Skip to content

Commit bc9656c

Browse files
committed
pages.md is updated, but is not used yet.
1 parent d7abe21 commit bc9656c

File tree

1 file changed

+53
-42
lines changed

1 file changed

+53
-42
lines changed

pages.md

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you use Pyverilog in your research, please cite my paper.
1111
title={Pyverilog: A Python-Based Hardware Design Processing Toolkit for Verilog HDL},
1212
author={Takamaeda-Yamazaki, Shinya},
1313
booktitle={Applied Reconfigurable Computing},
14-
month={Apr}
14+
month={Apr},
1515
year={2015},
1616
pages={451-460},
1717
volume={9040},
@@ -32,37 +32,47 @@ Pyverilog includes **(1) code parser, (2) dataflow analyzer, (3) control-flow an
3232
You can create your own design analyzer, code translator and code generator of Verilog HDL based on this toolkit.
3333

3434

35-
Software Requirements
35+
Installation
3636
==============================
3737

38-
* Python (2.7, 3.3 or later)
39-
* Icarus Verilog (0.9.6 or later)
40-
- pyverilog.vparser.preprocessor.py uses 'iverilog -E' command as the preprocessor.
41-
- 'apt-get install iverilog'
42-
* Graphviz and Pygraphviz (Python3 does not support Pygraphviz)
43-
- pyverilog.dataflow.graphgen and pyverilog.controlflow.controlflow (without --nograph option) use Pygraphviz (on Python 2.7).
44-
- If you do not use graphgen and controlflow (without --nograph) option, Python 3.x is fine.
45-
* Jinja2 (2.7 or later)
46-
- ast\_code\_generator requires jinja2 module.
47-
- 'pip3 install jinja2' (for Python 3.x) or 'pip install jinja2' (for Python 2.7)
38+
Requirements
39+
--------------------
4840

41+
- Python: 2.7, 3.4 or later
4942

50-
Installation
51-
==============================
43+
Python3 is recommended.
5244

53-
If you want to use Pyverilog as a general library, you can install on your environment by using setup.py.
45+
- Icarus Verilog: 0.9.7 or later
5446

55-
If Python 2.7 is used,
47+
Install on your platform. For exmple, on Ubuntu:
5648

57-
```
58-
python setup.py install
59-
```
49+
sudo apt-get install iverilog
6050

61-
If Python 3.x is used,
51+
- Jinja2: 2.8 or later
52+
- pytest: 2.8.2 or later
53+
- pytest-pythonpath: 0.7 or later
6254

63-
```
64-
python3 setup.py install
65-
```
55+
Install on your python environment by using pip.
56+
57+
pip install jinja2 pytest pytest-pythonpath
58+
59+
Options
60+
--------------------
61+
62+
- Graphviz: 2.38.0 or later
63+
- Pygraphviz: 1.3.1 or later
64+
65+
These softwares are option for graph visualization in dataflow/graphgen.py and controlflow/controlflow_analyzer.py.
66+
67+
sudo apt-get install graphviz
68+
pip install pygraphviz
69+
70+
Install
71+
--------------------
72+
73+
Install Pyverilog.
74+
75+
python setup.py install
6676

6777

6878
Tools
@@ -118,7 +128,7 @@ Code parser
118128
Let's try syntax analysis. Please type the command as below.
119129

120130
```
121-
python3 pyverilog/vparser/parser.py test.v
131+
python pyverilog/vparser/parser.py test.v
122132
```
123133

124134
Then you got the result as below. The result of syntax analysis is displayed.
@@ -238,7 +248,7 @@ Dataflow analyzer
238248
Let's try dataflow analysis. Please type the command as below.
239249

240250
```
241-
python3 pyverilog/dataflow/dataflow_analyzer.py -t top test.v
251+
python pyverilog/dataflow/dataflow_analyzer.py -t top test.v
242252
```
243253

244254
Then you got the result as below. The result of each signal definition and each signal assignment are displayed.
@@ -261,23 +271,23 @@ Bind:
261271
(Bind dest:top.led tree:(Partselect Var:(Terminal top.count) MSB:(IntConst 23) LSB:(IntConst 16)))
262272
```
263273

264-
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.
274+
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.
265275

266276
```
267-
python3 pyverilog/dataflow/graphgen.py -t top -s top.led test.v
277+
python pyverilog/dataflow/graphgen.py -t top -s top.led test.v
268278
```
269279

270280
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.
271281

272-
![out.png](http://cdn-ak.f.st-hatena.com/images/fotolife/s/sxhxtxa/20140101/20140101045641.png)
282+
![out.png](img/out.png)
273283

274284
Control-flow analyzer
275285
------------------------------
276286

277-
Let's try control-flow analysis. Please type the command as below.
287+
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.
278288

279289
```
280-
python2.7 pyverilog/controlflow/controlflow_analyzer.py -t top test.v
290+
python pyverilog/controlflow/controlflow_analyzer.py -t top test.v
281291
```
282292

283293
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.
@@ -297,9 +307,9 @@ Loop
297307
(0, 1, 2)
298308
```
299309

300-
You got also a png file (top_state.png). The picture shows that the graphical structure of the state machine.
310+
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.
301311

302-
![top_state.png](http://cdn-ak.f.st-hatena.com/images/fotolife/s/sxhxtxa/20140101/20140101045835.png)
312+
![top_state.png](img/top_state.png)
303313

304314
Code generator
305315
------------------------------
@@ -328,30 +338,32 @@ print(rslt)
328338
Please type the command as below at the same directory with Pyverilog.
329339

330340
```
331-
python3 test.py
341+
python test.py
332342
```
333343

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

336346
```verilog
337-
338347
module top
339-
(
340-
input [0:0] CLK,
341-
input [0:0] RST,
342-
output [7:0] led
348+
(
349+
input CLK,
350+
input RST,
351+
output [7:0] led
352+
);
343353
344-
);
345354
assign led = 8;
346-
endmodule
347355
356+
endmodule
348357
```
349358

350359

351360
Related Project and Site
352361
==============================
353362

354-
[PyCoRAM](https://github.com/shtaxxx/PyCoRAM)
363+
[Veriloggen](https://github.com/PyHDI/veriloggen)
364+
- A library for constructing a Verilog HDL source code in Python
365+
366+
[PyCoRAM](https://github.com/PyHDI/PyCoRAM)
355367
- Python-based Portable IP-core Synthesis Framework for FPGA-based Computing
356368

357369
[flipSyrup](https://github.com/shtaxxx/flipSyrup)
@@ -379,4 +391,3 @@ Copyright and Contact
379391
Copyright (C) 2013, Shinya Takamaeda-Yamazaki
380392

381393
E-mail: shinya\_at\_is.naist.jp
382-

0 commit comments

Comments
 (0)