Skip to content

Commit 90a2d26

Browse files
committed
Updated README and setup.py
1 parent 7911c26 commit 90a2d26

File tree

3 files changed

+66
-28
lines changed

3 files changed

+66
-28
lines changed

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ You can create your own design analyzer, code translator and code generator of V
5454
Installation
5555
==============================
5656

57-
Software Requirements
57+
Requirements
5858
--------------------
5959

6060
- Python: 2.7, 3.4 or later
6161

62+
Python3 is recommended.
63+
6264
- Icarus Verilog: 0.9.7 or later
6365

6466
Install on your platform. For exmple, on Ubuntu:
@@ -68,14 +70,26 @@ Install on your platform. For exmple, on Ubuntu:
6870
- Jinja2: 2.8 or later
6971
- pytest: 2.8.2 or later
7072
- pytest-pythonpath: 0.7 or lator
71-
- Pygraphviz: 1.3.1 or later (Option for graph visualization in dataflow/graphgen.py and controlflow/controlflow_analyzer.py)
7273

7374
Install on your python environment by using pip.
7475

7576
pip install jinja2 pytest pytest-pythonpath
76-
(pip install pygraphviz) # option
7777

78-
Finally, install Pyverilog.
78+
Options
79+
--------------------
80+
81+
- Graphviz: 2.38.0 or later
82+
- Pygraphviz: 1.3.1 or later
83+
84+
These softwares are option for graph visualization in dataflow/graphgen.py and controlflow/controlflow_analyzer.py.
85+
86+
sudo apt-get install graphviz
87+
pip install pygraphviz
88+
89+
Install
90+
--------------------
91+
92+
Install Pyverilog.
7993

8094
python setup.py install
8195

@@ -133,7 +147,7 @@ Code parser
133147
Let's try syntax analysis. Please type the command as below.
134148

135149
```
136-
python3 pyverilog/vparser/parser.py test.v
150+
python pyverilog/vparser/parser.py test.v
137151
```
138152

139153
Then you got the result as below. The result of syntax analysis is displayed.
@@ -253,7 +267,7 @@ Dataflow analyzer
253267
Let's try dataflow analysis. Please type the command as below.
254268

255269
```
256-
python3 pyverilog/dataflow/dataflow_analyzer.py -t top test.v
270+
python pyverilog/dataflow/dataflow_analyzer.py -t top test.v
257271
```
258272

259273
Then you got the result as below. The result of each signal definition and each signal assignment are displayed.
@@ -276,10 +290,10 @@ Bind:
276290
(Bind dest:top.led tree:(Partselect Var:(Terminal top.count) MSB:(IntConst 23) LSB:(IntConst 16)))
277291
```
278292

279-
Let's view the result of dataflow analysis as a picture file. Now we select 'led' as the target. Please type the command as below.
293+
Let's view the result of dataflow analysis as a picture file. Now we select 'led' as the target. Please type the command as below. In this example, Graphviz and Pygraphviz are installed.
280294

281295
```
282-
python3 pyverilog/dataflow/graphgen.py -t top -s top.led test.v
296+
python pyverilog/dataflow/graphgen.py -t top -s top.led test.v
283297
```
284298

285299
Then you got a png file (out.png). The picture shows that the definition of 'led' is a part-selection of 'count' from 23-bit to 16-bit.
@@ -289,10 +303,10 @@ Then you got a png file (out.png). The picture shows that the definition of 'led
289303
Control-flow analyzer
290304
------------------------------
291305

292-
Let's try control-flow analysis. Please type the command as below.
306+
Let's try control-flow analysis. Please type the command as below. In this example, Graphviz and Pygraphviz are installed. If don't use Graphviz, please append "--nograph" option.
293307

294308
```
295-
python2.7 pyverilog/controlflow/controlflow_analyzer.py -t top test.v
309+
python pyverilog/controlflow/controlflow_analyzer.py -t top test.v
296310
```
297311

298312
Then you got the result as below. The result shows that the state machine structure and transition conditions to the next state in the state machine.
@@ -312,7 +326,7 @@ Loop
312326
(0, 1, 2)
313327
```
314328

315-
You got also a png file (top_state.png). The picture shows that the graphical structure of the state machine.
329+
You got also a png file (top_state.png), if you did not append "--nograph". The picture shows that the graphical structure of the state machine.
316330

317331
![top_state.png](img/top_state.png)
318332

@@ -343,7 +357,7 @@ print(rslt)
343357
Please type the command as below at the same directory with Pyverilog.
344358

345359
```
346-
python3 test.py
360+
python test.py
347361
```
348362

349363
Then Verilog HDL code generated from the AST instances is displayed.

README.rst

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ on this toolkit.
5656
Installation
5757
============
5858

59-
Software Requirements
60-
---------------------
59+
Requirements
60+
------------
6161

