parameterFRAME_BITS_KEEP=4// number of bits from mcntrl frame number used to index absolute sensor frame number
)(
inputmrst,
inputmclk,// for command/status
input[NUM_FRAME_BITS*4-1:0]absolute_frames,// per-channel current sensor frame number
input[3:0]first_wr_in_frame,// sensor writes first block in a frame
// input [3:0] first_rd_in_frame, // compressor gets first block in a frame
input[4*LAST_FRAME_BITS-1:0]memory_frames_sensor,// 4 channels of frame numbers as defined for memory allocation
input[4*LAST_FRAME_BITS-1:0]memory_frames_compressor,// 4 channels of frame numbers as defined for memory allocation, valid after compression (before done)
outputreg[NUM_FRAME_BITS*4-1:0]compressed_frames// frame numbers valid at compressor done (TODO: keep until IRQ cleared? pointers will change anyway)