Skip to content

Commit 381ac89

Browse files
committed
Merge branch '2.1.0-rc'
2 parents 9d0af96 + 0973afa commit 381ac89

File tree

252 files changed

+55241
-30259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+55241
-30259
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,18 @@ Installation
8282
Requirements
8383
--------------------
8484

85-
- Python3: 3.7 or later
85+
- Python: 3.7.7 or later
86+
- Python 3.9.5 (via pyenv) is recommended for macOS with Apple Silicon.
8687
- Icarus Verilog: 10.1 or later
8788

8889
```
8990
sudo apt install iverilog
9091
```
9192

92-
- Pyverilog: 1.3.0 or later
93-
- NumPy: 1.17 or later
93+
- pyverilog: 1.3.0 or later
94+
- pyverilog requires Jinja2. Jinja2 3.0.3 is recommended for macOS with Apple Silicon.
95+
- numpy: 1.17 or later
96+
- numpy 1.22.1 is recommended for macOS with Apple Silicon.
9497

9598
```
9699
pip3 install pyverilog numpy
@@ -111,7 +114,7 @@ pip3 install pytest pytest-pythonpath
111114

112115
For fast RTL simulation, we recommend to install Verilator.
113116

114-
- Verilator: 3.916 or later
117+
- Verilator: 4.028 or later
115118

116119
```
117120
sudo apt install verilator
@@ -122,8 +125,8 @@ Optional installation for visualization
122125

123126
To visualize the generated hardware by veriloggen.stream, these libraries are required.
124127

125-
- Graphviz: 2.38.0 or later
126-
- Pygraphviz: 1.3.1 or later
128+
- graphviz: 2.38.0 or later
129+
- pygraphviz: 1.3.1 or later
127130

128131
```
129132
sudo apt install graphviz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
from __future__ import absolute_import
2+
from __future__ import print_function
3+
import sys
4+
import os
5+
6+
# the next line can be removed after installation
7+
sys.path.insert(0, os.path.dirname(os.path.dirname(
8+
os.path.dirname(os.path.abspath(__file__)))))
9+
10+
from veriloggen import *
11+
import veriloggen.thread as vthread
12+
import veriloggen.types.axi as axi
13+
14+
15+
def mkLed():
16+
m = Module('blinkled')
17+
clk = m.Input('CLK')
18+
rst = m.Input('RST')
19+
20+
datawidth = 32
21+
22+
axi_a = vthread.AXIStreamIn(m, 'axi_a', clk, rst, datawidth, with_last=True)
23+
axi_b = vthread.AXIStreamOut(m, 'axi_b', clk, rst, datawidth, with_last=True)
24+
25+
saxi = vthread.AXISLiteRegister(m, 'saxi', clk, rst, datawidth)
26+
27+
def comp():
28+
29+
while True:
30+
saxi.wait_flag(0, value=1, resetvalue=0)
31+
saxi.write(1, 1) # set busy
32+
size = saxi.read(2)
33+
34+
for i in range(size):
35+
a, a_last = axi_a.read()
36+
b = a + 1
37+
b_last = a_last
38+
axi_b.write(b, b_last)
39+
40+
saxi.write(1, 0) # unset busy
41+
42+
vthread.finish()
43+
44+
th = vthread.Thread(m, 'th_comp', clk, rst, comp)
45+
fsm = th.start()
46+
47+
return m
48+
49+
50+
def run(filename='tmp.v', simtype='iverilog', outputfile=None):
51+
52+
test = mkLed()
53+
54+
code = test.to_verilog(filename)
55+
return code
56+
57+
58+
if __name__ == '__main__':
59+
rslt = run(filename='tmp.v')
60+
print(rslt)

0 commit comments

Comments
 (0)