Skip to content

Commit 0b70179

Browse files
authored
feature/documentation (#35)
* Add main features and install steps * Add Readme, badges and LUT transformation diagram (#38) Added: * Changed README to reStructuredText * Added basic usage documentation and examples * Added LUT transformation diagram * Added badges (python version andMODNET last stable version) * Linked README.rst to pypi project description implemented in setup.py with `long_description` configuration
1 parent ddde01f commit 0b70179

4 files changed

Lines changed: 117 additions & 4 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.rst

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
MODify NETlist: A tool for processing verilog netlists and inserting fault injections at RTL level.
2+
===================================================================================================
3+
.. image:: https://img.shields.io/pypi/v/mod-net.svg
4+
:target: https://pypi.org/project/mod-net/
5+
.. image:: https://img.shields.io/badge/python-3.7-blue.svg
6+
:target: https://pypi.org/project/mod-net/
7+
.. image:: https://circleci.com/gh/LCSR-lab/MODNET.svg?style=shield
8+
:target: https://circleci.com/gh/LCSR-lab/MODNET
9+
.. image:: https://coveralls.io/repos/github/LCSR-lab/MODNET/badge.svg?branch=master
10+
:target: https://coveralls.io/github/LCSR-lab/MODNET?branch=master
11+
12+
|
13+
14+
.. figure:: _doc/lut.png
15+
:width: 200px
16+
:align: center
17+
:height: 100px
18+
:alt: LUT transformation
19+
:figclass: align-center
20+
21+
|
22+
23+
MODNET is a tool that takes the Netlist of a circuit which it will submit, making changes to the places that are considered sensitive, so that the fault injection possible. The HDL code of the circuit to be submitted is synthesized using the "Synplify Pro" synthesis tool. In this tool you choose for which type of technology you want to synthesize the HDL code, it generates the Netlist in Verilog of the device under test (DUT). The generated Netlist is put in the entry in the MODNET tool (Modify NETlist), developed to automate the process of modification of the Xilinx libraries. Some of the modified components are the FD (flip-flop D) and its different copies (FDC, FDE ... etc) and also the LUTs (Look-Up Table), logic gates and multiplexers are included. The exit MODNET is the modified Netlist with a large number of extra input signals used to inject the flaws into the logs and logic gates, in this way It is possible to prepare an RTL so that SEUs and SETs can be injected. In this sense the original internal architecture is not changed and is respected as it is.
24+
25+
Main Features
26+
-------------
27+
28+
* Simple implementation to create SEU and SET injections in Synplify Pro/Premier verilog netlists
29+
* Easly extendible for other netlists sources (Vivado, Yosys, etc.)
30+
* Thought from the begining to be automated into pipelines (fault-injection as a service)
31+
32+
33+
34+
Installing
35+
----------
36+
37+
Install using pip:
38+
39+
.. code-block:: python
40+
41+
pip install mod-net
42+
43+
44+
Creating injections
45+
--------------------
46+
cd into a directory where MODNET can find the Nestlist that will be modified with the desired injections, then run the following command:
47+
48+
.. code-block:: text
49+
50+
$ modnet --netlist path/to/netlist.vm --top-module top_module --outdir path/to/save/output
51+
52+
These 3 options are those required by the software to interpret the netlist correctly. This settings are:
53+
54+
* `netlist`: The path where to find the netlist to make changes to (as of today, only hierarchical netlists from Synplify Pro are supported)
55+
* `top_module`: This is the module that acts as top for the hole system. Since MODNET interpretates the netlist recursively, it is necessary to indicate which module acts as the top module.
56+
* `outdir`: This is the path where to save the resulting modules with injections (defaults to path/to/netlist/output)
57+
58+
This will create two directories in your current directory. As an example my directory will be called `example`.
59+
60+
Let’s look at what MODNET created:
61+
62+
::
63+
64+
example/
65+
├── netlist.vm
66+
└─ output
67+
│   ├── module1_with_inj.v
68+
│   ├── module2_with_inj.v
69+
│   ├── module3_with_inj.v
70+
│   ├── module4_with_inj.v
71+
│   ├── module5_with_inj.v
72+
│   └── module6_with_inj.v
73+
└── src
74+
├── module1.v
75+
├── module2.v
76+
├── module3.v
77+
├── module4.v
78+
├── module5.v
79+
└── module6.v
80+
81+
These files are:
82+
83+
* The outer example/ root directory is a container for your project. Its name doesn’t matter to MODNET; you can rename it anytime you like.
84+
* The inner output/ directory modified modules will be placed.
85+
* The inner src/ directory original modules will be placed.
86+
87+
Development
88+
----------
89+
In case you are looking to extend or improve this project, you'll first need to setup your development workflow. The project works with Docker and docker-compose. You can find information about `Install docker <https://docs.docker.com/install/>`_ and `Install docker compose <https://docs.docker.com/compose/install/>`_ in the official documentation.
90+
91+
In the project root directory, run:
92+
93+
.. code-block:: text
94+
95+
$ docker-compose up
96+
97+
98+
For the first time the docker image will be built. The compose configuration mounts the volume for the python library itself, so any chances made in the code, will be automatically mounted in the Docker container.
99+
100+
Testing
101+
-------
102+
This project counts with a set of unit tests made with `pytest <https://docs.pytest.org/en/stable/>`_. To run the complete set of sets run the following command:
103+
104+
.. code-block:: bash
105+
106+
$ docker-compose run tests
107+
108+
This will lunch a new Docker container that runs the run_tests.sh script, which installs the necessary requirements for the tests to run.

_doc/lut.png

20.1 KB
Loading

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@
1616
""".format(*(REQUIRED_PYTHON + CURRENT_PYTHON)))
1717
sys.exit(1)
1818

19+
# read the contents of your README file
20+
from os import path
21+
this_directory = path.abspath(path.dirname(__file__))
22+
with open(path.join(this_directory, 'README.rst'), encoding='utf-8') as f:
23+
long_description = f.read()
24+
1925
setup(
2026
name="mod-net",
21-
version="v2.0.0-beta4",
27+
version="v2.0.0-beta5",
2228
description="Make SET and SEU fault injections in hierarchical verilog netlists",
29+
long_description=long_description,
30+
long_description_content_type='text/x-rst',
2331
packages=find_packages(exclude=("tests",)),
2432
install_requires=[
2533
'Click==7.*',

0 commit comments

Comments
 (0)