diff --git a/techlibs/nanoxplore/Makefile.inc b/techlibs/nanoxplore/Makefile.inc index d7331f5dee4..030cabd64b7 100644 --- a/techlibs/nanoxplore/Makefile.inc +++ b/techlibs/nanoxplore/Makefile.inc @@ -7,3 +7,4 @@ $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_bb.v)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_map.v)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_sim.v)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/drams.txt)) +$(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/io_map.v)) diff --git a/techlibs/nanoxplore/io_map.v b/techlibs/nanoxplore/io_map.v new file mode 100644 index 00000000000..42fac461903 --- /dev/null +++ b/techlibs/nanoxplore/io_map.v @@ -0,0 +1,8 @@ +module \$__BEYOND_IBUF (input PAD, output O); + NX_IOB_I _TECHMAP_REPLACE_ (.IO(PAD), .O(O), .C(1'b0)); +endmodule + +module \$__BEYOND_OBUF (output PAD, input I); + NX_IOB_O _TECHMAP_REPLACE_ (.IO(PAD), .I(I), .C(1'b1)); +endmodule + diff --git a/techlibs/nanoxplore/synth_nanoxplore.cc b/techlibs/nanoxplore/synth_nanoxplore.cc index 97c4a21a4ba..d5e77daaa5d 100644 --- a/techlibs/nanoxplore/synth_nanoxplore.cc +++ b/techlibs/nanoxplore/synth_nanoxplore.cc @@ -82,8 +82,8 @@ struct SynthNanoXplorePass : public ScriptPass log(" -nodsp\n"); log(" do not map multipliers to NX_DSP cells\n"); log("\n"); - log(" -noiopad\n"); - log(" do not instantiate IO buffers\n"); + log(" -iopad\n"); + log(" insert IO buffers\n"); log("\n"); log("\n"); log("The following commands are executed by this synthesis command:\n"); @@ -92,7 +92,7 @@ struct SynthNanoXplorePass : public ScriptPass } string top_opt, json_file, family; - bool flatten, abc9, nocy, nolutram, nobram, nodsp, noiopad; + bool flatten, abc9, nocy, nolutram, nobram, nodsp, iopad; void clear_flags() override { @@ -105,7 +105,7 @@ struct SynthNanoXplorePass : public ScriptPass nolutram = false; nobram = false; nodsp = false; - noiopad = false; + iopad = false; } void execute(std::vector args, RTLIL::Design *design) override @@ -164,8 +164,8 @@ struct SynthNanoXplorePass : public ScriptPass nodsp = true; continue; } - if (args[argidx] == "-noiopad") { - noiopad = true; + if (args[argidx] == "-iopad") { + iopad = true; continue; } break; @@ -240,6 +240,12 @@ struct SynthNanoXplorePass : public ScriptPass run("techmap"); else run("techmap -map +/techmap.v -map +/nanoxplore/arith_map.v"); + if (help_mode || iopad) { + run("iopadmap -bits -outpad $__BEYOND_OBUF I:PAD -inpad $__BEYOND_IBUF O:PAD A:top", "(only if '-iopad')"); + run("techmap -map +/nanoxplore/io_map.v"); + run("attrmvcp -attr src -attr LOC t:NX_IOB_O n:*"); + run("attrmvcp -attr src -attr LOC -driven t:NX_IOB_I n:*"); + } run("opt -fast"); }