diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-12-09 14:28:54 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-12-09 14:28:54 -0800 |
commit | 36a88be609b942f9bc1a5e44ecdbe432a3fa56e8 (patch) | |
tree | e2306ecde8fa46b50406cf0dbd95420b98c19395 | |
parent | eff858cd33403a13736ac74cce6964648306e594 (diff) | |
download | yosys-36a88be609b942f9bc1a5e44ecdbe432a3fa56e8.tar.gz yosys-36a88be609b942f9bc1a5e44ecdbe432a3fa56e8.tar.bz2 yosys-36a88be609b942f9bc1a5e44ecdbe432a3fa56e8.zip |
ice40_wrapcarry -unwrap to preserve 'src' attribute
-rw-r--r-- | passes/pmgen/ice40_wrapcarry.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/passes/pmgen/ice40_wrapcarry.cc b/passes/pmgen/ice40_wrapcarry.cc index 4bddece30..6e154147f 100644 --- a/passes/pmgen/ice40_wrapcarry.cc +++ b/passes/pmgen/ice40_wrapcarry.cc @@ -121,16 +121,24 @@ struct Ice40WrapCarryPass : public Pass { lut->setPort(ID(A), {cell->getPort(ID(I0)), cell->getPort(ID(A)), cell->getPort(ID(B)), cell->getPort(ID(I3)) }); lut->setPort(ID(Y), cell->getPort(ID(O))); + Const src; for (const auto &a : cell->attributes) if (a.first.begins_with("\\SB_CARRY.\\")) carry->attributes[a.first.c_str() + strlen("\\SB_CARRY.")] = a.second; else if (a.first.begins_with("\\SB_LUT4.\\")) lut->attributes[a.first.c_str() + strlen("\\SB_LUT4.")] = a.second; - else if (a.first.in(ID(SB_LUT4.name), ID::keep, ID(module_not_derived), ID(src))) + else if (a.first == ID(src)) + src = a.second; + else if (a.first.in(ID(SB_LUT4.name), ID::keep, ID(module_not_derived))) continue; else log_abort(); + if (!src.empty()) { + carry->attributes.insert(std::make_pair(ID(src), src)); + lut->attributes.insert(std::make_pair(ID(src), src)); + } + module->remove(cell); } } |