mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-22 14:17:27 +02: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:
@@ -708,7 +708,7 @@ struct BtorWorker
|
||||
goto okay;
|
||||
}
|
||||
|
||||
if (cell->type.in(ID($mem), ID($memrd), ID($memwr), ID($meminit)))
|
||||
if (cell->is_mem_cell())
|
||||
{
|
||||
Mem *mem = mem_cells[cell];
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ struct Smt2Worker
|
||||
continue;
|
||||
|
||||
// Handled above.
|
||||
if (cell->type.in(ID($mem), ID($memrd), ID($memwr), ID($meminit))) {
|
||||
if (cell->is_mem_cell()) {
|
||||
mem_cells[cell] = mem_dict[cell->parameters.at(ID::MEMID).decode_string()];
|
||||
continue;
|
||||
}
|
||||
@@ -694,7 +694,7 @@ struct Smt2Worker
|
||||
// FIXME: $slice $concat
|
||||
}
|
||||
|
||||
if (memmode && cell->type.in(ID($mem), ID($memrd), ID($memwr), ID($meminit)))
|
||||
if (memmode && cell->is_mem_cell())
|
||||
{
|
||||
Mem *mem = mem_cells[cell];
|
||||
|
||||
|
||||
@@ -1464,7 +1464,7 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
|
||||
void dump_cell(std::ostream &f, std::string indent, RTLIL::Cell *cell)
|
||||
{
|
||||
// Handled by dump_memory
|
||||
if (cell->type.in(ID($mem), ID($memwr), ID($memrd), ID($meminit)))
|
||||
if (cell->is_mem_cell())
|
||||
return;
|
||||
|
||||
if (cell->type[0] == '$' && !noexpr) {
|
||||
|
||||
Reference in New Issue
Block a user