Skip to content

Commit

Permalink
Fixed misleading 'duplicate' warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed May 24, 2024
1 parent f71d980 commit 3e682e9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace hal {
WaveData(u32 id_, const QString& nam, NetType tp = RegularNet,
const QMap<u64,int>& dat = QMap<u64,int>() );
WaveData(const Net* n, NetType tp = RegularNet);
virtual ~WaveData();
virtual ~WaveData() {;}
u32 id() const { return mId; }
QString name() const { return mName; }
NetType netType() const { return mNetType; }
Expand Down Expand Up @@ -170,6 +170,7 @@ namespace hal {
u32 mMaxBooleanId;
u32 mMaxTriggerid;
QList<WaveData*> mTrashCan;
QSet<QString> mNotInNetlist;
void testDoubleCount();
void restoreIndex();
void updateMaxTime();
Expand Down
31 changes: 19 additions & 12 deletions plugins/simulator/netlist_simulator_controller/src/wave_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <QMap>
#include <QDir>
#include <stdio.h>
#include <QDebug>

namespace hal {

Expand Down Expand Up @@ -62,11 +61,6 @@ namespace hal {
mNetType(tp), mBits(1), mValueBase(16), mDirty(true)
{;}

WaveData::~WaveData()
{
// qDebug() << "~WaveData" << mId << mName;
}

void WaveData::resetWave()
{
mData.clear();
Expand Down Expand Up @@ -1290,20 +1284,17 @@ namespace hal {

mTimeframe.setSceneMaxTime(tmax);
if (mustUpdateClocks) updateClocks();
// qDebug() << "setMaxTime-Tfc" << mTimeframe.sceneMaxTime();
Q_EMIT timeframeChanged(&mTimeframe);
}

void WaveDataList::emitTimeframeChanged()
{
// qDebug() << "emitTimeframeChanged-Tfc" << mTimeframe.sceneMaxTime();
Q_EMIT timeframeChanged(&mTimeframe);
}

void WaveDataList::incrementSimulTime(u64 deltaT)
{
mTimeframe.mSimulateMaxTime += deltaT;
// qDebug() << "incrementSimulTime-Tfc" << mTimeframe.mSimulateMaxTime << ">" << mTimeframe.mSceneMaxTime;
if (mTimeframe.mSimulateMaxTime > mTimeframe.mSceneMaxTime)
setMaxTime(mTimeframe.mSimulateMaxTime);
}
Expand All @@ -1323,7 +1314,6 @@ namespace hal {
wd->clear();
}
}
// qDebug() << "setUserTimeframe-Tfc" << mTimeframe.sceneMaxTime();
Q_EMIT timeframeChanged(&mTimeframe);
}

Expand Down Expand Up @@ -1689,14 +1679,31 @@ namespace hal {
void WaveDataList::testDoubleCount()
{
QMap<u32,int> doubleCount;
QSet<QString> notInNetlist;
for (const WaveData* wd : *this)
++doubleCount[wd->id()];
{
if (!wd->id())
{
if (!mNotInNetlist.contains(wd->name()))
notInNetlist.insert(wd->name());
}
else
++doubleCount[wd->id()];
}
for (auto it=doubleCount.constBegin(); it!=doubleCount.constEnd(); ++it)
{
if (it.value() > 1)
{
qDebug() << "duplicate net" << it.value() << at(mIds.value(it.key()))->name();
log_warning("simulation_plugin", "Duplicate waveform ({}x) found : '{}'", it.value(), at(mIds.value(it.key()))->name().toStdString());
}
}
if (!notInNetlist.isEmpty())
{
for (const QString& name : notInNetlist)
{
log_warning("simulation_plugin", "Waveform not in (partial) netlist : '{}'", name.toStdString());
}
mNotInNetlist += notInNetlist;
}
}

Expand Down

0 comments on commit 3e682e9

Please sign in to comment.