|
HAL
v4.5.0-232-g8053ac4b3
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
Functions | |
| Result< std::vector< std::string > > | upgrade_document (rapidjson::Document &document) |
| std::filesystem::path | get_backup_path (const std::filesystem::path &file_path) |
| Result< std::filesystem::path > | replace_file (const rapidjson::Document &document, const std::filesystem::path &file_path) |
Variables | |
| const u32 | TARGET_VERSION = 6 |
Upgrade of gate library files in HGL format from an older format version to version 6.
What changed in version 6:
{data_identifier, data_category, bit_order} is replaced by an output_pins array, where each entry specifies the output pin, its data_identifier, bit_offset, bit_count, is_ascending and input_pins.parameters section, so that INIT identifiers can be resolved by name and size: one bit_vector parameter of size 2^n per LUT identifier, of size 1 per flip-flop or latch identifier, and of size bit_size / count per RAM identifier.c_ prefix (buffer, carry, mux, lut) are renamed to their canonical forms. | std::filesystem::path hal::hgl_upgrade::get_backup_path | ( | const std::filesystem::path & | file_path | ) |
Get the file name the original gate library is kept under after its upgrade.
The .hgl extension is replaced by .json, so that the original file does not get selected as a gate library by accident.
| [in] | file_path | - The path of the gate library file. |
Definition at line 316 of file upgrade_hgl.cpp.
Referenced by replace_file().
| Result< std::filesystem::path > hal::hgl_upgrade::replace_file | ( | const rapidjson::Document & | document, |
| const std::filesystem::path & | file_path | ||
| ) |
Replace a gate library file by an upgraded document.
The original file is renamed as given by get_backup_path and the document is written under the original name, so that projects referring to the gate library need no changes. If writing fails, the original file is restored.
| [in] | document | - The upgraded HGL document. |
| [in] | file_path | - The path of the gate library file to replace. |
Definition at line 323 of file upgrade_hgl.cpp.
References ERR, get_backup_path(), OK, and hal::gate_library_manager::remove().
| Result< std::vector< std::string > > hal::hgl_upgrade::upgrade_document | ( | rapidjson::Document & | document | ) |
Upgrade a parsed HGL document in place.
A document that is already at the target version is left unchanged. Cells that cannot be migrated automatically are left unchanged as well and reported by a warning.
| [in,out] | document | - The parsed HGL document. |
Definition at line 261 of file upgrade_hgl.cpp.
References ERR, OK, and TARGET_VERSION.
| const u32 hal::hgl_upgrade::TARGET_VERSION = 6 |
The format version gate libraries are upgraded to.
Definition at line 58 of file upgrade_hgl.h.
Referenced by upgrade_document().