aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc10
-rw-r--r--kernel/rtlil.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 770405720..f9ae947b6 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -3125,6 +3125,16 @@ void RTLIL::Cell::fixup_parameters(bool set_a_signed, bool set_b_signed)
check();
}
+bool RTLIL::Cell::has_memid() const
+{
+ return type.in(ID($memwr), ID($memrd), ID($meminit));
+}
+
+bool RTLIL::Cell::is_mem_cell() const
+{
+ return type == ID($mem) || has_memid();
+}
+
RTLIL::SigChunk::SigChunk()
{
wire = NULL;
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 3137deb00..2f06690d1 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -1522,6 +1522,9 @@ public:
#ifdef WITH_PYTHON
static std::map<unsigned int, RTLIL::Cell*> *get_all_cells(void);
#endif
+
+ bool has_memid() const;
+ bool is_mem_cell() const;
};
struct RTLIL::CaseRule : public RTLIL::AttrObject