From 842f3309b6853e1a9b1578978b14da9bc344c5e0 Mon Sep 17 00:00:00 2001 From: Martin Perner Date: Thu, 13 Jan 2011 17:30:11 +0100 Subject: [PATCH] dt/deepjit: disc/fetch added dt done by markus --- cpu/src/alu_b.vhd | 2 +- cpu/src/common_pkg.vhd | 1 + cpu/src/decoder_b.vhd | 13 +++++++++---- progs/deepjit.s | 9 +++------ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cpu/src/alu_b.vhd b/cpu/src/alu_b.vhd index 93f4f8d..bd78302 100755 --- a/cpu/src/alu_b.vhd +++ b/cpu/src/alu_b.vhd @@ -188,7 +188,7 @@ begin end if; when STACK_OP => mem_op := '1'; - pwr_en_v := '1'; + pwr_en_v := op_detail(PWREN_OPT); if op_detail(PUSH_OPT) = '1' then mem_en := '1'; pinc_v := '1'; diff --git a/cpu/src/common_pkg.vhd b/cpu/src/common_pkg.vhd index a88336c..2b711da 100755 --- a/cpu/src/common_pkg.vhd +++ b/cpu/src/common_pkg.vhd @@ -64,6 +64,7 @@ package common_pkg is constant CARRY_OPT : integer := 2; constant BYTE_OPT : integer := 2; constant LDI_REPLACE_OPT : integer := 2; + constant PWREN_OPT : integer := 2; constant RIGHT_OPT : integer := 3; constant JMP_REG_OPT : integer := 3; diff --git a/cpu/src/decoder_b.vhd b/cpu/src/decoder_b.vhd index 525d408..ed9ed4a 100644 --- a/cpu/src/decoder_b.vhd +++ b/cpu/src/decoder_b.vhd @@ -312,16 +312,21 @@ begin instr_s.reg_dest_addr := instruction(22 downto 19); instr_s.op_group := STACK_OP; instr_s.op_detail(NO_PSW_OPT) := '1'; + instr_s.op_detail(PWREN_OPT) := '1'; case instruction(18 downto 17) is - when "00" => + when "00" => --pop instr_s.op_detail(PUSH_OPT) := '0'; - when "01" => null; + when "01" => --disc + instr_s.op_detail(PUSH_OPT) := '0'; + instr_s.op_detail(NO_DST_OPT) := '1'; - when "10" => null; + when "10" => --fetch + instr_s.op_detail(PUSH_OPT) := '0'; + instr_s.op_detail(PWREN_OPT) := '0'; - when "11" => + when "11" => --push instr_s.op_detail(PUSH_OPT) := '1'; when others => null; diff --git a/progs/deepjit.s b/progs/deepjit.s index 400b6eb..c0f6680 100644 --- a/progs/deepjit.s +++ b/progs/deepjit.s @@ -73,8 +73,7 @@ prog_lessthan: .ifill pushge r15 prog_dup: -.ifill pop r6 -.ifill push r6 +.ifill fetch r6 .ifill push r6 prog_jmp: @@ -90,7 +89,7 @@ prog_imm: .ifill push r6 prog_pop: -.ifill pop r6 +.ifill disc r6 prog_xch: .ifill pop r6 @@ -436,11 +435,9 @@ vm_dup: PROGINSTR ldw r0, 4(r4) PROGINSTR - ldw r0, 8(r4) - PROGINSTR ;increment address - addi r2, r2, 3 + addi r2, r2, 2 br+ vm_loop -- 2.25.1