fpga-design-implview 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fpga_design_implview-0.1.0/LICENSE +21 -0
- fpga_design_implview-0.1.0/MANIFEST.in +2 -0
- fpga_design_implview-0.1.0/PKG-INFO +146 -0
- fpga_design_implview-0.1.0/README.md +116 -0
- fpga_design_implview-0.1.0/examples/highlight.toml +41 -0
- fpga_design_implview-0.1.0/examples/pynq-z2/gpt.toml +72 -0
- fpga_design_implview-0.1.0/examples/pynq-z2/mlp.toml +60 -0
- fpga_design_implview-0.1.0/examples/pynq-z2/platform.toml +44 -0
- fpga_design_implview-0.1.0/pyproject.toml +52 -0
- fpga_design_implview-0.1.0/setup.cfg +4 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/__init__.py +3 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/__main__.py +3 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/cache.py +26 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/cli.py +256 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/dcp.py +41 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/design.py +73 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/device.py +126 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/hier.py +181 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/highlight.py +245 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/html.py +679 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/layout.py +399 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/placement.py +127 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/render.py +531 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/tcl/batch.tcl +28 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/tcl/implview.tcl +177 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview/vivado.py +74 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview.egg-info/PKG-INFO +146 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview.egg-info/SOURCES.txt +34 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview.egg-info/dependency_links.txt +1 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview.egg-info/entry_points.txt +3 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview.egg-info/requires.txt +5 -0
- fpga_design_implview-0.1.0/src/fpga_design_implview.egg-info/top_level.txt +1 -0
- fpga_design_implview-0.1.0/tests/conftest.py +122 -0
- fpga_design_implview-0.1.0/tests/test_design.py +134 -0
- fpga_design_implview-0.1.0/tests/test_highlight.py +158 -0
- fpga_design_implview-0.1.0/tests/test_layout.py +76 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rocco Ardino
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fpga-design-implview
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Pictures and an interactive viewer of Vivado implemented designs: device resources and what the design uses of them
|
|
5
|
+
Author-email: Rocco Ardino <roccoardino@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/rardino/fpga-design-implview
|
|
8
|
+
Project-URL: Issues, https://github.com/rardino/fpga-design-implview/issues
|
|
9
|
+
Keywords: fpga,vivado,floorplan,placement,routing,visualization,eda
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Requires-Dist: matplotlib>=3.7
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: pytest; extra == "test"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Vivado implemented design renderer and viewer
|
|
32
|
+
|
|
33
|
+
This project was made with the help of Claude Opus 5.5.
|
|
34
|
+
|
|
35
|
+
`fpga-design-implview` draws what a Vivado implementation uses of the device: every site
|
|
36
|
+
of the part (slices, BRAM, DSP, URAM, IO, GT, clocking, hard blocks), lit up when the
|
|
37
|
+
design uses it and colored by hierarchy, with the part, WNS/WHS and the legend. The
|
|
38
|
+
part comes from the checkpoint: any design, any device.
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
PYNQ-Z2 (xc7z020), placement and routing usage:
|
|
43
|
+
|
|
44
|
+
<p>
|
|
45
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/gpt.png" width="49%" alt="PYNQ-Z2 design, placement">
|
|
46
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/gpt_routing.png" width="49%" alt="PYNQ-Z2 design, routing usage">
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
<p>
|
|
50
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/mlp.png" width="49%" alt="PYNQ-Z2 design, placement">
|
|
51
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/mlp_routing.png" width="49%" alt="PYNQ-Z2 design, routing usage">
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
Note: the text on the right is optional, `--no-panel` leaves only the device.
|
|
55
|
+
|
|
56
|
+
## Install
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
pipx install fpga-design-implview # or pip; Python 3.11+
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The command is `fpga-design-implview`, or `implview` for short. Vivado is needed to read
|
|
63
|
+
the checkpoint (with a license for its device); drawing works without it.
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
fpga-design-implview render path/to/impl_1 # <top>.png, <top>.pdf
|
|
69
|
+
fpga-design-implview render top_routed.dcp -o top.html # interactive viewer
|
|
70
|
+
fpga-design-implview render path/to/impl_1 -H highlight.toml --stats --theme dark
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The input is a run directory, a project directory or a routed checkpoint. The output
|
|
74
|
+
format follows the extension: `.png` (placement, plus `_routing.png`), `.pdf`, `.svg`,
|
|
75
|
+
`.html`.
|
|
76
|
+
|
|
77
|
+
The first run opens the checkpoint in Vivado (batch mode) and caches the export in
|
|
78
|
+
`~/.cache/implview`, so later renders take seconds. Vivado is `$IMPLVIEW_VIVADO` (or
|
|
79
|
+
`--vivado CMD` before the command), else `vivado` on the PATH, else the install under
|
|
80
|
+
`~/opt/xilinx`, `~/Xilinx`, `/opt/Xilinx` or `/tools/Xilinx` matching the checkpoint's
|
|
81
|
+
version.
|
|
82
|
+
|
|
83
|
+
| Option | What |
|
|
84
|
+
|----------------------------|---------------------------------------------------|
|
|
85
|
+
| `-o FILE`, `-O DIR` | output file (repeatable), output directory |
|
|
86
|
+
| `-H FILE` | highlight file: what to color and how |
|
|
87
|
+
| `-g PATH` | color a hierarchy path (repeatable) |
|
|
88
|
+
| `--depth N` | automatic groups cut at depth N |
|
|
89
|
+
| `--stats` | utilization table and cells per group |
|
|
90
|
+
| `--theme dark` | dark theme |
|
|
91
|
+
| `--no-routing` | skip the routing page (faster first export) |
|
|
92
|
+
| `--no-panel`, `--no-labels` | device only, no names on it |
|
|
93
|
+
| `--save-highlight FILE` | write the groups used as a highlight file |
|
|
94
|
+
| `--refresh` | export again, ignore the cache |
|
|
95
|
+
|
|
96
|
+
Other commands: `export` (only the export), `device PART` (only the device), `info`
|
|
97
|
+
(part, top, cache status), `tcl` (path of `implview.tcl`).
|
|
98
|
+
|
|
99
|
+
## Colors
|
|
100
|
+
|
|
101
|
+
By default the hierarchy is split into up to 8 groups. A highlight file (`-H`) chooses:
|
|
102
|
+
|
|
103
|
+
```toml
|
|
104
|
+
[[highlight]]
|
|
105
|
+
path = "u_core/u_fft" # * inside one level, ** any depth
|
|
106
|
+
color = "#2a78d6"
|
|
107
|
+
label = "FFT"
|
|
108
|
+
|
|
109
|
+
[[highlight]]
|
|
110
|
+
path = "u_core/gen_ch[*].u_filter" # a generate loop: one shade per instance
|
|
111
|
+
color = ["#8fe0bb", "#0f6e4b"]
|
|
112
|
+
label = "filter"
|
|
113
|
+
|
|
114
|
+
[options]
|
|
115
|
+
others = "grey" # or "hide"; also theme, stats, labels, panel
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The most specific path holds a cell. More in
|
|
119
|
+
[examples](https://github.com/rardino/fpga-design-implview/tree/main/examples).
|
|
120
|
+
|
|
121
|
+
## Viewer
|
|
122
|
+
|
|
123
|
+
Scroll to zoom, drag to pan, `F` to fit. Hover a site for its cells, click to pin them,
|
|
124
|
+
click a cell to highlight its module. Search cell names (`*`, `?`), toggle groups and
|
|
125
|
+
layers (routing, clock regions, pblocks), switch light/dark, save the view as PNG.
|
|
126
|
+
|
|
127
|
+
## From a build script
|
|
128
|
+
|
|
129
|
+
Export at the end of the implementation run, in the same Vivado session, to skip
|
|
130
|
+
opening the checkpoint again (`fpga-design-implview tcl` prints the script's path):
|
|
131
|
+
|
|
132
|
+
```tcl
|
|
133
|
+
source /path/to/implview.tcl
|
|
134
|
+
implview::export_all $out/implview -routing ;# <top>.ivd.gz and <part>.ivdev.gz
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
then `fpga-design-implview render $out/implview/<top>.ivd.gz`.
|
|
138
|
+
|
|
139
|
+
## Status
|
|
140
|
+
|
|
141
|
+
Tried on Zynq-7000 (xc7z020) and Virtex UltraScale+ HBM (xcvu37p, three SLRs).
|
|
142
|
+
UltraScale, Zynq UltraScale+ and Versal are not tried yet. Nets are not drawn, only how
|
|
143
|
+
much each interconnect tile is used. The picture follows Vivado's tile grid, not the die
|
|
144
|
+
to scale.
|
|
145
|
+
|
|
146
|
+
Tests, from a clone: `pip install -e .[test] && pytest` (no Vivado needed).
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Vivado implemented design renderer and viewer
|
|
2
|
+
|
|
3
|
+
This project was made with the help of Claude Opus 5.5.
|
|
4
|
+
|
|
5
|
+
`fpga-design-implview` draws what a Vivado implementation uses of the device: every site
|
|
6
|
+
of the part (slices, BRAM, DSP, URAM, IO, GT, clocking, hard blocks), lit up when the
|
|
7
|
+
design uses it and colored by hierarchy, with the part, WNS/WHS and the legend. The
|
|
8
|
+
part comes from the checkpoint: any design, any device.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
|
|
12
|
+
PYNQ-Z2 (xc7z020), placement and routing usage:
|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/gpt.png" width="49%" alt="PYNQ-Z2 design, placement">
|
|
16
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/gpt_routing.png" width="49%" alt="PYNQ-Z2 design, routing usage">
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p>
|
|
20
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/mlp.png" width="49%" alt="PYNQ-Z2 design, placement">
|
|
21
|
+
<img src="https://github.com/rardino/fpga-design-implview/raw/main/docs/pynq-z2/mlp_routing.png" width="49%" alt="PYNQ-Z2 design, routing usage">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
Note: the text on the right is optional, `--no-panel` leaves only the device.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pipx install fpga-design-implview # or pip; Python 3.11+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The command is `fpga-design-implview`, or `implview` for short. Vivado is needed to read
|
|
33
|
+
the checkpoint (with a license for its device); drawing works without it.
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
fpga-design-implview render path/to/impl_1 # <top>.png, <top>.pdf
|
|
39
|
+
fpga-design-implview render top_routed.dcp -o top.html # interactive viewer
|
|
40
|
+
fpga-design-implview render path/to/impl_1 -H highlight.toml --stats --theme dark
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The input is a run directory, a project directory or a routed checkpoint. The output
|
|
44
|
+
format follows the extension: `.png` (placement, plus `_routing.png`), `.pdf`, `.svg`,
|
|
45
|
+
`.html`.
|
|
46
|
+
|
|
47
|
+
The first run opens the checkpoint in Vivado (batch mode) and caches the export in
|
|
48
|
+
`~/.cache/implview`, so later renders take seconds. Vivado is `$IMPLVIEW_VIVADO` (or
|
|
49
|
+
`--vivado CMD` before the command), else `vivado` on the PATH, else the install under
|
|
50
|
+
`~/opt/xilinx`, `~/Xilinx`, `/opt/Xilinx` or `/tools/Xilinx` matching the checkpoint's
|
|
51
|
+
version.
|
|
52
|
+
|
|
53
|
+
| Option | What |
|
|
54
|
+
|----------------------------|---------------------------------------------------|
|
|
55
|
+
| `-o FILE`, `-O DIR` | output file (repeatable), output directory |
|
|
56
|
+
| `-H FILE` | highlight file: what to color and how |
|
|
57
|
+
| `-g PATH` | color a hierarchy path (repeatable) |
|
|
58
|
+
| `--depth N` | automatic groups cut at depth N |
|
|
59
|
+
| `--stats` | utilization table and cells per group |
|
|
60
|
+
| `--theme dark` | dark theme |
|
|
61
|
+
| `--no-routing` | skip the routing page (faster first export) |
|
|
62
|
+
| `--no-panel`, `--no-labels` | device only, no names on it |
|
|
63
|
+
| `--save-highlight FILE` | write the groups used as a highlight file |
|
|
64
|
+
| `--refresh` | export again, ignore the cache |
|
|
65
|
+
|
|
66
|
+
Other commands: `export` (only the export), `device PART` (only the device), `info`
|
|
67
|
+
(part, top, cache status), `tcl` (path of `implview.tcl`).
|
|
68
|
+
|
|
69
|
+
## Colors
|
|
70
|
+
|
|
71
|
+
By default the hierarchy is split into up to 8 groups. A highlight file (`-H`) chooses:
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[[highlight]]
|
|
75
|
+
path = "u_core/u_fft" # * inside one level, ** any depth
|
|
76
|
+
color = "#2a78d6"
|
|
77
|
+
label = "FFT"
|
|
78
|
+
|
|
79
|
+
[[highlight]]
|
|
80
|
+
path = "u_core/gen_ch[*].u_filter" # a generate loop: one shade per instance
|
|
81
|
+
color = ["#8fe0bb", "#0f6e4b"]
|
|
82
|
+
label = "filter"
|
|
83
|
+
|
|
84
|
+
[options]
|
|
85
|
+
others = "grey" # or "hide"; also theme, stats, labels, panel
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The most specific path holds a cell. More in
|
|
89
|
+
[examples](https://github.com/rardino/fpga-design-implview/tree/main/examples).
|
|
90
|
+
|
|
91
|
+
## Viewer
|
|
92
|
+
|
|
93
|
+
Scroll to zoom, drag to pan, `F` to fit. Hover a site for its cells, click to pin them,
|
|
94
|
+
click a cell to highlight its module. Search cell names (`*`, `?`), toggle groups and
|
|
95
|
+
layers (routing, clock regions, pblocks), switch light/dark, save the view as PNG.
|
|
96
|
+
|
|
97
|
+
## From a build script
|
|
98
|
+
|
|
99
|
+
Export at the end of the implementation run, in the same Vivado session, to skip
|
|
100
|
+
opening the checkpoint again (`fpga-design-implview tcl` prints the script's path):
|
|
101
|
+
|
|
102
|
+
```tcl
|
|
103
|
+
source /path/to/implview.tcl
|
|
104
|
+
implview::export_all $out/implview -routing ;# <top>.ivd.gz and <part>.ivdev.gz
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
then `fpga-design-implview render $out/implview/<top>.ivd.gz`.
|
|
108
|
+
|
|
109
|
+
## Status
|
|
110
|
+
|
|
111
|
+
Tried on Zynq-7000 (xc7z020) and Virtex UltraScale+ HBM (xcvu37p, three SLRs).
|
|
112
|
+
UltraScale, Zynq UltraScale+ and Versal are not tried yet. Nets are not drawn, only how
|
|
113
|
+
much each interconnect tile is used. The picture follows Vivado's tile grid, not the die
|
|
114
|
+
to scale.
|
|
115
|
+
|
|
116
|
+
Tests, from a clone: `pip install -e .[test] && pytest` (no Vivado needed).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Example highlight file, for a design with this hierarchy:
|
|
2
|
+
# u_core/u_fft, u_core/gen_ch[0..3].u_filter, u_core/u_ctrl,
|
|
3
|
+
# u_io/u_adc_a, u_io/u_adc_b, u_io/u_pcie, u_io/u_ddr
|
|
4
|
+
#
|
|
5
|
+
# fpga-design-implview render path/to/impl_1 -H examples/highlight.toml
|
|
6
|
+
#
|
|
7
|
+
# path: hierarchy path, * inside one level, ** any depth, brackets are literal.
|
|
8
|
+
# A path matching several instances (a generate loop) gets one shade each.
|
|
9
|
+
|
|
10
|
+
[[highlight]]
|
|
11
|
+
path = "u_core/u_fft"
|
|
12
|
+
color = "#2a78d6"
|
|
13
|
+
label = "FFT"
|
|
14
|
+
|
|
15
|
+
[[highlight]]
|
|
16
|
+
path = "u_core/gen_ch[*].u_filter"
|
|
17
|
+
color = ["#8fe0bb", "#0f6e4b"] # channel 0 light, channel 3 dark
|
|
18
|
+
label = "filter"
|
|
19
|
+
|
|
20
|
+
[[highlight]]
|
|
21
|
+
path = "u_core/u_ctrl"
|
|
22
|
+
color = "#eda100"
|
|
23
|
+
label = "control"
|
|
24
|
+
|
|
25
|
+
[[highlight]]
|
|
26
|
+
path = "u_io/u_adc_*" # u_adc_a and u_adc_b
|
|
27
|
+
color = "#e87ba4"
|
|
28
|
+
label = "ADC"
|
|
29
|
+
|
|
30
|
+
[[highlight]]
|
|
31
|
+
path = "u_io/u_pcie"
|
|
32
|
+
color = "#eb6834"
|
|
33
|
+
label = "PCIe"
|
|
34
|
+
|
|
35
|
+
[[highlight]]
|
|
36
|
+
path = "u_io/u_ddr"
|
|
37
|
+
color = "#e34948"
|
|
38
|
+
label = "DDR"
|
|
39
|
+
|
|
40
|
+
[options]
|
|
41
|
+
others = "grey" # everything else; "hide" to leave it uncolored
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# PYNQ-Z2 (xc7z020): the infrastructure and a GPT accelerator.
|
|
2
|
+
#
|
|
3
|
+
# fpga-design-implview render pynqz2-gpt.ivd.gz -H examples/pynq-z2/gpt.toml
|
|
4
|
+
#
|
|
5
|
+
# The accelerator's AXI registers and stream FIFOs, the GP0 split and ID
|
|
6
|
+
# slot and the PS resets are left in "(other)".
|
|
7
|
+
|
|
8
|
+
# The infrastructure, the same colors in the three examples: warm for the
|
|
9
|
+
# infrastructure, blue and violet for the model.
|
|
10
|
+
|
|
11
|
+
[[highlight]]
|
|
12
|
+
path = "u_ps/u_system/ps7"
|
|
13
|
+
color = "#eb6834"
|
|
14
|
+
label = "PS7"
|
|
15
|
+
|
|
16
|
+
[[highlight]]
|
|
17
|
+
path = "u_ps/u_system/sc_hp"
|
|
18
|
+
color = "#eda100"
|
|
19
|
+
label = "SmartConnect HP0"
|
|
20
|
+
|
|
21
|
+
[[highlight]]
|
|
22
|
+
path = "u_ps/u_system/sc_ctrl"
|
|
23
|
+
color = "#e87ba4"
|
|
24
|
+
label = "SmartConnect GP0"
|
|
25
|
+
|
|
26
|
+
[[highlight]]
|
|
27
|
+
path = "u_core/u_dma"
|
|
28
|
+
color = "#1baf7a"
|
|
29
|
+
label = "AXI DMA"
|
|
30
|
+
|
|
31
|
+
[[highlight]]
|
|
32
|
+
path = "u_core/u_ddr_rw"
|
|
33
|
+
color = "#008300"
|
|
34
|
+
label = "ddr_rw"
|
|
35
|
+
|
|
36
|
+
[[highlight]]
|
|
37
|
+
path = "u_core/u_test"
|
|
38
|
+
color = "#e34948"
|
|
39
|
+
label = "axis_test"
|
|
40
|
+
|
|
41
|
+
# The GPT. gpt_core holds the parameter memories and the model (u_gpt); the
|
|
42
|
+
# more specific paths below take their cells out of it.
|
|
43
|
+
|
|
44
|
+
[[highlight]]
|
|
45
|
+
path = "u_core/g_gpt.u_gpt/u_core"
|
|
46
|
+
color = "#a77be0"
|
|
47
|
+
label = "GPT parameters"
|
|
48
|
+
|
|
49
|
+
[[highlight]]
|
|
50
|
+
path = "u_core/g_gpt.u_gpt/u_core/u_gpt"
|
|
51
|
+
color = "#174a8b"
|
|
52
|
+
color_dark = "#4f8fe0"
|
|
53
|
+
label = "GPT: embedding, head, glue"
|
|
54
|
+
|
|
55
|
+
[[highlight]]
|
|
56
|
+
path = "u_core/g_gpt.u_gpt/u_core/u_gpt/u_block/u_attention"
|
|
57
|
+
color = "#2a78d6"
|
|
58
|
+
label = "attention"
|
|
59
|
+
|
|
60
|
+
[[highlight]]
|
|
61
|
+
path = "u_core/g_gpt.u_gpt/u_core/u_gpt/u_block/u_engine"
|
|
62
|
+
color = "#6250d6"
|
|
63
|
+
label = "linear engine"
|
|
64
|
+
|
|
65
|
+
[[highlight]]
|
|
66
|
+
path = "u_core/g_gpt.u_gpt/u_core/u_gpt/**/u_ln*" # u_ln1, u_ln2, u_lnf
|
|
67
|
+
color = "#7fb4ee"
|
|
68
|
+
gradient = false
|
|
69
|
+
label = "layer norms"
|
|
70
|
+
|
|
71
|
+
[options]
|
|
72
|
+
others = "grey"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# PYNQ-Z2 (xc7z020): the infrastructure and an MLP accelerator.
|
|
2
|
+
#
|
|
3
|
+
# fpga-design-implview render pynqz2-mlp.ivd.gz -H examples/pynq-z2/mlp.toml
|
|
4
|
+
#
|
|
5
|
+
# The accelerator's AXI registers and stream FIFOs, the GP0 split and ID
|
|
6
|
+
# slot and the PS resets are left in "(other)".
|
|
7
|
+
|
|
8
|
+
# The infrastructure, the same colors in the three examples: warm for the
|
|
9
|
+
# infrastructure, blue and violet for the model.
|
|
10
|
+
|
|
11
|
+
[[highlight]]
|
|
12
|
+
path = "u_ps/u_system/ps7"
|
|
13
|
+
color = "#eb6834"
|
|
14
|
+
label = "PS7"
|
|
15
|
+
|
|
16
|
+
[[highlight]]
|
|
17
|
+
path = "u_ps/u_system/sc_hp"
|
|
18
|
+
color = "#eda100"
|
|
19
|
+
label = "SmartConnect HP0"
|
|
20
|
+
|
|
21
|
+
[[highlight]]
|
|
22
|
+
path = "u_ps/u_system/sc_ctrl"
|
|
23
|
+
color = "#e87ba4"
|
|
24
|
+
label = "SmartConnect GP0"
|
|
25
|
+
|
|
26
|
+
[[highlight]]
|
|
27
|
+
path = "u_core/u_dma"
|
|
28
|
+
color = "#1baf7a"
|
|
29
|
+
label = "AXI DMA"
|
|
30
|
+
|
|
31
|
+
[[highlight]]
|
|
32
|
+
path = "u_core/u_ddr_rw"
|
|
33
|
+
color = "#008300"
|
|
34
|
+
label = "ddr_rw"
|
|
35
|
+
|
|
36
|
+
[[highlight]]
|
|
37
|
+
path = "u_core/u_test"
|
|
38
|
+
color = "#e34948"
|
|
39
|
+
label = "axis_test"
|
|
40
|
+
|
|
41
|
+
# The MLP. mlp_core holds the parameter memories and the network (u_mlp).
|
|
42
|
+
|
|
43
|
+
[[highlight]]
|
|
44
|
+
path = "u_core/g_mlp.u_mlp/u_core"
|
|
45
|
+
color = "#a77be0"
|
|
46
|
+
label = "MLP parameters"
|
|
47
|
+
|
|
48
|
+
[[highlight]]
|
|
49
|
+
path = "u_core/g_mlp.u_mlp/u_core/u_mlp"
|
|
50
|
+
color = "#174a8b"
|
|
51
|
+
color_dark = "#4f8fe0"
|
|
52
|
+
label = "MLP: argmax, glue"
|
|
53
|
+
|
|
54
|
+
[[highlight]]
|
|
55
|
+
path = "u_core/g_mlp.u_mlp/u_core/u_mlp/u_l*" # one shade per layer
|
|
56
|
+
color = ["#2a78d6", "#7fb4ee"]
|
|
57
|
+
label = "layer"
|
|
58
|
+
|
|
59
|
+
[options]
|
|
60
|
+
others = "grey"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# PYNQ-Z2 (xc7z020), the infrastructure alone: the PS7 with an AXI
|
|
2
|
+
# SmartConnect on GP0 and on HP0, and in the PL the GP0 register slots,
|
|
3
|
+
# ddr_rw, the AXI DMA and axis_test.
|
|
4
|
+
#
|
|
5
|
+
# fpga-design-implview render pynqz2-platform.ivd.gz -H examples/pynq-z2/platform.toml
|
|
6
|
+
#
|
|
7
|
+
# The GP0 split and ID slot, the PS resets and the LED counters are left in
|
|
8
|
+
# "(other)".
|
|
9
|
+
|
|
10
|
+
# The infrastructure, the same colors in the three examples: warm for the
|
|
11
|
+
# infrastructure, blue and violet for the model.
|
|
12
|
+
|
|
13
|
+
[[highlight]]
|
|
14
|
+
path = "u_ps/u_system/ps7"
|
|
15
|
+
color = "#eb6834"
|
|
16
|
+
label = "PS7"
|
|
17
|
+
|
|
18
|
+
[[highlight]]
|
|
19
|
+
path = "u_ps/u_system/sc_hp"
|
|
20
|
+
color = "#eda100"
|
|
21
|
+
label = "SmartConnect HP0"
|
|
22
|
+
|
|
23
|
+
[[highlight]]
|
|
24
|
+
path = "u_ps/u_system/sc_ctrl"
|
|
25
|
+
color = "#e87ba4"
|
|
26
|
+
label = "SmartConnect GP0"
|
|
27
|
+
|
|
28
|
+
[[highlight]]
|
|
29
|
+
path = "u_core/u_dma"
|
|
30
|
+
color = "#1baf7a"
|
|
31
|
+
label = "AXI DMA"
|
|
32
|
+
|
|
33
|
+
[[highlight]]
|
|
34
|
+
path = "u_core/u_ddr_rw"
|
|
35
|
+
color = "#008300"
|
|
36
|
+
label = "ddr_rw"
|
|
37
|
+
|
|
38
|
+
[[highlight]]
|
|
39
|
+
path = "u_core/u_test"
|
|
40
|
+
color = "#e34948"
|
|
41
|
+
label = "axis_test"
|
|
42
|
+
|
|
43
|
+
[options]
|
|
44
|
+
others = "grey"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fpga-design-implview"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Pictures and an interactive viewer of Vivado implemented designs: device resources and what the design uses of them"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
authors = [{ name = "Rocco Ardino", email = "roccoardino@gmail.com" }]
|
|
14
|
+
keywords = ["fpga", "vivado", "floorplan", "placement", "routing", "visualization", "eda"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: Science/Research",
|
|
20
|
+
"Operating System :: POSIX :: Linux",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
26
|
+
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Visualization",
|
|
28
|
+
]
|
|
29
|
+
dependencies = ["numpy>=1.24", "matplotlib>=3.7"]
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
test = ["pytest"]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/rardino/fpga-design-implview"
|
|
36
|
+
Issues = "https://github.com/rardino/fpga-design-implview/issues"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
fpga-design-implview = "fpga_design_implview.cli:main"
|
|
40
|
+
implview = "fpga_design_implview.cli:main"
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.dynamic]
|
|
43
|
+
version = { attr = "fpga_design_implview.__version__" }
|
|
44
|
+
|
|
45
|
+
[tool.setuptools.packages.find]
|
|
46
|
+
where = ["src"]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.package-data]
|
|
49
|
+
fpga_design_implview = ["tcl/*.tcl"]
|
|
50
|
+
|
|
51
|
+
[tool.pytest.ini_options]
|
|
52
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Exports are cached: devices by part, designs by checkpoint and options."""
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def root():
|
|
8
|
+
base = os.environ.get("IMPLVIEW_CACHE") or os.path.join(
|
|
9
|
+
os.environ.get("XDG_CACHE_HOME") or os.path.expanduser("~/.cache"), "implview")
|
|
10
|
+
return base
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def device_path(part):
|
|
14
|
+
d = os.path.join(root(), "devices")
|
|
15
|
+
os.makedirs(d, exist_ok=True)
|
|
16
|
+
return os.path.join(d, f"{part}.ivdev.gz")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def design_path(dcp, *opts):
|
|
20
|
+
st = os.stat(dcp)
|
|
21
|
+
key = f"{os.path.abspath(dcp)}|{st.st_mtime_ns}|{st.st_size}|{'|'.join(map(str, opts))}"
|
|
22
|
+
h = hashlib.sha1(key.encode()).hexdigest()[:16]
|
|
23
|
+
d = os.path.join(root(), "designs")
|
|
24
|
+
os.makedirs(d, exist_ok=True)
|
|
25
|
+
name = os.path.splitext(os.path.basename(dcp))[0]
|
|
26
|
+
return os.path.join(d, f"{name}-{h}.ivd.gz")
|