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


Public Member Functions | |
| SimulatorSerializer () | |
| std::string | serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutosave) override |
| void | deserialize (Netlist *netlist, const std::filesystem::path &loaddir) override |
| std::vector< std::unique_ptr< NetlistSimulatorController > > | restore () |
Public Member Functions inherited from hal::ProjectSerializer | |
| ProjectSerializer (const std::string &name) | |
| virtual | ~ProjectSerializer () |
Additional Inherited Members | |
Protected Attributes inherited from hal::ProjectSerializer | |
| std::string | m_name |
Stores the simulation controllers of a project so that they can be restored when the project is opened again.
Definition at line 45 of file plugin_netlist_simulator_controller.h.
| hal::SimulatorSerializer::SimulatorSerializer | ( | ) |
Definition at line 24 of file plugin_netlist_simulator_controller.cpp.
|
overridevirtual |
Abstract deserialize method to be implemented by derived class. Note that it can be assumed upon calling this method that the deserialization of the netlist has been successful. Caller will provide project directory name but not the filename. The latter one can be queried from ProjectManager.
| [in] | netlist | The netlist already deserialized |
| [in] | loaddir | Project directory to load files from |
Implements hal::ProjectSerializer.
Definition at line 57 of file plugin_netlist_simulator_controller.cpp.
References hal::NetlistSimulatorControllerMap::clearAll(), QString::fromStdString(), and hal::NetlistSimulatorControllerMap::instance().
| std::vector< std::unique_ptr< NetlistSimulatorController > > hal::SimulatorSerializer::restore | ( | ) |
Definition at line 65 of file plugin_netlist_simulator_controller.cpp.
References QDir::absoluteFilePath(), QJsonArray::at(), QJsonObject::contains(), QJsonDocument::fromJson(), QString::fromStdString(), hal::ProjectManager::get_filename(), hal::plugin_manager::get_plugin_instance(), hal::ProjectManager::get_project_directory(), hal::ProjectManager::instance(), QString::isEmpty(), QDir::isEmpty(), hal::ProjectSerializer::m_name, QJsonDocument::object(), QFile::open(), QString::push_back(), QIODevice::readAll(), QIODevice::ReadOnly, hal::NetlistSimulatorControllerPlugin::restore_simulator_controller(), QJsonArray::size(), QJsonValue::toObject(), and QString::toStdString().
Referenced by hal::WaveformViewer::restoreFromProject().
|
overridevirtual |
Abstract serialize method to be implemented by derived class. If there was no need for serialization or serialization failed an empty file name should be returned.
| [in] | netlist | The netlist to be serialized |
| [in] | savedir | Target project directory |
| [in] | isAutosave | true if serialize call was issued from autosave, false otherwise |
Implements hal::ProjectSerializer.
Definition at line 28 of file plugin_netlist_simulator_controller.cpp.
References QDir::absoluteFilePath(), QJsonArray::append(), QJsonDocument::Compact, QString::fromStdString(), hal::ProjectManager::get_project_directory(), hal::ProjectDirectory::get_relative_file_path(), hal::ProjectManager::instance(), hal::NetlistSimulatorControllerMap::instance(), QFile::open(), QString::toStdString(), QIODevice::write(), and QIODevice::WriteOnly.