From 8d92524d4c46493ad83ebd493dabd3f88e11037b Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Sat, 5 Sep 2020 18:21:53 +0200 Subject: add mul instruction together with bench --- design/stack_machine.v | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'design') diff --git a/design/stack_machine.v b/design/stack_machine.v index 4313713..a6b2765 100644 --- a/design/stack_machine.v +++ b/design/stack_machine.v @@ -212,6 +212,10 @@ module stack_machine_new assign instr_udiv = !set_im && !use_im && stack_shrinks_by_1 && instruction[11:0] == 12'd2; + wire instr_mul; + assign instr_mul = !set_im && !use_im && stack_shrinks_by_1 && + instruction[11:0] == 12'd3; + reg halt; /* Set once a halt instruction is encountered */ assign finished = halt; @@ -505,6 +509,9 @@ module stack_machine_new if (instr_udiv && arithmetic_uncompleted) r1 <= div_quotient; + + if (instr_mul && arithmetic_uncompleted) + r1 <= r0 * r1; end // case: STEP_EXECUTING endcase // case (step) end // else: !if(RST_I) -- cgit v1.2.3