diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-04-29 07:44:57 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-04-29 07:44:57 +0200 |
commit | 96be31de89bfcfb64d195dbdc0891bd507aec399 (patch) | |
tree | b7d9e2e10ec131b8037b9300a61920d1d7583268 /passes/cmds | |
parent | f483dce7c231f83937b5944ed0166a70594a0e8b (diff) | |
download | yosys-96be31de89bfcfb64d195dbdc0891bd507aec399.tar.gz yosys-96be31de89bfcfb64d195dbdc0891bd507aec399.tar.bz2 yosys-96be31de89bfcfb64d195dbdc0891bd507aec399.zip |
Preserve important attributes in splitnets
Diffstat (limited to 'passes/cmds')
-rw-r--r-- | passes/cmds/splitnets.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/passes/cmds/splitnets.cc b/passes/cmds/splitnets.cc index d4e721a5d..d22d65000 100644 --- a/passes/cmds/splitnets.cc +++ b/passes/cmds/splitnets.cc @@ -54,6 +54,19 @@ struct SplitnetsWorker new_wire->port_input = wire->port_input; new_wire->port_output = wire->port_output; + if (wire->attributes.count("\\src")) + new_wire->attributes["\\src"] = wire->attributes.at("\\src"); + + if (wire->attributes.count("\\keep")) + new_wire->attributes["\\keep"] = wire->attributes.at("\\keep"); + + if (wire->attributes.count("\\init")) { + Const old_init = wire->attributes.at("\\init"), new_init; + for (int i = offset; i < offset+width; i++) + new_init.bits.push_back(i < GetSize(old_init) ? old_init.bits.at(i) : State::Sx); + new_wire->attributes["\\init"] = new_init; + } + std::vector<RTLIL::SigBit> sigvec = RTLIL::SigSpec(new_wire).to_sigbit_vector(); splitmap[wire].insert(splitmap[wire].end(), sigvec.begin(), sigvec.end()); } |