`timescale 1us/1us `include "nandgame_types.v" module logic_unit_tb; logic [15:0] tst_in1, tst_in2; LogicCode tst_opcode; logic [15:0] tst_result; logic_unit uut ( .X_in(tst_in1), .Y_in(tst_in2), .logic_operation_in(tst_opcode), .result_out(tst_result) ); string filename; initial begin `ifdef DUMP_FILE_NAME filename=`DUMP_FILE_NAME; `else filename="logic_unit.lxt2"; `endif $dumpfile(filename); $dumpvars(); end initial begin tst_in1 = 16'b1010; tst_in2 = 16'b1100; tst_opcode = LOGIC_AND; #1 assert(tst_result == 16'b1000); #1 tst_in1 = 16'b1010; tst_in2 = 16'b1100; tst_opcode = LOGIC_OR; #1 assert(tst_result == 16'b1110); #1 tst_in1 = 16'b1010; tst_in2 = 16'b1100; tst_opcode = LOGIC_XOR; #1 assert(tst_result == 16'b0110); #1 tst_in1 = 16'b1010101010101010; tst_opcode = LOGIC_NEGT; #1 assert(tst_result == 16'b0101010101010101); #1 $finish(); end endmodule