FluxBench.AI · software checked September 21, 2026
HDL tools and waveform references
Ten small designs pass their testbenches, produce checked waveforms and synthesize to a Yosys netlist. These are software references; no FPGA or PCB was tested.
10/10
reference projects
40
testbench assertions
40
exact waveform samples
10/10
injected faults detected
Measured tool versions
| Tool | Installed version |
|---|---|
| iverilog | Icarus Verilog version 14.0 (devel) (s20260301-274-ga540a7a16-dirty) |
| vvp | Icarus Verilog runtime version 14.0 (devel) (s20260301-274-ga540a7a16-dirty) |
| yosys | Yosys 0.67+24 (git sha1 0e82bbefe, Release, Clang /usr/bin/clang++ 18.1.8) |
| nextpnr-ice40 | "nextpnr-ice40" -- Next Generation Place and Route (Version nextpnr-0.10-82-g2b560ad0) |
| nextpnr-ecp5 | "nextpnr-ecp5" -- Next Generation Place and Route (Version nextpnr-0.10-82-g2b560ad0) |
| nextpnr-himbaechel | "nextpnr-himbaechel" -- Next Generation Place and Route (Version nextpnr-0.10-82-g2b560ad0) |
Simulation uses Icarus with the 2012 language option; synthesis uses Yosys with its SystemVerilog option. Those options do not establish full SystemVerilog compatibility. The place-and-route tools are inventoried; these ten tests stop at simulation and generic synthesis.
Ten reproducible projects
Expand a reference to inspect its design and testbench. Helper files are included where required. Testbench stimulus and assertions are separate from the synthesizable design.
Boolean gates · 4 checks passed
AND, OR and XOR truth table. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input a,b,output [2:0] y); assign y={a&b,a|b,a^b}; endmoduletb.v
`timescale 1ns/1ns
module tb;
reg a=0,b=0;
wire [2:0] y;
top dut(.a(a),.b(b),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
a=0;b=0;#2; if (y !== 3'h0) $fatal(1, "FAIL gates check 1");
a=0;b=1;#2; if (y !== 3'h3) $fatal(1, "FAIL gates check 2");
a=1;b=0;#2; if (y !== 3'h3) $fatal(1, "FAIL gates check 3");
a=1;b=1;#2; if (y !== 3'h6) $fatal(1, "FAIL gates check 4");
$display("PASS gates 4"); $finish;
end
endmodule
Four-way multiplexer · 4 checks passed
Combinational case selection. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input [1:0] sel,output reg [7:0] y); always @* case(sel) 0:y=8'h12;1:y=8'h34;2:y=8'h56;default:y=8'h78;endcase endmoduletb.v
`timescale 1ns/1ns
module tb;
reg [1:0] sel;
wire [7:0] y;
top dut(.sel(sel),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
sel=0;#2; if (y !== 8'h12) $fatal(1, "FAIL mux check 1");
sel=1;#2; if (y !== 8'h34) $fatal(1, "FAIL mux check 2");
sel=2;#2; if (y !== 8'h56) $fatal(1, "FAIL mux check 3");
sel=3;#2; if (y !== 8'h78) $fatal(1, "FAIL mux check 4");
$display("PASS mux 4"); $finish;
end
endmodule
Carry-preserving addition · 4 checks passed
Eight-bit operands and ninth carry bit. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input [7:0] a,b,output [8:0] y); assign y={1'b0,a}+{1'b0,b}; endmoduletb.v
`timescale 1ns/1ns
module tb;
reg [7:0] a=0,b=0;
wire [8:0] y;
top dut(.a(a),.b(b),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
a=0;b=0;#2; if (y !== 9'h0) $fatal(1, "FAIL adder check 1");
a=255;b=1;#2; if (y !== 9'h100) $fatal(1, "FAIL adder check 2");
a=255;b=255;#2; if (y !== 9'h1FE) $fatal(1, "FAIL adder check 3");
a=20;b=22;#2; if (y !== 9'h2A) $fatal(1, "FAIL adder check 4");
$display("PASS adder 4"); $finish;
end
endmodule
Resettable counter · 4 checks passed
Asynchronous reset and nonblocking updates. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input clk,rst,output reg [3:0] y); always @(posedge clk or posedge rst) if(rst)y<=0;else y<=y+1'b1; endmoduletb.v
`timescale 1ns/1ns
module tb;
reg clk=0,rst=0;
wire [3:0] y;
top dut(.clk(clk),.rst(rst),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
#1 rst=1; #1 rst=0;
#1 clk=1; #1; if (y !== 4'h1) $fatal(1, "FAIL counter check 1"); #1 clk=0;
#1 clk=1; #1; if (y !== 4'h2) $fatal(1, "FAIL counter check 2"); #1 clk=0;
#1 clk=1; #1; if (y !== 4'h3) $fatal(1, "FAIL counter check 3"); #1 clk=0;
#1 clk=1; #1; if (y !== 4'h4) $fatal(1, "FAIL counter check 4"); #1 clk=0;
$display("PASS counter 4"); $finish;
end
endmodule
Enabled register · 4 checks passed
Load, hold and clear on clock edges. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input clk,rst,en,d,output reg y); always @(posedge clk or posedge rst) if(rst)y<=0;else if(en)y<=d; endmoduletb.v
`timescale 1ns/1ns
module tb;
reg clk=0,rst=0,en=0,d=0;
wire [0:0] y;
top dut(.clk(clk),.rst(rst),.en(en),.d(d),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
#1 rst=1; #1 rst=0;
en=1;d=1; #1 clk=1; #1; if (y !== 1'h1) $fatal(1, "FAIL enable check 1"); #1 clk=0;
en=0;d=0; #1 clk=1; #1; if (y !== 1'h1) $fatal(1, "FAIL enable check 2"); #1 clk=0;
en=1;d=0; #1 clk=1; #1; if (y !== 1'h0) $fatal(1, "FAIL enable check 3"); #1 clk=0;
en=0;d=1; #1 clk=1; #1; if (y !== 1'h0) $fatal(1, "FAIL enable check 4"); #1 clk=0;
$display("PASS enable 4"); $finish;
end
endmodule
Serial shift register · 4 checks passed
Four sampled serial bits. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input clk,rst,d,output reg [3:0] y); always @(posedge clk or posedge rst) if(rst)y<=0;else y<={y[2:0],d}; endmoduletb.v
`timescale 1ns/1ns
module tb;
reg clk=0,rst=0,d=0;
wire [3:0] y;
top dut(.clk(clk),.rst(rst),.d(d),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
#1 rst=1; #1 rst=0;
d=1; #1 clk=1; #1; if (y !== 4'h1) $fatal(1, "FAIL shift check 1"); #1 clk=0;
d=0; #1 clk=1; #1; if (y !== 4'h2) $fatal(1, "FAIL shift check 2"); #1 clk=0;
d=1; #1 clk=1; #1; if (y !== 4'h5) $fatal(1, "FAIL shift check 3"); #1 clk=0;
d=0; #1 clk=1; #1; if (y !== 4'hA) $fatal(1, "FAIL shift check 4"); #1 clk=0;
$display("PASS shift 4"); $finish;
end
endmodule
Three-state machine · 4 checks passed
Reset, transitions and wrap. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input clk,rst,output reg [1:0] y); always @(posedge clk or posedge rst) if(rst)y<=0;else case(y)0:y<=1;1:y<=2;default:y<=0;endcase endmoduletb.v
`timescale 1ns/1ns
module tb;
reg clk=0,rst=0;
wire [1:0] y;
top dut(.clk(clk),.rst(rst),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
#1 rst=1; #1 rst=0;
#1 clk=1; #1; if (y !== 2'h1) $fatal(1, "FAIL state-machine check 1"); #1 clk=0;
#1 clk=1; #1; if (y !== 2'h2) $fatal(1, "FAIL state-machine check 2"); #1 clk=0;
#1 clk=1; #1; if (y !== 2'h0) $fatal(1, "FAIL state-machine check 3"); #1 clk=0;
#1 clk=1; #1; if (y !== 2'h1) $fatal(1, "FAIL state-machine check 4"); #1 clk=0;
$display("PASS state-machine 4"); $finish;
end
endmodule
Combinational lookup · 4 checks passed
All four lookup addresses. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input [1:0] addr,output reg [7:0] y); always @* case(addr)0:y=8'hA5;1:y=8'h3C;2:y=8'hF0;default:y=8'h0F;endcase endmoduletb.v
`timescale 1ns/1ns
module tb;
reg [1:0] addr;
wire [7:0] y;
top dut(.addr(addr),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
addr=0;#2; if (y !== 8'hA5) $fatal(1, "FAIL rom check 1");
addr=1;#2; if (y !== 8'h3C) $fatal(1, "FAIL rom check 2");
addr=2;#2; if (y !== 8'hF0) $fatal(1, "FAIL rom check 3");
addr=3;#2; if (y !== 8'h0F) $fatal(1, "FAIL rom check 4");
$display("PASS rom 4"); $finish;
end
endmodule
Parameterized hierarchy · 4 checks passed
Included parameter, helper module and generate loop. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
`include "width.vh"
module top(input [`WIDTH-1:0] a,output [`WIDTH-1:0] y); genvar i;generate for(i=0;i<`WIDTH;i=i+1)begin: bits invert u(.a(a[i]),.y(y[i]));end endgenerate endmoduletb.v
`timescale 1ns/1ns
module tb;
reg [3:0] a=0;
wire [3:0] y;
top dut(.a(a),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
a=0;#2; if (y !== 4'hF) $fatal(1, "FAIL hierarchy check 1");
a=5;#2; if (y !== 4'hA) $fatal(1, "FAIL hierarchy check 2");
a=10;#2; if (y !== 4'h5) $fatal(1, "FAIL hierarchy check 3");
a=15;#2; if (y !== 4'h0) $fatal(1, "FAIL hierarchy check 4");
$display("PASS hierarchy 4"); $finish;
end
endmodule
invert.v
module invert(input a,output y);assign y=~a;endmodulewidth.vh
`define WIDTH 4
Exact 64-bit register · 4 checks passed
Wide constants, carry and waveform precision. Repeat simulation agrees; forcing the output low triggers a failing assertion.
top.v
module top(input clk,rst,load,input [63:0] d,output reg [63:0] y); always @(posedge clk or posedge rst) if(rst)y<=0;else if(load)y<=d;else y<=y+1'b1;endmoduletb.v
`timescale 1ns/1ns
module tb;
reg clk=0,rst=0,load=0;reg [63:0] d=64'hFEDCBA9876543210;
wire [63:0] y;
top dut(.clk(clk),.rst(rst),.load(load),.d(d),.y(y));
initial begin
$dumpfile("wave.vcd"); $dumpvars(0,tb);
// FAULT_INSERT
#1 rst=1; #1 rst=0;
load=1; #1 clk=1; #1; if (y !== 64'hFEDCBA9876543210) $fatal(1, "FAIL wide-register check 1"); #1 clk=0;
load=0; #1 clk=1; #1; if (y !== 64'hFEDCBA9876543211) $fatal(1, "FAIL wide-register check 2"); #1 clk=0;
#1 clk=1; #1; if (y !== 64'hFEDCBA9876543212) $fatal(1, "FAIL wide-register check 3"); #1 clk=0;
#1 clk=1; #1; if (y !== 64'hFEDCBA9876543213) $fatal(1, "FAIL wide-register check 4"); #1 clk=0;
$display("PASS wide-register 4"); $finish;
end
endmodule