mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Added "write_blif -cname" mode
This commit is contained in:
parent
c3fd03d722
commit
4393a8ffbf
|
@ -37,6 +37,7 @@ struct BlifDumperConfig
|
||||||
bool conn_mode;
|
bool conn_mode;
|
||||||
bool impltf_mode;
|
bool impltf_mode;
|
||||||
bool gates_mode;
|
bool gates_mode;
|
||||||
|
bool cname_mode;
|
||||||
bool param_mode;
|
bool param_mode;
|
||||||
bool attr_mode;
|
bool attr_mode;
|
||||||
bool blackbox_mode;
|
bool blackbox_mode;
|
||||||
|
@ -45,7 +46,8 @@ struct BlifDumperConfig
|
||||||
std::map<RTLIL::IdString, std::pair<RTLIL::IdString, RTLIL::IdString>> unbuf_types;
|
std::map<RTLIL::IdString, std::pair<RTLIL::IdString, RTLIL::IdString>> unbuf_types;
|
||||||
std::string true_type, true_out, false_type, false_out, undef_type, undef_out;
|
std::string true_type, true_out, false_type, false_out, undef_type, undef_out;
|
||||||
|
|
||||||
BlifDumperConfig() : icells_mode(false), conn_mode(false), impltf_mode(false), gates_mode(false), param_mode(false), attr_mode(false), blackbox_mode(false) { }
|
BlifDumperConfig() : icells_mode(false), conn_mode(false), impltf_mode(false), gates_mode(false),
|
||||||
|
cname_mode(false), param_mode(false), attr_mode(false), blackbox_mode(false) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BlifDumper
|
struct BlifDumper
|
||||||
|
@ -349,6 +351,8 @@ struct BlifDumper
|
||||||
}
|
}
|
||||||
f << stringf("\n");
|
f << stringf("\n");
|
||||||
|
|
||||||
|
if (config->cname_mode)
|
||||||
|
f << stringf(".cname %s\n", cstr(cell->name));
|
||||||
if (config->attr_mode)
|
if (config->attr_mode)
|
||||||
dump_params(".attr", cell->attributes);
|
dump_params(".attr", cell->attributes);
|
||||||
if (config->param_mode)
|
if (config->param_mode)
|
||||||
|
@ -426,6 +430,9 @@ struct BlifBackend : public Backend {
|
||||||
log(" -param\n");
|
log(" -param\n");
|
||||||
log(" use the non-standard .param statement to write cell parameters\n");
|
log(" use the non-standard .param statement to write cell parameters\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
log(" -cname\n");
|
||||||
|
log(" use the non-standard .cname statement to write cell names\n");
|
||||||
|
log("\n");
|
||||||
log(" -blackbox\n");
|
log(" -blackbox\n");
|
||||||
log(" write blackbox cells with .blackbox statement.\n");
|
log(" write blackbox cells with .blackbox statement.\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
@ -490,6 +497,10 @@ struct BlifBackend : public Backend {
|
||||||
config.conn_mode = true;
|
config.conn_mode = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (args[argidx] == "-cname") {
|
||||||
|
config.cname_mode = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (args[argidx] == "-param") {
|
if (args[argidx] == "-param") {
|
||||||
config.param_mode = true;
|
config.param_mode = true;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue