diff options
| author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-22 19:14:13 +0200 | 
|---|---|---|
| committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-05-22 21:43:00 +0200 | 
| commit | c4cc888b2c51a6507b73fdcde1dc61c37384105d (patch) | |
| tree | d5bc86b7ae97217a242c7e1f5b6f9ad6da1e4c7d /backends | |
| parent | c7076495f197732725456992c9a02aed9966139a (diff) | |
| download | yosys-c4cc888b2c51a6507b73fdcde1dc61c37384105d.tar.gz yosys-c4cc888b2c51a6507b73fdcde1dc61c37384105d.tar.bz2 yosys-c4cc888b2c51a6507b73fdcde1dc61c37384105d.zip  | |
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.
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/btor/btor.cc | 2 | ||||
| -rw-r--r-- | backends/smt2/smt2.cc | 4 | ||||
| -rw-r--r-- | backends/verilog/verilog_backend.cc | 2 | 
3 files changed, 4 insertions, 4 deletions
diff --git a/backends/btor/btor.cc b/backends/btor/btor.cc index 692452aad..936cb20fb 100644 --- a/backends/btor/btor.cc +++ b/backends/btor/btor.cc @@ -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]; diff --git a/backends/smt2/smt2.cc b/backends/smt2/smt2.cc index 8be9e05f1..e0f43d686 100644 --- a/backends/smt2/smt2.cc +++ b/backends/smt2/smt2.cc @@ -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]; diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc index 165ce1ea4..cfdc0316a 100644 --- a/backends/verilog/verilog_backend.cc +++ b/backends/verilog/verilog_backend.cc @@ -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) {  | 
