Skip to content

Commit

Permalink
Test whether clock data is required when simulation input entered by …
Browse files Browse the repository at this point in the history
…user
  • Loading branch information
joern274 committed Jun 22, 2024
1 parent 307ff16 commit ab48a45
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ class NETLIST_API NetlistSimulatorController : public QObject {
*/
void set_no_clock_used();

/**
* Check wether no clock signal will be automatically generated as simulation input. Either there
* is no clock present or the clock signal will be passed as normal waveform input.
*/
bool is_no_clock_used() const;

/**
* Add waveform group. Netlist must not be empty. First net in list is considered the lowest significant bit.
* @param name The waveform group name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ namespace hal {
*/
void set_no_clock_used();

/**
* Check wether no clock signal will be automatically generated as simulation input. Either there
* is no clock present or the clock signal will be passed as normal waveform input.
*/
bool is_no_clock_used() const;

/**
* Tests whether net is an input net
* @param[in] n pointer to net
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ namespace hal
checkReadyState();
}

bool NetlistSimulatorController::is_no_clock_used() const
{
return mSimulationInput->is_no_clock_used();
}

u32 NetlistSimulatorController::add_trigger_time(const std::vector<WaveData*>& trigger_waves, const std::vector<int>& trigger_on_values)
{
if (trigger_waves.empty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ namespace hal {
mNoClockUsed = true;
}

bool SimulationInput::is_no_clock_used() const
{
return mNoClockUsed;
}

void SimulationInput::dump(std::string filename) const
{
FILE* of = stderr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace hal {
public:
WavedataTableEditor(QWidget* parent = nullptr);

void setup(const std::vector<NetlistSimulatorController::InputColumnHeader>& inpColHeads);
void setup(const std::vector<NetlistSimulatorController::InputColumnHeader>& inpColHeads, bool omitClock);

int validLines() const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ namespace hal {
: QTableWidget(parent), mMaxTime(0)
{;}

void WavedataTableEditor::setup(const std::vector<NetlistSimulatorController::InputColumnHeader> &inpColHeads)
void WavedataTableEditor::setup(const std::vector<NetlistSimulatorController::InputColumnHeader> &inpColHeads, bool omitClock)
{
int n = inpColHeads.size()+1;
setColumnCount(n);
setRowCount(2);
QStringList headerLabel;
for (NetlistSimulatorController::InputColumnHeader ich : inpColHeads)
{
if (omitClock && ich.is_clock) continue;
QString colName = QString::fromStdString(ich.name);
if (ich.nets.size() > 1) colName += QString("[%1:0]").arg(ich.nets.size()-1);
mInputColumnHeader.append(ich);
Expand Down
2 changes: 1 addition & 1 deletion plugins/simulator/waveform_viewer/src/wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ namespace hal {

void PageInputData::initializePage()
{
mTableEditor->setup(mController->get_input_column_headers());
mTableEditor->setup(mController->get_input_column_headers(), mController->is_no_clock_used());
handleRadioToggled(true);
}

Expand Down

0 comments on commit ab48a45

Please sign in to comment.