3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-12 12:08:19 +00:00

Fix some synth_* help messages

Mostly memory_libmap arg checks; puts the checks into an else block on the `if (help_mode)` check to avoid cases like `synth_ice40` listing `-no-auto-huge [-no-auto-huge]`.
Also fix `map_iopad` section being empty in `synth_fabulous`.
This commit is contained in:
Krystine Sherwin 2024-03-18 11:33:18 +13:00
parent 3eeefd23e3
commit ff10aeebd6
No known key found for this signature in database
8 changed files with 45 additions and 29 deletions

View file

@ -169,12 +169,14 @@ struct SynthAnlogicPass : public ScriptPass
if (check_label("map_ram")) if (check_label("map_ram"))
{ {
std::string args = ""; std::string args = "";
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
if (help_mode) if (help_mode)
args += " [-no-auto-block] [-no-auto-distributed]"; args += " [-no-auto-block] [-no-auto-distributed]";
else {
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
}
run("memory_libmap -lib +/anlogic/lutrams.txt -lib +/anlogic/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run("memory_libmap -lib +/anlogic/lutrams.txt -lib +/anlogic/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)");
run("techmap -map +/anlogic/lutrams_map.v -map +/anlogic/brams_map.v"); run("techmap -map +/anlogic/lutrams_map.v -map +/anlogic/brams_map.v");
} }

View file

@ -308,12 +308,14 @@ struct SynthEcp5Pass : public ScriptPass
if (check_label("map_ram")) if (check_label("map_ram"))
{ {
std::string args = ""; std::string args = "";
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
if (help_mode) if (help_mode)
args += " [-no-auto-block] [-no-auto-distributed]"; args += " [-no-auto-block] [-no-auto-distributed]";
else {
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
}
run("memory_libmap -lib +/ecp5/lutrams.txt -lib +/ecp5/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run("memory_libmap -lib +/ecp5/lutrams.txt -lib +/ecp5/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)");
run("techmap -map +/ecp5/lutrams_map.v -map +/ecp5/brams_map.v"); run("techmap -map +/ecp5/lutrams_map.v -map +/ecp5/brams_map.v");
} }

View file

@ -161,9 +161,13 @@ struct SynthEfinixPass : public ScriptPass
if (check_label("map_ram")) if (check_label("map_ram"))
{ {
std::string args = ""; std::string args = "";
if (nobram) if (help_mode)
args += " -no-auto-block"; args += " [-no-auto-block]";
run("memory_libmap -lib +/efinix/brams.txt" + args); else {
if (nobram)
args += " -no-auto-block";
}
run("memory_libmap -lib +/efinix/brams.txt" + args, "(-no-auto-block if -nobram)");
run("techmap -map +/efinix/brams_map.v"); run("techmap -map +/efinix/brams_map.v");
} }

View file

@ -320,7 +320,7 @@ struct SynthPass : public ScriptPass
run("opt_clean"); run("opt_clean");
} }
if (check_label("map_ram")) { if (check_label("map_ram", "(unless -noregfile)")) {
// RegFile extraction // RegFile extraction
if (!noregfile) { if (!noregfile) {
run("memory_libmap -lib +/fabulous/ram_regfile.txt"); run("memory_libmap -lib +/fabulous/ram_regfile.txt");
@ -342,7 +342,7 @@ struct SynthPass : public ScriptPass
} }
if (check_label("map_iopad", "(if -iopad)")) { if (check_label("map_iopad", "(if -iopad)")) {
if (iopad) { if (iopad || help_mode) {
run("opt -full"); run("opt -full");
run("iopadmap -bits -outpad $__FABULOUS_OBUF I:PAD -inpad $__FABULOUS_IBUF O:PAD " run("iopadmap -bits -outpad $__FABULOUS_OBUF I:PAD -inpad $__FABULOUS_IBUF O:PAD "
"-toutpad IO_1_bidirectional_frame_config_pass ~T:I:PAD " "-toutpad IO_1_bidirectional_frame_config_pass ~T:I:PAD "

View file

@ -230,12 +230,14 @@ struct SynthGowinPass : public ScriptPass
if (check_label("map_ram")) if (check_label("map_ram"))
{ {
std::string args = ""; std::string args = "";
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
if (help_mode) if (help_mode)
args += " [-no-auto-block] [-no-auto-distributed]"; args += " [-no-auto-block] [-no-auto-distributed]";
else {
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
}
run("memory_libmap -lib +/gowin/lutrams.txt -lib +/gowin/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run("memory_libmap -lib +/gowin/lutrams.txt -lib +/gowin/brams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)");
run("techmap -map +/gowin/lutrams_map.v -map +/gowin/brams_map.v"); run("techmap -map +/gowin/lutrams_map.v -map +/gowin/brams_map.v");
} }

View file

@ -353,12 +353,14 @@ struct SynthIce40Pass : public ScriptPass
if (check_label("map_ram")) if (check_label("map_ram"))
{ {
std::string args = ""; std::string args = "";
if (!spram)
args += " -no-auto-huge";
if (nobram)
args += " -no-auto-block";
if (help_mode) if (help_mode)
args += " [-no-auto-huge] [-no-auto-block]"; args += " [-no-auto-huge] [-no-auto-block]";
else {
if (!spram)
args += " -no-auto-huge";
if (nobram)
args += " -no-auto-block";
}
run("memory_libmap -lib +/ice40/brams.txt -lib +/ice40/spram.txt" + args, "(-no-auto-huge unless -spram, -no-auto-block if -nobram)"); run("memory_libmap -lib +/ice40/brams.txt -lib +/ice40/spram.txt" + args, "(-no-auto-huge unless -spram, -no-auto-block if -nobram)");
run("techmap -map +/ice40/brams_map.v -map +/ice40/spram_map.v"); run("techmap -map +/ice40/brams_map.v -map +/ice40/spram_map.v");
run("ice40_braminit"); run("ice40_braminit");

View file

@ -373,12 +373,14 @@ struct SynthLatticePass : public ScriptPass
if (check_label("map_ram")) if (check_label("map_ram"))
{ {
std::string args = ""; std::string args = "";
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
if (help_mode) if (help_mode)
args += " [-no-auto-block] [-no-auto-distributed]"; args += " [-no-auto-block] [-no-auto-distributed]";
else {
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
}
run("memory_libmap -lib +/lattice/lutrams.txt -lib +/lattice/brams" + brams_map + ".txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run("memory_libmap -lib +/lattice/lutrams.txt -lib +/lattice/brams" + brams_map + ".txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)");
run("techmap -map +/lattice/lutrams_map.v -map +/lattice/brams_map" + brams_map + ".v"); run("techmap -map +/lattice/lutrams_map.v -map +/lattice/brams_map" + brams_map + ".v");
} }

View file

@ -300,12 +300,14 @@ struct SynthNexusPass : public ScriptPass
{ {
std::string args = ""; std::string args = "";
args += " -no-auto-huge"; args += " -no-auto-huge";
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
if (help_mode) if (help_mode)
args += " [-no-auto-block] [-no-auto-distributed]"; args += " [-no-auto-block] [-no-auto-distributed]";
else {
if (nobram)
args += " -no-auto-block";
if (nolutram)
args += " -no-auto-distributed";
}
run("memory_libmap -lib +/nexus/lutrams.txt -lib +/nexus/brams.txt -lib +/nexus/lrams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)"); run("memory_libmap -lib +/nexus/lutrams.txt -lib +/nexus/brams.txt -lib +/nexus/lrams.txt" + args, "(-no-auto-block if -nobram, -no-auto-distributed if -nolutram)");
run("techmap -map +/nexus/lutrams_map.v -map +/nexus/brams_map.v -map +/nexus/lrams_map.v"); run("techmap -map +/nexus/lutrams_map.v -map +/nexus/brams_map.v -map +/nexus/lrams_map.v");
} }