Skip to content

Simulation Failure in 4-bit Multiplier Circuit #2335

Description

@shimoshida

Describe the bug
When implementing a 4-bit multiplier circuit on an FPGA fabric generated using OpenFPGA and running a simulation, the simulation fails. The same implementation works correctly for 2-bit and 3-bit multiplier circuits, and no issues were observed in those cases.

  • OpenFPGA flow

To Reproduce
Steps to reproduce the behavior:

  1. Clone OpenFPGA repository and checkout current master
    commit id: 55c2ccf50798645694204434936c38f86b14611b

  2. Change or add some files relevant to generate_fabric task

  • task.conf
Details

[GENERAL]
run_engine=openfpga_shell
power_tech_file = ${PATH:OPENFPGA_PATH}/openfpga_flow/tech/PTM_45nm/45nm.xml
power_analysis = true
spice_output=false
verilog_output=true
timeout_each_job = 20*60
fpga_flow=vpr_blif
# fpga_flow=yosys_vpr
arch_variable_file=${PATH:TASK_DIR}/design_variables.yml 

[OpenFPGA_SHELL]
# openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/write_full_testbench_example_script.openfpga
openfpga_shell_template=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_shell_scripts/generate_fabric_example_script.openfpga

openfpga_arch_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_arch/k6_frac_N10_40nm_openfpga.xml
openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml
# Use a absolute path for the Verilog netlists to be generated
# This is designed to allow the test case 'basic_tests/generate_testbench'
# to use the Verilog netlists along with testbenches in HDL simulation
openfpga_verilog_output_dir=${PATH:OPENFPGA_PATH}/openfpga_flow/tasks/basic_tests/generate_fabric/latest/k6_frac_N10_tileable_40nm/mult4/MIN_ROUTE_CHAN_WIDTH
openfpga_vpr_device_layout=2x2
openfpga_vpr_route_chan_width=20

[ARCHITECTURES]
arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k6_frac_N10_tileable_40nm.xml

[BENCHMARKS]
bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/mult4/mult4.blif

