mirror of https://github.com/YosysHQ/yosys.git
Added "nlutmap -assert"
This commit is contained in:
parent
52b0b4e31e
commit
99edf24966
|
@ -26,6 +26,7 @@ PRIVATE_NAMESPACE_BEGIN
|
||||||
struct NlutmapConfig
|
struct NlutmapConfig
|
||||||
{
|
{
|
||||||
vector<int> luts;
|
vector<int> luts;
|
||||||
|
bool assert_mode = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NlutmapWorker
|
struct NlutmapWorker
|
||||||
|
@ -116,6 +117,12 @@ struct NlutmapWorker
|
||||||
available_luts.back() += n_luts;
|
available_luts.back() += n_luts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.assert_mode) {
|
||||||
|
for (auto cell : module->cells())
|
||||||
|
if (cell->type == "$lut" && !mapped_cells.count(cell))
|
||||||
|
log_error("Insufficient number of LUTs to map all logic cells!\n");
|
||||||
|
}
|
||||||
|
|
||||||
run_abc(0);
|
run_abc(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -135,6 +142,9 @@ struct NlutmapPass : public Pass {
|
||||||
log(" The number of LUTs with 1, 2, 3, ... inputs that are\n");
|
log(" The number of LUTs with 1, 2, 3, ... inputs that are\n");
|
||||||
log(" available in the target architecture.\n");
|
log(" available in the target architecture.\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
log(" -assert\n");
|
||||||
|
log(" Create an error if not all logic can be mapped\n");
|
||||||
|
log("\n");
|
||||||
log("Excess logic that does not fit into the specified LUTs is mapped back\n");
|
log("Excess logic that does not fit into the specified LUTs is mapped back\n");
|
||||||
log("to generic logic gates ($_AND_, etc.).\n");
|
log("to generic logic gates ($_AND_, etc.).\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
@ -156,6 +166,10 @@ struct NlutmapPass : public Pass {
|
||||||
config.luts.push_back(atoi(token.c_str()));
|
config.luts.push_back(atoi(token.c_str()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (args[argidx] == "-assert") {
|
||||||
|
config.assert_mode = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
extra_args(args, argidx, design);
|
extra_args(args, argidx, design);
|
||||||
|
|
|
@ -167,9 +167,9 @@ struct SynthGreenPAK4Pass : public ScriptPass
|
||||||
|
|
||||||
if (check_label("map_luts"))
|
if (check_label("map_luts"))
|
||||||
{
|
{
|
||||||
if (help_mode || part == "SLG46140V") run("nlutmap -luts 0,6,8,2", " (for -part SLG46140V)");
|
if (help_mode || part == "SLG46140V") run("nlutmap -assert -luts 0,6,8,2", " (for -part SLG46140V)");
|
||||||
if (help_mode || part == "SLG46620V") run("nlutmap -luts 2,8,16,2", "(for -part SLG46620V)");
|
if (help_mode || part == "SLG46620V") run("nlutmap -assert -luts 2,8,16,2", "(for -part SLG46620V)");
|
||||||
if (help_mode || part == "SLG46621V") run("nlutmap -luts 2,8,16,2", "(for -part SLG46621V)");
|
if (help_mode || part == "SLG46621V") run("nlutmap -assert -luts 2,8,16,2", "(for -part SLG46621V)");
|
||||||
run("clean");
|
run("clean");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue