Skip to content

Commit 29e8812

Browse files
authored
Merge pull request #4724 from YosysHQ/micko/blackbox_verific
verific: fix blackbox regression and add test case
2 parents 9512ec4 + df391f5 commit 29e8812

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

frontends/verific/verific.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,6 +3422,7 @@ struct VerificPass : public Pass {
34223422
RuntimeFlags::SetVar("veri_preserve_assignments", 1);
34233423
RuntimeFlags::SetVar("veri_preserve_comments", 1);
34243424
RuntimeFlags::SetVar("veri_preserve_drivers", 1);
3425+
RuntimeFlags::SetVar("veri_create_empty_box", 1);
34253426

34263427
// Workaround for VIPER #13851
34273428
RuntimeFlags::SetVar("veri_create_name_for_unnamed_gen_block", 1);

tests/verific/blackbox.ys

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
verific -sv -lib <<EOF
2+
module TEST_CELL(input clk, input a, input b, output reg c);
3+
parameter PATH = "DEFAULT";
4+
always @(posedge clk) begin
5+
if (PATH=="DEFAULT")
6+
c <= a;
7+
else
8+
c <= b;
9+
end
10+
11+
endmodule
12+
EOF
13+
14+
verific -sv <<EOF
15+
module top(input clk, input a, input b, output c, output d);
16+
TEST_CELL #(.PATH("TEST")) test1(.clk(clk),.a(a),.b(1'b1),.c(c));
17+
TEST_CELL #(.PATH("DEFAULT")) test2(.clk(clk),.a(a),.b(1'bx),.c(d));
18+
endmodule
19+
EOF
20+
21+
verific -import top
22+
hierarchy -top top
23+
stat
24+
select -assert-count 2 t:TEST_CELL

0 commit comments

Comments
 (0)