|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|


Classes | |
| struct | InputColumnHeader |
Public Types | |
| enum | SimulationState { NoGatesSelected , ParameterSetup , ParameterReady , SimulationRun , ShowResults , EngineFailed } |
| enum | FilterInputFlag { GlobalInputs , PartialNetlist , CompleteNetlist , NoFilter } |
Public Slots | |
| void | handleOpenInputFile (const QString &filename) |
| void | handleSelectGates () |
| void | handleRunFinished (bool success) |
Signals | |
| void | stateChanged (hal::NetlistSimulatorController::SimulationState state) |
| void | engineFinished (bool success) |
| void | parseComplete () |
| void | loadProgress (int percent) |
Public Member Functions | |
| NetlistSimulatorController (u32 id, const std::string nam, const std::string &workdir, QObject *parent=nullptr) | |
| NetlistSimulatorController (u32 id, Netlist *nl, const std::string &filename, QObject *parent=nullptr) | |
| ~NetlistSimulatorController () | |
| SimulationEngine * | create_simulation_engine (const std::string &name) |
| SimulationEngine * | get_simulation_engine () const |
| void | add_clock_frequency (const Net *clock_net, u64 frequency, bool start_at_zero=true) |
| void | add_clock_period (const Net *clock_net, u64 period, bool start_at_zero=true, u64 duration=0) |
| void | set_no_clock_used () |
| bool | is_no_clock_used () const |
| u32 | add_waveform_group (const std::string &name, const std::vector< Net * > &nets) |
| u32 | add_waveform_group (const PinGroup< ModulePin > *pin_group) |
| u32 | add_waveform_group (const Gate *gate, const PinGroup< GatePin > *pin_group) |
| u32 | add_waveform_group (const std::string &name, const PinGroup< ModulePin > *pin_group) |
| u32 | add_boolean_expression_waveform (const std::string &expression) |
| u32 | add_boolean_accept_list_waveform (const std::vector< WaveData * > &input_waves, const std::vector< int > &accepted_combination) |
| u32 | add_trigger_time (const std::vector< WaveData * > &trigger_waves, const std::vector< int > &trigger_on_values=std::vector< int >()) |
| void | remove_waveform_group (u32 group_id) |
| void | add_gates (const std::vector< Gate * > &gates) |
| void | compute_waveform_groups () |
| void | load_waveform_groups (bool inputs) |
| void | set_input (const Net *net, BooleanFunction::Value value) |
| void | set_input (WaveData *wd, BooleanFunction::Value value) |
| void | set_input (const std::vector< Net * > &nets, const std::vector< BooleanFunction::Value > &values) |
| void | set_input (const WaveDataGroup *wdg, const std::vector< BooleanFunction::Value > &values) |
| void | set_input (const u32 id, const std::vector< BooleanFunction::Value > &values) |
| void | set_input (const PinGroup< ModulePin > *pin_group, const std::vector< BooleanFunction::Value > &values) |
| void | initialize () |
| void | simulate (u64 picoseconds) |
| void | reset () |
| const std::unordered_set< const Gate * > & | get_gates () const |
| const std::unordered_set< const Net * > & | get_input_nets () const |
| std::vector< InputColumnHeader > | get_input_column_headers () const |
| const std::vector< const Net * > & | get_output_nets () const |
| const std::vector< const Net * > & | get_partial_netlist_nets () const |
| std::vector< std::string > | get_engine_names () const |
| QString | name () const |
| std::string | get_name () const |
| u32 | get_id () const |
| bool | get_results () |
| u64 | get_max_simulated_time () const |
| bool | run_simulation () |
| bool | import_vcd (const std::string &filename, FilterInputFlag filter) |
| void | import_csv (const std::string &filename, FilterInputFlag filter, u64 timescale=1000000000) |
| void | import_saleae (const std::string &dirname, std::unordered_map< Net *, int > lookupTable, u64 timescale=1000000000) |
| void | import_simulation (const std::string &dirname, FilterInputFlag filter, u64 timescale=1000000000) |
| void | set_saleae_timescale (u64 timescale=1000000000) |
| bool | generate_vcd (const std::filesystem::path &path, u32 start_time=0, u32 end_time=0, std::set< const Net * > nets={}) const |
| std::string | get_working_directory () const |
| bool | is_legal_directory_name () const |
| std::filesystem::path | get_saleae_directory_filename () const |
| WaveDataList * | get_waves () const |
| SimulationState | get_state () const |
| WaveData * | get_waveform_by_net (const Net *n) const |
| void | rename_waveform (WaveData *wd, std::string name) |
| WaveDataGroup * | get_waveform_group_by_id (u32 id) const |
| WaveDataBoolean * | get_waveform_boolean_by_id (u32 id) const |
| WaveDataTrigger * | get_trigger_time_by_id (u32 id) const |
| void | set_timeframe (u64 tmin=0, u64 tmax=0) |
| void | emitLoadProgress (int percent) |
| bool | can_import_data () const |
| void | simulate_only_probes (const std::vector< const Net * > &probes) |
| void | simulate_only_probes (const QSet< u32 > &probes) |
| bool | persist () const |
| void | setLogReceiver (SimulationLogReceiver *logrec) |
Public Member Functions inherited from QObject | |
| virtual const QMetaObject * | metaObject () const const |
| QObject (QObject *parent) | |
| virtual | ~QObject () |
| virtual bool | event (QEvent *e) |
| virtual bool | eventFilter (QObject *watched, QEvent *event) |
| QString | objectName () const const |
| void | setObjectName (const QString &name) |
| bool | isWidgetType () const const |
| bool | isWindowType () const const |
| bool | signalsBlocked () const const |
| bool | blockSignals (bool block) |
| QThread * | thread () const const |
| void | moveToThread (QThread *targetThread) |
| int | startTimer (int interval, Qt::TimerType timerType) |
| int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
| void | killTimer (int id) |
| T | findChild (const QString &name, Qt::FindChildOptions options) const const |
| QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
| QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
| QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
| const QObjectList & | children () const const |
| void | setParent (QObject *parent) |
| void | installEventFilter (QObject *filterObj) |
| void | removeEventFilter (QObject *obj) |
| QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
| bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
| bool | disconnect (const QObject *receiver, const char *method) const const |
| void | dumpObjectTree () |
| void | dumpObjectInfo () |
| void | dumpObjectTree () const const |
| void | dumpObjectInfo () const const |
| bool | setProperty (const char *name, const QVariant &value) |
| QVariant | property (const char *name) const const |
| QList< QByteArray > | dynamicPropertyNames () const const |
| void | destroyed (QObject *obj) |
| void | objectNameChanged (const QString &objectName) |
| QObject * | parent () const const |
| bool | inherits (const char *className) const const |
| void | deleteLater () |
| Q_DISABLE_COPY (Class) | |
| Q_DISABLE_MOVE (Class) | |
| Q_DISABLE_COPY_MOVE (Class) | |
| T | qobject_cast (QObject *object) |
| T | qobject_cast (const QObject *object) |
| T | qFindChild (const QObject *obj, const QString &name) |
| QList< T > | qFindChildren (const QObject *obj, const QString &name) |
| QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
| Q_CLASSINFO (Name, Value) | |
| Q_INTERFACES (...) | |
| Q_PROPERTY (...) | |
| Q_ENUMS (...) | |
| Q_FLAGS (...) | |
| Q_ENUM (...) | |
| Q_FLAG (...) | |
| Q_ENUM_NS (...) | |
| Q_FLAG_NS (...) | |
| Q_OBJECT Q_OBJECT | |
| Q_GADGET Q_GADGET | |
| Q_NAMESPACE Q_NAMESPACE | |
| Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
| Q_SIGNALS Q_SIGNALS | |
| Q_SIGNAL Q_SIGNAL | |
| Q_SLOTS Q_SLOTS | |
| Q_SLOT Q_SLOT | |
| Q_EMIT Q_EMIT | |
| Q_INVOKABLE Q_INVOKABLE | |
| Q_REVISION Q_REVISION | |
| Q_SET_OBJECT_NAME (Object) | |
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Static Public Attributes | |
| static const char * | sPersistFile = "netlist_simulator_controller.json" |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
| QString | tr (const char *sourceText, const char *disambiguation, int n) |
| QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
| QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
| bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
| bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
| bool | disconnect (const QMetaObject::Connection &connection) |
| bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Public Attributes inherited from QObject | |
| typedef | QObjectList |
Protected Member Functions inherited from QObject | |
| QObject * | sender () const const |
| int | senderSignalIndex () const const |
| int | receivers (const char *signal) const const |
| bool | isSignalConnected (const QMetaMethod &signal) const const |
| virtual void | timerEvent (QTimerEvent *event) |
| virtual void | childEvent (QChildEvent *event) |
| virtual void | customEvent (QEvent *event) |
| virtual void | connectNotify (const QMetaMethod &signal) |
| virtual void | disconnectNotify (const QMetaMethod &signal) |
Properties inherited from QObject | |
| objectName | |
Drives a single simulation run from gate selection over input generation to the results. It is the central entry point for simulation, independent of the engine that eventually performs it.
Definition at line 61 of file netlist_simulator_controller.h.
| Enumerator | |
|---|---|
| GlobalInputs | |
| PartialNetlist | |
| CompleteNetlist | |
| NoFilter | |
Definition at line 73 of file netlist_simulator_controller.h.
| Enumerator | |
|---|---|
| NoGatesSelected | |
| ParameterSetup | |
| ParameterReady | |
| SimulationRun | |
| ShowResults | |
| EngineFailed | |
Definition at line 65 of file netlist_simulator_controller.h.
| hal::NetlistSimulatorController::NetlistSimulatorController | ( | u32 | id, |
| const std::string | nam, | ||
| const std::string & | workdir, | ||
| QObject * | parent = nullptr |
||
| ) |
Definition at line 32 of file netlist_simulator_controller.cpp.
References QDir::absoluteFilePath(), QDir::absolutePath(), hal::LogManager::add_channel(), hal::NetlistSimulatorControllerMap::addController(), QString::arg(), hal::SimulationSettings::baseDirectory(), QString::fromStdString(), hal::LogManager::get_instance(), hal::ProjectManager::instance(), hal::NetlistSimulatorControllerMap::instance(), QString::isEmpty(), QDir::mkpath(), QFile::open(), QTemporaryDir::path(), hal::NetlistSimulatorControllerPlugin::sSimulationSettings, QString::toStdString(), QIODevice::write(), and QIODevice::WriteOnly.
| hal::NetlistSimulatorController::NetlistSimulatorController | ( | u32 | id, |
| Netlist * | nl, | ||
| const std::string & | filename, | ||
| QObject * | parent = nullptr |
||
| ) |
Definition at line 74 of file netlist_simulator_controller.cpp.
References QDir::absoluteFilePath(), QDir::absolutePath(), hal::LogManager::add_channel(), add_clock_period(), hal::SimulationInput::add_gates(), hal::NetlistSimulatorControllerMap::addController(), create_simulation_engine(), hal::ff, QString::fromStdString(), hal::Netlist::get_gate_by_id(), hal::LogManager::get_instance(), hal::Gate::get_name(), hal::Netlist::get_net_by_id(), hal::NetlistSimulatorControllerMap::instance(), log_warning, QDir::mkpath(), hal::WaveDataList::saleaeDirectory(), hal::SimulationEngine::set_engine_property(), hal::WaveDataTimeframe::simulateMaxTime(), hal::SaleaeDirectoryStoreRequest::sWriteDisabled, hal::WaveDataList::timeFrame(), QString::toStdString(), and hal::WaveDataList::updateFromSaleae().
| hal::NetlistSimulatorController::~NetlistSimulatorController | ( | ) |
Definition at line 171 of file netlist_simulator_controller.cpp.
References QObject::deleteLater(), hal::NetlistSimulatorControllerMap::instance(), and hal::NetlistSimulatorControllerMap::removeController().
| u32 hal::NetlistSimulatorController::add_boolean_accept_list_waveform | ( | const std::vector< WaveData * > & | input_waves, |
| const std::vector< int > & | accepted_combination | ||
| ) |
Add boolean waveform based on list of accepted combinations
| input_waves | List of input waveforms |
| accepted_combination | List of accepted combinations. Each combination is coded as binary integer value which is matched bitwise with value of input waveform. |
Definition at line 344 of file netlist_simulator_controller.cpp.
References QList::append(), and hal::WaveData::id().
Referenced by hal::PYBIND11_PLUGIN().
| u32 hal::NetlistSimulatorController::add_boolean_expression_waveform | ( | const std::string & | expression | ) |
Add waveform based on boolean expression.
| expression | The boolean expression based on names of existing waveforms. |
Definition at line 330 of file netlist_simulator_controller.cpp.
References QString::fromStdString(), and hal::WaveData::id().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulatorController::add_clock_frequency | ( | const Net * | clock_net, |
| u64 | frequency, | ||
| bool | start_at_zero = true |
||
| ) |
Specify a net that carries the clock signal and set the clock frequency in hertz. This function can only be called before the simulation has been initialized.
| [in] | clock_net | - The net that carries the clock signal. |
| [in] | frequency | - The clock frequency in hertz. |
| [in] | start_at_zero | - Initial clock state is 0 if true, 1 otherwise. |
Definition at line 1009 of file netlist_simulator_controller.cpp.
References add_clock_period().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulatorController::add_clock_period | ( | const Net * | clock_net, |
| u64 | period, | ||
| bool | start_at_zero = true, |
||
| u64 | duration = 0 |
||
| ) |
Specify a net that carries the clock signal and set the clock period in picoseconds. This function can only be called before the simulation has been initialized.
| [in] | clock_net | - The net that carries the clock signal. |
| [in] | period | - The clock period from rising edge to rising edge in picoseconds. |
| [in] | start_at_zero | - Initial clock state is 0 if true, 1 otherwise. |
| [in] | duration | - Optional max time limit when showing clock in VCD viewer or editor |
Definition at line 1029 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::add_clock(), hal::WaveDataList::addOrReplace(), hal::SimulationInput::Clock::clock_net, get_name(), log_warning, hal::SimulationInput::Clock::start_at_zero, and hal::SimulationInput::Clock::switch_time.
Referenced by add_clock_frequency(), NetlistSimulatorController(), hal::PYBIND11_PLUGIN(), and hal::PageClock::validatePage().
| void hal::NetlistSimulatorController::add_gates | ( | const std::vector< Gate * > & | gates | ) |
Add gates to the simulation set that contains all gates that are considered during simulation. This function can only be called before the simulation has been initialized.
| [in] | gates | - The gates to add. |
Definition at line 1087 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::add_gates(), hal::WaveDataList::addOrReplace(), QSet::contains(), hal::SimulationInput::get_input_nets(), get_name(), hal::SimulationInput::has_gates(), hal::WaveData::InputNet, QSet::insert(), log_warning, NoGatesSelected, ParameterSetup, hal::WaveDataList::remove(), and hal::WaveDataList::toSet().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageSelectGates::validatePage().
| u32 hal::NetlistSimulatorController::add_trigger_time | ( | const std::vector< WaveData * > & | trigger_waves, |
| const std::vector< int > & | trigger_on_values = std::vector<int>() |
||
| ) |
Add trigger time vector based on wave transitions.
| trigger_waves | List of source waveform to generate trigger time |
| trigger_on_values | Optional list of values. Order of values must match order of waveform. Trigger will only be generated upon transition to value. |
Definition at line 306 of file netlist_simulator_controller.cpp.
References QList::append(), and hal::WaveData::id().
Referenced by hal::PYBIND11_PLUGIN().
| u32 hal::NetlistSimulatorController::add_waveform_group | ( | const Gate * | gate, |
| const PinGroup< GatePin > * | pin_group | ||
| ) |
Create a waveform group from the nets of a given gate pin group.
| gate | The gate the pin group belongs to. |
| pin_group | The pin_group to create waveform group from. |
Definition at line 411 of file netlist_simulator_controller.cpp.
References add_waveform_group(), hal::Gate::get_fan_in_net(), hal::Gate::get_fan_out_net(), hal::PinGroup< T >::get_name(), get_name(), hal::PinGroup< T >::get_pins(), hal::input, log_warning, and hal::output.
Create a waveform group from the nets of a given module pin group.
| pin_group | The pin_group to create waveform group from. |
Definition at line 395 of file netlist_simulator_controller.cpp.
References add_waveform_group(), hal::PinGroup< T >::get_name(), get_name(), hal::PinGroup< T >::get_pins(), and log_warning.
| u32 hal::NetlistSimulatorController::add_waveform_group | ( | const std::string & | name, |
| const PinGroup< ModulePin > * | pin_group | ||
| ) |
Create a waveform group from the nets of a given module pin group.
| pin_group | The pin_group to create waveform group from. |
| name | The name of the newly created waveform group from. |
Definition at line 443 of file netlist_simulator_controller.cpp.
References add_waveform_group(), hal::PinGroup< T >::get_name(), get_name(), hal::PinGroup< T >::get_pins(), log_warning, and name().
| u32 hal::NetlistSimulatorController::add_waveform_group | ( | const std::string & | name, |
| const std::vector< Net * > & | nets | ||
| ) |
Add waveform group. Netlist must not be empty. First net in list is considered the lowest significant bit.
| name | The waveform group name |
| nets | List of nets for group |
Definition at line 368 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::addWavesToGroup(), QVector::append(), QString::fromStdString(), get_name(), get_waveform_by_net(), hal::WaveData::id(), QVector::isEmpty(), log_warning, name(), and QVector::reserve().
Referenced by add_waveform_group(), load_waveform_groups(), and hal::PYBIND11_PLUGIN().
| bool hal::NetlistSimulatorController::can_import_data | ( | ) | const |
Controller is in a state that allows import from VCD, CSV, or SALEAE waveform data
true if import is allowed, false otherwise. Definition at line 699 of file netlist_simulator_controller.cpp.
References ParameterReady, ParameterSetup, and ShowResults.
Referenced by hal::PageInputData::validatePage().
| void hal::NetlistSimulatorController::compute_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)
Definition at line 1053 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::compute_net_groups().
Referenced by hal::PageSelectGates::validatePage().
| SimulationEngine * hal::NetlistSimulatorController::create_simulation_engine | ( | const std::string & | name | ) |
Call to one of the registered engine factories to create a new engine. Controller will take ownership for new engine.
| [in] | name | name of engine factory (thus name of the engine) |
nullptr otherwise Definition at line 250 of file netlist_simulator_controller.cpp.
References hal::SimulationEngineFactory::createEngine(), hal::SimulationEngineFactories::factoryByName(), get_name(), get_working_directory(), hal::SimulationEngineFactories::instance(), log_info, name(), hal::SimulationEngine::name(), and hal::SimulationEngine::set_working_directory().
Referenced by NetlistSimulatorController(), hal::PYBIND11_PLUGIN(), and hal::PageEngine::validatePage().
| void hal::NetlistSimulatorController::emitLoadProgress | ( | int | percent | ) |
Emit load progress when importing VCD, CSV, or SALEAE waveform
| [in] | percent | load progress, negative values to hide progess bar |
Definition at line 709 of file netlist_simulator_controller.cpp.
References loadProgress(), and QObject::Q_EMIT().
|
signal |
Referenced by handleRunFinished().
| bool hal::NetlistSimulatorController::generate_vcd | ( | const std::filesystem::path & | path, |
| u32 | start_time = 0, |
||
| u32 | end_time = 0, |
||
| std::set< const Net * > | nets = {} |
||
| ) | const |
Generates the a partial VCD file for parts the simulated netlist.
| [in] | path | - The path to the VCD file. |
| [in] | start_time | - Start of the timeframe to write to the file (in picoseconds). |
| [in] | end_time | - End of the timeframe to write to the file (in picoseconds). |
| [in] | nets | - Nets to include in the VCD file. |
true if the file gerneration was successful, false otherwise. Definition at line 1291 of file netlist_simulator_controller.cpp.
References QList::append(), hal::VcdSerializer::exportVcd(), QString::fromStdString(), hal::WaveDataTimeframe::sceneMaxTime(), hal::WaveDataTimeframe::sceneMinTime(), hal::WaveDataList::timeFrame(), and hal::WaveDataList::waveDataByNet().
Referenced by hal::PYBIND11_PLUGIN().
| std::vector< std::string > hal::NetlistSimulatorController::get_engine_names | ( | ) | const |
Shortcut to SimulationEngines::instance()->names()
Definition at line 273 of file netlist_simulator_controller.cpp.
References hal::SimulationEngineFactories::factoryNames(), and hal::SimulationEngineFactories::instance().
Referenced by hal::PYBIND11_PLUGIN().
| const std::unordered_set< const Gate * > & hal::NetlistSimulatorController::get_gates | ( | ) | const |
Shortcut to SimulationInput::get_gates
Definition at line 1120 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::get_gates().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageSelectGates::validatePage().
|
inline |
Getter for controller ID
Definition at line 346 of file netlist_simulator_controller.h.
Referenced by hal::NetlistSimulatorControllerMap::addController(), persist(), and hal::PYBIND11_PLUGIN().
| std::vector< NetlistSimulatorController::InputColumnHeader > hal::NetlistSimulatorController::get_input_column_headers | ( | ) | const |
Get headers for input columns. A column might comprise a single net or a group of nets
Definition at line 1130 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::get_clocks(), hal::SimulationInput::get_input_nets(), hal::SimulationInput::get_net_groups(), hal::NetlistSimulatorController::InputColumnHeader::is_clock, hal::NetlistSimulatorController::InputColumnHeader::name, and hal::NetlistSimulatorController::InputColumnHeader::nets.
Referenced by hal::PageInputData::initializePage().
| const std::unordered_set< const Net * > & hal::NetlistSimulatorController::get_input_nets | ( | ) | const |
Shortcut to SimulationInput::get_input_nets
Definition at line 1125 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::get_input_nets().
Referenced by hal::PageClock::initializePage(), hal::PYBIND11_PLUGIN(), hal::PageSelectGates::validatePage(), hal::PageClock::validatePage(), and hal::PageInputData::validatePage().
| u64 hal::NetlistSimulatorController::get_max_simulated_time | ( | ) | const |
Convenience method to get the last time covered by simulation. This is the last transition found in waveforms.
Definition at line 236 of file netlist_simulator_controller.cpp.
References hal::WaveDataTimeframe::simulateMaxTime(), and hal::WaveDataList::timeFrame().
Referenced by hal::PYBIND11_PLUGIN().
|
inline |
Getter for controller name
Definition at line 340 of file netlist_simulator_controller.h.
Referenced by add_clock_period(), add_gates(), add_waveform_group(), create_simulation_engine(), hal::PageRunSimulation::handleEngineFinished(), handleRunFinished(), import_simulation(), persist(), hal::PYBIND11_PLUGIN(), run_simulation(), set_input(), and hal::PageInputData::validatePage().
| const std::vector< const Net * > & hal::NetlistSimulatorController::get_output_nets | ( | ) | const |
Shortcut to SimulationInput::get_output_nets
Definition at line 1173 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::get_output_nets().
Referenced by hal::PYBIND11_PLUGIN().
| const std::vector< const Net * > & hal::NetlistSimulatorController::get_partial_netlist_nets | ( | ) | const |
Shortcut to SimulationInput::get_partial_netlist_nets
Definition at line 1178 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::get_partial_netlist_nets().
Referenced by hal::PYBIND11_PLUGIN().
| bool hal::NetlistSimulatorController::get_results | ( | ) |
Get simulated data from engine, either from shared memory or from VCD file
true on success, false otherwise Definition at line 945 of file netlist_simulator_controller.cpp.
References EngineFailed, and ShowResults.
Referenced by hal::PageRunSimulation::handleEngineFinished(), and hal::PYBIND11_PLUGIN().
| std::filesystem::path hal::NetlistSimulatorController::get_saleae_directory_filename | ( | ) | const |
Get the filename of SALEAE directory file (JSON format).
Definition at line 245 of file netlist_simulator_controller.cpp.
References hal::SaleaeDirectory::get_filename(), and hal::WaveDataList::saleaeDirectory().
Referenced by hal::Wizard::Wizard().
| SimulationEngine * hal::NetlistSimulatorController::get_simulation_engine | ( | ) | const |
Getter for simulation engine (if any)
nullptr Definition at line 268 of file netlist_simulator_controller.cpp.
|
inline |
Getter for controller state
Definition at line 442 of file netlist_simulator_controller.h.
Referenced by hal::PageRunSimulation::handleEngineFinished(), hal::PageRunSimulation::nextId(), and hal::PageRunSimulation::validatePage().
| WaveDataTrigger * hal::NetlistSimulatorController::get_trigger_time_by_id | ( | u32 | id | ) | const |
Getter for trigger time set.
| [in] | id | - Trigger time id. |
Definition at line 656 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::mDataTrigger.
Referenced by hal::PYBIND11_PLUGIN().
| WaveDataBoolean * hal::NetlistSimulatorController::get_waveform_boolean_by_id | ( | u32 | id | ) | const |
Getter for boolean waveform (which is a combination of several other waveform by boolean operation).
| [in] | id | - Boolean waveform id. |
Definition at line 651 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::mDataBooleans.
Referenced by hal::PYBIND11_PLUGIN().
Getter for a single waveform
| [in] | n | - The net the waveform is associated with. |
Definition at line 640 of file netlist_simulator_controller.cpp.
References hal::Net::get_id(), hal::WaveDataList::triggerAddToView(), and hal::WaveDataList::waveDataByNet().
Referenced by add_waveform_group(), hal::PYBIND11_PLUGIN(), and hal::PageSelectGates::validatePage().
| WaveDataGroup * hal::NetlistSimulatorController::get_waveform_group_by_id | ( | u32 | id | ) | const |
Getter for waveform group
| [in] | id | - Waveform group id. |
Definition at line 646 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::mDataGroups.
Referenced by hal::PYBIND11_PLUGIN(), and set_input().
|
inline |
Getter for wave data list - simulation input as well as output
Definition at line 436 of file netlist_simulator_controller.h.
Referenced by hal::PerfTestPlugin::cmp_sim_data(), hal::PageSelectGates::validatePage(), hal::PageInputData::validatePage(), hal::PageLoadResults::validatePage(), and hal::WaveWidget::WaveWidget().
| std::string hal::NetlistSimulatorController::get_working_directory | ( | ) | const |
The working directory. Directory is temporary and will be removed when controller gets deleted
Definition at line 222 of file netlist_simulator_controller.cpp.
References QString::toStdString().
Referenced by create_simulation_engine(), hal::NetlistSimulatorControllerPlugin::create_simulator_controller(), hal::PYBIND11_PLUGIN(), hal::NetlistSimulatorControllerPlugin::restore_simulator_controller(), and hal::PageInputData::validatePage().
|
slot |
Definition at line 464 of file netlist_simulator_controller.cpp.
References QList::append(), hal::SimulationInput::get_input_nets(), hal::VcdSerializer::importVcd(), QString::isEmpty(), and hal::WaveDataList::updateFromSaleae().
|
slot |
Definition at line 922 of file netlist_simulator_controller.cpp.
References EngineFailed, engineFinished(), get_name(), log_warning, and QObject::Q_EMIT().
Referenced by hal::SimulationProcess::SimulationProcess(), and hal::SimulationThread::SimulationThread().
|
slot |
Definition at line 1283 of file netlist_simulator_controller.cpp.
| void hal::NetlistSimulatorController::import_csv | ( | const std::string & | filename, |
| FilterInputFlag | filter, | ||
| u64 | timescale = 1000000000 |
||
| ) |
Import CSV file and convert content into SALEAE format
| [in] | filename | the filename to read |
| [in] | filter | filter to select waveform data from file |
| [in] | timescale | multiplication factor for time value in first column |
Definition at line 741 of file netlist_simulator_controller.cpp.
References QList::append(), QString::fromStdString(), hal::VcdSerializer::importCsv(), NoFilter, parseComplete(), QObject::Q_EMIT(), and hal::WaveDataList::updateFromSaleae().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageInputData::validatePage().
| void hal::NetlistSimulatorController::import_saleae | ( | const std::string & | dirname, |
| std::unordered_map< Net *, int > | lookupTable, | ||
| u64 | timescale = 1000000000 |
||
| ) |
Import nets given by lookup table from SALEAE directory
| [in] | dirname | the directory to import files from |
| [in] | lookupTable | mapping nets to be imported with saleae file index |
| [in] | timescale | multiplication factor for time value if SALEAE data in float format |
Definition at line 762 of file netlist_simulator_controller.cpp.
References QString::fromStdString(), hal::VcdSerializer::importSaleae(), parseComplete(), QObject::Q_EMIT(), and hal::WaveDataList::updateFromSaleae().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageInputData::validatePage().
| void hal::NetlistSimulatorController::import_simulation | ( | const std::string & | dirname, |
| FilterInputFlag | filter, | ||
| u64 | timescale = 1000000000 |
||
| ) |
Imports nets from simulation working directory. Existing saleae directory required to nets with binary data
| [in] | dirname | the directory to import files from |
| [in] | filter | filter to select waveform data for import |
| [in] | timescale | multiplication factor for time value if SALEAE data in float format |
Definition at line 773 of file netlist_simulator_controller.cpp.
References QDir::absoluteFilePath(), QFile::copy(), QDir::entryInfoList(), QString::fromStdString(), hal::SaleaeDirectory::get_datafile_index(), hal::SaleaeDirectory::get_directory(), get_name(), hal::VcdSerializer::importSaleae(), log_warning, NoFilter, parseComplete(), QObject::Q_EMIT(), QFile::remove(), hal::WaveDataList::saleaeDirectory(), QString::toStdString(), and hal::WaveDataList::updateFromSaleae().
Referenced by hal::PYBIND11_PLUGIN().
| bool hal::NetlistSimulatorController::import_vcd | ( | const std::string & | filename, |
| FilterInputFlag | filter | ||
| ) |
Import VCD file and convert content into SALEAE format
| [in] | filename | the filename to read |
| [in] | filter | filter to select waveform data from file |
Definition at line 714 of file netlist_simulator_controller.cpp.
References QList::append(), QString::fromStdString(), hal::VcdSerializer::importVcd(), NoFilter, parseComplete(), QObject::Q_EMIT(), and hal::WaveDataList::updateFromSaleae().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageInputData::validatePage().
| void hal::NetlistSimulatorController::initialize | ( | ) |
Initialize the simulation. No additional gates or clocks can be added after this point.
Definition at line 1266 of file netlist_simulator_controller.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| bool hal::NetlistSimulatorController::is_legal_directory_name | ( | ) | const |
Verilator's gmake disallows spaces in directory name. Other tests (e.g. dot) might be added in future.
true if directory name is legal, false otherwise Definition at line 227 of file netlist_simulator_controller.cpp.
References QString::contains().
Referenced by hal::NetlistSimulatorControllerPlugin::create_simulator_controller().
| bool hal::NetlistSimulatorController::is_no_clock_used | ( | ) | const |
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.
Definition at line 288 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::is_no_clock_used().
Referenced by hal::PageInputData::initializePage().
| void hal::NetlistSimulatorController::load_waveform_groups | ( | bool | inputs | ) |
Load waveform signal groups into container either for inputs or for everything except inputs
| [in] | inputs | - If true only waveform groups providing simulation input are loaded. Otherwise these groups are omitted. |
Definition at line 1058 of file netlist_simulator_controller.cpp.
References add_waveform_group(), and hal::SimulationInput::get_net_groups().
Referenced by hal::PageSelectGates::validatePage(), and hal::PageLoadResults::validatePage().
|
signal |
Referenced by emitLoadProgress(), and hal::WaveWidget::WaveWidget().
|
inline |
Getter for controller name
Definition at line 334 of file netlist_simulator_controller.h.
Referenced by add_waveform_group(), create_simulation_engine(), hal::WaveformViewer::handleControllerAdded(), and rename_waveform().
|
signal |
Referenced by import_csv(), import_saleae(), import_simulation(), import_vcd(), and hal::WaveWidget::WaveWidget().
| bool hal::NetlistSimulatorController::persist | ( | ) | const |
Store significant information into working directory
true if JSON file created successfully, false otherwise. Definition at line 483 of file netlist_simulator_controller.cpp.
References QDir::absoluteFilePath(), hal::JsonWriteObject::add_array(), hal::JsonWriteArray::add_object(), hal::JsonWriteObject::add_object(), hal::JsonWriteComplex::close(), hal::SimulationInput::get_clocks(), hal::SimulationEngine::get_engine_properties(), hal::SimulationInput::get_gates(), get_id(), get_name(), hal::SimulationEngine::name(), hal::JsonWriteDocument::serialize(), sPersistFile, and QString::toStdString().
Referenced by run_simulation().
| void hal::NetlistSimulatorController::remove_waveform_group | ( | u32 | group_id | ) |
Remove waveform group identified by group ID. Waveform for nets will still be shown but they are not bundled.
| group_id | The ID of waveform group to be removed |
Definition at line 459 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::removeGroup().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulatorController::rename_waveform | ( | WaveData * | wd, |
| std::string | name | ||
| ) |
Rename waveform and emit 'renamed' signal
| [in] | wd | - Waveform to be renamed. |
| [in] | name | - New name for waveform. |
Definition at line 661 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::emitGroupUpdated(), QString::fromStdString(), hal::WaveData::id(), name(), hal::WaveData::rename(), hal::WaveDataList::updateWaveName(), and hal::WaveDataList::waveIndexByNetId().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulatorController::reset | ( | ) |
Reset the simulator state, i.e., treat all signals as unknown. Does not remove gates/nets from the simulation set.
Definition at line 1270 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::clear(), hal::WaveDataList::clearAll(), and NoGatesSelected.
Referenced by hal::PYBIND11_PLUGIN(), hal::PageSelectGates::validatePage(), and hal::Wizard::Wizard().
| bool hal::NetlistSimulatorController::run_simulation | ( | ) |
run simulation
true on success, false otherwise Definition at line 530 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::addOrReplace(), QMap::begin(), hal::SimulationEngine::clock_events_required(), QHash::constBegin(), QHash::constEnd(), hal::WaveDataList::emitTimeframeChanged(), QMap::end(), EngineFailed, hal::SimulationSettings::engineProperties(), QString::fromStdString(), hal::SimulationInput::get_clocks(), hal::SimulationEngine::get_engine_property(), hal::SimulationInput::get_input_nets(), get_name(), hal::SimulationInput::is_clock(), QMap::isEmpty(), QMap::key(), log_info, log_warning, ParameterReady, persist(), hal::SimulationEngine::run(), hal::WaveDataTimeframe::sceneMaxTime(), hal::SimulationEngine::set_engine_property(), hal::SimulationSettings::setEngineProperties(), hal::SimulationEngine::setSimulationInput(), hal::WaveDataList::setValueForEmpty(), SimulationRun, hal::NetlistSimulatorControllerPlugin::sSimulationSettings, QSettings::sync(), and hal::WaveDataList::timeFrame().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulatorController::set_input | ( | const Net * | net, |
| BooleanFunction::Value | value | ||
| ) |
Set the signal for a specific wire to control input signals between simulation cycles.
| [in] | net | - The net to set a signal value for. |
| [in] | value | - The value to set. |
Definition at line 1183 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::addOrReplace(), get_name(), hal::WaveDataList::insertBooleanValue(), hal::WaveData::insertBooleanValueWithoutSync(), hal::SimulationInput::is_input_net(), log_warning, net, hal::WaveDataTimeframe::simulateMaxTime(), hal::WaveDataList::timeFrame(), and hal::WaveDataList::waveDataByNet().
Referenced by hal::PYBIND11_PLUGIN(), and set_input().
| void hal::NetlistSimulatorController::set_input | ( | const PinGroup< ModulePin > * | pin_group, |
| const std::vector< BooleanFunction::Value > & | values | ||
| ) |
Set the signals for a specific module pin group to control input signals between simulation cycles.
| [in] | pin_group | - The module pin group. |
| [in] | values | - The values to set. |
Definition at line 1250 of file netlist_simulator_controller.cpp.
References hal::PinGroup< T >::get_pins(), and set_input().
| void hal::NetlistSimulatorController::set_input | ( | const std::vector< Net * > & | nets, |
| const std::vector< BooleanFunction::Value > & | values | ||
| ) |
Set the signal for a group of nets to control input signals between simulation cycles.
| [in] | nets | - The vector of nets. |
| [in] | values | - The values to set. |
Definition at line 1214 of file netlist_simulator_controller.cpp.
References get_name(), log_error, and set_input().
| void hal::NetlistSimulatorController::set_input | ( | const u32 | id, |
| const std::vector< BooleanFunction::Value > & | values | ||
| ) |
Set the signals for a specific WaveDataGroup to control input signals between simulation cycles.
| [in] | id | - ID of the WaveDataGroup. |
| [in] | values | - The values to set. |
Definition at line 1244 of file netlist_simulator_controller.cpp.
References get_waveform_group_by_id(), and set_input().
| void hal::NetlistSimulatorController::set_input | ( | const WaveDataGroup * | wdg, |
| const std::vector< BooleanFunction::Value > & | values | ||
| ) |
Set the signals for a specific WaveDataGroup to control input signals between simulation cycles.
| [in] | wdg | - The WaveDataGroup. |
| [in] | values | - The values to set. |
Definition at line 1228 of file netlist_simulator_controller.cpp.
References get_name(), hal::WaveDataGroup::get_waveforms(), log_error, and set_input().
| void hal::NetlistSimulatorController::set_input | ( | WaveData * | wd, |
| BooleanFunction::Value | value | ||
| ) |
Set the signal for a specific wire to control input signals between simulation cycles.
| [in] | wd | - WaveData object of the signal. |
| [in] | value | - The value to set. |
Definition at line 1208 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::insertBooleanValue(), hal::WaveDataTimeframe::simulateMaxTime(), and hal::WaveDataList::timeFrame().
| void hal::NetlistSimulatorController::set_no_clock_used | ( | ) |
Prepare simulation where no net is defined as clock input
Definition at line 282 of file netlist_simulator_controller.cpp.
References hal::SimulationInput::set_no_clock_used().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageClock::validatePage().
| void hal::NetlistSimulatorController::set_saleae_timescale | ( | u64 | timescale = 1000000000 | ) |
Set timescale when parsing SALEAE float values
| [in] | timescale | multiplication factor for time value |
Definition at line 917 of file netlist_simulator_controller.cpp.
References hal::SaleaeParser::sTimeScaleFactor.
Referenced by hal::PYBIND11_PLUGIN().
Set timeframe for viewer
| [in] | tmin | Lower limit for time scale in wave viewer |
| [in] | tmax | Upper limit for time scale in wave viewer |
Definition at line 1261 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::setUserTimeframe().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulatorController::setLogReceiver | ( | SimulationLogReceiver * | logrec | ) |
Set log receiver instance which gets called whenever new engine output is available
| logrec | Log receiver instance derived from abstract base class SimulationLogReceiver |
Definition at line 182 of file netlist_simulator_controller.cpp.
| void hal::NetlistSimulatorController::simulate | ( | u64 | picoseconds | ) |
Simulate for a specific period, advancing the internal state. Automatically initializes the simulation if 'initialize' has not yet been called. Use 'set_input' to control specific signals.
| [in] | picoseconds | - The duration to simulate. |
Definition at line 1277 of file netlist_simulator_controller.cpp.
References hal::WaveDataList::incrementSimulTime().
Referenced by hal::PYBIND11_PLUGIN(), and hal::PageInputData::validatePage().
Discard all results except listed probes
| probes | Set of net IDs which will be simulated (aka probes) |
Definition at line 301 of file netlist_simulator_controller.cpp.
| void hal::NetlistSimulatorController::simulate_only_probes | ( | const std::vector< const Net * > & | probes | ) |
Discard all results except listed probes
| probes | List of nets which will be simulated (aka probes) |
Definition at line 293 of file netlist_simulator_controller.cpp.
References QSet::insert().
|
signal |
Referenced by hal::WaveWidget::WaveWidget().
|
static |
Definition at line 522 of file netlist_simulator_controller.h.
Referenced by persist().