Skip to content

DfX-NYUAD/randomize_netlist

Repository files navigation

This tool serves to randomize Verilog netlists (synthesized for the Nangate 45nm lib). Note that the lib support is generic; see the folder Nangate_45nm_combinatorial_cells for more details. Currently, only combinational cells are supported.

The code supports multi-threading and various randomization options. It has been thoroughly tested across ITC benchmarks. See the sample_files folder.

There is also a branch that contains only the code for HD evaluation, HD_only.

The options/parameters for the program are the following:
IO> Usage: ./Randomize_Netlist netlist.v cells.inputs cells.outputs cells.functions [--golden_netlist=netlist.v --gates_to_delete= --also_output_scrambled_netlists=0 --threads=1 --intermediate_output_HD_step=0.05 --HD_target=0.5 --acceptance_ratio=0.01 --HD_sampling_iterations=1,000 --lazy_Boolean_evaluation=1 --consider_fanout=0 --consider_driving_strength=1 --random_op=-1]
IO>
IO> Mandatory parameter netlist.v: Netlist to be randomized
IO> Mandatory parameter cells.inputs: Cells and their inputs
IO> Mandatory parameter cells.outputs: Cells and their outputs
IO> Mandatory parameter cells.functions: Cells and their output functions
IO> Optional parameter golden_netlist: Golden or reference netlist used for HD evaluation -- providing the very original file here and an already (partially) randomized netlist for netlist.v allows to continue the randomization of netlist.v; default value: netlist.v
IO> Optional parameter gates_to_delete: List of gates to be deleted; no default value
IO> Optional parameter also_output_scrambled_netlists: Besides, randomized netlists, also generate scrambled netlists; default value: 0
IO> Optional parameter threads: Threads for parallel runs; default value: 1
IO> Optional parameter intermediate_output_HD_step: Write out intermediate results/netlist, for every X step from HD 0.0 to HD_target; default value: 0.05
IO> Optional parameter HD_target: Target value for HD [0.0 - 1.0]; default value: 0.5
IO> Optional parameter acceptance_ratio: Ratio for accepting some modification with inferior HD [0.0 - 1.0]; default value: 0.01
IO> Optional parameter HD_sampling_iterations: Iterations for HD evaluation; default value: 1,000
IO> Optional parameter lazy_Boolean_evaluation: parsing of Boolean strings is short-cut whenever possible during the HD evaluation, but in case there are unsupported or erroneous parts in the Boolean function strings, the HD values will be wrong -- it's recommend to use this feature only once regular evaluation was tried, which reports on such errors; default value: 1
IO> Optional parameter consider_fanout: when swapping outputs for a pair of gate, try to match the fan-out for those outputs; default value: 0
IO> Optional parameter consider_driving_strength: when replacing the underlying cell type, try to keep the same driving strength; default value: 1
IO> Optional parameter random_op: Integer code for the random operation to be applied; possible values:
IO> Replace underlying cell type: 1
IO> Swap outputs for a pair of gates: 2
IO> Swap inputs for a pair of gates: 3
IO> Delete a gate: 4
IO> Insert a gate: 5
IO> Note that there's no default value for random_op -- in case this parameter is not provided, the above operations will be picked randomly

OTHER NOTES

Idea for speeding up HD comp:

  • Use string-based evaluation only during parsing.
  • Namely, go through all rows in truth table for each cell's functions E.g., A, B, C will give 8 rows
  • These rows are evaluated using string evaluation
  • The results are stored in vector<bool>
  • The vector is used later on, during actual evaluation runs
  • There, the vector index/adress is based on the input patterns E.g., A=0, B=1, C=0 is index/address 2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages