parameterSENSOR_FIFO_DELAY=7// approxiametly half (1 << SENSOR_FIFO_2DEPTH) - how long to wait after getting HACT on FIFO before stering it on output
parameterSENSOR_FIFO_DELAY=5// 7 // approxiametly half (1 << SENSOR_FIFO_2DEPTH) - how long to wait after getting HACT on FIFO before stering it on output
)(
)(
// input rst,
// input rst,
inputiclk,// input -synchronous clock
inputiclk,// input -synchronous clock
...
@@ -45,7 +45,8 @@ module sensor_fifo #(
...
@@ -45,7 +45,8 @@ module sensor_fifo #(
regsof_r,eof_r;
regsof_r,eof_r;
wirewe;
wirewe;
// output clock domain
// output clock domain
wirepre_re,re_w,re;
// wire pre_re;
wirere;// re_w,re;
regre_r;
regre_r;
reg[1:0]pre_hact;
reg[1:0]pre_hact;
reghact_out_r;
reghact_out_r;
...
@@ -86,14 +87,44 @@ module sensor_fifo #(
...
@@ -86,14 +87,44 @@ module sensor_fifo #(
);
);
// output clock domain
// output clock domain
assignpre_re=nempty&&!re_r;
// assign pre_re = nempty && !re_r;
assignre_w=re_r&&nempty;// to protect from false positive on nempty
// Generating first read (for hact), then wait to fill half FIFO and continue continuous read until hact end
assignre=(re_w&&!pre_hact)||hact_out_r;
// assign re_w = re_r && nempty; // to protect from false positive on nempty
// assign re = (re_w && !pre_hact) || hact_out_r; // no check for nempty - producing un-interrupted stream
assignre=(re_r&&nempty&&!pre_hact[0])||hact_out_r;// no check for nempty - producing un-interrupted stream
assignpxd_out=pxd_r;
assignpxd_out=pxd_r;
assigndata_valid=hact_out_r;
assigndata_valid=hact_out_r;
assignsof=sof_r;
assignsof=sof_r;
assigneof=eof_r;
assigneof=eof_r;
always@(posedgepclk)begin
if(prst)re_r<=0;
elsere_r<=nempty&&!re_r&&!pre_hact[0];// only generate one cycle (after SOF of HACT)
`include"includes/x393_parameters.vh"// SuppressThisWarning VEditor - not used
`include"includes/x393_parameters.vh"// SuppressThisWarning VEditor - not used
...
@@ -54,7 +57,7 @@ module x393_testbench02 #(
...
@@ -54,7 +57,7 @@ module x393_testbench02 #(
`ifdefIVERILOG
`ifdefIVERILOG
// $display("IVERILOG is defined");
// $display("IVERILOG is defined");
`ifdefNON_VDT_ENVIROMENT
`ifdefNON_VDT_ENVIROMENT
parameterlxtname="x393.lxt";
parameterfstname="x393.fst";
`else
`else
`include"IVERILOG_INCLUDE.v"
`include"IVERILOG_INCLUDE.v"
`endif// NON_VDT_ENVIROMENT
`endif// NON_VDT_ENVIROMENT
...
@@ -62,12 +65,12 @@ module x393_testbench02 #(
...
@@ -62,12 +65,12 @@ module x393_testbench02 #(
// $display("IVERILOG is not defined");
// $display("IVERILOG is not defined");
`ifdefCVC
`ifdefCVC
`ifdefNON_VDT_ENVIROMENT
`ifdefNON_VDT_ENVIROMENT
parameterlxtname="x393.fst";
parameterfstname="x393.fst";
`else// NON_VDT_ENVIROMENT
`else// NON_VDT_ENVIROMENT
`include"IVERILOG_INCLUDE.v"
`include"IVERILOG_INCLUDE.v"
`endif// NON_VDT_ENVIROMENT
`endif// NON_VDT_ENVIROMENT
`else
`else
parameterlxtname="x393.lxt";
parameterfstname="x393.fst";
`endif// CVC
`endif// CVC
`endif// IVERILOG
`endif// IVERILOG
`defineDEBUG_WR_SINGLE1
`defineDEBUG_WR_SINGLE1
...
@@ -75,9 +78,14 @@ module x393_testbench02 #(
...
@@ -75,9 +78,14 @@ module x393_testbench02 #(
//`include "includes/x393_cur_params_sim.vh" // parameters that may need adjustment, should be before x393_localparams.vh
//`include "includes/x393_cur_params_sim.vh" // parameters that may need adjustment, should be before x393_localparams.vh
`include"includes/x393_cur_params_target.vh"// SuppressThisWarning VEditor - not used parameters that may need adjustment, should be before x393_localparams.vh
`include"includes/x393_cur_params_target.vh"// SuppressThisWarning VEditor - not used parameters that may need adjustment, should be before x393_localparams.vh
`include"includes/x393_localparams.vh"// SuppressThisWarning VEditor - not used