[SYNTHESIS_PARAM]
bench0_top = mult4
bench0_verilog = ${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/mult4/mult4.v
bench0_act = ${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/mult4/mult4.act

[SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH]

  • benchmark: mult4
Details
# Benchmark "mult4" written by ABC on Sat Jan 24 18:54:44 2026
.model mult4
.inputs A[0] A[1] A[2] A[3] B[0] B[1] B[2] B[3] 
.outputs Y[0] Y[1] Y[2] Y[3] Y[4] Y[5] Y[6] Y[7] 
.names B[0] A[0] Y[0]
11 1
.names B[0] A[1] B[1] A[0] Y[1]
-011 1
0-11 1
11-0 1
110- 1
.names A[2] B[2] A[1] B[1] B[0] A[0] Y[2]
---000 0
--0-00 0
-0-00- 0
-00-0- 0
-11101 0
0--0-0 0
0-0--0 0
00--11 0
1-1110 0
11--11 0
.names new_$abc$328$new_n24 new_$abc$328$new_n25 new_$abc$328$new_n23 \
 new_$abc$328$new_n22 new_$abc$328$new_n27 new_$abc$328$new_n26 Y[4]
-00001 1
-00010 1
-01100 1
-01111 1
-10100 1
-10111 1
-11000 1
-11011 1
0-0100 1
0-0111 1
0-1000 1
0-1011 1
01-000 1
01-011 1
011101 1
011110 1
1-0001 1
1-0010 1
1-1100 1
1-1111 1
10-001 1
10-010 1
100-01 1
100-10 1
.names B[2] A[2] A[0] A[1] B[1] B[0] new_$abc$328$new_n22
001111 1
111111 1
.names B[3] A[0] new_$abc$328$new_n23
11 1
.names A[2] B[0] B[1] A[1] B[2] A[0] new_$abc$328$new_n24
--1111 0
11--11 0
1111-- 0
.names B[0] A[2] B[1] A[3] B[2] A[1] new_$abc$328$new_n25
--0011 1
-0-011 1
-110-0 1
-1100- 1
0-0-11 1
00--11 1
011--0 1
011-0- 1
1-01-0 1
1-010- 1
10-1-0 1
10-10- 1
111111 1
.names B[3] A[1] new_$abc$328$new_n26
11 1
.names B[0] A[1] A[3] B[2] A[2] B[1] new_$abc$328$new_n27
---0-0 0
--0-0- 0
--00-- 0
-0--00 0
-10--1 0
0---00 0
001111 0
1--01- 0
11-101 0
111-10 0
.names new_$abc$328$new_n33 new_$abc$328$new_n30 new_$abc$328$new_n29 Y[5]
-10 1
001 1
1-0 1
.names new_$abc$328$new_n25 new_$abc$328$new_n23 new_$abc$328$new_n22 \
 new_$abc$328$new_n24 new_$abc$328$new_n26 new_$abc$328$new_n27 \
 new_$abc$328$new_n29
---100 1
---111 1
--0-00 1
--0-11 1
-0--00 1
-0--11 1
-001-- 1
0---00 1
0---11 1
0-01-- 1
00-1-- 1
000--- 1
.names new_$abc$328$new_n27 new_$abc$328$new_n26 new_$abc$328$new_n31 \
 new_$abc$328$new_n32 new_$abc$328$new_n30
--11 1
11-1 1
.names B[0] A[1] A[2] B[1] A[3] B[2] new_$abc$328$new_n31
-11101 1
1-1110 1
110111 1
111011 1
.names B[1] B[2] A[3] A[2] B[3] new_$abc$328$new_n32
--011 1
-0-11 1
-110- 1
011-0 1
1--11 1
.names new_$abc$328$new_n27 new_$abc$328$new_n26 new_$abc$328$new_n32 \
 new_$abc$328$new_n31 new_$abc$328$new_n33
-000 1
0-00 1
.names new_$abc$328$new_n33 new_$abc$328$new_n35 B[3] A[3] \
 new_$abc$328$new_n30 new_$abc$328$new_n36 Y[6]
---011 1
--0-11 1
--1110 1
-0-000 1
-00-00 1
-01101 1
01-0-1 1
010--1 1
0111-0 1
1--000 1
1-0-00 1
1-1101 1
.names new_$abc$328$new_n27 new_$abc$328$new_n26 new_$abc$328$new_n24 \
 new_$abc$328$new_n25 new_$abc$328$new_n23 new_$abc$328$new_n35
---00 0
--1-0 0
--10- 0
00--- 0
11--- 0
.names B[3] B[1] A[3] A[2] B[2] new_$abc$328$new_n36
-1111 0
1-111 0
.names new_$abc$328$new_n25 new_$abc$328$new_n24 new_$abc$328$new_n23 \
 new_$abc$328$new_n22 Y[3]
0000 1
0011 1
0101 1
0110 1
1001 1
1010 1
1100 1
1111 1
.names new_$abc$328$new_n30 new_$abc$328$new_n33 new_$abc$328$new_n35 \
 new_$abc$328$new_n36 A[3] B[3] Y[7]
---011 1
-01-11 1
-010-- 1
1---11 1
1--0-- 1
.end

  1. Execute OpenFPGA task or your own example:
    python openfpga_flow/scripts/run_fpga_task.py basic_tests/generate_fabric

  2. Fix generated verilog files in SRC directory

  • Some modules: nettype none is replaced with wire
  • Test bench
Details
//-------------------------------------------
//	FPGA Synthesizable Verilog Netlist
//	Description: FPGA Verilog full testbench for top-level netlist of design: mult4
//	Author: Xifan TANG
//	Organization: University of Utah
//	Date: Sat Jan 24 19:10:26 2026
//-------------------------------------------
//----- Default net type -----
`default_nettype wire

module mult4_autocheck_top_tb;
// ----- Local wires for global ports of FPGA fabric -----
wire [0:0] pReset;
wire [0:0] prog_clk;
wire [0:0] set;
wire [0:0] reset;
wire [0:0] clk;

// ----- Local wires for I/Os of FPGA fabric -----
wire [0:63] gfpga_pad_GPIO_PAD;



reg [0:0] __config_done__;
wire [0:0] __config_all_done__;
wire [0:0] __prog_clock__;
reg [0:0] __prog_clock___reg__;
wire [0:0] __op_clock__;
reg [0:0] __op_clock___reg__;
reg [0:0] __prog_reset__;
reg [0:0] __prog_set_;
reg [0:0] __greset__;
reg [0:0] __gset__;
// ---- Configuration-chain head -----
reg [0:0] ccff_head;
// ---- Configuration-chain tail -----
wire [0:0] ccff_tail;
// ----- Shared inputs -------
	reg [0:0] A_0__shared_input;
	reg [0:0] A_1__shared_input;
	reg [0:0] A_2__shared_input;
	reg [0:0] A_3__shared_input;
	reg [0:0] B_0__shared_input;
	reg [0:0] B_1__shared_input;
	reg [0:0] B_2__shared_input;
	reg [0:0] B_3__shared_input;

	wire [3:0] A_shared_input = {A_3__shared_input,
			 A_2__shared_input,
			 A_1__shared_input,
			 A_0__shared_input};

	wire [3:0] B_shared_input = {B_3__shared_input,
			 B_2__shared_input,
			 B_1__shared_input,
			 B_0__shared_input};
// ----- FPGA fabric outputs -------
	wire [0:0] Y_0__fpga;
	wire [0:0] Y_1__fpga;
	wire [0:0] Y_2__fpga;
	wire [0:0] Y_3__fpga;
	wire [0:0] Y_4__fpga;
	wire [0:0] Y_5__fpga;
	wire [0:0] Y_6__fpga;
	wire [0:0] Y_7__fpga;
	wire [7:0] Y_fpga = {Y_7__fpga,
		     Y_6__fpga,
		     Y_5__fpga,
		     Y_4__fpga,
		     Y_3__fpga,
		     Y_2__fpga,
		     Y_1__fpga,
		     Y_0__fpga};

// ----- Benchmark outputs -------
	wire [0:0] Y_0__benchmark;
	wire [0:0] Y_1__benchmark;
	wire [0:0] Y_2__benchmark;
	wire [0:0] Y_3__benchmark;
	wire [0:0] Y_4__benchmark;
	wire [0:0] Y_5__benchmark;
	wire [0:0] Y_6__benchmark;
	wire [0:0] Y_7__benchmark;
	wire [7:0] Y_benchmark = {Y_7__benchmark,
		     Y_6__benchmark,
		     Y_5__benchmark,
		     Y_4__benchmark,
		     Y_3__benchmark,
		     Y_2__benchmark,
		     Y_1__benchmark,
		     Y_0__benchmark};

// ----- Output vectors checking flags -------
	reg [0:0] Y_0__flag;
	reg [0:0] Y_1__flag;
	reg [0:0] Y_2__flag;
	reg [0:0] Y_3__flag;
	reg [0:0] Y_4__flag;
	reg [0:0] Y_5__flag;
	reg [0:0] Y_6__flag;
	reg [0:0] Y_7__flag;

// ----- Error counter: Deposit an error for config_done signal is not raised at the beginning -----
	integer nb_error= 1;
// ----- Number of clock cycles in configuration phase: 8417 -----
// ----- Begin configuration done signal generation -----
initial
	begin
		__config_done__[0] = 1'b0;
	end

// ----- End configuration done signal generation -----

// ----- Begin raw programming clock signal generation -----
initial
	begin
		__prog_clock___reg__[0] = 1'b0;
	end
always
	begin
		#5	__prog_clock___reg__[0] = ~__prog_clock___reg__[0];
	end

// ----- End raw programming clock signal generation -----

// ----- Actual programming clock is triggered only when __config_done__ and __prog_reset__ are disabled -----
	assign __prog_clock__[0] = __prog_clock___reg__[0] & (~__config_done__[0]) & (~__prog_reset__[0]);

	assign __config_all_done__[0] = __config_done__[0];
// ----- Begin raw operating clock signal generation -----
initial
	begin
		__op_clock___reg__[0] = 1'b0;
	end
always wait(~__greset__)
	begin
		#1.761053801	__op_clock___reg__[0] = ~__op_clock___reg__[0];
	end

// ----- End raw operating clock signal generation -----
// ----- Actual operating clock is triggered only when __config_all_done__ is enabled -----
	assign __op_clock__[0] = __op_clock___reg__[0] & __config_all_done__[0];

// ----- Begin programming reset signal generation -----
initial
	begin
		__prog_reset__[0] = 1'b1;
	#10	__prog_reset__[0] = 1'b0;
	end

// ----- End programming reset signal generation -----

// ----- Begin programming set signal generation -----
initial
	begin
		__prog_set_[0] = 1'b1;
	#10	__prog_set_[0] = 1'b0;
	end

// ----- End programming set signal generation -----

// ----- Begin operating reset signal generation -----
// ----- Reset signal is enabled until the first clock cycle in operation phase -----
initial
	begin
		__greset__[0] = 1'b1;
	wait(__config_all_done__)
	#3.522107601	__greset__[0] = 1'b1;
	#7.044215202	__greset__[0] = 1'b0;
	end

// ----- End operating reset signal generation -----
// ----- Begin operating set signal generation: always disabled -----
initial
	begin
		__gset__[0] = 1'b0;
	end

// ----- End operating set signal generation: always disabled -----

// ----- Begin connecting global ports of FPGA fabric to stimuli -----
	assign clk[0] = __op_clock__[0];
	assign prog_clk[0] = __prog_clock__[0];
	assign reset[0] = __greset__[0];
	assign pReset[0] = __prog_reset__[0];
	assign set[0] = __gset__[0];
// ----- End connecting global ports of FPGA fabric to stimuli -----
// ----- FPGA top-level module to be capsulated -----
	fpga_top FPGA_DUT (
		.pReset(pReset[0]),
		.prog_clk(prog_clk[0]),
		.set(set[0]),
		.reset(reset[0]),
		.clk(clk[0]),
		.gfpga_pad_GPIO_PAD(gfpga_pad_GPIO_PAD[0:63]),
		.ccff_head(ccff_head[0]),
		.ccff_tail(ccff_tail[0]));

// ----- Link BLIF Benchmark I/Os to FPGA I/Os -----
// ----- Blif Benchmark input A_0_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[12] -----
	assign gfpga_pad_GPIO_PAD[12] = A_0__shared_input[0];

// ----- Blif Benchmark input A_1_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[9] -----
	assign gfpga_pad_GPIO_PAD[9] = A_1__shared_input[0];

// ----- Blif Benchmark input A_2_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[32] -----
	assign gfpga_pad_GPIO_PAD[32] = A_2__shared_input[0];

// ----- Blif Benchmark input A_3_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[34] -----
	assign gfpga_pad_GPIO_PAD[34] = A_3__shared_input[0];

// ----- Blif Benchmark input B_0_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[39] -----
	assign gfpga_pad_GPIO_PAD[39] = B_0__shared_input[0];

// ----- Blif Benchmark input B_1_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[36] -----
	assign gfpga_pad_GPIO_PAD[36] = B_1__shared_input[0];

// ----- Blif Benchmark input B_2_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[11] -----
	assign gfpga_pad_GPIO_PAD[11] = B_2__shared_input[0];

// ----- Blif Benchmark input B_3_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[38] -----
	assign gfpga_pad_GPIO_PAD[38] = B_3__shared_input[0];

// ----- Blif Benchmark output Y_0_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[37] -----
	assign Y_0__fpga[0] = gfpga_pad_GPIO_PAD[37];

// ----- Blif Benchmark output Y_1_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[19] -----
	assign Y_1__fpga[0] = gfpga_pad_GPIO_PAD[19];

// ----- Blif Benchmark output Y_2_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[27] -----
	assign Y_2__fpga[0] = gfpga_pad_GPIO_PAD[27];

// ----- Blif Benchmark output Y_3_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[35] -----
	assign Y_3__fpga[0] = gfpga_pad_GPIO_PAD[35];

// ----- Blif Benchmark output Y_4_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[33] -----
	assign Y_4__fpga[0] = gfpga_pad_GPIO_PAD[33];

// ----- Blif Benchmark output Y_5_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[8] -----
	assign Y_5__fpga[0] = gfpga_pad_GPIO_PAD[8];

// ----- Blif Benchmark output Y_6_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[14] -----
	assign Y_6__fpga[0] = gfpga_pad_GPIO_PAD[14];

// ----- Blif Benchmark output Y_7_ is mapped to FPGA IOPAD gfpga_pad_GPIO_PAD[29] -----
	assign Y_7__fpga[0] = gfpga_pad_GPIO_PAD[29];

// ----- Wire unused FPGA I/Os to constants -----
	assign gfpga_pad_GPIO_PAD[0] = 1'b0;
	assign gfpga_pad_GPIO_PAD[1] = 1'b0;
	assign gfpga_pad_GPIO_PAD[2] = 1'b0;
	assign gfpga_pad_GPIO_PAD[3] = 1'b0;
	assign gfpga_pad_GPIO_PAD[4] = 1'b0;
	assign gfpga_pad_GPIO_PAD[5] = 1'b0;
	assign gfpga_pad_GPIO_PAD[6] = 1'b0;
	assign gfpga_pad_GPIO_PAD[7] = 1'b0;
	assign gfpga_pad_GPIO_PAD[10] = 1'b0;
	assign gfpga_pad_GPIO_PAD[13] = 1'b0;
	assign gfpga_pad_GPIO_PAD[15] = 1'b0;
	assign gfpga_pad_GPIO_PAD[16] = 1'b0;
	assign gfpga_pad_GPIO_PAD[17] = 1'b0;
	assign gfpga_pad_GPIO_PAD[18] = 1'b0;
	assign gfpga_pad_GPIO_PAD[20] = 1'b0;
	assign gfpga_pad_GPIO_PAD[21] = 1'b0;
	assign gfpga_pad_GPIO_PAD[22] = 1'b0;
	assign gfpga_pad_GPIO_PAD[23] = 1'b0;
	assign gfpga_pad_GPIO_PAD[24] = 1'b0;
	assign gfpga_pad_GPIO_PAD[25] = 1'b0;
	assign gfpga_pad_GPIO_PAD[26] = 1'b0;
	assign gfpga_pad_GPIO_PAD[28] = 1'b0;
	assign gfpga_pad_GPIO_PAD[30] = 1'b0;
	assign gfpga_pad_GPIO_PAD[31] = 1'b0;
	assign gfpga_pad_GPIO_PAD[40] = 1'b0;
	assign gfpga_pad_GPIO_PAD[41] = 1'b0;
	assign gfpga_pad_GPIO_PAD[42] = 1'b0;
	assign gfpga_pad_GPIO_PAD[43] = 1'b0;
	assign gfpga_pad_GPIO_PAD[44] = 1'b0;
	assign gfpga_pad_GPIO_PAD[45] = 1'b0;
	assign gfpga_pad_GPIO_PAD[46] = 1'b0;
	assign gfpga_pad_GPIO_PAD[47] = 1'b0;
	assign gfpga_pad_GPIO_PAD[48] = 1'b0;
	assign gfpga_pad_GPIO_PAD[49] = 1'b0;
	assign gfpga_pad_GPIO_PAD[50] = 1'b0;
	assign gfpga_pad_GPIO_PAD[51] = 1'b0;
	assign gfpga_pad_GPIO_PAD[52] = 1'b0;
	assign gfpga_pad_GPIO_PAD[53] = 1'b0;
	assign gfpga_pad_GPIO_PAD[54] = 1'b0;
	assign gfpga_pad_GPIO_PAD[55] = 1'b0;
	assign gfpga_pad_GPIO_PAD[56] = 1'b0;
	assign gfpga_pad_GPIO_PAD[57] = 1'b0;
	assign gfpga_pad_GPIO_PAD[58] = 1'b0;
	assign gfpga_pad_GPIO_PAD[59] = 1'b0;
	assign gfpga_pad_GPIO_PAD[60] = 1'b0;
	assign gfpga_pad_GPIO_PAD[61] = 1'b0;
	assign gfpga_pad_GPIO_PAD[62] = 1'b0;
	assign gfpga_pad_GPIO_PAD[63] = 1'b0;

// ----- Reference Benchmark Instanication -------
	mult4 REF_DUT(
		.A(A_shared_input),
		.B(B_shared_input),
		.Y(Y_benchmark)
	);
// ----- End reference Benchmark Instanication -------

// ----- Begin bitstream loading during configuration phase -----
`define BITSTREAM_LENGTH 8416
`define BITSTREAM_WIDTH 1
// ----- Virtual memory to store the bitstream from external file -----
reg [0:`BITSTREAM_WIDTH - 1] bit_mem[0:`BITSTREAM_LENGTH - 1];
reg [$clog2(`BITSTREAM_LENGTH):0] bit_index;
// ----- Registers used for fast configuration logic -----
reg [$clog2(`BITSTREAM_LENGTH):0] ibit;
reg [0:0] skip_bits;
// ----- Preload bitstream file to a virtual memory -----
initial begin
	$readmemb("fabric_bitstream.bit", bit_mem);
// ----- Configuration chain default input -----
	ccff_head[0] <= 1'b0;
	bit_index <= 0;
	skip_bits[0] <= 1'b0;
	for (ibit = 0; ibit < `BITSTREAM_LENGTH + 1; ibit = ibit + 1) begin
		if (1'b0 == bit_mem[ibit]) begin
			if (1'b1 == skip_bits[0]) begin
				bit_index <= bit_index + 1;
			end
		end else begin
			skip_bits[0] <= 1'b0;
		end
	end
end
// ----- 'else if' condition is required by Modelsim to synthesis the Verilog correctly -----
always @(negedge __prog_clock___reg__[0]) begin
	if (bit_index >= `BITSTREAM_LENGTH) begin
		__config_done__[0] <= 1'b1;
	end else if (bit_index >= 0 && bit_index < `BITSTREAM_LENGTH) begin
		ccff_head[0] <= bit_mem[bit_index];
		bit_index <= bit_index + 1;
	end
end
// ----- End bitstream loading during configuration phase -----
// ----- Begin reset signal generation -----
// ----- Input Initialization -------
	initial begin
		A_0__shared_input <= 1'b0;
		A_1__shared_input <= 1'b0;
		A_2__shared_input <= 1'b0;
		A_3__shared_input <= 1'b0;
		B_0__shared_input <= 1'b0;
		B_1__shared_input <= 1'b0;
		B_2__shared_input <= 1'b0;
		B_3__shared_input <= 1'b0;

		Y_0__flag[0] <= 1'b0;
		Y_1__flag[0] <= 1'b0;
		Y_2__flag[0] <= 1'b0;
		Y_3__flag[0] <= 1'b0;
		Y_4__flag[0] <= 1'b0;
		Y_5__flag[0] <= 1'b0;
		Y_6__flag[0] <= 1'b0;
		Y_7__flag[0] <= 1'b0;
	end

// ----- Input Stimulus -------
	always@(negedge __op_clock__[0]) begin
		A_0__shared_input <= $random;
		A_1__shared_input <= $random;
		A_2__shared_input <= $random;
		A_3__shared_input <= $random;
		B_0__shared_input <= $random;
		B_1__shared_input <= $random;
		B_2__shared_input <= $random;
		B_3__shared_input <= $random;
	end

// ----- Begin checking output vectors -------
// ----- Skip the first falling edge of clock, it is for initialization -------
	reg [0:0] sim_start;

	always@(negedge __op_clock__[0]) begin
		if (1'b1 == sim_start[0]) begin
			sim_start[0] <= ~sim_start[0];
		end else 
			if (1'b1 == __config_all_done__) begin
			if(!(Y_0__fpga === Y_0__benchmark) && !(Y_0__benchmark === 1'bx)) begin
				Y_0__flag <= 1'b1;
			end else begin
				Y_0__flag<= 1'b0;
			end
			if(!(Y_1__fpga === Y_1__benchmark) && !(Y_1__benchmark === 1'bx)) begin
				Y_1__flag <= 1'b1;
			end else begin
				Y_1__flag<= 1'b0;
			end
			if(!(Y_2__fpga === Y_2__benchmark) && !(Y_2__benchmark === 1'bx)) begin
				Y_2__flag <= 1'b1;
			end else begin
				Y_2__flag<= 1'b0;
			end
			if(!(Y_3__fpga === Y_3__benchmark) && !(Y_3__benchmark === 1'bx)) begin
				Y_3__flag <= 1'b1;
			end else begin
				Y_3__flag<= 1'b0;
			end
			if(!(Y_4__fpga === Y_4__benchmark) && !(Y_4__benchmark === 1'bx)) begin
				Y_4__flag <= 1'b1;
			end else begin
				Y_4__flag<= 1'b0;
			end
			if(!(Y_5__fpga === Y_5__benchmark) && !(Y_5__benchmark === 1'bx)) begin
				Y_5__flag <= 1'b1;
			end else begin
				Y_5__flag<= 1'b0;
			end
			if(!(Y_6__fpga === Y_6__benchmark) && !(Y_6__benchmark === 1'bx)) begin
				Y_6__flag <= 1'b1;
			end else begin
				Y_6__flag<= 1'b0;
			end
			if(!(Y_7__fpga === Y_7__benchmark) && !(Y_7__benchmark === 1'bx)) begin
				Y_7__flag <= 1'b1;
			end else begin
				Y_7__flag<= 1'b0;
			end
		end
	end

	always@(posedge Y_0__flag) begin
		if(Y_0__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_0__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_1__flag) begin
		if(Y_1__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_1__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_2__flag) begin
		if(Y_2__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_2__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_3__flag) begin
		if(Y_3__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_3__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_4__flag) begin
		if(Y_4__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_4__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_5__flag) begin
		if(Y_5__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_5__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_6__flag) begin
		if(Y_6__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_6__fpga at time = %t", $realtime);
		end
	end

	always@(posedge Y_7__flag) begin
		if(Y_7__flag) begin
			nb_error = nb_error + 1;
			$display("Mismatch on Y_7__fpga at time = %t", $realtime);
		end
	end


// ----- Configuration done must be raised in the end -------
	always@(posedge __config_all_done__[0]) begin
		nb_error = nb_error - 1;
	end

// ----- Begin output waveform to VCD file-------
	initial begin
		$dumpfile("mult4_formal.vcd");
		$dumpvars(1, mult4_autocheck_top_tb);
	end
// ----- END output waveform to VCD file -------

initial begin
	sim_start[0] <= 1'b1;
	$timeformat(-9, 2, "ns", 20);
	$display("Simulation start");
// ----- Can be changed by the user for his/her need -------
	#84240
	if(nb_error == 0) begin
		$display("Simulation Succeed");
	end else begin
		$display("Simulation Failed with %d error(s)", nb_error);
	end
	$finish;
end

endmodule
// ----- END Verilog module for mult4_autocheck_top_tb -----

//----- Default net type -----
`default_nettype wire

  1. See error

Expected behavior
Simulation Succeeds

Screenshots
Simulation via Vivado 2024.1
Image

Enviornment (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS
  • Compiler:N/A
  • Version: Current master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions