mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-30 21:57:47 +00:00
modtools: fix database sanity on wire name swap
This commit is contained in:
parent
62f19cb3a9
commit
c75d80905a
1 changed files with 17 additions and 1 deletions
|
|
@ -28,6 +28,22 @@ YOSYS_NAMESPACE_BEGIN
|
||||||
|
|
||||||
struct ModIndex : public RTLIL::Monitor
|
struct ModIndex : public RTLIL::Monitor
|
||||||
{
|
{
|
||||||
|
struct PointerOrderedSigBit : public RTLIL::SigBit {
|
||||||
|
PointerOrderedSigBit(SigBit s) {
|
||||||
|
wire = s.wire;
|
||||||
|
if (wire)
|
||||||
|
offset = s.offset;
|
||||||
|
else
|
||||||
|
data = s.data;
|
||||||
|
}
|
||||||
|
inline bool operator<(const RTLIL::SigBit &other) const {
|
||||||
|
if (wire == other.wire)
|
||||||
|
return wire ? (offset < other.offset) : (data < other.data);
|
||||||
|
if (wire != nullptr && other.wire != nullptr)
|
||||||
|
return wire < other.wire; // look here
|
||||||
|
return (wire != nullptr) < (other.wire != nullptr);
|
||||||
|
}
|
||||||
|
};
|
||||||
struct PortInfo {
|
struct PortInfo {
|
||||||
RTLIL::Cell* cell;
|
RTLIL::Cell* cell;
|
||||||
RTLIL::IdString port;
|
RTLIL::IdString port;
|
||||||
|
|
@ -77,7 +93,7 @@ struct ModIndex : public RTLIL::Monitor
|
||||||
|
|
||||||
SigMap sigmap;
|
SigMap sigmap;
|
||||||
RTLIL::Module *module;
|
RTLIL::Module *module;
|
||||||
std::map<RTLIL::SigBit, SigBitInfo> database;
|
std::map<PointerOrderedSigBit, SigBitInfo> database;
|
||||||
int auto_reload_counter;
|
int auto_reload_counter;
|
||||||
bool auto_reload_module;
|
bool auto_reload_module;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue