From d3e96fef52bbd1c7fc4acf85561e9a4874016283 Mon Sep 17 00:00:00 2001 From: Stefan Rebernig Date: Wed, 17 Nov 2010 11:14:44 +0100 Subject: [PATCH] =?utf8?q?kleine=20=C3=84nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- cpu/src/alu_pkg.vhd | 2 +- cpu/src/core_top.vhd | 7 ++++++- cpu/src/decode_stage_b.vhd | 2 +- cpu/src/execute_stage_b.vhd | 8 ++++++-- cpu/src/writeback_stage_b.vhd | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cpu/src/alu_pkg.vhd b/cpu/src/alu_pkg.vhd index 13285d9..16a175c 100755 --- a/cpu/src/alu_pkg.vhd +++ b/cpu/src/alu_pkg.vhd @@ -42,7 +42,7 @@ package alu_pkg is end record alu_result_rec; - constant SHIFT_WIDTH : integer := 4; --log2c(gp_register_t'length); + constant SHIFT_WIDTH : integer := 1; --log2c(gp_register_t'length); constant COND_ZERO : condition_t := "0001"; constant COND_NZERO : condition_t := "0000"; diff --git a/cpu/src/core_top.vhd b/cpu/src/core_top.vhd index 8892f75..58a2377 100644 --- a/cpu/src/core_top.vhd +++ b/cpu/src/core_top.vhd @@ -11,7 +11,9 @@ entity core_top is --System input pins sys_clk : in std_logic; sys_res : in std_logic; - result : out gp_register_t + result : out gp_register_t; + jump_result : out instruction_addr_t; + reg_wr_data : out gp_register_t ); @@ -123,4 +125,7 @@ begin result <= result_pin; nop_pin <= (alu_jump_bit_pin xor brpr_pin); + jump_result <= jump_result_pin; + + reg_wr_data <= reg_wr_data_pin; end behav; diff --git a/cpu/src/decode_stage_b.vhd b/cpu/src/decode_stage_b.vhd index 7d42e8f..14846b2 100644 --- a/cpu/src/decode_stage_b.vhd +++ b/cpu/src/decode_stage_b.vhd @@ -164,7 +164,7 @@ begin rtw_rec_nxt.rtw_reg1 <= ('1' and reg_we); end if; - if (reg_w_addr = instr_spl.reg_src1_addr) then + if (reg_w_addr = instr_spl.reg_src2_addr) then rtw_rec_nxt.rtw_reg2 <= ('1' and reg_we); end if; diff --git a/cpu/src/execute_stage_b.vhd b/cpu/src/execute_stage_b.vhd index 4d69cee..73c7bf2 100644 --- a/cpu/src/execute_stage_b.vhd +++ b/cpu/src/execute_stage_b.vhd @@ -77,7 +77,7 @@ begin end process asyn; -forward: process(regfile_val, reg_we, reg_addr, dec_instr.src1,dec_instr.src2) +forward: process(regfile_val, reg_we, reg_addr, dec_instr) begin left_operand <= dec_instr.src1; right_operand <= dec_instr.src2; @@ -98,9 +98,13 @@ alu_jump <= reg.alu_jump; brpr <= reg.brpr; wr_en <= reg.wr_en; dmem <= alu_nxt.mem_op; +--dmem <= reg.result(4); dmem_write_en <= alu_nxt.mem_en; +--dmem_write_en <= reg.result(0); +--dmem_write_en <= '1'; hword <= alu_nxt.hw_op; +--hword <= reg.result(1); byte_s <= alu_nxt.byte_op; - +--byte_s <= reg.result(2); end behav; diff --git a/cpu/src/writeback_stage_b.vhd b/cpu/src/writeback_stage_b.vhd index d432cbd..196af9c 100644 --- a/cpu/src/writeback_stage_b.vhd +++ b/cpu/src/writeback_stage_b.vhd @@ -111,7 +111,7 @@ end process; -out_logic: process(write_en, result_addr) +out_logic: process(write_en, result_addr, wb_reg, alu_jmp) begin reg_we <= (write_en or (wb_reg.dmem_en and not(wb_reg.dmem_write_en))) and not(alu_jmp); -- 2.25.1