summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-01-03 02:43:31 +0100
committerClifford Wolf <clifford@clifford.at>2014-01-03 02:43:31 +0100
commiteec2cd1e7850133302654ae8985d8ede9954a569 (patch)
treef85d3a22d219a00fca9915e2594c637419155ada /kernel
parentfb2bf934dc6d2c969906b350c9a1b09a972bfdd7 (diff)
Added RTLIL::SigSpec::optimized() API
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc7
-rw-r--r--kernel/rtlil.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 1311f31c..66152573 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -1024,6 +1024,13 @@ void RTLIL::SigSpec::optimize()
check();
}
+RTLIL::SigSpec RTLIL::SigSpec::optimized() const
+{
+ RTLIL::SigSpec ret = *this;
+ ret.optimize();
+ return ret;
+}
+
bool RTLIL::SigChunk::compare(const RTLIL::SigChunk &a, const RTLIL::SigChunk &b)
{
if (a.wire != b.wire) {
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 8e3b78ee..504fdbbd 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -373,6 +373,7 @@ struct RTLIL::SigSpec {
SigSpec(std::vector<RTLIL::SigBit> bits);
void expand();
void optimize();
+ RTLIL::SigSpec optimized() const;
void sort();
void sort_and_unify();
void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with);