|
HAL
v4.5.0-254-g8f9f6a423
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
Classes | |
| struct | LOC |
| Information on a LOC. More... | |
| struct | CellData |
| Data of a cell on the FPGA fabric. More... | |
| class | GuiLayoutLocker |
| Suppresses layout updates of the GUI for as long as the object exists. More... | |
Enumerations | |
| enum | BELType { A6LUT , B6LUT , C6LUT , D6LUT , A5LUT , B5LUT , C5LUT , D5LUT , F7AMUX , F7BMUX , F8MUX , CARRY4 , AFF , BFF , CFF , DFF , A5FF , B5FF , C5FF , D5FF , BUFG , INBUF_EN , OUTBUF } |
| BEL types relevant for XDC file parsing. More... | |
| enum | LOCType { SLICE , RAMB36 , BUFGCTRL , PIN } |
| LOC types relevant for XDC file parsing. More... | |
Functions | |
| Result< std::monostate > | split_lut (Gate *g, bool create_module=false) |
Split a single LUT6_2 gate into up to two separate LUT gates. More... | |
| Result< u32 > | split_luts (const std::vector< Gate * > &gates, bool create_module=false) |
Split a set of LUT6_2 gates into separate LUT gates. More... | |
| Result< u32 > | split_luts (Netlist *nl, const std::vector< Gate * > &gates={}, bool create_module=false) |
Split the LUT6_2 gates of the netlist, or of the given gates, into separate LUT gates. More... | |
| Result< std::monostate > | split_shift_register (Gate *g, bool create_module=false) |
Split a single shift register primitive into an equivalent chain of FDCE flip-flops. More... | |
| Result< u32 > | split_shift_registers (const std::vector< Gate * > &gates, bool create_module=false) |
Split a set of shift register primitives into equivalent FDCE flip-flop chains. More... | |
| Result< u32 > | split_shift_registers (Netlist *nl, const std::vector< Gate * > &gates={}, bool create_module=false) |
Split the shift register primitives of the netlist, or of the given gates, into FDCE flip-flop chains. More... | |
| Result< u32 > | remove_no_load_wires (Netlist *nl, const std::vector< Net * > &nets={}) |
| Remove the "no load wire" nets that Vivado writes for unused output pins. More... | |
| Result< std::monostate > | parse_xdc_file (Netlist *nl, const std::filesystem::path &xdc_file) |
Parse an .xdc file and extract the position LOC and BEL data of each gate. More... | |
Applies Xilinx-specific placement information from an XDC file to a netlist.
BEL types relevant for XDC file parsing.
| Result< std::monostate > hal::xilinx_toolbox::parse_xdc_file | ( | Netlist * | nl, |
| const std::filesystem::path & | xdc_file | ||
| ) |
Parse an .xdc file and extract the position LOC and BEL data of each gate.
Translates the coordinates extracted from the .xdc file into integer values.
| [in] | nl | - The netlist to operate on. |
| [in] | xdc_file | - The path to the .xdc file. |
Definition at line 220 of file xdc_parser.cpp.
References ERR.
Referenced by hal::PYBIND11_PLUGIN().
| Result< u32 > hal::xilinx_toolbox::remove_no_load_wires | ( | Netlist * | nl, |
| const std::vector< Net * > & | nets = {} |
||
| ) |
Remove the "no load wire" nets that Vivado writes for unused output pins.
Vivado names such nets NLW_<instance>_<pin>_UNCONNECTED and only connects them to the output pin they stand in for. A net is removed if its name starts with NLW_ (or has NLW_ right after a / in a flattened path) and ends with _UNCONNECTED, optionally followed by a bit index such as (2) or [2], it has no destinations, and it is not a global output. The output pins that drove the removed nets are left unconnected.
| [in] | nl | - The netlist to operate on. |
| [in] | nets | - The nets to consider. Defaults to an empty vector, in which case all nets of the netlist are considered. |
Definition at line 466 of file preprocessing.cpp.
References hal::Netlist::delete_net(), ERR, hal::Netlist::get_id(), hal::Netlist::get_nets(), log_info, name, and OK.
Referenced by hal::GuiExtensionXilinxToolbox::execute_function(), and hal::PYBIND11_PLUGIN().
Split a single LUT6_2 gate into up to two separate LUT gates.
Creates replacement gates depending on which outputs are connected:
O6 → LUT6 using all 64 bits of the INIT string and all 6 inputs.O5 → LUT5 using bits [0, 31] of the INIT string and inputs I0-I4 (I5 is excluded, as it only selects the INIT half).The original LUT6_2 gate is always deleted. The original INIT string is stored on each replacement gate under xilinx_preprocessing_information/original_init.
| [in] | g | - The LUT6_2 gate to split. |
| [in] | create_module | - If true, a new module named after the original gate is created as a child of its parent module and all replacement gates are placed into it. If false (default), replacement gates inherit the parent module of the original gate. |
g is not of type LUT6_2, if the INIT string is malformed, or if the gate cannot be deleted. Definition at line 78 of file preprocessing.cpp.
References hal::Module::assign_gate(), hal::Netlist::create_gate(), hal::Netlist::create_module(), hal::Netlist::delete_gate(), ERR, hal::GateTypeComponent::get_component_as(), hal::GateType::get_component_as(), hal::Gate::get_fan_in_endpoints(), hal::Gate::get_fan_out_net(), hal::Netlist::get_gate_library(), hal::GateLibrary::get_gate_type_by_name(), hal::Gate::get_id(), hal::LUTComponent::get_init_string(), hal::Gate::get_module(), hal::Gate::get_name(), hal::GateType::get_name(), hal::Gate::get_netlist(), hal::Gate::get_type(), hal::GateTypeComponent::get_type(), hal::Module::is_top_module(), log_warning, hal::GateTypeComponent::lut, OK, and hal::DataContainer::set_data().
Referenced by hal::PYBIND11_PLUGIN(), and split_luts().
| Result< u32 > hal::xilinx_toolbox::split_luts | ( | const std::vector< Gate * > & | gates, |
| bool | create_module = false |
||
| ) |
Split a set of LUT6_2 gates into separate LUT gates.
Calls split_lut for each gate in gates. Gates that cannot be split are skipped with a warning; processing always continues with the remaining gates.
| [in] | gates | - The LUT6_2 gates to split. |
| [in] | create_module | - If true, each split gate's replacements are placed into a new module named after the original gate. If false (default), replacements inherit the parent module of the original gate. |
Definition at line 199 of file preprocessing.cpp.
References log_info, log_warning, OK, and split_lut().
Referenced by hal::GuiExtensionXilinxToolbox::execute_function(), hal::PYBIND11_PLUGIN(), and split_luts().
| Result< u32 > hal::xilinx_toolbox::split_luts | ( | Netlist * | nl, |
| const std::vector< Gate * > & | gates = {}, |
||
| bool | create_module = false |
||
| ) |
Split the LUT6_2 gates of the netlist, or of the given gates, into separate LUT gates.
Finds all gates of type LUT6_2 within gates (or within the netlist if gates is empty) and calls split_luts(gates).
| [in] | nl | - The netlist to operate on. |
| [in] | gates | - The gates to consider. Defaults to an empty vector, in which case all gates of the netlist are considered. |
| [in] | create_module | - If true, each split gate's replacements are placed into a new module named after the original gate. If false (default), replacements inherit the parent module of the original gate. |
LUT6_2 gates. Definition at line 217 of file preprocessing.cpp.
References hal::Gate::get_type(), and split_luts().
| Result< std::monostate > hal::xilinx_toolbox::split_shift_register | ( | Gate * | g, |
| bool | create_module = false |
||
| ) |
Split a single shift register primitive into an equivalent chain of FDCE flip-flops.
Supported gate types: SRL16, SRL16E, SRLC16E, SRLC32E.
Every address pin must be connected and driven by a constant (GND/VCC) net; an error is returned otherwise. The number of flip-flops created equals select_value + 1, where select_value is the binary value encoded by the address pins (A0 = bit 0). When the cascade output (Q15 for SRLC16E, Q31 for SRLC32E) has downstream consumers, all stages up to the maximum depth (15 or 31) are materialised so that the last flip-flop correctly drives the cascade net.
The original gate is always deleted on success.
| [in] | g | - The shift register gate to split. |
| [in] | create_module | - If true, a new module named after the original gate is created as a child of its parent module and all replacement flip-flops are placed into it. If false (default), replacement flip-flops inherit the parent module of the original gate. |
g is not a supported shift register type, if any address pin is unconnected or not driven by a constant (GND/VCC) net, or if the gate cannot be deleted. Definition at line 222 of file preprocessing.cpp.
References hal::Net::add_destination(), hal::Net::add_source(), hal::Module::assign_gate(), hal::clock, hal::control, hal::Netlist::create_gate(), hal::Netlist::create_module(), hal::Netlist::create_net(), hal::data, hal::Netlist::delete_gate(), hal::enable, ERR, hal::ff, hal::Net::get_destinations(), hal::BasePin< T >::get_direction(), hal::Gate::get_fan_in_net(), hal::Gate::get_fan_out_net(), hal::Netlist::get_gate_library(), hal::GateLibrary::get_gate_type_by_name(), hal::Gate::get_id(), hal::Gate::get_module(), hal::Gate::get_name(), hal::GateType::get_name(), hal::Gate::get_netlist(), hal::Net::get_num_of_destinations(), hal::DataContainer::get_parameter_value(), hal::GateType::get_pins(), hal::Gate::get_type(), hal::BasePin< T >::get_type(), hal::DataContainer::has_parameter(), hal::input, hal::Net::is_gnd_net(), hal::Module::is_top_module(), hal::Net::is_vcc_net(), log_warning, OK, and hal::Net::remove_destination().
Referenced by hal::PYBIND11_PLUGIN(), and split_shift_registers().
| Result< u32 > hal::xilinx_toolbox::split_shift_registers | ( | const std::vector< Gate * > & | gates, |
| bool | create_module = false |
||
| ) |
Split a set of shift register primitives into equivalent FDCE flip-flop chains.
Supported gate types: SRL16, SRL16E, SRLC16E, SRLC32E.
Calls split_shift_register for each gate in gates. Gates that cannot be split (e.g. because an address pin is not driven by a constant net) are skipped with a warning; processing always continues with the remaining gates.
| [in] | gates | - The shift register gates to split. |
| [in] | create_module | - If true, each split gate's replacements are placed into a new module named after the original gate. If false (default), replacements inherit the parent module of the original gate. |
Definition at line 443 of file preprocessing.cpp.
References log_info, log_warning, OK, and split_shift_register().
Referenced by hal::GuiExtensionXilinxToolbox::execute_function(), hal::PYBIND11_PLUGIN(), and split_shift_registers().
| Result< u32 > hal::xilinx_toolbox::split_shift_registers | ( | Netlist * | nl, |
| const std::vector< Gate * > & | gates = {}, |
||
| bool | create_module = false |
||
| ) |
Split the shift register primitives of the netlist, or of the given gates, into FDCE flip-flop chains.
Supported gate types: SRL16, SRL16E, SRLC16E, SRLC32E.
Finds all gates of one of the supported types within gates (or within the netlist if gates is empty) and calls split_shift_registers(gates).
| [in] | nl | - The netlist to operate on. |
| [in] | gates | - The gates to consider. Defaults to an empty vector, in which case all gates of the netlist are considered. |
| [in] | create_module | - If true, each split gate's replacements are placed into a new module named after the original gate. If false (default), replacements inherit the parent module of the original gate. |
Definition at line 461 of file preprocessing.cpp.
References hal::GateType::get_name(), hal::Gate::get_type(), and split_shift_registers().