mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
kernel/rtlil: Extract some helpers for checking memory cell types.
There will soon be more (versioned) memory cells, so handle passes that only care if a cell is memory-related by a simple helper call instead of a hardcoded list.
This commit is contained in:
parent
c7076495f1
commit
c4cc888b2c
10 changed files with 24 additions and 28 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue