diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-02-13 12:05:14 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-02-13 12:05:14 -0800 |
commit | ebb11bcea4ab5d2aed90d640904bf490a3285fb8 (patch) | |
tree | 627f9bedfdada300e725640a4acb07dab8952722 /tests/techmap/iopadmap.ys | |
parent | cb7bc6a12fee1d948b7f91fd37f326dbd4f5ca47 (diff) | |
download | yosys-ebb11bcea4ab5d2aed90d640904bf490a3285fb8.tar.gz yosys-ebb11bcea4ab5d2aed90d640904bf490a3285fb8.tar.bz2 yosys-ebb11bcea4ab5d2aed90d640904bf490a3285fb8.zip |
iopadmap: move \init attributes from outpad output to its input
Diffstat (limited to 'tests/techmap/iopadmap.ys')
-rw-r--r-- | tests/techmap/iopadmap.ys | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/techmap/iopadmap.ys b/tests/techmap/iopadmap.ys index c058d1607..b787bb55f 100644 --- a/tests/techmap/iopadmap.ys +++ b/tests/techmap/iopadmap.ys @@ -120,3 +120,40 @@ select -assert-count 1 g/t:iobuf select -assert-count 1 h/t:ibuf select -assert-count 1 h/t:iobuf select -assert-count 1 h/t:obuf + + +# Check that \init attributes get moved from output buffer +# to buffer input +design -reset +read_verilog << EOT +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 sub(input i, output o); endmodule + +module a(input i, (* init=1'b1 *) output o); +sub s(.i(i), .o(o)); +endmodule + +module b(input i, oe, output o); +(* init=1'b1 *) wire w; +sub s(.i(i), .o(w)); +assign o = oe ? w : 1'bz; +endmodule + +module c(input i, oe, inout io); +(* init=1'b1 *) wire w; +sub s(.i(i), .o(w)); +assign io = oe ? w : 1'bz; +endmodule +EOT +opt_clean +tribuf +simplemap +iopadmap -bits -outpad obuf i:o -toutpad obuft oe:i:o -tinoutpad iobuf oe:o:i:io +select -assert-count 1 a/c:s %co a/a:init=1'1 %i +select -assert-count 1 a/a:init=1'1 +select -assert-count 1 b/c:s %co b/a:init=1'1 %i +select -assert-count 1 b/a:init=1'1 +select -assert-count 1 c/c:s %co c/a:init=1'1 %i +select -assert-count 1 c/a:init=1'1 |