aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2019-04-05 15:46:18 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2019-04-05 15:46:18 -0700
commit0364a5d811f79364f35b72935fe90bc188229c19 (patch)
tree221646765409f5eddcd066dc72b4bb17097fd008 /kernel
parent544843da717734ab9bd9bd88f71db2475fc3abc0 (diff)
parent97587015748eb9f7e0d55a1121f604b8b462b45a (diff)
downloadyosys-0364a5d811f79364f35b72935fe90bc188229c19.tar.gz
yosys-0364a5d811f79364f35b72935fe90bc188229c19.tar.bz2
yosys-0364a5d811f79364f35b72935fe90bc188229c19.zip
Merge branch 'eddie/fix_retime' into xc7srl
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc24
-rw-r--r--kernel/rtlil.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index b3214579d..9ae20a317 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -641,6 +641,30 @@ RTLIL::Module::~Module()
delete it->second;
}
+void RTLIL::Module::makeblackbox()
+{
+ pool<RTLIL::Wire*> delwires;
+
+ for (auto it = wires_.begin(); it != wires_.end(); ++it)
+ if (!it->second->port_input && !it->second->port_output)
+ delwires.insert(it->second);
+
+ for (auto it = memories.begin(); it != memories.end(); ++it)
+ delete it->second;
+ memories.clear();
+
+ for (auto it = cells_.begin(); it != cells_.end(); ++it)
+ delete it->second;
+ cells_.clear();
+
+ for (auto it = processes.begin(); it != processes.end(); ++it)
+ delete it->second;
+ processes.clear();
+
+ remove(delwires);
+ set_bool_attribute("\\blackbox");
+}
+
void RTLIL::Module::reprocess_module(RTLIL::Design *, dict<RTLIL::IdString, RTLIL::Module *>)
{
log_error("Cannot reprocess_module module `%s' !\n", id2cstr(name));
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 52496e702..fb045bc72 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -976,6 +976,7 @@ public:
virtual void sort();
virtual void check();
virtual void optimize();
+ virtual void makeblackbox();
void connect(const RTLIL::SigSig &conn);
void connect(const RTLIL::SigSpec &lhs, const RTLIL::SigSpec &rhs);