mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 19:05:52 +00:00
Various fixes for memories with offsets
This commit is contained in:
parent
dcf2e24240
commit
e9368a1d7e
5 changed files with 24 additions and 13 deletions
|
@ -1214,9 +1214,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
RTLIL::Wire *wire = current_module->addWire(cell->name.str() + "_DATA", current_module->memories[str]->width);
|
||||
wire->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
|
||||
|
||||
int addr_bits = 1;
|
||||
while ((1 << addr_bits) < current_module->memories[str]->size)
|
||||
addr_bits++;
|
||||
int mem_width, mem_size, addr_bits;
|
||||
id2ast->meminfo(mem_width, mem_size, addr_bits);
|
||||
|
||||
cell->setPort("\\CLK", RTLIL::SigSpec(RTLIL::State::Sx, 1));
|
||||
cell->setPort("\\ADDR", children[0]->genWidthRTLIL(addr_bits));
|
||||
|
@ -1243,9 +1242,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
RTLIL::Cell *cell = current_module->addCell(sstr.str(), type == AST_MEMWR ? "$memwr" : "$meminit");
|
||||
cell->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum);
|
||||
|
||||
int addr_bits = 1;
|
||||
while ((1 << addr_bits) < current_module->memories[str]->size)
|
||||
addr_bits++;
|
||||
int mem_width, mem_size, addr_bits;
|
||||
id2ast->meminfo(mem_width, mem_size, addr_bits);
|
||||
|
||||
cell->setPort("\\ADDR", children[0]->genWidthRTLIL(addr_bits));
|
||||
cell->setPort("\\DATA", children[1]->genWidthRTLIL(current_module->memories[str]->width));
|
||||
|
|
|
@ -1421,6 +1421,7 @@ skip_dynamic_range_lvalue_expansion:;
|
|||
if (current_always->type != AST_INITIAL)
|
||||
wrnode->children.push_back(new AstNode(AST_IDENTIFIER));
|
||||
wrnode->str = children[0]->str;
|
||||
wrnode->id2ast = children[0]->id2ast;
|
||||
wrnode->children[0]->str = id_addr;
|
||||
wrnode->children[1]->str = id_data;
|
||||
if (current_always->type != AST_INITIAL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue