GithubHelp home page GithubHelp logo

cynthi8 / gnnunlock Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 182.67 MB

Reproduction of https://github.com/DfX-NYUAD/GNNUnlock

Verilog 99.98% Python 0.02% Shell 0.01% Tcl 0.01%
hardware-security machine-learning networkx reproduction

gnnunlock's Introduction

GNNUnlock

Reproduction of https://github.com/DfX-NYUAD/GNNUnlock

This project reproduces the steps of Lilas Alrahis et al. in GNNUnlock up to evaluating the GNN (Graph Neural Network).

SFLL-HD explains that I was able reproduce the success of the original authors for netlists locked with SFLL-HD and Cross Compilation explains an essential shortcoming with GNNUnlock.

SFLL-HD

I chose to reproduce the setup in ANTI_SAT_DATASET_c7552 except with SFLL-HD_2. This setup uses 24 netlists of c2670 and c5315 as training graphs, 9 netlists of c3540 as validation graphs, and 12 netlists of c7552 as testing graphs (total: 45 netlists). Each netlist is locked with various key sizes and different values and are contained in Datasets/SFLL_HD_2.

The training log for this setup is shown in Datasets/SFLL_HD_2/log_training.txt. The GNN performance on the test graphs is shown below:

Confusion Matrix

True \ Predicted restore perturb main
restore 888 0 0
perturb 0 654 22
main 15 5 8518

F1 Score by Class

main perturb restore
0.992 0.980 0.998

Cross Compilation

In GNNUnlock, training, validation, and testing are all done on non-cross-compiled netlists. Any realistic implementation of logic locking would flatten the design heirarchy before compiling which would further obfuscate the main design/pertub/restore node classes.

All netlists were compiled with Synthesizer/dc_shell_script.tcl, while Synthesizer/dc_shell_script_cross_compile.tcl would be a more "realistic" implementation.

Setup Steps:

  1. Run source setup_conda_env.sh to setup the anaconda enviroment
  2. Run setup_GraphSAINT.sh to clone GraphSAINT and build it

Remain in the gnnunlock-env anaconda enviroment while working within this repository.

Reproduction Steps:

The bolded directories at each step contain the relevant files.

  1. Obtain Benchmarks in Bench format. These are already saved in Benchmarks
  2. Convert to Verilog. python convert_bench_files_to_verilog.py
  3. Lock with SFLL and AntiSAT. python lock_netlists.py
  4. Synthesize with Design Compiler™. Examples are already saved in SynthesizedLockedNetlists
cd Synthesizer/ 
python synthesize_netlists.py
  1. Assign roles (train, validation, test). Examples are saved in Datasets
  2. Convert to graph and extract features.
python convert_netlists_to_graph.py
  1. Train GNN.
./trainGNN.sh

Epochs Trained

Adjust the phase: end parameter in DATE21.yml to increase the training time. Data were collected with end: 2000 to be consistant with GNNUnlock.

gnnunlock's People

Contributors

cynthi8 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

gnnunlock's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.