Merge pull request #2635 from whitequark/cxxrtl-memrd-async-addr

cxxrtl: follow aliases to outlines when emitting $memrd.ADDR
This commit is contained in:
whitequark 2021-03-05 05:30:19 -08:00 committed by GitHub
commit 9dd813374e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1233,7 +1233,9 @@ struct CxxrtlWorker {
RTLIL::Memory *memory = cell->module->memories[cell->getParam(ID::MEMID).decode_string()];
std::string valid_index_temp = fresh_temporary();
f << indent << "auto " << valid_index_temp << " = memory_index(";
dump_sigspec_rhs(cell->getPort(ID::ADDR));
// Almost all non-elidable cells cannot appear in debug_eval(), but $memrd is an exception; asynchronous
// memory read ports can.
dump_sigspec_rhs(cell->getPort(ID::ADDR), for_debug);
f << ", " << memory->start_offset << ", " << memory->size << ");\n";
if (cell->type == ID($memrd)) {
bool has_enable = cell->getParam(ID::CLK_ENABLE).as_bool() && !cell->getPort(ID::EN).is_fully_ones();