mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Clean up pseudo-private member usage in backends/blif/blif.cc
.
This commit is contained in:
parent
f657fed24c
commit
24ef73904f
|
@ -138,9 +138,9 @@ struct BlifDumper
|
||||||
{
|
{
|
||||||
if (!config->gates_mode)
|
if (!config->gates_mode)
|
||||||
return "subckt";
|
return "subckt";
|
||||||
if (!design->modules_.count(RTLIL::escape_id(cell_type)))
|
if (design->module(RTLIL::escape_id(cell_type)) == nullptr)
|
||||||
return "gate";
|
return "gate";
|
||||||
if (design->modules_.at(RTLIL::escape_id(cell_type))->get_blackbox_attribute())
|
if (design->module(RTLIL::escape_id(cell_type))->get_blackbox_attribute())
|
||||||
return "gate";
|
return "gate";
|
||||||
return "subckt";
|
return "subckt";
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ struct BlifDumper
|
||||||
void dump_params(const char *command, dict<IdString, Const> ¶ms)
|
void dump_params(const char *command, dict<IdString, Const> ¶ms)
|
||||||
{
|
{
|
||||||
for (auto ¶m : params) {
|
for (auto ¶m : params) {
|
||||||
f << stringf("%s %s ", command, RTLIL::id2cstr(param.first));
|
f << stringf("%s %s ", command, log_id(param.first));
|
||||||
if (param.second.flags & RTLIL::CONST_FLAG_STRING) {
|
if (param.second.flags & RTLIL::CONST_FLAG_STRING) {
|
||||||
std::string str = param.second.decode_string();
|
std::string str = param.second.decode_string();
|
||||||
f << stringf("\"");
|
f << stringf("\"");
|
||||||
|
@ -172,8 +172,7 @@ struct BlifDumper
|
||||||
|
|
||||||
std::map<int, RTLIL::Wire*> inputs, outputs;
|
std::map<int, RTLIL::Wire*> inputs, outputs;
|
||||||
|
|
||||||
for (auto &wire_it : module->wires_) {
|
for (auto wire : module->wires()) {
|
||||||
RTLIL::Wire *wire = wire_it.second;
|
|
||||||
if (wire->port_input)
|
if (wire->port_input)
|
||||||
inputs[wire->port_id] = wire;
|
inputs[wire->port_id] = wire;
|
||||||
if (wire->port_output)
|
if (wire->port_output)
|
||||||
|
@ -229,10 +228,8 @@ struct BlifDumper
|
||||||
f << stringf(".names $undef\n");
|
f << stringf(".names $undef\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &cell_it : module->cells_)
|
for (auto cell : module->cells())
|
||||||
{
|
{
|
||||||
RTLIL::Cell *cell = cell_it.second;
|
|
||||||
|
|
||||||
if (config->unbuf_types.count(cell->type)) {
|
if (config->unbuf_types.count(cell->type)) {
|
||||||
auto portnames = config->unbuf_types.at(cell->type);
|
auto portnames = config->unbuf_types.at(cell->type);
|
||||||
f << stringf(".names %s %s\n1 1\n",
|
f << stringf(".names %s %s\n1 1\n",
|
||||||
|
@ -649,25 +646,24 @@ struct BlifBackend : public Backend {
|
||||||
extra_args(f, filename, args, argidx);
|
extra_args(f, filename, args, argidx);
|
||||||
|
|
||||||
if (top_module_name.empty())
|
if (top_module_name.empty())
|
||||||
for (auto & mod_it:design->modules_)
|
for (auto module : design->modules())
|
||||||
if (mod_it.second->get_bool_attribute("\\top"))
|
if (module->get_bool_attribute("\\top"))
|
||||||
top_module_name = mod_it.first.str();
|
top_module_name = module->name.str();
|
||||||
|
|
||||||
*f << stringf("# Generated by %s\n", yosys_version_str);
|
*f << stringf("# Generated by %s\n", yosys_version_str);
|
||||||
|
|
||||||
std::vector<RTLIL::Module*> mod_list;
|
std::vector<RTLIL::Module*> mod_list;
|
||||||
|
|
||||||
design->sort();
|
design->sort();
|
||||||
for (auto module_it : design->modules_)
|
for (auto module : design->modules())
|
||||||
{
|
{
|
||||||
RTLIL::Module *module = module_it.second;
|
|
||||||
if (module->get_blackbox_attribute() && !config.blackbox_mode)
|
if (module->get_blackbox_attribute() && !config.blackbox_mode)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (module->processes.size() != 0)
|
if (module->processes.size() != 0)
|
||||||
log_error("Found unmapped processes in module %s: unmapped processes are not supported in BLIF backend!\n", RTLIL::id2cstr(module->name));
|
log_error("Found unmapped processes in module %s: unmapped processes are not supported in BLIF backend!\n", log_id(module->name));
|
||||||
if (module->memories.size() != 0)
|
if (module->memories.size() != 0)
|
||||||
log_error("Found unmapped memories in module %s: unmapped memories are not supported in BLIF backend!\n", RTLIL::id2cstr(module->name));
|
log_error("Found unmapped memories in module %s: unmapped memories are not supported in BLIF backend!\n", log_id(module->name));
|
||||||
|
|
||||||
if (module->name == RTLIL::escape_id(top_module_name)) {
|
if (module->name == RTLIL::escape_id(top_module_name)) {
|
||||||
BlifDumper::dump(*f, module, design, config);
|
BlifDumper::dump(*f, module, design, config);
|
||||||
|
|
Loading…
Reference in a new issue