mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 09:55:20 +00:00
smt2 mem init bugfix
This commit is contained in:
parent
2c0d818296
commit
3ceba145d5
|
@ -742,7 +742,7 @@ struct Smt2Worker
|
||||||
|
|
||||||
for (int i = 0; i < memsize; i++)
|
for (int i = 0; i < memsize; i++)
|
||||||
{
|
{
|
||||||
if (GetSize(init_data) < i*width)
|
if (i*width >= GetSize(init_data))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Const initword = init_data.extract(i*width, width, State::Sx);
|
Const initword = init_data.extract(i*width, width, State::Sx);
|
||||||
|
@ -752,9 +752,11 @@ struct Smt2Worker
|
||||||
if (bit == State::S0 || bit == State::S1)
|
if (bit == State::S0 || bit == State::S1)
|
||||||
gen_init_constr = true;
|
gen_init_constr = true;
|
||||||
|
|
||||||
init_list.push_back(stringf("(= (select (|%s#%d#0| state) #b%s) #b%s) ; %s[%d]",
|
if (gen_init_constr) {
|
||||||
get_id(module), arrayid, Const(i, abits).as_string().c_str(),
|
init_list.push_back(stringf("(= (select (|%s#%d#0| state) #b%s) #b%s) ; %s[%d]",
|
||||||
initword.as_string().c_str(), get_id(cell), i));
|
get_id(module), arrayid, Const(i, abits).as_string().c_str(),
|
||||||
|
initword.as_string().c_str(), get_id(cell), i));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue