projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1f1b64b
)
Formatting fixes
author
Sahand Kashani
<sahand.kashani@gmail.com>
Wed, 6 May 2020 19:15:32 +0000
(21:15 +0200)
committer
Sahand Kashani
<sahand.kashani@gmail.com>
Wed, 6 May 2020 19:15:32 +0000
(21:15 +0200)
backends/firrtl/firrtl.cc
patch
|
blob
|
history
diff --git
a/backends/firrtl/firrtl.cc
b/backends/firrtl/firrtl.cc
index ff1329532f6142285292d33739d7cfdc21c0fe4e..e83d4f654bd8339918f90a909b019f392f6267a4 100644
(file)
--- a/
backends/firrtl/firrtl.cc
+++ b/
backends/firrtl/firrtl.cc
@@
-396,26
+396,23
@@
struct FirrtlWorker
{
std::string moduleFileinfo = getFileinfo(module);
f << stringf(" extmodule %s: %s\n", make_id(module->name), moduleFileinfo.c_str());
{
std::string moduleFileinfo = getFileinfo(module);
f << stringf(" extmodule %s: %s\n", make_id(module->name), moduleFileinfo.c_str());
- vector<string> port_decls;
+ vector<st
d::st
ring> port_decls;
for (auto wire : module->wires())
{
const auto wireName = make_id(wire->name);
std::string wireFileinfo = getFileinfo(wire);
for (auto wire : module->wires())
{
const auto wireName = make_id(wire->name);
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));
- }
- port_decls.push_back(stringf(" %s %s: UInt<%d> %s\n", wire->port_input ? "input" : "output",
- wireName, wire->width, wireFileinfo.c_str()));
+ log_error("Module port %s.%s is inout!\n", log_id(module), log_id(wire));
}
}
+ port_decls.push_back(stringf(" %s %s: UInt<%d> %s\n", wire->port_input ? "input" : "output",
+ wireName, wire->width, wireFileinfo.c_str()));
}
}
- for (auto str : port_decls) {
+ for (auto &str : port_decls)
+ {
f << str;
}
f << str;
}
@@
-1115,13
+1112,9
@@
struct FirrtlWorker
// Blackboxes should be emitted as `extmodule`s in firrtl. Only ports are
// emitted in such a case.
if (module->get_blackbox_attribute())
// Blackboxes should be emitted as `extmodule`s in firrtl. Only ports are
// emitted in such a case.
if (module->get_blackbox_attribute())
- {
emit_extmodule();
emit_extmodule();
- }
else
else
- {
emit_module();
emit_module();
- }
}
};
}
};