3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-18 01:02:19 +00:00

rename: add -move-to-cell option in -wire mode

This commit is contained in:
Jannis Harder 2025-05-07 12:22:37 +02:00 committed by Emil J. Tywoniak
parent fb024c4d55
commit 77089a8d03
2 changed files with 80 additions and 9 deletions

View file

@ -0,0 +1,35 @@
read_verilog <<EOF
module top(input clk, rst, input [7:0] din, output [7:0] dout, input bin, output bout);
reg [7:0] dq;
reg bq;
always @(posedge clk, posedge rst) begin
if (rst) dq <= '0;
else dq <= din;
end
always @(posedge clk) bq <= bin;
assign dout = dq;
assign bout = bq;
endmodule
EOF
proc
hierarchy -top top
select -assert-count 1 t:$dff
select -assert-count 1 t:$adff
select -assert-count 0 t:$dff n:bq %i
select -assert-count 0 t:$adff n:dq %i
select -assert-count 1 w:bq
select -assert-count 1 w:dq
rename -wire -move-to-cell
select -assert-count 1 t:$dff
select -assert-count 1 t:$adff
select -assert-count 1 t:$dff n:bq %i
select -assert-count 1 t:$adff n:dq %i
select -assert-count 0 w:bq
select -assert-count 0 w:dq