x393  1.0
FPGAcodeforElphelNC393camera
frame_num_sync.v
Go to the documentation of this file.
1 
26 `timescale 1ns/1ps
27 
28 module frame_num_sync #(
29  parameter NUM_FRAME_BITS = 4,
30  parameter LAST_FRAME_BITS = 16,
31  parameter FRAME_BITS_KEEP = 4 // number of bits from mcntrl frame number used to index absolute sensor frame number
32 )(
33 // SuppressWarnings VEditor unused
34  input mrst,
35  input mclk, // for command/status
36  input [NUM_FRAME_BITS*4-1:0] absolute_frames, // per-channel current sensor frame number
37  input [3:0] first_wr_in_frame, // sensor writes first block in a frame
38 // input [3:0] first_rd_in_frame, // compressor gets first block in a frame
39  input [4*LAST_FRAME_BITS-1:0] memory_frames_sensor, // 4 channels of frame numbers as defined for memory allocation
40  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)
41  output reg [NUM_FRAME_BITS*4-1:0] compressed_frames // frame numbers valid at compressor done (TODO: keep until IRQ cleared? pointers will change anyway)
42 );
47  always @ (posedge mclk) begin
56  end
57 
58 
59 endmodule
60 
61 // wire [4*LAST_FRAME_BITS-1:0] cmprs_frame_number_src;// input[15:0] current frame number (for multi-frame ranges) in the source (sensor) channel
[0:1<<FRAME_BITS_KEEP-1] 10502frames_ram0reg[NUM_FRAME_BITS-1:0]
[0:1<<FRAME_BITS_KEEP-1] 10503frames_ram1reg[NUM_FRAME_BITS-1:0]
[4*LAST_FRAME_BITS-1:0] 10499memory_frames_sensor
[4*LAST_FRAME_BITS-1:0] 10500memory_frames_compressor
[3:0] 10498first_wr_in_frame
[0:1<<FRAME_BITS_KEEP-1] 10505frames_ram3reg[NUM_FRAME_BITS-1:0]
[NUM_FRAME_BITS*4-1:0] 10497absolute_frames
[0:1<<FRAME_BITS_KEEP-1] 10504frames_ram2reg[NUM_FRAME_BITS-1:0]
reg [NUM_FRAME_BITS*4-1:0] 10501compressed_frames