44 parameter [
3:
0]
SENSOR_FIFO_DELAY =
5 // 7 // approxiametly half (1 << SENSOR_FIFO_2DEPTH) - how long to wait after getting HACT on FIFO before stering it on output 47 input iclk,
// input -synchronous clock 48 input pclk,
// internal lixel clock 49 input prst,
// @ posedge pclk 50 input irst,
// @ posedge iclk 56 output data_valid,
// @posedge pclk: continuous data valid for each line, FIFO should compensate for clock differences 57 output sof,
// @posedge pclk: single-cycle Start of Frame 58 output eof // @posedge pclk: single-cycle End of Frame (not yet used) 65 // output clock domain 72 // wire hact_out_start; 75 always @(
posedge iclk)
begin 83 )
fifo_cross_clocks_i (
84 .
rst (
1'b0),
// rst), // input 102 .dly(SENSOR_FIFO_DELAY), // input[3:0] 103 .din(pre_hact[0] && ! pre_hact[1]), // input[0:0] 104 .dout(hact_out_start) // output[0:0] 170 // output clock domain 171 // assign pre_re = nempty && !re_r; 172 // Generating first read (for hact), then wait to fill half FIFO and continue continuous read until hact end 173 // assign re_w = re_r && nempty; // to protect from false positive on nempty 174 // assign re = (re_w && !pre_hact) || hact_out_r; // no check for nempty - producing un-interrupted stream 175 // assign re = (re_r && nempty && !pre_hact[0]) || hact_out_r[0]; // no check for nempty - producing un-interrupted stream 183 // if (prst) re_r <= 0; 184 // else re_r <= nempty && !re_r && !pre_hact[0]; // only generate one cycle (after SOF of HACT) 212 always @(posedge iclk) begin 216 if (irst) pre_hact[0] <= 0; 217 else if (re) pre_hact[0] <= hact_w; 219 if (irst) pre_hact[1] <= 0; 220 else if (re) pre_hact[1] <= pre_hact[0]; 222 if (irst) pxd_r <= 0; 223 else if (re) pxd_r <= pxd_w; 225 if (irst) hact_out_r <= 0; 226 else if (hact_out_start) hact_out_r <= 1; 227 else if (!hact_w) hact_out_r <= 0; 229 if (irst) sof_r <= 0; 230 else sof_r <= re && sof_w; 232 if (irst) eof_r <= 0; 233 else eof_r <= re && eof_w;
[SENSOR_DATA_WIDTH-1:0] 8117pxd_in
[DATA_WIDTH-1:0] 10404data_out
[SENSOR_DATA_WIDTH-1:0] 8120pxd_out
pulse_cross_clock_sol_i pulse_cross_clock
[DATA_WIDTH-1:0] 10403data_in
8128pxd_wwire[SENSOR_DATA_WIDTH-1:0]
fifo_cross_clocks_i fifo_cross_clocks
[3:0] 8112SENSOR_FIFO_DELAY5
8139pxd_rreg[SENSOR_DATA_WIDTH-1:0]