diff options
Diffstat (limited to 'alu_tb.v')
-rw-r--r-- | alu_tb.v | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -11,6 +11,7 @@ module alu_tb (); reg expected_zero; wire carry; reg expected_carry; + reg carry_in; reg [3*8:0] opstr; integer file, r; @@ -24,9 +25,12 @@ module alu_tb (); while (!$feof(file)) begin r = $fscanf(file, " 0x%x %3s 0x%x = 0x%x Z=%x C=%x\n", x, opstr, y, expected_result, expected_zero, expected_carry); + carry_in = opstr == "++" || opstr == "--"; case (opstr) - "+" : op = 0; - "-" : op = 1; + "+" : op = 0; + "++" : op = 0; + "-" : op = 1; + "--" : op = 1; "*" : op = 2; "/" : op = 3; "&" : op = 4; @@ -59,6 +63,7 @@ module alu_tb (); .op(op), .x(x), .y(y), + .carry_in(carry_in), .result(result), .zero(zero), .carry(carry) |