Giter Club home page Giter Club logo

trojansaint's Introduction

TrojanSAINT: Gate-Level Netlist Sampling-BasedInductive Learning for Hardware Trojan Detection

Training/Validation/Test Preparation

To prepare your training, validation and test sets, first ensure you have the train, val, and test directories. If not, you can simply make them by running

mkdir train
mkdir val
mkdir test

Go into your nets directory

cd nets

Run split.py. Be careful that you have nothing important in your train, val, and test as this script will empty them. split.py accepts a single integer as argument indicating which file will be used for testing. This integer indicates the position of the file in alphabetical order (so an argument of 0 will select rs232t1000.v, for example)

python split.py

Converting Into Graph

We provide a parser that takes the verilog files as input and converts them into the format needed for use with GraphSAINT

To run it, you first need to prepare your training, validation and test sets as described above. Then simply run:

python parser.py

Note that the script needs verilog_lib.v in the same directory. Once it is run, adj_full.npz, adj_train.npz, class_map.json, feats.npy, role.json will be generated. Those can then be used with GraphSAINT

Training and Inference with GraphSAINT

Training and inference is done on GraphSAINT, which is included here as submodule.

We make slight modifications to the graphsaint/pytorch_version/train.py file to save the outputs, and we include the modified version in this repo, so make sure to use this submodule here. To run training, simply follow the instructions on the GraphSAINT repository using the new files and the DATE21.yaml

trojansaint's People

Contributors

jknechtel avatar hl3372 avatar

Stargazers

Md Omar Faruque avatar  avatar Sung-Ping Wang avatar b4nbird avatar  avatar lizongtai avatar dengyun avatar QuentinT avatar

Watchers

 avatar QuentinT avatar

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.