HAL  v4.5.0-124-g47ab54673
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::bitorder_propagation::BitOrder Class Reference

#include </home/runner/work/hal/hal/plugins/bitorder_propagation/include/bitorder_propagation/bit_order.h>

Collaboration diagram for hal::bitorder_propagation::BitOrder:
Collaboration graph

Public Member Functions

 BitOrder (Module *module, PinGroup< ModulePin > *pin_group, std::vector< std::pair< Net *, u32 >> order)
 
Moduleget_module () const
 
PinGroup< ModulePin > * get_pin_group () const
 
const std::vector< std::pair< Net *, u32 > > & get_order () const
 
std::optional< u32get_index (const Net *net) const
 
Netget_net_at (u32 index) const
 
u32 get_size () const
 
bool is_continuous () const
 
bool operator== (const BitOrder &other) const
 
bool operator!= (const BitOrder &other) const
 

Detailed Description

The bit order of a single module pin group, i.e., which net of the pin group carries which bit.

The index of a net is stored with it rather than implied by its position, so that an order with gaps in it can be expressed. Propagation produces a continuous order today, but it is not guaranteed to keep doing so, and the pin group a bit order belongs to need not start at index 0 either.

Definition at line 61 of file bit_order.h.

Constructor & Destructor Documentation

◆ BitOrder()

hal::bitorder_propagation::BitOrder::BitOrder ( Module module,
PinGroup< ModulePin > *  pin_group,
std::vector< std::pair< Net *, u32 >>  order 
)

Construct a bit order for a module pin group.

The order is sorted by index, so that iterating over it walks the bits from the lowest index to the highest no matter in which order they were discovered.

Parameters
[in]module- The module the pin group belongs to.
[in]pin_group- The pin group.
[in]order- The index of each net of the pin group.

Definition at line 12 of file bit_order.cpp.

Member Function Documentation

◆ get_index()

std::optional< u32 > hal::bitorder_propagation::BitOrder::get_index ( const Net net) const

Get the index of the given net.

Parameters
[in]net- The net.
Returns
The index of the net, or std::nullopt if the net is not part of this bit order.

Definition at line 33 of file bit_order.cpp.

References net.

Referenced by hal::PYBIND11_PLUGIN().

◆ get_module()

Module * hal::bitorder_propagation::BitOrder::get_module ( ) const

Get the module that the pin group belongs to.

Returns
The module.

Definition at line 18 of file bit_order.cpp.

Referenced by hal::bitorder_propagation::BitOrderResult::add(), and hal::PYBIND11_PLUGIN().

◆ get_net_at()

Net * hal::bitorder_propagation::BitOrder::get_net_at ( u32  index) const

Get the net at the given index.

Parameters
[in]index- The index.
Returns
The net at the index, or a nullptr if no net carries that index.

Definition at line 39 of file bit_order.cpp.

References index.

Referenced by hal::PYBIND11_PLUGIN().

◆ get_order()

const std::vector< std::pair< Net *, u32 > > & hal::bitorder_propagation::BitOrder::get_order ( ) const

Get the index of every net, ordered by index.

Returns
The nets and their indices.

Definition at line 28 of file bit_order.cpp.

Referenced by hal::PYBIND11_PLUGIN().

◆ get_pin_group()

PinGroup< ModulePin > * hal::bitorder_propagation::BitOrder::get_pin_group ( ) const

Get the pin group whose bit order this is.

Returns
The pin group.

Definition at line 23 of file bit_order.cpp.

Referenced by hal::bitorder_propagation::BitOrderResult::add(), and hal::PYBIND11_PLUGIN().

◆ get_size()

u32 hal::bitorder_propagation::BitOrder::get_size ( ) const

Get the number of nets that the bit order covers.

Returns
The number of nets.

Definition at line 45 of file bit_order.cpp.

Referenced by hal::PYBIND11_PLUGIN().

◆ is_continuous()

bool hal::bitorder_propagation::BitOrder::is_continuous ( ) const

Check whether the indices run from 0 without leaving a gap.

Returns
true if the order is continuous, false otherwise.

Definition at line 50 of file bit_order.cpp.

Referenced by hal::PYBIND11_PLUGIN().

◆ operator!=()

bool hal::bitorder_propagation::BitOrder::operator!= ( const BitOrder other) const

Definition at line 68 of file bit_order.cpp.

◆ operator==()

bool hal::bitorder_propagation::BitOrder::operator== ( const BitOrder other) const

Definition at line 63 of file bit_order.cpp.


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