Skip to content
Snippets Groups Projects
Commit 163c7bac authored by Pepping's avatar Pepping
Browse files

- Implemented rd_interval parameter

- Revised the s_wait_rd state. 
parent 7880b577
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
-- - wr_nof_chunks is the number of write accesses performed during a write period -- - wr_nof_chunks is the number of write accesses performed during a write period
-- - rd_chunksize is the number of samples that are read during a read access. -- - rd_chunksize is the number of samples that are read during a read access.
-- - rd_nof_chunks is the number of read accesses performed during a read period -- - rd_nof_chunks is the number of read accesses performed during a read period
-- - rd_interval defines the number of blocks in between two consecutive reads.
-- - gapsize is the address space to be skipped in between two consecutive write or -- - gapsize is the address space to be skipped in between two consecutive write or
-- read periods. Gapsize can be used to create byte-alignment in the memory. -- read periods. Gapsize can be used to create byte-alignment in the memory.
-- - nof_blocks determines the number of write and read periods before the page -- - nof_blocks determines the number of write and read periods before the page
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
-- wr_nof_chunks : POSITIVE := 1; -- wr_nof_chunks : POSITIVE := 1;
-- rd_chunksize : POSITIVE := 4; -- rd_chunksize : POSITIVE := 4;
-- rd_nof_chunks : POSITIVE := 2; -- rd_nof_chunks : POSITIVE := 2;
-- rd_interval : POSITIVE := 2;
-- gapsize : NATURAL := 0; -- gapsize : NATURAL := 0;
-- nof_blocks : POSITIVE := 5; -- nof_blocks : POSITIVE := 5;
...@@ -55,27 +57,27 @@ ...@@ -55,27 +57,27 @@
-- -------- -------- -- -------- --------
-- gapsize | | | | -- gapsize | | | |
-- -------- -------- -- -------- --------
-- |1 | |0,1 | -- |1 | |1,1 |
-- | | -------- -- | | --------
-- | | |3,0 | -- | | |4,0 |
-- -------- -------- -- -------- --------
-- | | | | -- | | | |
-- -------- -------- -- -------- --------
-- |2 | |1,0 | -- |2 | |0,1 |
-- | | -------- -- | | --------
-- | | |3,1 | -- | | |3,0 |
-- -------- -------- -- -------- --------
-- | | | | -- | | | |
-- -------- -------- -- -------- --------
-- |3 | |1,1 | -- |3 | |2,0 |
-- | | -------- -- | | --------
-- | | |4,0 | -- | | |4,1 |
-- -------- -------- -- -------- --------
-- | | | | -- | | | |
-- -------- -------- -- -------- --------
-- |4 | |2,0 | -- |4 | |1,0 |
-- | | -------- -- | | --------
-- | | |4,1 | -- | | |3,1 |
-- -------- -------- -- -------- --------
-- | | | | -- | | | |
-- -------- -------- -- -------- --------
...@@ -119,6 +121,7 @@ ARCHITECTURE rtl OF reorder_sequencer IS ...@@ -119,6 +121,7 @@ ARCHITECTURE rtl OF reorder_sequencer IS
CONSTANT c_blocksize : POSITIVE := g_reorder_seq.wr_nof_chunks * (g_reorder_seq.wr_chunksize + g_reorder_seq.gapsize); CONSTANT c_blocksize : POSITIVE := g_reorder_seq.wr_nof_chunks * (g_reorder_seq.wr_chunksize + g_reorder_seq.gapsize);
CONSTANT c_page_size : POSITIVE := c_blocksize * g_reorder_seq.nof_blocks; CONSTANT c_page_size : POSITIVE := c_blocksize * g_reorder_seq.nof_blocks;
CONSTANT c_rd_block_increment : POSITIVE := c_blocksize * g_reorder_seq.rd_interval;
CONSTANT c_nof_wr_access : POSITIVE := g_reorder_seq.wr_nof_chunks * g_reorder_seq.nof_blocks; CONSTANT c_nof_wr_access : POSITIVE := g_reorder_seq.wr_nof_chunks * g_reorder_seq.nof_blocks;
CONSTANT c_address_w : POSITIVE := ceil_log2(2*c_page_size); CONSTANT c_address_w : POSITIVE := ceil_log2(2*c_page_size);
CONSTANT c_address_shift_w : POSITIVE := ceil_log2(g_data_w_ratio); CONSTANT c_address_shift_w : POSITIVE := ceil_log2(g_data_w_ratio);
...@@ -224,35 +227,31 @@ BEGIN ...@@ -224,35 +227,31 @@ BEGIN
END IF; END IF;
WHEN s_wait_rd => WHEN s_wait_rd =>
IF(r.switch_cnt = g_reorder_seq.rd_nof_chunks) THEN
v.switch_cnt := 0; v.rd_block_offset := (r.rd_block_offset + c_rd_block_increment) MOD c_page_size;
v.state := s_write;
IF(r.rd_block_offset + c_rd_block_increment >= c_page_size) THEN
v.rd_chunks_offset := r.rd_chunks_offset + g_reorder_seq.rd_chunksize;
v.rd_chunks_cnt := r.rd_chunks_cnt + 1;
ELSE ELSE
v.state := s_read; v.rd_block_cnt := r.rd_block_cnt + 1;
END IF; END IF;
IF(r.rd_block_cnt = g_reorder_seq.nof_blocks-1 AND r.rd_chunks_cnt = g_reorder_seq.rd_nof_chunks-1) THEN IF(r.switch_cnt = g_reorder_seq.rd_nof_chunks) THEN
v.rd_block_offset := 0; v.switch_cnt := 0;
v.rd_chunks_offset := 0; v.state := s_write;
v.rd_block_cnt := 0;
v.rd_chunks_cnt := 0;
IF(r.page_cnt = c_nof_wr_access) THEN IF(r.page_cnt = c_nof_wr_access) THEN
v.rd_page_offset := r.wr_page_offset; v.rd_page_offset := r.wr_page_offset;
v.wr_page_offset := r.rd_page_offset; v.wr_page_offset := r.rd_page_offset;
v.page_cnt := 0; v.page_cnt := 0;
v.first_write := '0'; v.first_write := '0';
-- IF(sync_ok_in = '0') THEN
-- v.state := s_idle;
-- END IF;
END IF;
ELSIF(r.rd_block_cnt = g_reorder_seq.nof_blocks-1) THEN
v.rd_block_offset := 0; v.rd_block_offset := 0;
v.rd_chunks_offset := r.rd_chunks_offset + g_reorder_seq.rd_chunksize; v.rd_chunks_offset := 0;
v.rd_block_cnt := 0; v.rd_block_cnt := 0;
v.rd_chunks_cnt := r.rd_chunks_cnt + 1; v.rd_chunks_cnt := 0;
END IF;
ELSE ELSE
v.rd_block_offset := r.rd_block_offset + c_blocksize; v.state := s_read;
v.rd_block_cnt := r.rd_block_cnt + 1;
END IF; END IF;
WHEN OTHERS => WHEN OTHERS =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment