mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Set init state for all wires from FST and set past
This commit is contained in:
parent
8fa2f3b260
commit
75032a565d
|
@ -782,22 +782,21 @@ struct SimInstance
|
||||||
bool setInitState()
|
bool setInitState()
|
||||||
{
|
{
|
||||||
bool did_something = false;
|
bool did_something = false;
|
||||||
|
for(auto &item : fst_handles) {
|
||||||
|
if (item.second==0) continue; // Ignore signals not found
|
||||||
|
std::string v = shared->fst->valueOf(item.second);
|
||||||
|
did_something |= set_state(item.first, Const::from_string(v));
|
||||||
|
}
|
||||||
for (auto &it : ff_database)
|
for (auto &it : ff_database)
|
||||||
{
|
{
|
||||||
ff_state_t &ff = it.second;
|
ff_state_t &ff = it.second;
|
||||||
SigSpec qsig = it.second.data.sig_q;
|
SigSpec dsig = it.second.data.sig_d;
|
||||||
if (qsig.is_wire()) {
|
Const value = get_state(dsig);
|
||||||
IdString name = qsig.as_wire()->name;
|
if (dsig.is_wire()) {
|
||||||
fstHandle id = shared->fst->getHandle(scope + "." + RTLIL::unescape_id(name));
|
ff.past_d = value;
|
||||||
if (id==0 && name.isPublic())
|
if (ff.data.has_aload)
|
||||||
log_warning("Unable to find wire %s in input file.\n", (scope + "." + RTLIL::unescape_id(name)).c_str());
|
ff.past_ad = value;
|
||||||
if (id!=0) {
|
did_something |= true;
|
||||||
Const fst_val = Const::from_string(shared->fst->valueOf(id));
|
|
||||||
ff.past_d = fst_val;
|
|
||||||
if (ff.data.has_aload)
|
|
||||||
ff.past_ad = fst_val;
|
|
||||||
did_something = set_state(qsig, fst_val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto child : children)
|
for (auto child : children)
|
||||||
|
|
Loading…
Reference in a new issue