add io mapping

This commit is contained in:
Miodrag Milanovic 2024-03-01 13:52:11 +01:00
parent 65d2ebac9d
commit 4c1f84a686
3 changed files with 21 additions and 6 deletions

View File

@ -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_map.v))
$(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_sim.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/drams.txt))
$(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/io_map.v))

View File

@ -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

View File

@ -82,8 +82,8 @@ struct SynthNanoXplorePass : public ScriptPass
log(" -nodsp\n"); log(" -nodsp\n");
log(" do not map multipliers to NX_DSP cells\n"); log(" do not map multipliers to NX_DSP cells\n");
log("\n"); log("\n");
log(" -noiopad\n"); log(" -iopad\n");
log(" do not instantiate IO buffers\n"); log(" insert IO buffers\n");
log("\n"); log("\n");
log("\n"); log("\n");
log("The following commands are executed by this synthesis command:\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; 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 void clear_flags() override
{ {
@ -105,7 +105,7 @@ struct SynthNanoXplorePass : public ScriptPass
nolutram = false; nolutram = false;
nobram = false; nobram = false;
nodsp = false; nodsp = false;
noiopad = false; iopad = false;
} }
void execute(std::vector<std::string> args, RTLIL::Design *design) override void execute(std::vector<std::string> args, RTLIL::Design *design) override
@ -164,8 +164,8 @@ struct SynthNanoXplorePass : public ScriptPass
nodsp = true; nodsp = true;
continue; continue;
} }
if (args[argidx] == "-noiopad") { if (args[argidx] == "-iopad") {
noiopad = true; iopad = true;
continue; continue;
} }
break; break;
@ -240,6 +240,12 @@ struct SynthNanoXplorePass : public ScriptPass
run("techmap"); run("techmap");
else else
run("techmap -map +/techmap.v -map +/nanoxplore/arith_map.v"); 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"); run("opt -fast");
} }