From f37a50d6cfe86e6f5ebe368c0868878fd72aa884 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Sat, 5 Sep 2020 18:32:44 +0200 Subject: add jump 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 a6b2765..150f6c7 100644 --- a/design/stack_machine.v +++ b/design/stack_machine.v @@ -190,6 +190,10 @@ module stack_machine_new assign instr_set_sp = use_im && stack_same_size && instruction[11:7] == 5'd0; + wire instr_jump; + assign instr_jump = use_im && stack_same_size && + instruction[11:7] == 5'd1; + /* Instructions, that grow stack */ wire instr_tee; assign instr_tee = !set_im && !use_im && stack_grows && @@ -493,6 +497,9 @@ module stack_machine_new if (instr_set_sp) `SET_SP(im_effective); + if (instr_jump) + `SET_PC(im_effective); + /* Instructions, that grow stack */ if (instr_tee) r1 <= r1; -- cgit v1.2.3