Skip to content
Snippets Groups Projects
Commit 3ac8fbe4 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Use g_rd_fifo_af_margin to fit one (DDR3 IP) or more (DDR4 IP) rd burst...

Use g_rd_fifo_af_margin to fit one (DDR3 IP) or more (DDR4 IP) rd burst accesses of g_tech_ddr.maxburstsize each.
parent 8ff6fba0
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
-- DDR write access can start on the next valid, sop or sync dependent on -- DDR write access can start on the next valid, sop or sync dependent on
-- g_wr_flush_mode. -- g_wr_flush_mode.
-- --
-- The g_rd_fifo_af_margin needs to be large enough to fit a number of read
-- bursts that may be pending in the DDR controller command queue depth.
-- A new rd access can start when ctlr_rd_src_in.ready indicates that there
-- is sufficient space in the read FIFO to store g_tech_ddr.maxburstsize
-- words. Due to the DDR controller command queue there can be more rd
-- bursts already be pending. Therefore the g_rd_fifo_af_margin needs to be
-- large enough to fit a number of read bursts.
-- In simulation use g_sim=TRUE to also include the DDR memory model that is -- In simulation use g_sim=TRUE to also include the DDR memory model that is
-- internally available within tech_ddr. This avoids having to connect a DDR -- internally available within tech_ddr. This avoids having to connect a DDR
-- memory model at top level in the test bench. -- memory model at top level in the test bench.
...@@ -54,7 +62,7 @@ ...@@ -54,7 +62,7 @@
-- . The dvr interface could be connected to a DP sequencer that can write -- . The dvr interface could be connected to a DP sequencer that can write
-- blocks to DDR and read back from DDR. The DP sequencer uses signals -- blocks to DDR and read back from DDR. The DP sequencer uses signals
-- from its input DP interface. For write access the dvr_en could relate -- from its input DP interface. For write access the dvr_en could relate
-- to teh sop and the dvr_nof_data then equals the nof data from sop to eop. -- to the sop and the dvr_nof_data then equals the nof data from sop to eop.
-- The dvr_done can be treated as xon. The dvr_wr_not_rd selects between -- The dvr_done can be treated as xon. The dvr_wr_not_rd selects between
-- the write stream to DDR access or the read stream from DDR access. For a -- the write stream to DDR access or the read stream from DDR access. For a
-- read access the sequencer needs to generate the dvr signals itself. -- read access the sequencer needs to generate the dvr signals itself.
...@@ -156,8 +164,9 @@ ENTITY io_ddr IS ...@@ -156,8 +164,9 @@ ENTITY io_ddr IS
g_cross_domain_dvr_ctlr : BOOLEAN := TRUE; g_cross_domain_dvr_ctlr : BOOLEAN := TRUE;
g_cross_domain_delay_len : NATURAL := c_meta_delay_len; g_cross_domain_delay_len : NATURAL := c_meta_delay_len;
g_wr_data_w : NATURAL := 32; g_wr_data_w : NATURAL := 32;
g_wr_fifo_depth : NATURAL := 128; -- >=16 , defined at DDR side of the FIFO. g_wr_fifo_depth : NATURAL := 256; -- >=16 , defined at DDR side of the FIFO, default 256 because 32b*256 fits in 1 M9K
g_rd_fifo_depth : NATURAL := 256; -- >=16 AND >g_tech_ddr.maxburstsize, defined at DDR side of the FIFO. g_rd_fifo_depth : NATURAL := 256; -- >=16 AND >g_tech_ddr.maxburstsize, defined at DDR side of the FIFO, default 256 because 32b*256 fits in 1 M9K
g_rd_fifo_af_margin : NATURAL := 4 + 1*64; -- < g_rd_fifo_depth and sufficient to fit one or more rd burst accesses of g_tech_ddr.maxburstsize each
g_rd_data_w : NATURAL := 32; g_rd_data_w : NATURAL := 32;
g_wr_flush_mode : STRING := "VAL"; -- "VAL", "SOP", "SYN" g_wr_flush_mode : STRING := "VAL"; -- "VAL", "SOP", "SYN"
g_wr_flush_use_channel : BOOLEAN := FALSE; g_wr_flush_use_channel : BOOLEAN := FALSE;
...@@ -218,7 +227,6 @@ ARCHITECTURE str OF io_ddr IS ...@@ -218,7 +227,6 @@ ARCHITECTURE str OF io_ddr IS
CONSTANT c_wr_fifo_depth : NATURAL := g_wr_fifo_depth * (c_ctlr_data_w/g_wr_data_w); -- get FIFO depth at write side CONSTANT c_wr_fifo_depth : NATURAL := g_wr_fifo_depth * (c_ctlr_data_w/g_wr_data_w); -- get FIFO depth at write side
CONSTANT c_wr_fifo_af_margin : NATURAL := 4 + 1; -- use +1 to compensate for latency introduced by registering wr_siso.ready due to RL=0 CONSTANT c_wr_fifo_af_margin : NATURAL := 4 + 1; -- use +1 to compensate for latency introduced by registering wr_siso.ready due to RL=0
CONSTANT c_rd_fifo_af_margin : NATURAL := 4 + g_tech_ddr.maxburstsize; -- use ctlr_rd_src_in.ready to only start new rd access when there is sufficient space in the read FIFO
SIGNAL ctlr_dvr_miso : t_mem_ctlr_miso; SIGNAL ctlr_dvr_miso : t_mem_ctlr_miso;
SIGNAL ctlr_dvr_mosi : t_mem_ctlr_mosi; SIGNAL ctlr_dvr_mosi : t_mem_ctlr_mosi;
...@@ -369,7 +377,7 @@ BEGIN ...@@ -369,7 +377,7 @@ BEGIN
g_rd_data_w => g_rd_data_w, g_rd_data_w => g_rd_data_w,
g_use_ctrl => FALSE, g_use_ctrl => FALSE,
g_wr_fifo_size => g_rd_fifo_depth, g_wr_fifo_size => g_rd_fifo_depth,
g_wr_fifo_af_margin => c_rd_fifo_af_margin, -- >=4 (required by dp_fifo) g_wr_fifo_af_margin => g_rd_fifo_af_margin, -- >=4 (required by dp_fifo)
g_rd_fifo_rl => 1 g_rd_fifo_rl => 1
) )
PORT MAP ( PORT MAP (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment