From f7c3463501271ae8c2c9c66634e7cfb21821140c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Markus=20Hofst=C3=A4tter?= Date: Sat, 11 Dec 2010 11:29:45 +0100 Subject: [PATCH] next step: call --- cpu/src/alu_b.vhd | 32 +++++++++++++++++++++++++++----- cpu/src/common_pkg.vhd | 3 ++- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/cpu/src/alu_b.vhd b/cpu/src/alu_b.vhd index b0bf5a4..44306f5 100755 --- a/cpu/src/alu_b.vhd +++ b/cpu/src/alu_b.vhd @@ -49,6 +49,10 @@ calc: process(left_operand, right_operand,displacement, cond, op_group, op_detai variable mem_op : std_logic; variable alu_jump : std_logic; variable nop : std_logic; + + variable pinc_v, pwr_en_v : std_logic; + + variable prog_cnt_nxt : std_logic_vector(prog_cnt'range); begin result_v := alu_state; @@ -63,12 +67,13 @@ begin addr <= add_result.result; data <= right_operand; - pinc <= '0'; - pwr_en <= '0'; + pinc_v := '0'; + pwr_en_v := '0'; + paddr <= (others =>'0'); result_v.result := add_result.result; - + prog_cnt_nxt := std_logic_vector(unsigned(prog_cnt)+1); case cond is when COND_NZERO => cond_met := not(alu_state.status.zero); @@ -136,7 +141,20 @@ begin left_o <= prog_cnt; end if; alu_jump := '1'; - when JMP_ST_OP => null; + when JMP_ST_OP => + left_o <= prog_cnt; + men_en := '1'; + alu_jump := '1'; + men_op := '1'; + pinc_v := '1'; + pinc_wr_en := '1'; + paddr <= (others =>'0'); + + addr <= pval; + data <= prog_cnt_nxt; + -- if(op_detail(RET_OPT) = '1' then + -- null; + -- end if; end case; @@ -157,14 +175,18 @@ begin result_v.mem_op := mem_op and cond_met; result_v.alu_jump := alu_jump and cond_met; result_v.brpr := brpr and nop; + + pwr_en_v := pwr_en_v and cond_met; if (result_v.alu_jump = '0') and (brpr = '1') then result_v.result := (others => '0'); - result_v.result(prog_cnt'range) := std_logic_vector(unsigned(prog_cnt)+1); + result_v.result(prog_cnt'range) := prog_cnt_nxt; --result_v.reg_op := '1'; end if; alu_result <= result_v; + pinc <= pinc_v; + pwr_en <= pwr_en_v; end process calc; diff --git a/cpu/src/common_pkg.vhd b/cpu/src/common_pkg.vhd index 3790d0f..ec18a20 100755 --- a/cpu/src/common_pkg.vhd +++ b/cpu/src/common_pkg.vhd @@ -57,7 +57,8 @@ package common_pkg is constant RIGHT_OPT : integer := 3; constant JMP_REG_OPT : integer := 3; - constant ST_OPT : integer := 3; + constant ST_OPT : integer := 3; -- store opt + constant RET_OPT : integer := 3; constant NO_PSW_OPT : integer := 4;--no sharing constant NO_DST_OPT : integer := 5; --no sharing -- 2.25.1