3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-14 04:48:46 +00:00

Formatting fixes

This commit is contained in:
Sahand Kashani 2020-05-06 21:15:32 +02:00
parent 1f1b64b880
commit 1688a62500

View file

@ -396,16 +396,13 @@ struct FirrtlWorker
{ {
std::string moduleFileinfo = getFileinfo(module); std::string moduleFileinfo = getFileinfo(module);
f << stringf(" extmodule %s: %s\n", make_id(module->name), moduleFileinfo.c_str()); f << stringf(" extmodule %s: %s\n", make_id(module->name), moduleFileinfo.c_str());
vector<string> port_decls; vector<std::string> port_decls;
for (auto wire : module->wires()) for (auto wire : module->wires())
{ {
const auto wireName = make_id(wire->name); const auto wireName = make_id(wire->name);
std::string wireFileinfo = getFileinfo(wire); std::string wireFileinfo = getFileinfo(wire);
// Maybe not needed?
if (wire->port_id)
{
if (wire->port_input && wire->port_output) if (wire->port_input && wire->port_output)
{ {
log_error("Module port %s.%s is inout!\n", log_id(module), log_id(wire)); log_error("Module port %s.%s is inout!\n", log_id(module), log_id(wire));
@ -413,9 +410,9 @@ struct FirrtlWorker
port_decls.push_back(stringf(" %s %s: UInt<%d> %s\n", wire->port_input ? "input" : "output", port_decls.push_back(stringf(" %s %s: UInt<%d> %s\n", wire->port_input ? "input" : "output",
wireName, wire->width, wireFileinfo.c_str())); wireName, wire->width, wireFileinfo.c_str()));
} }
}
for (auto str : port_decls) { for (auto &str : port_decls)
{
f << str; f << str;
} }
@ -1115,14 +1112,10 @@ struct FirrtlWorker
// Blackboxes should be emitted as `extmodule`s in firrtl. Only ports are // Blackboxes should be emitted as `extmodule`s in firrtl. Only ports are
// emitted in such a case. // emitted in such a case.
if (module->get_blackbox_attribute()) if (module->get_blackbox_attribute())
{
emit_extmodule(); emit_extmodule();
}
else else
{
emit_module(); emit_module();
} }
}
}; };
struct FirrtlBackend : public Backend { struct FirrtlBackend : public Backend {