`timescale 1us/1us `include "nandgame_types.v" module arith_unit_tb; logic [15:0] tst_in1; logic [15:0] tst_in2; ArithCode tst_opcode; logic [15:0] tst_result; arith_unit uut ( .X_in(tst_in1), .Y_in(tst_in2), .arith_operation_in(tst_opcode), .result_out(tst_result) ); string filename; initial begin `ifdef DUMP_FILE_NAME filename=`DUMP_FILE_NAME; `else filename=" arith_unit.lxt2"; `endif $dumpfile(filename); $dumpvars(); end initial begin tst_in1 = 13; tst_in2 = 17; tst_opcode = ARITH_PLUS; #1 assert(tst_result == 30); #1 tst_in1 = 12; tst_in2 = 4; tst_opcode = ARITH_MINUS; #1 assert(tst_result == 8); #1 tst_in1 = 12; tst_in2 = 13; tst_opcode = ARITH_MINUS; #1 assert(tst_result == 16'hffff); #1 tst_in1 = 13; tst_in2 = 17; tst_opcode = ARITH_INC; #1 assert(tst_result == 14); #1 tst_in1 = 13; tst_in2 = 17; tst_opcode = ARITH_DEC; #1 assert(tst_result == 12); #1 tst_in1 = 0; tst_in2 = 17; tst_opcode = ARITH_DEC; #1 assert(tst_result == 16'hffff); #1 $finish(); end endmodule