Skip to content

Commit

Permalink
testsuite/synth: add more sources for verilog generate
Browse files Browse the repository at this point in the history
  • Loading branch information
tgingold committed Feb 14, 2024
1 parent ac67b4c commit 1bf3814
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
14 changes: 14 additions & 0 deletions testsuite/synth/generate01/gen1.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module oa8(input [7:0] a,
input [7:0] b,
input [7:0] c,
output [7:0] o);

genvar i;

generate
for (i = 0; i < 8; i=i+1) begin
wire t = a[i] | b[i];
assign o[i] = t & c[i];
end
endgenerate
endmodule
12 changes: 12 additions & 0 deletions testsuite/synth/generate01/gen2.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module oa8(input [7:0] a,
input [7:0] b,
input [7:0] c,
output [7:0] o);

genvar i;

for (i = 0; i < 8; i=i+1) begin
wire t = a[i] | b[i];
assign o[i] = t & c[i];
end
endmodule
12 changes: 12 additions & 0 deletions testsuite/synth/generate01/gen3.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module oa8(input [7:0] a,
input [7:0] b,
input [7:0] c,
output [7:0] o);

genvar i;

for (i = 0; i < 8; i=i+1) begin
or a_or_b(t, a[i], b[i]);
assign o[i] = t & c[i];
end
endmodule
19 changes: 19 additions & 0 deletions testsuite/synth/generate01/gen4.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module oa1(input a,
input b,
input c,
output o);

assign o = (a | b) & c;
endmodule

module oa8(input [7:0] a,
input [7:0] b,
input [7:0] c,
output [7:0] o);

genvar i;

for (i = 0; i < 8; i=i+1) begin
oa1 gate(a[i], b[i], c[i], o[i]);
end
endmodule

0 comments on commit 1bf3814

Please sign in to comment.