alu: return to previous
authorMarkus Hofstätter <markus.hofstaetter@gmx.net>
Tue, 30 Nov 2010 14:09:04 +0000 (15:09 +0100)
committerMarkus Hofstätter <markus.hofstaetter@gmx.net>
Tue, 30 Nov 2010 14:09:04 +0000 (15:09 +0100)
cpu/src/alu.vhd
cpu/src/alu_b.vhd
cpu/src/alu_pkg.vhd
cpu/src/execute_stage_b.vhd

index e6ed85a3a51acd844901a610652f1a633b7bd59e..b68e7c012e75c07501a726854a98c0707fb4957d 100755 (executable)
@@ -20,7 +20,9 @@ entity alu is
                         displacement : in gp_register_t;\r
                        op_detail : in op_opt_t;\r
                        alu_state  : in alu_result_rec;\r
-                       alu_result : out alu_result_rec;\r
+                       alu_result : out alu_result_rec;
+                        addr : out word_t; --memaddr
+                        data : out gp_register_t --mem data --ureg\r
                );\r
                \r
 end alu;\r
index 9f29b0be5afa1605631ac38c0b7e8156c9c05984..340536561a4e7e9f407c9ba8b28be2afe2235f4f 100755 (executable)
@@ -56,7 +56,10 @@ begin
         mem_op := '0';\r
         addr <= add_result.result;
         left <= left_operand;
-        right <= right_operand;\r
+        right <= right_operand;
+
+        addr <= add_result.result;
+        data <= right_operand;\r
        \r
        case cond is\r
        when COND_NZERO =>\r
@@ -133,8 +136,8 @@ begin
        \r
        result_v.reg_op := not(op_detail(NO_DST_OPT)) and res_prod and cond_met;\r
        result_v.mem_en := mem_en and cond_met;
-        result_v.mem_op := mem_op and cond_met;\r
-\r
+        result_v.mem_op := mem_op and cond_met;
+        \r
        alu_result <= result_v;\r
        \r
 end process calc; \r
index 7e1562d5d161da0331bb8daccf0b20090f64b9c3..16c1099ace925b32aefa2dda682b4e6398200557 100755 (executable)
@@ -87,7 +87,9 @@ package alu_pkg is
                         displacement : in gp_register_t;
                        op_detail : in op_opt_t;
                        alu_state  : in alu_result_rec;
-                       alu_result : out alu_result_rec
+                       alu_result : out alu_result_rec;
+                        addr : out word_t; --memaddr
+                        data : out gp_register_t --mem data --ureg
                );
         end component alu;
        
index 79a36614762a2e5286f35e7be6c25ec683753c22..550c1e9683bb1fec35bcbcadf33c371b22edd37e 100644 (file)
@@ -29,7 +29,7 @@ begin
 
 alu_inst : alu
 port map(clk, reset, condition, op_group, 
-         left_operand, right_operand, dec_instr.displacement, op_detail, alu_state, alu_nxt);
+         left_operand, right_operand, dec_instr.displacement, op_detail, alu_state, alu_nxt,addr,data);
 
 gpm_inst : gpm
         generic map(RESET_VALUE)
@@ -106,8 +106,8 @@ hword <= alu_nxt.hw_op;
 --hword <= reg.result(1);
 byte_s <= alu_nxt.byte_op;
 
-addr <= alu_nxt.result;
-data <= right_operand;
+--addr <= alu_nxt.result;
+--data <= right_operand;
 --byte_s <= reg.result(2);
 end behav;