Elaborate memory references with non-zero bases.
This fixes r-value type references to memory words for memories that have a non-zero base address. Elaborate the expression needed to get the canonical word index.
This commit is contained in:
parent
3d51810f01
commit
42fe46a7db
11
elab_expr.cc
11
elab_expr.cc
|
|
@ -1197,6 +1197,17 @@ NetExpr* PEIdent::elaborate_expr_net_word_(Design*des, NetScope*scope,
|
|||
delete word_index;
|
||||
word_index = tmp;
|
||||
}
|
||||
|
||||
} else if (word_index) {
|
||||
// If there is a non-zero base to the memory, then build an
|
||||
// expression to calculate the canonical address.
|
||||
if (long base = net->array_first()) {
|
||||
|
||||
word_index = make_add_expr(word_index, 0-base);
|
||||
if (NetExpr*tmp = word_index->eval_tree()) {
|
||||
word_index = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NetESignal*res = new NetESignal(net, word_index);
|
||||
|
|
|
|||
Loading…
Reference in New Issue