From 3eeefd23e38a53b28923749feaa9f57670e07d5c Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:08:13 +1300 Subject: [PATCH 1/2] Typo fixup(s) --- frontends/ast/genrtlil.cc | 2 +- kernel/driver.cc | 2 +- passes/pmgen/ice40_dsp.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index fe67f00c6..e1cf6fb57 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -2224,7 +2224,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint) else input_error("FATAL.\n"); } else { - input_error("Unknown elabortoon system task '%s'.\n", str.c_str()); + input_error("Unknown elaboration system task '%s'.\n", str.c_str()); } } break; diff --git a/kernel/driver.cc b/kernel/driver.cc index 58da1bc32..79dff7dda 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -356,7 +356,7 @@ int main(int argc, char **argv) printf(" -V\n"); printf(" print version information and exit\n"); printf("\n"); - printf("The option -S is an shortcut for calling the \"synth\" command, a default\n"); + printf("The option -S is a shortcut for calling the \"synth\" command, a default\n"); printf("script for transforming the Verilog input to a gate-level netlist. For example:\n"); printf("\n"); printf(" yosys -o output.blif -S input.v\n"); diff --git a/passes/pmgen/ice40_dsp.cc b/passes/pmgen/ice40_dsp.cc index 24134b1fb..5720c9b1e 100644 --- a/passes/pmgen/ice40_dsp.cc +++ b/passes/pmgen/ice40_dsp.cc @@ -289,7 +289,7 @@ struct Ice40DspPass : public Pass { log("\n"); log("Pack input registers (A, B, {C,D}; with optional hold), pipeline registers\n"); log("({F,J,K,G}, H), output registers (O -- full 32-bits or lower 16-bits only; with\n"); - log("optional hold), and post-adder into into the SB_MAC16 resource.\n"); + log("optional hold), and post-adder into the SB_MAC16 resource.\n"); log("\n"); log("Multiply-accumulate operations using the post-adder with feedback on the {C,D}\n"); log("input will be folded into the DSP. In this scenario only, resetting the\n"); From ff10aeebd68a1906703cc4a63b70ca0f30474c0d Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:33:18 +1300 Subject: [PATCH 2/2] 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`. --- techlibs/anlogic/synth_anlogic.cc | 10 ++++++---- techlibs/ecp5/synth_ecp5.cc | 10 ++++++---- techlibs/efinix/synth_efinix.cc | 10 +++++++--- techlibs/fabulous/synth_fabulous.cc | 4 ++-- techlibs/gowin/synth_gowin.cc | 10 ++++++---- techlibs/ice40/synth_ice40.cc | 10 ++++++---- techlibs/lattice/synth_lattice.cc | 10 ++++++---- techlibs/nexus/synth_nexus.cc | 10 ++++++---- 8 files changed, 45 insertions(+), 29 deletions(-) diff --git a/techlibs/anlogic/synth_anlogic.cc b/techlibs/anlogic/synth_anlogic.cc index a3c1e0434..c72e7f2a1 100644 --- a/techlibs/anlogic/synth_anlogic.cc +++ b/techlibs/anlogic/synth_anlogic.cc @@ -169,12 +169,14 @@ struct SynthAnlogicPass : public ScriptPass if (check_label("map_ram")) { std::string args = ""; - if (nobram) - args += " -no-auto-block"; - if (nolutram) - args += " -no-auto-distributed"; if (help_mode) 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("techmap -map +/anlogic/lutrams_map.v -map +/anlogic/brams_map.v"); } diff --git a/techlibs/ecp5/synth_ecp5.cc b/techlibs/ecp5/synth_ecp5.cc index f6215987f..6e518f5d1 100644 --- a/techlibs/ecp5/synth_ecp5.cc +++ b/techlibs/ecp5/synth_ecp5.cc @@ -308,12 +308,14 @@ struct SynthEcp5Pass : public ScriptPass if (check_label("map_ram")) { std::string args = ""; - if (nobram) - args += " -no-auto-block"; - if (nolutram) - args += " -no-auto-distributed"; if (help_mode) 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("techmap -map +/ecp5/lutrams_map.v -map +/ecp5/brams_map.v"); } diff --git a/techlibs/efinix/synth_efinix.cc b/techlibs/efinix/synth_efinix.cc index bbc389444..419bc2f88 100644 --- a/techlibs/efinix/synth_efinix.cc +++ b/techlibs/efinix/synth_efinix.cc @@ -161,9 +161,13 @@ struct SynthEfinixPass : public ScriptPass if (check_label("map_ram")) { std::string args = ""; - if (nobram) - args += " -no-auto-block"; - run("memory_libmap -lib +/efinix/brams.txt" + args); + if (help_mode) + args += " [-no-auto-block]"; + 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"); } diff --git a/techlibs/fabulous/synth_fabulous.cc b/techlibs/fabulous/synth_fabulous.cc index b4a7ab2dc..8d2fb1471 100644 --- a/techlibs/fabulous/synth_fabulous.cc +++ b/techlibs/fabulous/synth_fabulous.cc @@ -320,7 +320,7 @@ struct SynthPass : public ScriptPass run("opt_clean"); } - if (check_label("map_ram")) { + if (check_label("map_ram", "(unless -noregfile)")) { // RegFile extraction if (!noregfile) { run("memory_libmap -lib +/fabulous/ram_regfile.txt"); @@ -342,7 +342,7 @@ struct SynthPass : public ScriptPass } if (check_label("map_iopad", "(if -iopad)")) { - if (iopad) { + if (iopad || help_mode) { run("opt -full"); run("iopadmap -bits -outpad $__FABULOUS_OBUF I:PAD -inpad $__FABULOUS_IBUF O:PAD " "-toutpad IO_1_bidirectional_frame_config_pass ~T:I:PAD " diff --git a/techlibs/gowin/synth_gowin.cc b/techlibs/gowin/synth_gowin.cc index 85022c1cf..48b7563b1 100644 --- a/techlibs/gowin/synth_gowin.cc +++ b/techlibs/gowin/synth_gowin.cc @@ -230,12 +230,14 @@ struct SynthGowinPass : public ScriptPass if (check_label("map_ram")) { std::string args = ""; - if (nobram) - args += " -no-auto-block"; - if (nolutram) - args += " -no-auto-distributed"; if (help_mode) 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("techmap -map +/gowin/lutrams_map.v -map +/gowin/brams_map.v"); } diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc index 4c691c7a5..818323892 100644 --- a/techlibs/ice40/synth_ice40.cc +++ b/techlibs/ice40/synth_ice40.cc @@ -353,12 +353,14 @@ struct SynthIce40Pass : public ScriptPass if (check_label("map_ram")) { std::string args = ""; - if (!spram) - args += " -no-auto-huge"; - if (nobram) - args += " -no-auto-block"; if (help_mode) 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("techmap -map +/ice40/brams_map.v -map +/ice40/spram_map.v"); run("ice40_braminit"); diff --git a/techlibs/lattice/synth_lattice.cc b/techlibs/lattice/synth_lattice.cc index cc5821ad8..16a068b07 100644 --- a/techlibs/lattice/synth_lattice.cc +++ b/techlibs/lattice/synth_lattice.cc @@ -373,12 +373,14 @@ struct SynthLatticePass : public ScriptPass if (check_label("map_ram")) { std::string args = ""; - if (nobram) - args += " -no-auto-block"; - if (nolutram) - args += " -no-auto-distributed"; if (help_mode) 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("techmap -map +/lattice/lutrams_map.v -map +/lattice/brams_map" + brams_map + ".v"); } diff --git a/techlibs/nexus/synth_nexus.cc b/techlibs/nexus/synth_nexus.cc index 6fd15ba55..2935fbd3b 100644 --- a/techlibs/nexus/synth_nexus.cc +++ b/techlibs/nexus/synth_nexus.cc @@ -300,12 +300,14 @@ struct SynthNexusPass : public ScriptPass { std::string args = ""; args += " -no-auto-huge"; - if (nobram) - args += " -no-auto-block"; - if (nolutram) - args += " -no-auto-distributed"; if (help_mode) 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("techmap -map +/nexus/lutrams_map.v -map +/nexus/brams_map.v -map +/nexus/lrams_map.v"); }