Skip to content

Commit 6a8786e

Browse files
authored
Merge pull request #64 from Thomas-Vreys/wavedrom-bitfield-bug
Wavedrom bitfield bug
2 parents c024ce7 + bad9adf commit 6a8786e

6 files changed

Lines changed: 137 additions & 1 deletion

File tree

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ gen:
5555
ipxact2md --srcFile example/input/test2.xml --destDir example/output
5656
ipxact2c --srcFile example/input/test2.xml --destDir example/output
5757

58+
cp example/output/example2.rst example/output_sphinx2
59+
ipxact2rst --srcFile example/input/test2.xml --destDir example/output_sphinx2 --config example/input/sphinx.ini
60+
sphinx-build example/output_sphinx2 example/output_sphinx2/build -q -b latex
61+
make -C example/output_sphinx2/build
62+
cp example/output_sphinx2/build/example2.pdf example/output_sphinx2/example2.pdf
63+
5864

5965
compile:
6066
test -d work || vlib work

example/output_sphinx2/conf.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = 'example2'
10+
copyright = '2023, IEEE'
11+
author = 'ipxact2systemverilog'
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = ['sphinxcontrib.wavedrom']
17+
18+
templates_path = ['_templates']
19+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
20+
21+
# Use the Python implementation of wavedrom-cli and not the npx one
22+
render_using_wavedrompy = True
125 KB
Binary file not shown.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
========
2+
example2
3+
========
4+
5+
Second demo example used for the testing of the ipxact2systemverilog
6+
tool.
7+
8+
:Base Address: 0x0
9+
10+
Registers
11+
---------
12+
13+
+-----------+-----------------+--------------------------------+
14+
| Address | Register Name | Description |
15+
+===========+=================+================================+
16+
| 0x00 | reg0_ | read something useful for reg0 |
17+
+-----------+-----------------+--------------------------------+
18+
| 0x01 | reg1_ | |
19+
+-----------+-----------------+--------------------------------+
20+
21+
reg0
22+
----
23+
24+
:Name: reg0
25+
:Address: 0x0
26+
:Access: read-only
27+
:Description: read something useful for reg0
28+
29+
.. wavedrom::
30+
:alt: reg0
31+
32+
{
33+
"reg": [
34+
{
35+
"name": "field0",
36+
"bits": 2
37+
},
38+
{
39+
"name": "field1",
40+
"bits": 6
41+
}
42+
],
43+
"config": {
44+
"lanes": 1,
45+
"bits": 8
46+
}
47+
}
48+
49+
50+
+--------+--------------+----------------------------------+
51+
| Bits | Field name | Description |
52+
+========+==============+==================================+
53+
| [7:2] | field1 | read something useful for field1 |
54+
+--------+--------------+----------------------------------+
55+
| [1:0] | field0 | read something useful for field0 |
56+
+--------+--------------+----------------------------------+
57+
58+
reg1
59+
----
60+
61+
:Name: reg1
62+
:Address: 0x1
63+
:Access: read-only
64+
:Description:
65+
66+
.. wavedrom::
67+
:alt: reg1
68+
69+
{
70+
"reg": [
71+
{
72+
"name": "field0",
73+
"bits": 8
74+
}
75+
],
76+
"config": {
77+
"lanes": 1,
78+
"bits": 8
79+
}
80+
}
81+
82+
83+
+--------+--------------+----------------------------------+
84+
| Bits | Field name | Description |
85+
+========+==============+==================================+
86+
| [7:0] | field0 | read something useful for field0 |
87+
+--------+--------------+----------------------------------+
88+
89+
field0
90+
~~~~~~
91+
92+
:Minimum: 0x00
93+
:Maximum: 0x07
94+

example/output_sphinx2/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. IPXACT documentation master file, created by
2+
sphinx-quickstart on Sat Oct 14 18:45:45 2023.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to IPXACT's documentation!
7+
==================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
example2.rst

ipxact2systemverilog/ipxact2hdlCommon.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ def returnAsString(self):
297297
py.append(f)
298298

299299
wd = {'reg': py,
300-
'config': {'lanes': reg.size//8}}
300+
'config': {'lanes': reg.size//8,
301+
'bits': reg.size,}}
301302
r.newline()
302303
r.directive(name="wavedrom",
303304
fields=[("alt", reg.name)],

0 commit comments

Comments
 (0)