3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 17:15:33 +00:00

tests: add testcase for clean-ing unused (* init *)

This commit is contained in:
Eddie Hung 2020-05-25 08:22:39 -07:00
parent 0a14e1e837
commit fe500f585c

View file

@ -11,3 +11,32 @@ EOT
clean
select -assert-count 1 a:init
select -assert-count 1 w:y a:init %i
design -reset
read_verilog <<EOT
module top(input clk, d, output q);
(* init=1'b0 *) wire private0;
reg private1 = 1'b1;
always @(posedge clk)
private1 <= d;
assign q = private1;
endmodule
EOT
proc
rename -hide w:private*
clean
select -assert-count 1 a:init=1'b1
select -assert-count 0 a:init=1'b0
design -reset
read_verilog <<EOT
module top;
(* init=1'b0 *) wire private;
wire public = private;
endmodule
EOT
rename -hide w:private
clean
select -assert-none w:*