From 9896a1680271045c32bfd4a93c88003c86b85822 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Markus=20Hofst=C3=A4tter?= Date: Tue, 30 Nov 2010 15:09:04 +0100 Subject: [PATCH] alu: return to previous --- cpu/src/alu.vhd | 4 +++- cpu/src/alu_b.vhd | 9 ++++++--- cpu/src/alu_pkg.vhd | 4 +++- cpu/src/execute_stage_b.vhd | 6 +++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/cpu/src/alu.vhd b/cpu/src/alu.vhd index e6ed85a..b68e7c0 100755 --- a/cpu/src/alu.vhd +++ b/cpu/src/alu.vhd @@ -20,7 +20,9 @@ entity alu 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 alu; diff --git a/cpu/src/alu_b.vhd b/cpu/src/alu_b.vhd index 9f29b0b..3405365 100755 --- a/cpu/src/alu_b.vhd +++ b/cpu/src/alu_b.vhd @@ -56,7 +56,10 @@ begin mem_op := '0'; addr <= add_result.result; left <= left_operand; - right <= right_operand; + right <= right_operand; + + addr <= add_result.result; + data <= right_operand; case cond is when COND_NZERO => @@ -133,8 +136,8 @@ begin result_v.reg_op := not(op_detail(NO_DST_OPT)) and res_prod and cond_met; result_v.mem_en := mem_en and cond_met; - result_v.mem_op := mem_op and cond_met; - + result_v.mem_op := mem_op and cond_met; + alu_result <= result_v; end process calc; diff --git a/cpu/src/alu_pkg.vhd b/cpu/src/alu_pkg.vhd index 7e1562d..16c1099 100755 --- a/cpu/src/alu_pkg.vhd +++ b/cpu/src/alu_pkg.vhd @@ -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; diff --git a/cpu/src/execute_stage_b.vhd b/cpu/src/execute_stage_b.vhd index 79a3661..550c1e9 100644 --- a/cpu/src/execute_stage_b.vhd +++ b/cpu/src/execute_stage_b.vhd @@ -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; -- 2.25.1