summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sigtools.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/sigtools.h b/kernel/sigtools.h
index f081957c..69d6cd72 100644
--- a/kernel/sigtools.h
+++ b/kernel/sigtools.h
@@ -139,6 +139,30 @@ struct SigPool
}
return true;
}
+
+ RTLIL::SigSpec export_one()
+ {
+ RTLIL::SigSpec sig;
+ for (auto &bit : bits) {
+ sig.append(RTLIL::SigSpec(bit.first, 1, bit.second));
+ break;
+ }
+ return sig;
+ }
+
+ RTLIL::SigSpec export_all()
+ {
+ RTLIL::SigSpec sig;
+ for (auto &bit : bits)
+ sig.append(RTLIL::SigSpec(bit.first, 1, bit.second));
+ sig.sort_and_unify();
+ return sig;
+ }
+
+ size_t size()
+ {
+ return bits.size();
+ }
};
template <typename T>