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


Public Member Functions | |
| const std::unordered_set< Gate * > & | get_gates () const |
| void | set_input (const Net *net, BooleanFunction::Value value) |
| void | initialize_sequential_gates (const std::function< bool(const Gate *)> &filter=nullptr) |
| void | initialize_sequential_gates (BooleanFunction::Value value, const std::function< bool(const Gate *)> &filter=nullptr) |
| void | load_initial_values (BooleanFunction::Value value) |
| void | load_initial_values_from_netlist () |
| void | initialize () |
| void | simulate (u64 picoseconds) |
| SimulationInput * | get_simulation_input () const override |
| void | reset () |
| void | set_simulation_state (const Simulation &state) |
| const Simulation & | get_simulation_state () const |
| void | set_iteration_timeout (u64 iterations) |
| u64 | get_simulation_timeout () const |
| bool | generate_vcd (const std::filesystem::path &path, u32 start_time, u32 end_time, std::set< const Net * > nets={}) const |
| std::vector< WaveEvent > | get_simulation_events (u32 netId) const override |
| bool | inputEvent (const SimulationInputNetEvent &netEv) override |
Public Member Functions inherited from hal::SimulationEngineEventDriven | |
| SimulationEngineEventDriven (const std::string &nam) | |
Public Member Functions inherited from hal::SimulationEngine | |
| SimulationEngine (const std::string &nam) | |
| virtual | ~SimulationEngine () |
| std::string | name () const |
| State | state () const |
| int | get_state () const |
| std::string | get_working_directory () const |
| void | set_working_directory (const std::string &workDir) |
| bool | clock_events_required () const |
| bool | can_share_memory () const |
| bool | install_saleae_parser (std::string dirname) const |
| virtual void | setResultFilename (const std::string filename) |
| std::string | get_result_filename () const |
| virtual bool | finalize () |
| virtual void | failed () |
| virtual void | set_engine_property (const std::string &key, const std::string &value) |
| virtual std::string | get_engine_property (const std::string &key) |
| virtual const std::unordered_map< std::string, std::string > & | get_engine_properties () const |
Friends | |
| class | NetlistSimulatorFactory |
| class | NetlistSimulatorPlugin |
Additional Inherited Members | |
Public Types inherited from hal::SimulationEngine | |
| enum | State { Failed = -1 , Done = 0 , Running = 1 , Preparing = 2 } |
Protected Attributes inherited from hal::SimulationEngine | |
| bool | mRequireClockEvents |
| bool | mCanShareMemory |
| std::string | mResultFilename |
| State | mState |
| std::unordered_map< std::string, std::string > | mProperties |
| SimulationInput * | mSimulationInput |
| std::string | mWorkDir |
HAL's built-in event-driven simulation engine.
Definition at line 45 of file netlist_simulator.h.
| bool hal::NetlistSimulator::generate_vcd | ( | const std::filesystem::path & | path, |
| u32 | start_time, | ||
| u32 | end_time, | ||
| std::set< const Net * > | nets = {} |
||
| ) | const |
Generates the a 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 568 of file netlist_simulator.cpp.
References log_error, and net.
Referenced by hal::PYBIND11_PLUGIN().
| const std::unordered_set<Gate*>& hal::NetlistSimulator::get_gates | ( | ) | const |
Get all gates that are in the simulation set.
|
overridevirtual |
Get vector of simulated events for net
| [in] | netId | - The net for which events where simulated |
Reimplemented from hal::SimulationEngineEventDriven.
Definition at line 230 of file netlist_simulator.cpp.
References hal::Simulation::get_events_by_net_id().
|
inlineoverridevirtual |
Get simulation input
Reimplemented from hal::SimulationEngine.
Definition at line 116 of file netlist_simulator.h.
References hal::SimulationEngine::mSimulationInput.
| const Simulation & hal::NetlistSimulator::get_simulation_state | ( | ) | const |
Get the current simulation state.
Definition at line 215 of file netlist_simulator.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| u64 hal::NetlistSimulator::get_simulation_timeout | ( | ) | const |
Get the current iteration timeout value.
Definition at line 225 of file netlist_simulator.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::initialize | ( | ) |
Initialize the simulation. No additional gates or clocks can be added after this point.
Definition at line 248 of file netlist_simulator.cpp.
References hal::WaveEvent::affected_net, log_error, measure_block_time, net, hal::WaveEvent::new_value, pins, and hal::WaveEvent::time.
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::initialize_sequential_gates | ( | BooleanFunction::Value | value, |
| const std::function< bool(const Gate *)> & | filter = nullptr |
||
| ) |
Configure the sequential gates matching the (optional) user-defined filter condition with the specified value. Schedules the respective gates for initialization, the actual configuration is applied during initialization of the simulator. This function can only be called before the simulation has started.
| [in] | value | - The value to initialize the selected gates with. |
| [in] | filter | - The optional filter to be applied before initialization. |
Definition at line 63 of file netlist_simulator.cpp.
References log_error.
| void hal::NetlistSimulator::initialize_sequential_gates | ( | const std::function< bool(const Gate *)> & | filter = nullptr | ) |
Configure the sequential gates matching the (optional) user-defined filter condition with initialization data specified within the netlist. Schedules the respective gates for initialization, the actual configuration is applied during initialization of the simulator. This function can only be called before the simulation has started.
| [in] | filter | - The optional filter to be applied before initialization. |
Definition at line 50 of file netlist_simulator.cpp.
References log_error.
Referenced by hal::PYBIND11_PLUGIN().
|
overridevirtual |
Must be implemented by derived class
Passes an event to engine to trigger simulation
| [in] | netEv | input event asigning input values (0,1,X,Z) for nets and providing number of cycles to simulate |
true if event was handled successfully, false otherwise Implements hal::SimulationEngineEventDriven.
Definition at line 235 of file netlist_simulator.cpp.
References hal::SimulationInputNetEvent::get_simulation_duration().
| void hal::NetlistSimulator::load_initial_values | ( | BooleanFunction::Value | value | ) |
| [in] | value | - The initial value to load. |
Definition at line 76 of file netlist_simulator.cpp.
References hal::WaveEvent::affected_net, hal::WaveEvent::new_value, hal::WaveEvent::time, and hal::simulation_utils::toggle().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::load_initial_values_from_netlist | ( | ) |
Definition at line 118 of file netlist_simulator.cpp.
References hal::WaveEvent::affected_net, hal::InitComponent::get_init_category(), hal::InitComponent::get_init_identifiers(), hal::GateType::get_name(), hal::InitComponent::get_type(), log_error, hal::WaveEvent::new_value, hal::WaveEvent::time, and hal::simulation_utils::toggle().
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::reset | ( | ) |
Reset the simulator state, i.e., treat all signals as unknown. Does not remove gates/nets from the simulation set.
Definition at line 200 of file netlist_simulator.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::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 27 of file netlist_simulator.cpp.
References hal::WaveEvent::affected_net, log_error, net, hal::WaveEvent::new_value, and hal::WaveEvent::time.
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::set_iteration_timeout | ( | u64 | iterations | ) |
Set the iteration timeout, i.e., the maximum number of events processed for a single point in time. Useful to abort in case of infinite loops. A value of 0 disables the timeout.
| [in] | iterations | - The iteration timeout. |
Definition at line 220 of file netlist_simulator.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::set_simulation_state | ( | const Simulation & | state | ) |
Set the simulator state, i.e., net signals, to a given state. Does not influence gates/nets added to the simulation set.
| [in] | state | - The state to apply. |
Definition at line 210 of file netlist_simulator.cpp.
References hal::state.
Referenced by hal::PYBIND11_PLUGIN().
| void hal::NetlistSimulator::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 188 of file netlist_simulator.cpp.
References hal::initialize().
Referenced by hal::PYBIND11_PLUGIN().
|
friend |
Definition at line 47 of file netlist_simulator.h.
|
friend |
Definition at line 180 of file netlist_simulator.h.