summaryrefslogtreecommitdiff
path: root/kernel/rtlil.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-26 16:11:28 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-26 16:11:28 +0200
commit97a59851a6c411ccb06162d4b31725bf89262378 (patch)
tree74cba570ab858657b6fa524cdc9fa45b0493c4be /kernel/rtlil.cc
parenta84cb0493566f8f5eb610c6d7b67dda85b0f227b (diff)
Added RTLIL::Cell::has(portname)
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r--kernel/rtlil.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index ceb2b0f5..059357d2 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -348,9 +348,9 @@ namespace {
void port(const char *name, int width)
{
- if (cell->connections().count(name) == 0)
+ if (!cell->has(name))
error(__LINE__);
- if (cell->connections().at(name).size() != width)
+ if (cell->get(name).size() != width)
error(__LINE__);
expected_ports.insert(name);
}
@@ -379,9 +379,9 @@ namespace {
for (const char *p = ports; *p; p++) {
char portname[3] = { '\\', *p, 0 };
- if (cell->connections().count(portname) == 0)
+ if (!cell->has(portname))
error(__LINE__);
- if (cell->connections().at(portname).size() != 1)
+ if (cell->get(portname).size() != 1)
error(__LINE__);
}
@@ -1340,6 +1340,11 @@ RTLIL::Memory::Memory()
size = 0;
}
+bool RTLIL::Cell::has(RTLIL::IdString portname)
+{
+ return connections_.count(portname) != 0;
+}
+
void RTLIL::Cell::unset(RTLIL::IdString portname)
{
connections_.erase(portname);