mirror of https://github.com/YosysHQ/yosys.git
Add read_liberty -wb
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
a31c8a82be
commit
b506f398dd
|
@ -464,6 +464,9 @@ struct LibertyFrontend : public Frontend {
|
||||||
log(" -lib\n");
|
log(" -lib\n");
|
||||||
log(" only create empty blackbox modules\n");
|
log(" only create empty blackbox modules\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
log(" -wb\n");
|
||||||
|
log(" mark imported cells as whiteboxes\n");
|
||||||
|
log("\n");
|
||||||
log(" -nooverwrite\n");
|
log(" -nooverwrite\n");
|
||||||
log(" ignore re-definitions of modules. (the default behavior is to\n");
|
log(" ignore re-definitions of modules. (the default behavior is to\n");
|
||||||
log(" create an error message if the existing module is not a blackbox\n");
|
log(" create an error message if the existing module is not a blackbox\n");
|
||||||
|
@ -489,6 +492,7 @@ struct LibertyFrontend : public Frontend {
|
||||||
void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) override
|
void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) override
|
||||||
{
|
{
|
||||||
bool flag_lib = false;
|
bool flag_lib = false;
|
||||||
|
bool flag_wb = false;
|
||||||
bool flag_nooverwrite = false;
|
bool flag_nooverwrite = false;
|
||||||
bool flag_overwrite = false;
|
bool flag_overwrite = false;
|
||||||
bool flag_ignore_miss_func = false;
|
bool flag_ignore_miss_func = false;
|
||||||
|
@ -505,6 +509,10 @@ struct LibertyFrontend : public Frontend {
|
||||||
flag_lib = true;
|
flag_lib = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (arg == "-wb") {
|
||||||
|
flag_wb = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (arg == "-ignore_redef" || arg == "-nooverwrite") {
|
if (arg == "-ignore_redef" || arg == "-nooverwrite") {
|
||||||
flag_nooverwrite = true;
|
flag_nooverwrite = true;
|
||||||
flag_overwrite = false;
|
flag_overwrite = false;
|
||||||
|
@ -535,6 +543,9 @@ struct LibertyFrontend : public Frontend {
|
||||||
}
|
}
|
||||||
extra_args(f, filename, args, argidx);
|
extra_args(f, filename, args, argidx);
|
||||||
|
|
||||||
|
if (flag_wb && flag_lib)
|
||||||
|
log_error("-wb and -lib cannot be specified together!\n");
|
||||||
|
|
||||||
LibertyParser parser(*f);
|
LibertyParser parser(*f);
|
||||||
int cell_count = 0;
|
int cell_count = 0;
|
||||||
|
|
||||||
|
@ -572,6 +583,9 @@ struct LibertyFrontend : public Frontend {
|
||||||
if (flag_lib)
|
if (flag_lib)
|
||||||
module->set_bool_attribute(ID::blackbox);
|
module->set_bool_attribute(ID::blackbox);
|
||||||
|
|
||||||
|
if (flag_wb)
|
||||||
|
module->set_bool_attribute(ID::whitebox);
|
||||||
|
|
||||||
for (auto &attr : attributes)
|
for (auto &attr : attributes)
|
||||||
module->attributes[attr] = 1;
|
module->attributes[attr] = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue