summaryrefslogtreecommitdiff
path: root/eater_cpu
diff options
context:
space:
mode:
Diffstat (limited to 'eater_cpu')
-rw-r--r--eater_cpu/eater_computer_tb.sv10
1 files changed, 10 insertions, 0 deletions
diff --git a/eater_cpu/eater_computer_tb.sv b/eater_cpu/eater_computer_tb.sv
index eab7b23..cc024f4 100644
--- a/eater_cpu/eater_computer_tb.sv
+++ b/eater_cpu/eater_computer_tb.sv
@@ -120,6 +120,16 @@ initial begin
assert (uut.ALU_flags_int.Carry == 1)
else $error("Expected carry flag from ALU, got it not.");
+ uut.manual_flags.ALU_subtract_nadd = 1;
+
+ @(negedge clk_in);
+ assert (uut.bus == 8'('haa - 'hbb))
+ else $error("Expected 0x%02x (from ALU), got 0x%02x on bus", 8'('haa - 'hbb), uut.bus);
+
+ assert (uut.ALU_flags_int.Carry == 1)
+ else $error("Expected carry flag from ALU, got it not.");
+
+ uut.manual_flags.ALU_subtract_nadd = 0;
uut.manual_flags.ALU_out = 0;
uut.manual_flags.PC_out = 1;