aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/machxo2
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2020-12-12 18:09:52 -0500
committerMarcelina Koƛcielnicka <mwk@0x04.net>2021-02-23 17:39:58 +0100
commit3674eb34d4e3719798a274a251150a7687064422 (patch)
treecd0b6379d0ff5d87522e0c1ba86b0d64bc072302 /techlibs/machxo2
parent124780ecd9a74e9477313975b5e06e3fdd902573 (diff)
downloadyosys-3674eb34d4e3719798a274a251150a7687064422.tar.gz
yosys-3674eb34d4e3719798a274a251150a7687064422.tar.bz2
yosys-3674eb34d4e3719798a274a251150a7687064422.zip
machxo2: Use attrmvcp pass to move LOC and src attributes from ports/wires to IO cells.
Diffstat (limited to 'techlibs/machxo2')
-rw-r--r--techlibs/machxo2/cells_sim.v12
-rw-r--r--techlibs/machxo2/synth_machxo2.cc6
2 files changed, 17 insertions, 1 deletions
diff --git a/techlibs/machxo2/cells_sim.v b/techlibs/machxo2/cells_sim.v
index 76de39299..3dd41334e 100644
--- a/techlibs/machxo2/cells_sim.v
+++ b/techlibs/machxo2/cells_sim.v
@@ -188,3 +188,15 @@ module OSCH #(
output SEDSTDBY
);
endmodule
+
+// IO- "$__" cells for the iopadmap pass. These are temporary cells not meant
+// to be instantiated by the end user. They are required in this file for
+// attrmvcp to work.
+(* blackbox *)
+module \$__FACADE_OUTPAD (input I, output O); endmodule
+(* blackbox *)
+module \$__FACADE_INPAD (input I, output O); endmodule
+(* blackbox *)
+module \$__FACADE_TOUTPAD (input I, OE, output O); endmodule
+(* blackbox *)
+module \$__FACADE_TINOUTPAD (input I, OE, output O, inout B); endmodule
diff --git a/techlibs/machxo2/synth_machxo2.cc b/techlibs/machxo2/synth_machxo2.cc
index c9ab23426..ea9b2a0e8 100644
--- a/techlibs/machxo2/synth_machxo2.cc
+++ b/techlibs/machxo2/synth_machxo2.cc
@@ -154,7 +154,7 @@ struct SynthMachXO2Pass : public ScriptPass
{
if (check_label("begin"))
{
- run("read_verilog -lib +/machxo2/cells_sim.v");
+ run("read_verilog -lib -icells +/machxo2/cells_sim.v");
run(stringf("hierarchy -check %s", help_mode ? "-top <top>" : top_opt.c_str()));
}
@@ -184,7 +184,11 @@ struct SynthMachXO2Pass : public ScriptPass
if (check_label("map_ios"))
{
if (!noiopad || help_mode)
+ {
run("iopadmap -bits -outpad $__FACADE_OUTPAD I:O -inpad $__FACADE_INPAD O:I -toutpad $__FACADE_TOUTPAD OE:I:O -tinoutpad $__FACADE_TINOUTPAD OE:O:I:B A:top", "(skip if '-noiopad')");
+ run("attrmvcp -attr src -attr LOC t:$__FACADE_OUTPAD %x:+[O] t:$__FACADE_TOUTPAD %x:+[O] t:$__FACADE_TINOUTPAD %x:+[B]", "(skip if '-noiopad')");
+ run("attrmvcp -attr src -attr LOC -driven t:$__FACADE_INPAD %x:+[I]", "(skip if '-noiopad')");
+ }
}
if (check_label("map_ffs"))