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

iopadmap: Look harder for already-present buffers. (#1731)

iopadmap: Look harder for already-present buffers.

Fixes #1720.
This commit is contained in:
Marcelina Kościelnicka 2020-03-02 21:40:09 +01:00 committed by GitHub
parent 4f889b2f57
commit 968956badb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 77 additions and 18 deletions

View file

@ -4,12 +4,15 @@ module obuf (input i, (* iopad_external_pin *) output o); endmodule
module obuft (input i, input oe, (* iopad_external_pin *) output o); endmodule
module iobuf (input i, input oe, output o, (* iopad_external_pin *) inout io); endmodule
module buf_inside (input i, output o);
obuf b (.i(i), .o(o));
endmodule
module a(input i, output o);
assign o = i;
endmodule
module b(input i, output o);
assign o = i;
ibuf b (.i(i), .o(o));
endmodule
@ -42,12 +45,22 @@ assign io = i;
assign o = io;
endmodule
module i(input i, output o);
buf_inside b (.i(i), .o(o));
endmodule
module j(input i, output o);
wire tmp;
obuf b (.i(i), .o(tmp));
assign o = tmp;
endmodule
EOT
opt_clean
tribuf
simplemap
iopadmap -bits -inpad ibuf o:i -outpad obuf i:o -toutpad obuft oe:i:o -tinoutpad iobuf oe:o:i:io
iopadmap -bits -inpad ibuf o:i -outpad obuf i:o -toutpad obuft oe:i:o -tinoutpad iobuf oe:o:i:io a b c d e f g h i j
opt_clean
select -assert-count 1 a/t:ibuf
@ -121,6 +134,12 @@ select -assert-count 1 h/t:ibuf
select -assert-count 1 h/t:iobuf
select -assert-count 1 h/t:obuf
select -assert-count 1 i/t:ibuf
select -assert-count 0 i/t:obuf
select -assert-count 1 j/t:ibuf
select -assert-count 1 j/t:obuf
# Check that \init attributes get moved from output buffer
# to buffer input