Skip to content

Commit

Permalink
Minor bugfixes and debug statements removed
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed Jun 25, 2024
1 parent 757295b commit 0e30de2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,20 @@ class NETLIST_API NetlistSimulatorController : public QObject {
*/
void add_gates(const std::vector<Gate*>& gates);

void make_waveform_groups();
/**
* Create groups of waveform signals. Internally the routine is evaluating whether simulated nets are
* connected to pins which are grouped either by module pingroups or gate pingroups.
* Note that this method only identifies the groups. No waveform data gets loaded at this point since
* the singals might not be available yet (e.g. before simulation has run)
*/
void compute_waveform_groups();

/**
* Load waveform signal groups into container either for inputs or for everything except inputs
*
* @param inputs[in] - If true only waveform groups providing simulation input are loaded. Otherwise these groups are omitted.
*/
void load_waveform_groups(bool inputs);

/**
* Set the signal for a specific wire to control input signals between simulation cycles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,17 @@ namespace hal {
*/
void dump(std::string filename = std::string()) const;

/**
* Group one-bit signals to multi-bit bus according to pingroups.
* Pingroups are only evaluated if all connected nets are part of the simulation.
* Module pingroups have priority before gate pingroups.
*/
void compute_net_groups();

/**
* Get groups computed in method above.
* @return Vector of groups.
*/
const std::vector<NetGroup>& get_net_groups() const { return m_netgroups; }
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -925,13 +925,23 @@ namespace hal
checkReadyState();
}

void NetlistSimulatorController::make_waveform_groups()
void NetlistSimulatorController::compute_waveform_groups()
{
mSimulationInput->compute_net_groups();
}

void NetlistSimulatorController::load_waveform_groups(bool inputs)
{
for (const SimulationInput::NetGroup& ng : mSimulationInput->get_net_groups())
{
if (!ng.is_input) continue;
if (inputs)
{
if (!ng.is_input) continue;
}
else
{
if (ng.is_input) continue;
}
if (ng.gate)
add_waveform_group(ng.gate, ng.gate_pin_group);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ namespace hal {

void WaveGraphicsCanvas::handleTimeframeChanged(const WaveDataTimeframe* tframe)
{
qDebug() << "WaveGraphicsCanvas::callTfc" << tframe->sceneMaxTime() << "=?=" << mTransform.tMax();
// qDebug() << "WaveGraphicsCanvas::callTfc" << tframe->sceneMaxTime() << "=?=" << mTransform.tMax();
if (mTransform.tMin() == tframe->sceneMinTime() && mTransform.tMax() == tframe->sceneMaxTime()) return;
qDebug() << "WaveGraphicsCanvas::handleTfc" << tframe->sceneMaxTime();
// qDebug() << "WaveGraphicsCanvas::handleTfc" << tframe->sceneMaxTime();
mTransform.setTmin(tframe->sceneMinTime());
mTransform.setTmax(tframe->sceneMaxTime());
mRenderEngine->update();
Expand Down
2 changes: 1 addition & 1 deletion plugins/simulator/waveform_viewer/src/wave_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ namespace hal {
}
}
delete sd;
qDebug() << "Addable entries :" << retval.size();
// qDebug() << "Addable entries :" << retval.size();
return retval;
}

Expand Down
6 changes: 5 additions & 1 deletion plugins/simulator/waveform_viewer/src/wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ namespace hal {
if (mController->get_gates().empty() || mController->get_input_nets().empty())
return false;

mController->make_waveform_groups();
mController->compute_waveform_groups();
mController->load_waveform_groups(true);
return true;
}

Expand Down Expand Up @@ -783,7 +784,10 @@ namespace hal {
selIndexList.append(mProxyModel->mapToSource(proxyInx));
}
if (!selIndexList.isEmpty())
{
mWaveWidget->addSelectedResults(mWaveModel->entryMap(selIndexList));
mController->load_waveform_groups(false); // create waveform groups EXCEPT(=false) input groups
}
return true;
}

Expand Down

0 comments on commit 0e30de2

Please sign in to comment.