aboutsummaryrefslogtreecommitdiff
path: root/design
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-09-05 16:43:32 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-09-05 16:43:32 +0200
commit40a11a7155bc474d85ded1fef183baae2007f101 (patch)
treeee101c1e2ba2be097c5ff81b321247fb15edd882 /design
parent572c9d71cf66bb2097bce384b8cb3899af0b8473 (diff)
downloadAGH-engineering-thesis-40a11a7155bc474d85ded1fef183baae2007f101.tar.gz
AGH-engineering-thesis-40a11a7155bc474d85ded1fef183baae2007f101.zip
add tee instruction together with bench
Diffstat (limited to 'design')
-rw-r--r--design/stack_machine.v12
1 files changed, 10 insertions, 2 deletions
diff --git a/design/stack_machine.v b/design/stack_machine.v
index d0ca36b..04b1285 100644
--- a/design/stack_machine.v
+++ b/design/stack_machine.v
@@ -183,9 +183,14 @@ module stack_machine_new
assign instr_set_sp = use_im && stack_same_size &&
instruction[11:7] == 5'd0;
- /* Instructions, that grom stack */
+ /* Instructions, that grow stack */
+ wire instr_tee;
+ assign instr_tee = !set_im && !use_im && stack_grows &&
+ instruction[11:0] == 12'd0;
+
wire instr_const;
- assign instr_const = use_im && stack_grows && instruction[11:7] == 5'd0;
+ assign instr_const = use_im && stack_grows &&
+ instruction[11:7] == 5'd0;
/* Instructions, that shrink stack */
/* none now */
@@ -423,6 +428,9 @@ module stack_machine_new
if (instr_const && first_execution_tick)
r1 <= im_effective;
+ if (instr_tee)
+ r1 <= r1;
+
if (instr_set_sp)
`SET_SP(im_effective);
end // case: STEP_EXECUTING