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

Fixed avoiding combinatorial latches. Removed unused x,y,z debug signals.

parent 23672377
No related branches found
No related tags found
No related merge requests found
...@@ -153,9 +153,6 @@ ARCHITECTURE rtl OF common_mem_bus IS ...@@ -153,9 +153,6 @@ ARCHITECTURE rtl OF common_mem_bus IS
SIGNAL slave_mosi_arr_comb : t_mem_mosi_arr(0 TO g_nof_slaves-1) := (OTHERS=>c_mem_mosi_rst); SIGNAL slave_mosi_arr_comb : t_mem_mosi_arr(0 TO g_nof_slaves-1) := (OTHERS=>c_mem_mosi_rst);
SIGNAL master_miso_comb : t_mem_miso := c_mem_miso_rst; SIGNAL master_miso_comb : t_mem_miso := c_mem_miso_rst;
SIGNAL x : NATURAL;
SIGNAL y : NATURAL;
SIGNAL z : NATURAL;
BEGIN BEGIN
gen_single : IF g_nof_slaves=1 GENERATE gen_single : IF g_nof_slaves=1 GENERATE
...@@ -178,8 +175,6 @@ BEGIN ...@@ -178,8 +175,6 @@ BEGIN
EXIT; EXIT;
END IF; END IF;
END LOOP; END LOOP;
x <= c_mm_bus_addr_w;
y <= v_base;
END PROCESS; END PROCESS;
index_pipeline(1 TO c_index_latency_max) <= index_pipeline(0 TO c_index_latency_max-1) WHEN rising_edge(mm_clk); index_pipeline(1 TO c_index_latency_max) <= index_pipeline(0 TO c_index_latency_max-1) WHEN rising_edge(mm_clk);
...@@ -187,11 +182,13 @@ BEGIN ...@@ -187,11 +182,13 @@ BEGIN
-- Master access, can be write or read -- Master access, can be write or read
p_mosi : PROCESS(master_mosi, index_pipeline) p_mosi : PROCESS(master_mosi, index_pipeline)
BEGIN BEGIN
slave_mosi_arr_comb <= (OTHERS=>master_mosi); -- default assign to all, to avoid latches
FOR I IN 0 TO g_nof_slaves-1 LOOP FOR I IN 0 TO g_nof_slaves-1 LOOP
slave_mosi_arr_comb(I).rd <= '0'; slave_mosi_arr_comb(I).rd <= '0';
slave_mosi_arr_comb(I).wr <= '0'; slave_mosi_arr_comb(I).wr <= '0';
IF I = index_pipeline(0) THEN -- check index for read or write access IF I = index_pipeline(0) THEN -- check index for read or write access
slave_mosi_arr_comb(I) <= master_mosi; slave_mosi_arr_comb(I).rd <= master_mosi.rd;
slave_mosi_arr_comb(I).wr <= master_mosi.wr;
END IF; END IF;
END LOOP; END LOOP;
END PROCESS; END PROCESS;
...@@ -207,7 +204,7 @@ BEGIN ...@@ -207,7 +204,7 @@ BEGIN
p_miso : PROCESS(slave_miso_arr, index_pipeline) p_miso : PROCESS(slave_miso_arr, index_pipeline)
VARIABLE v_rd_latency : NATURAL; VARIABLE v_rd_latency : NATURAL;
BEGIN BEGIN
master_miso_comb <= c_mem_miso_rst; master_miso_comb <= c_mem_miso_rst; -- default clear, to avoid latches
FOR I IN 0 TO g_nof_slaves-1 LOOP FOR I IN 0 TO g_nof_slaves-1 LOOP
v_rd_latency := c_mosi_latency + g_rd_latency_arr(I); v_rd_latency := c_mosi_latency + g_rd_latency_arr(I);
IF I = index_pipeline(v_rd_latency) THEN -- check index for read response IF I = index_pipeline(v_rd_latency) THEN -- check index for read response
......
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