Skip to content

Commit

Permalink
add io mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Mar 11, 2024
1 parent 023ddff commit 28c2817
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions techlibs/nanoxplore/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
8 changes: 8 additions & 0 deletions techlibs/nanoxplore/io_map.v
Original file line number Diff line number Diff line change
@@ -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

18 changes: 12 additions & 6 deletions techlibs/nanoxplore/synth_nanoxplore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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
{
Expand All @@ -105,7 +105,7 @@ struct SynthNanoXplorePass : public ScriptPass
nolutram = false;
nobram = false;
nodsp = false;
noiopad = false;
iopad = false;
}

void execute(std::vector<std::string> args, RTLIL::Design *design) override
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit 28c2817

Please sign in to comment.