|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
The SaleaeDirectory class provides the API for the SALEAE directory file. The SALEAE directory file with the name "saleae.json" provides the links between waveform data stored in binary SALEAE files and nets from simulated netlist. Additionally composed data like groups, boolean waveforms, or trigger time sets can be persisted in directory file. The file format is JSON. More...

Classes | |
| struct | ListEntry |
Public Member Functions | |
| SaleaeDirectory (const std::string &path, bool create=false) | |
| constructor More... | |
| bool | parse_json () |
Parse .json file into class instance. More... | |
| void | add_or_replace_net (SaleaeDirectoryNetEntry &sdne) |
| Add net entry if not yet existing, replace existing entry otherwise. More... | |
| void | clearAll () |
| Remove all files and reset internal variables. More... | |
| std::vector< SaleaeDirectoryNetEntry > | dump () const |
| Dump content of class instance to console for debugging purpose. More... | |
| void | update_file_indexes (std::unordered_map< int, SaleaeDirectoryFileIndex > &fileIndexes) |
| Update file index information (like number of transitions, end time ...) after writing SALEAE files. More... | |
| void | rename_net (uint32_t id, const std::string &nam) |
| Change waveform name entry for net identified by id. More... | |
| std::string | get_datafile_name (int index) const |
| Get waveform datafile name without path (digital_XXX.bin) More... | |
| std::string | get_datafile_path (int index) const |
| Get full path to waveform data file. More... | |
| std::string | get_datafile_path (const std::string &nam, uint32_t id) const |
| Get full path to waveform data file for net identified by name and id. More... | |
| int | get_datafile_index (const std::string &nam, uint32_t id) const |
| Get waveform datafile index for net identified by name and id. More... | |
| int | get_next_available_index () const |
| Getter for next available file index ('digital_XXX.bin' with lowest number XXX not in use) More... | |
| uint64_t | get_max_time () const |
| Getter for maximum time. More... | |
| std::string | get_directory () const |
| Get path to SALEAE directory without filename. More... | |
| std::string | get_filename () const |
| Get full path to saleae directory file including filename (/.../saleae.json) More... | |
| std::vector< ListEntry > | get_net_list () const |
| Getter for all net entries. More... | |
| void | add_or_replace_composed (SaleaeDirectoryComposedEntry sdce) |
| Add composed waveform entry (Group, Boolean, Trigger) More... | |
| void | remove_composed (uint32_t id, SaleaeDirectoryNetEntry::Type tp) |
| Remove composed waveform entry identified by id an type. More... | |
| SaleaeDirectoryComposedEntry | get_composed (uint32_t id, SaleaeDirectoryNetEntry::Type tp) const |
| Getter for pointer to composed waveform entry allowing modifications. More... | |
| std::vector< SaleaeDirectoryComposedEntry > | get_composed_list () const |
| Getter to list of all composed waveform entries. More... | |
Friends | |
| class | SaleaeDirectoryStoreRequest |
The SaleaeDirectory class provides the API for the SALEAE directory file. The SALEAE directory file with the name "saleae.json" provides the links between waveform data stored in binary SALEAE files and nets from simulated netlist. Additionally composed data like groups, boolean waveforms, or trigger time sets can be persisted in directory file. The file format is JSON.
Definition at line 207 of file saleae_directory.h.
| hal::SaleaeDirectory::SaleaeDirectory | ( | const std::string & | path, |
| bool | create = false |
||
| ) |
constructor
Definition at line 18 of file saleae_directory.cpp.
References hal::SaleaeDirectoryNetEntry::id(), hal::SaleaeDirectoryNetEntry::name(), and parse_json().
| void hal::SaleaeDirectory::add_or_replace_composed | ( | SaleaeDirectoryComposedEntry | sdce | ) |
Add composed waveform entry (Group, Boolean, Trigger)
Definition at line 442 of file saleae_directory.cpp.
References hal::gate_library_manager::save(), and hal::SaleaeDirectoryNetEntry::uniqueKey().
Referenced by hal::WaveDataGroup::restoreIndex(), and hal::WaveDataTrigger::set_filter_wave().
| void hal::SaleaeDirectory::add_or_replace_net | ( | SaleaeDirectoryNetEntry & | sdne | ) |
Add net entry if not yet existing, replace existing entry otherwise.
Definition at line 268 of file saleae_directory.cpp.
References hal::SaleaeDirectoryNetEntry::id(), hal::SaleaeDirectoryNetEntry::indexes(), and hal::SaleaeDirectoryNetEntry::name().
Referenced by hal::SaleaeWriter::add_directory_entry(), hal::VcdSerializer::importSaleae(), and hal::WaveData::saveSaleae().
| void hal::SaleaeDirectory::clearAll | ( | ) |
Remove all files and reset internal variables.
Definition at line 34 of file saleae_directory.cpp.
References get_datafile_path(), and hal::gate_library_manager::remove().
Referenced by hal::Wizard::Wizard().
| std::vector< SaleaeDirectoryNetEntry > hal::SaleaeDirectory::dump | ( | ) | const |
Dump content of class instance to console for debugging purpose.
Definition at line 239 of file saleae_directory.cpp.
Referenced by saleae_diff(), and saleae_ls().
| SaleaeDirectoryComposedEntry hal::SaleaeDirectory::get_composed | ( | uint32_t | id, |
| SaleaeDirectoryNetEntry::Type | tp | ||
| ) | const |
Getter for pointer to composed waveform entry allowing modifications.
Definition at line 461 of file saleae_directory.cpp.
References hal::SaleaeDirectoryNetEntry::uniqueKey().
Referenced by hal::WaveDataTrigger::set_filter_wave().
| std::vector< SaleaeDirectoryComposedEntry > hal::SaleaeDirectory::get_composed_list | ( | ) | const |
Getter to list of all composed waveform entries.
Definition at line 469 of file saleae_directory.cpp.
| int hal::SaleaeDirectory::get_datafile_index | ( | const std::string & | nam, |
| uint32_t | id | ||
| ) | const |
Get waveform datafile index for net identified by name and id.
Definition at line 318 of file saleae_directory.cpp.
Referenced by hal::SaleaeWriter::add_or_replace_waveform(), get_datafile_path(), hal::NetlistSimulatorController::import_simulation(), hal::VcdSerializer::importSaleae(), hal::WaveData::saveSaleae(), and hal::PageInputData::validatePage().
| std::string hal::SaleaeDirectory::get_datafile_name | ( | int | index | ) | const |
Get waveform datafile name without path (digital_XXX.bin)
Definition at line 376 of file saleae_directory.cpp.
References index.
Referenced by get_datafile_path().
| std::string hal::SaleaeDirectory::get_datafile_path | ( | const std::string & | nam, |
| uint32_t | id | ||
| ) | const |
Get full path to waveform data file for net identified by name and id.
Definition at line 311 of file saleae_directory.cpp.
References get_datafile_index(), get_datafile_path(), and index.
| std::string hal::SaleaeDirectory::get_datafile_path | ( | int | index | ) | const |
Get full path to waveform data file.
Definition at line 301 of file saleae_directory.cpp.
References folderSeparator, get_datafile_name(), get_directory(), and index.
Referenced by hal::SaleaeWriter::add_or_replace_waveform(), clearAll(), hal::WaveData::fileName(), get_datafile_path(), hal::WaveData::get_events(), hal::WaveData::intValue(), hal::WaveData::loadSaleae(), hal::WaveData::neighborTransition(), hal::SaleaeParser::register_callback(), and hal::WaveData::saveSaleae().
| std::string hal::SaleaeDirectory::get_directory | ( | ) | const |
Get path to SALEAE directory without filename.
Definition at line 384 of file saleae_directory.cpp.
References folderSeparator.
Referenced by get_datafile_path(), hal::WaveTreeModel::handleStartValueThread(), hal::NetlistSimulatorController::import_simulation(), hal::WaveRenderEngine::paintEvent(), hal::WaveTreeModel::persist(), hal::WaveTreeModel::restore(), and hal::WaveData::saveSaleae().
| std::string hal::SaleaeDirectory::get_filename | ( | ) | const |
Get full path to saleae directory file including filename (/.../saleae.json)
Definition at line 391 of file saleae_directory.cpp.
Referenced by hal::WaveData::get_events(), and hal::NetlistSimulatorController::get_saleae_directory_filename().
| uint64_t hal::SaleaeDirectory::get_max_time | ( | ) | const |
Getter for maximum time.
Definition at line 330 of file saleae_directory.cpp.
Referenced by hal::SaleaeParser::get_max_time(), and hal::WaveDataList::updateFromSaleae().
| std::vector< SaleaeDirectory::ListEntry > hal::SaleaeDirectory::get_net_list | ( | ) | const |
Getter for all net entries.
Definition at line 353 of file saleae_directory.cpp.
References size.
Referenced by hal::WaveWidget::addableEntries(), and hal::WaveDataList::updateFromSaleae().
|
inline |
Getter for next available file index ('digital_XXX.bin' with lowest number XXX not in use)
Definition at line 270 of file saleae_directory.h.
Referenced by hal::SaleaeWriter::add_or_replace_waveform(), hal::WaveWidget::canImportWires(), hal::VcdSerializer::importSaleae(), and hal::WaveData::saveSaleae().
| bool hal::SaleaeDirectory::parse_json | ( | ) |
Parse .json file into class instance.
Definition at line 51 of file saleae_directory.cpp.
References hal::SaleaeDirectoryComposedEntry::add_child(), hal::SaleaeDirectoryNetEntry::addIndex(), hal::SaleaeDirectoryNetEntry::Boolean, hal::ff, hal::SaleaeDirectoryNetEntry::Group, name, hal::SaleaeDirectoryNetEntry::None, hal::SaleaeDirectoryComposedEntry::set_data(), hal::SaleaeDirectoryComposedEntry::set_filter_entry(), hal::SaleaeDirectoryNetEntry::Trigger, and hal::SaleaeDirectoryNetEntry::uniqueKey().
Referenced by SaleaeDirectory(), and hal::WaveDataList::updateFromSaleae().
| void hal::SaleaeDirectory::remove_composed | ( | uint32_t | id, |
| SaleaeDirectoryNetEntry::Type | tp | ||
| ) |
Remove composed waveform entry identified by id an type.
Definition at line 450 of file saleae_directory.cpp.
References hal::gate_library_manager::save(), and hal::SaleaeDirectoryNetEntry::uniqueKey().
Referenced by hal::WaveDataList::removeGroup().
| void hal::SaleaeDirectory::rename_net | ( | uint32_t | id, |
| const std::string & | nam | ||
| ) |
Change waveform name entry for net identified by id.
Definition at line 343 of file saleae_directory.cpp.
References hal::gate_library_manager::save().
Referenced by hal::WaveDataList::updateWaveName().
| void hal::SaleaeDirectory::update_file_indexes | ( | std::unordered_map< int, SaleaeDirectoryFileIndex > & | fileIndexes | ) |
Update file index information (like number of transitions, end time ...) after writing SALEAE files.
Definition at line 253 of file saleae_directory.cpp.
Referenced by hal::SaleaeWriter::~SaleaeWriter().
|
friend |
Definition at line 209 of file saleae_directory.h.