-
Notifications
You must be signed in to change notification settings - Fork 76
Netlist Utilities
nils1603 edited this page Oct 27, 2020
·
10 revisions
The netlist utils class provides several utility functions that aid reverse engineering.
It is often desirable to generate a boolean function that combines multiple gates. Therefore the get subgraph function can be used. It takes as input a set of gates and the output net, for which a boolean function, depending on the provided set of gates, should be generated (see the python doc). It is important to note that the variables in the Boolean function are the IDs of the nets in the netlist. Furthermore, the generated Boolean function is not optimized yet. An example code looks as following:
gate1 = netlist.get_gate_by_id(1)
gate2 = netlist.get_gate_by_id(2)
subgraph = [gate1, gate2]
output_net = netlist.get_net_by_id(10)
bf = hal_py.NetlistUtils.get_subgraph_function(subgraph, output_net)
print(bf.optimize())
This might return the following output: 3 & 4 & 5 & 6 & 7 & 8 & 9
We will extend this class with more useful functions over time 👍