`timescale 1us/1us `include "nandgame_types.v" module cond_check_tb; logic [15:0] tst_in1; logic tst_check_ltz, tst_check_gtz, tst_check_eqz; logic tst_result; cond_check uut ( .X_in(tst_in1), .check_ltz_in(tst_check_ltz), .check_gtz_in(tst_check_gtz), .check_eqz_in(tst_check_eqz), .result_out(tst_result) ); string filename; initial begin `ifdef DUMP_FILE_NAME filename=`DUMP_FILE_NAME; `else filename="cond_check.lin1t2"; `endif $dumpfile(filename); $dumpvars(); end bit exp_res; initial begin tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 0; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 1; tst_in1 = 0; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 1; tst_check_ltz = 0; tst_in1 = 0; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 1; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 0; #1 exp_res = 1; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 1; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 1; tst_in1 = 1; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 1; tst_check_ltz = 0; tst_in1 = 1; #1 exp_res = 1; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 1; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 1; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = -1; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 1; tst_in1 = -1; #1 exp_res = 1; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 0; tst_check_gtz = 1; tst_check_ltz = 0; tst_in1 = -1; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 tst_check_eqz = 1; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = -1; #1 exp_res = 0; assert(tst_result == exp_res) else $error("Expected %d, but got %d", exp_res, tst_result); #1 $finish(); end endmodule