mirror of https://github.com/YosysHQ/yosys.git
equiv_purge bugfix, using SigChunk in Yosys namespace
This commit is contained in:
parent
2a0f577f83
commit
6fe48cf41e
|
@ -169,6 +169,7 @@ namespace RTLIL {
|
||||||
struct IdString;
|
struct IdString;
|
||||||
struct Const;
|
struct Const;
|
||||||
struct SigBit;
|
struct SigBit;
|
||||||
|
struct SigChunk;
|
||||||
struct SigSpec;
|
struct SigSpec;
|
||||||
struct Wire;
|
struct Wire;
|
||||||
struct Cell;
|
struct Cell;
|
||||||
|
@ -184,6 +185,7 @@ namespace AST {
|
||||||
using RTLIL::IdString;
|
using RTLIL::IdString;
|
||||||
using RTLIL::Const;
|
using RTLIL::Const;
|
||||||
using RTLIL::SigBit;
|
using RTLIL::SigBit;
|
||||||
|
using RTLIL::SigChunk;
|
||||||
using RTLIL::SigSpec;
|
using RTLIL::SigSpec;
|
||||||
using RTLIL::Wire;
|
using RTLIL::Wire;
|
||||||
using RTLIL::Cell;
|
using RTLIL::Cell;
|
||||||
|
|
|
@ -156,7 +156,7 @@ struct EquivMiterWorker
|
||||||
struct RewriteSigSpecWorker {
|
struct RewriteSigSpecWorker {
|
||||||
RTLIL::Module * mod;
|
RTLIL::Module * mod;
|
||||||
void operator()(SigSpec &sig) {
|
void operator()(SigSpec &sig) {
|
||||||
vector<RTLIL::SigChunk> chunks = sig.chunks();
|
vector<SigChunk> chunks = sig.chunks();
|
||||||
for (auto &c : chunks)
|
for (auto &c : chunks)
|
||||||
if (c.wire != NULL)
|
if (c.wire != NULL)
|
||||||
c.wire = mod->wires_.at(c.wire->name);
|
c.wire = mod->wires_.at(c.wire->name);
|
||||||
|
|
|
@ -162,8 +162,9 @@ struct EquivPurgeWorker
|
||||||
|
|
||||||
srcsig.sort_and_unify();
|
srcsig.sort_and_unify();
|
||||||
|
|
||||||
for (SigSpec sig : srcsig.chunks())
|
for (SigChunk chunk : srcsig.chunks())
|
||||||
rewrite_sigmap.add(sig, make_input(sig));
|
if (chunk.wire != nullptr)
|
||||||
|
rewrite_sigmap.add(chunk, make_input(chunk));
|
||||||
|
|
||||||
for (auto cell : module->cells())
|
for (auto cell : module->cells())
|
||||||
if (cell->type == "$equiv")
|
if (cell->type == "$equiv")
|
||||||
|
|
|
@ -737,7 +737,7 @@ struct ExtractPass : public Pass {
|
||||||
RTLIL::Cell *newCell = newMod->addCell(cell->name, cell->type);
|
RTLIL::Cell *newCell = newMod->addCell(cell->name, cell->type);
|
||||||
newCell->parameters = cell->parameters;
|
newCell->parameters = cell->parameters;
|
||||||
for (auto &conn : cell->connections()) {
|
for (auto &conn : cell->connections()) {
|
||||||
std::vector<RTLIL::SigChunk> chunks = sigmap(conn.second);
|
std::vector<SigChunk> chunks = sigmap(conn.second);
|
||||||
for (auto &chunk : chunks)
|
for (auto &chunk : chunks)
|
||||||
if (chunk.wire != NULL)
|
if (chunk.wire != NULL)
|
||||||
chunk.wire = newMod->wires_.at(chunk.wire->name);
|
chunk.wire = newMod->wires_.at(chunk.wire->name);
|
||||||
|
|
|
@ -49,7 +49,7 @@ void apply_prefix(std::string prefix, std::string &id)
|
||||||
|
|
||||||
void apply_prefix(std::string prefix, RTLIL::SigSpec &sig, RTLIL::Module *module)
|
void apply_prefix(std::string prefix, RTLIL::SigSpec &sig, RTLIL::Module *module)
|
||||||
{
|
{
|
||||||
std::vector<RTLIL::SigChunk> chunks = sig;
|
vector<SigChunk> chunks = sig;
|
||||||
for (auto &chunk : chunks)
|
for (auto &chunk : chunks)
|
||||||
if (chunk.wire != NULL) {
|
if (chunk.wire != NULL) {
|
||||||
std::string wire_name = chunk.wire->name.str();
|
std::string wire_name = chunk.wire->name.str();
|
||||||
|
|
Loading…
Reference in New Issue