mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-28 03:15:50 +00:00
cxxrtl: make ROMs writable, document memory::operator[].
There is no practical benefit from using `const memory` for ROMs; it uses an std::vector internally, which prevents contemporary compilers from constant-propagating ROM contents. (It is not clear whether they are permitted to do so.) However, there is a major benefit from using non-const `memory` for ROMs, which is the ability to dynamically fill the ROM for each individual simulation.
This commit is contained in:
parent
9043632dcc
commit
06c0338f2c
2 changed files with 6 additions and 4 deletions
|
@ -1166,8 +1166,7 @@ struct CxxrtlWorker {
|
|||
});
|
||||
|
||||
dump_attrs(memory);
|
||||
f << indent << (writable_memories[memory] ? "" : "const ")
|
||||
<< "memory<" << memory->width << "> " << mangle(memory)
|
||||
f << indent << "memory<" << memory->width << "> " << mangle(memory)
|
||||
<< " { " << memory->size << "u";
|
||||
if (init_cells.empty()) {
|
||||
f << " };\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue