From 7ddb4265d30ef30df6e7098c979334109378357c Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Mon, 5 Oct 2020 14:23:47 +0200 Subject: fixes, add_sp instruciton and translation of br instruction from wasm --- 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 5e6e0d6..b5c56e6 100644 --- a/design/stack_machine.v +++ b/design/stack_machine.v @@ -201,6 +201,10 @@ module stack_machine_new assign instr_jump = use_im && stack_same_size && instruction[11:7] == 5'd1; + wire instr_add_sp; + assign instr_add_sp = use_im && stack_same_size && + instruction[11:7] == 5'd2; + /* Instructions, that grow stack */ wire instr_tee; assign instr_tee = !set_im && !use_im && stack_grows && @@ -533,6 +537,9 @@ module stack_machine_new if (instr_set_sp) `SET_SP(im_effective); + if (instr_add_sp) + `SET_SP(im_effective + sp); + if (instr_jump) `SET_PC(im_effective); -- cgit v1.2.3