HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::SaleaeDirectory Class Reference

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...

#include </home/runner/work/hal/hal/plugins/simulator/netlist_simulator_controller/include/netlist_simulator_controller/saleae_directory.h>

Collaboration diagram for hal::SaleaeDirectory:
Collaboration graph

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< SaleaeDirectoryNetEntrydump () 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< ListEntryget_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< SaleaeDirectoryComposedEntryget_composed_list () const
 Getter to list of all composed waveform entries. More...
 

Friends

class SaleaeDirectoryStoreRequest
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SaleaeDirectory()

hal::SaleaeDirectory::SaleaeDirectory ( const std::string &  path,
bool  create = false 
)

Member Function Documentation

◆ add_or_replace_composed()

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().

◆ add_or_replace_net()

void hal::SaleaeDirectory::add_or_replace_net ( SaleaeDirectoryNetEntry sdne)

◆ clearAll()

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().

◆ dump()

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().

◆ get_composed()

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().

◆ get_composed_list()

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.

◆ get_datafile_index()

int hal::SaleaeDirectory::get_datafile_index ( const std::string &  nam,
uint32_t  id 
) const

◆ get_datafile_name()

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().

◆ get_datafile_path() [1/2]

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.

◆ get_datafile_path() [2/2]

◆ get_directory()

◆ get_filename()

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().

◆ get_max_time()

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().

◆ get_net_list()

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().

◆ get_next_available_index()

int hal::SaleaeDirectory::get_next_available_index ( ) const
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().

◆ parse_json()

◆ remove_composed()

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().

◆ rename_net()

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().

◆ update_file_indexes()

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().

Friends And Related Function Documentation

◆ SaleaeDirectoryStoreRequest

friend class SaleaeDirectoryStoreRequest
friend

Definition at line 209 of file saleae_directory.h.


The documentation for this class was generated from the following files: