diff --git a/techlibs/fabulous/CMakeLists.txt b/techlibs/fabulous/CMakeLists.txt index 7794a01e4..ff6c08a0d 100644 --- a/techlibs/fabulous/CMakeLists.txt +++ b/techlibs/fabulous/CMakeLists.txt @@ -30,5 +30,4 @@ yosys_pass(synth_fabulous DATA_DIR fabulous DATA_FILES - cells_map.v ) diff --git a/techlibs/fabulous/synth_fabulous.cc b/techlibs/fabulous/synth_fabulous.cc index f79bf4a73..d77dd54a9 100644 --- a/techlibs/fabulous/synth_fabulous.cc +++ b/techlibs/fabulous/synth_fabulous.cc @@ -57,6 +57,9 @@ struct SynthPass : public ScriptPass { log(" -ff \n"); log(" convert FFs to cell types via dfflegalize (can be specified multiple times).\n"); log("\n"); + log(" -cells-map \n"); + log(" map luts to corresponding cells.\n"); + log("\n"); log(" -arith-map \n"); log(" mapping file for arithmetic operations.\n"); log("\n"); @@ -117,7 +120,7 @@ struct SynthPass : public ScriptPass { log("\n"); } - string top_module, json_file, blif_file, fsm_opts, memory_opts, carry_mode, arith_map, clkbuf_map, multiplier_map; + string top_module, json_file, blif_file, fsm_opts, memory_opts, carry_mode, cells_map, arith_map, clkbuf_map, multiplier_map; std::vector extra_plib, extra_map, extra_mlibmap; std::vector> extra_ffs; @@ -183,6 +186,10 @@ struct SynthPass : public ScriptPass { extra_ffs.push_back({cell, init}); continue; } + if (args[argidx] == "-cells-map" && argidx + 1 < args.size()) { + cells_map = args[++argidx]; + continue; + } if (args[argidx] == "-arith-map" && argidx + 1 < args.size()) { arith_map = args[++argidx]; continue; @@ -409,7 +416,11 @@ struct SynthPass : public ScriptPass { } if (check_label("map_cells")) { - run(stringf("techmap -D LUT_K=%d -map +/fabulous/cells_map.v", lut)); + if (help_mode) { + run("techmap -D LUT_K= -map "); + } else if (!cells_map.empty()) { + run(stringf("techmap -D LUT_K=%d -map %s", lut, cells_map.c_str())); + } run("clean"); } diff --git a/techlibs/fabulous/cells_map.v b/tests/arch/fabulous/cells_map.v similarity index 100% rename from techlibs/fabulous/cells_map.v rename to tests/arch/fabulous/cells_map.v