6262
- Python: 2.7, 3.4 or later
6363

64+
Python3 is recommended.
65+
6466
- Icarus Verilog: 0.9.7 or later
6567

6668
Install on your platform. For exmple, on Ubuntu:
@@ -72,17 +74,31 @@ Install on your platform. For exmple, on Ubuntu:
7274
- Jinja2: 2.8 or later
7375
- pytest: 2.8.2 or later
7476
- pytest-pythonpath: 0.7 or lator
75-
- Pygraphviz: 1.3.1 or later (Option for graph visualization in
76-
dataflow/graphgen.py and controlflow/controlflow\_analyzer.py)
7777

7878
Install on your python environment by using pip.
7979

8080
::
8181

8282
pip install jinja2 pytest pytest-pythonpath
83-
(pip install pygraphviz) # option
8483

85-
Finally, install Pyverilog.
84+
Options
85+
-------
86+
87+
- Graphviz: 2.38.0 or later
88+
- Pygraphviz: 1.3.1 or later
89+
90+
These softwares are option for graph visualization in
91+
dataflow/graphgen.py and controlflow/controlflow\_analyzer.py.
92+
93+
::
94+
95+
sudo apt-get install graphviz
96+
pip install pygraphviz
97+
98+
Install
99+
-------
100+
101+
Install Pyverilog.
86102

87103
::
88104

@@ -145,7 +161,7 @@ Let's try syntax analysis. Please type the command as below.
145161

146162
::
147163

148-
python3 pyverilog/vparser/parser.py test.v
164+
python pyverilog/vparser/parser.py test.v
149165

150166
Then you got the result as below. The result of syntax analysis is
151167
displayed.
@@ -266,7 +282,7 @@ Let's try dataflow analysis. Please type the command as below.
266282

267283
::
268284

269-
python3 pyverilog/dataflow/dataflow_analyzer.py -t top test.v
285+
python pyverilog/dataflow/dataflow_analyzer.py -t top test.v
270286

271287
Then you got the result as below. The result of each signal definition
272288
and each signal assignment are displayed.
@@ -290,11 +306,12 @@ and each signal assignment are displayed.
290306
(Bind dest:top.led tree:(Partselect Var:(Terminal top.count) MSB:(IntConst 23) LSB:(IntConst 16)))
291307

292308
Let's view the result of dataflow analysis as a picture file. Now we
293-
select 'led' as the target. Please type the command as below.
309+
select 'led' as the target. Please type the command as below. In this
310+
example, Graphviz and Pygraphviz are installed.
294311

295312
::
296313

297-
python3 pyverilog/dataflow/graphgen.py -t top -s top.led test.v
314+
python pyverilog/dataflow/graphgen.py -t top -s top.led test.v
298315

299316
Then you got a png file (out.png). The picture shows that the definition
300317
of 'led' is a part-selection of 'count' from 23-bit to 16-bit.
@@ -307,11 +324,13 @@ of 'led' is a part-selection of 'count' from 23-bit to 16-bit.
307324
Control-flow analyzer
308325
---------------------
309326

310-
Let's try control-flow analysis. Please type the command as below.
327+
Let's try control-flow analysis. Please type the command as below. In
328+
this example, Graphviz and Pygraphviz are installed. If don't use
329+
Graphviz, please append "--nograph" option.
311330

312331
::
313332

314-
python2.7 pyverilog/controlflow/controlflow_analyzer.py -t top test.v
333+
python pyverilog/controlflow/controlflow_analyzer.py -t top test.v
315334

316335
Then you got the result as below. The result shows that the state
317336
machine structure and transition conditions to the next state in the
@@ -332,8 +351,9 @@ state machine.
332351
Loop
333352
(0, 1, 2)
334353

335-
You got also a png file (top\_state.png). The picture shows that the
336-
graphical structure of the state machine.
354+
You got also a png file (top\_state.png), if you did not append
355+
"--nograph". The picture shows that the graphical structure of the state
356+
machine.
337357

338358
.. figure:: img/top_state.png
339359
:alt: top\_state.png
@@ -369,7 +389,7 @@ Please type the command as below at the same directory with Pyverilog.
369389

370390
::
371391

372-
python3 test.py
392+
python test.py
373393

374394
Then Verilog HDL code generated from the AST instances is displayed.
375395

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ def read(filename):
2121
url='https://github.com/PyHDI/Pyverilog',
2222
packages=find_packages(),
2323
package_data={ 'pyverilog.ast_code_generator' : ['template/*'], },
24-
install_requires=['Jinja2', 'pytest', 'pytest-pythonpath'],
24+
install_requires=[ 'Jinja2' ],
25+
extras_require={
26+
'test' : [ 'pytest', 'pytest-pythonpath' ],
27+
'graph' : [ 'pygraphviz' ],
28+
},
2529
)

0 commit comments

Comments
 (0)