Add forwarding in the register file
authorAnton Blanchard <anton@linux.ibm.com>
Mon, 9 Sep 2019 06:36:47 +0000 (16:36 +1000)
committerAnton Blanchard <anton@ozlabs.org>
Mon, 9 Sep 2019 10:06:46 +0000 (20:06 +1000)
We need this for the upcoming pipelining patches.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
register_file.vhdl

index 9995374251bf7a5d16f424b73ab5ba282852dd3f..bc6ef1c294defefdbbfd00f379aa913617f2ca93 100644 (file)
@@ -51,17 +51,17 @@ begin
                d_out.read3_data <= registers(to_integer(unsigned(d_in.read3_reg)));
 
                -- Forward any written data
-               --if w_in.write_enable = '1' then
-                       --if d_in.read1_reg = w_in.write_reg then
-                               --d_out.read1_data <= w_in.write_data;
-                       --end if;
-                       --if d_in.read2_reg = w_in.write_reg then
-                               --d_out.read2_data <= w_in.write_data;
-                       --end if;
-                       --if d_in.read3_reg = w_in.write_reg then
-                               --d_out.read3_data <= w_in.write_data;
-                       --end if;
-               --end if;
+               if w_in.write_enable = '1' then
+                       if d_in.read1_reg = w_in.write_reg then
+                               d_out.read1_data <= w_in.write_data;
+                       end if;
+                       if d_in.read2_reg = w_in.write_reg then
+                               d_out.read2_data <= w_in.write_data;
+                       end if;
+                       if d_in.read3_reg = w_in.write_reg then
+                               d_out.read3_data <= w_in.write_data;
+                       end if;
+               end if;
        end process register_read_0;
 
        -- debug