HAL  v4.5.0-147-gff98e36c6
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
Decorators
Collaboration diagram for Decorators:

Classes

class  hal::BooleanFunctionDecorator
 
class  hal::BooleanFunctionNetDecorator
 
class  hal::NetlistModificationDecorator
 
class  hal::TraversalCache
 
class  hal::NetlistTraversalDecorator
 
class  hal::SubgraphNetlistDecorator
 

Typedefs

using hal::SubgraphFunctionCache = std::map< std::pair< u32, const GatePin * >, BooleanFunction >
 

Enumerations

enum class  hal::TraversalDirection { hal::forward , hal::backward , hal::both }
 
enum class  hal::TraversalStop { hal::at_match , hal::at_mismatch , hal::never }
 

Detailed Description

Typedef Documentation

◆ SubgraphFunctionCache

using hal::SubgraphFunctionCache = typedef std::map<std::pair<u32, const GatePin*>, BooleanFunction>

Cache for the Boolean functions that SubgraphNetlistDecorator::get_subgraph_function computes for the output pins of gates. It maps a pair of gate ID and output pin to the Boolean function of that pin, with the variables already replaced by the corresponding nets.

Passing the same cache to consecutive calls of get_subgraph_function avoids recomputing logic that several subgraphs share. The cache is filled by these calls and should initially be empty. It must not be reused after the netlist has been modified.

In Python, the cache is available as hal_py.SubgraphFunctionCache and is passed by reference, so it is filled across calls just as in C++.

Definition at line 50 of file subgraph_function_cache.h.

Enumeration Type Documentation

◆ TraversalDirection

The direction in which a netlist is traversed.

Enumerator
forward 

Follow the fan-out, i.e., towards the successors of a gate.

backward 

Follow the fan-in, i.e., towards the predecessors of a gate.

both 

Follow both, and report the union of the two.

Definition at line 41 of file netlist_traversal_decorator.h.

◆ TraversalStop

enum hal::TraversalStop
strong

Where a traversal stops relative to the gates it is looking for.

A traversal walks the netlist collecting the gates a filter accepts. What separates one traversal from another is not what it collects but where it comes to a halt, and these are the three ways that can be answered.

Enumerator
at_match 

Stop at a gate the filter accepts. The gates collected are the boundary of the search: they are reported but not traversed through, so what lies behind them is not reached. This is how one asks for the next flip-flops behind a cone of combinational logic.

at_mismatch 

Stop at a gate the filter rejects. Only gates the filter accepts are traversed through, so the gates collected form one connected region of them. This is how one asks for the combinational logic between two registers.

never 

Do not stop at a gate at all. Everything reachable is traversed and every gate the filter accepts is collected on the way. Bound this with a depth or with the endpoint filters, or it walks to the edges of the netlist.

Definition at line 57 of file netlist_traversal_decorator.h.