mirror of https://github.com/YosysHQ/yosys.git
modtools: fix database sanity on wire name swap
(cherry picked from commit c75d80905a)
This commit is contained in:
parent
58ba984498
commit
298b755fb7
|
|
@ -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…
Reference in New Issue