Skip to content

Commit 97445cd

Browse files
authored
VHDL updates for readthedocs documentation (#19)
* update README * updated readthedocs for VHDL * updated many missed references to systemverilog exporter * added note in quick start about hdl-src/ files
1 parent 6593108 commit 97445cd

25 files changed

+136
-187
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to the PeakRDL-regblock code generator
1+
# Contributing to the PeakRDL-regblock-vhdl code generator
22
We love your input! We want to make contributing to this project as easy and
33
transparent as possible, whether it's:
44

@@ -9,13 +9,14 @@ transparent as possible, whether it's:
99
- Becoming a maintainer
1010

1111

12-
## Open an issue using the [Issue Tracker](https://github.com/SystemRDL/PeakRDL-regblock/issues)
12+
## Open an issue using the [Issue Tracker](https://github.com/SystemRDL/PeakRDL-regblock-vhdl/issues)
1313
Talking to us is the easiest way to contribute! Report a bug or feature request by
14-
[opening a new issue](https://github.com/SystemRDL/PeakRDL-regblock/issues).
14+
[opening a new issue](https://github.com/SystemRDL/PeakRDL-regblock-vhdl/issues).
1515

1616
Issue submission expectations:
1717
* Please keep each issue submission limited to one topic. This helps us stay organized.
1818
* Before opening an issue, check if one already exists for your topic. It may have already been discussed.
19+
* Check the upstream SystemVerilog regblock exporter [issue tracker](https://github.com/SystemRDL/PeakRDL-regblock/issues) as well.
1920
* If submitting a bug, provide enough details so we can reproduce it on our end. (version number, example SystemRDL, etc...)
2021
* If submitting a feature request, please make sure ...
2122
* ... it does not violate the semantics of the SystemRDL standard.

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
[![Documentation Status](https://readthedocs.org/projects/peakrdl-regblock/badge/?version=latest)](http://peakrdl-regblock.readthedocs.io)
1+
[![Documentation Status](https://readthedocs.org/projects/peakrdl-regblock-vhdl/badge/?version=latest)](http://peakrdl-regblock-vhdl.readthedocs.io)
22
[![build](https://github.com/SystemRDL/PeakRDL-regblock-vhdl/workflows/build/badge.svg)](https://github.com/SystemRDL/PeakRDL-regblock-vhdl/actions?query=workflow%3Abuild+branch%3Amain)
33
[![Coverage Status](https://coveralls.io/repos/github/SystemRDL/PeakRDL-regblock-vhdl/badge.svg?branch=main)](https://coveralls.io/github/SystemRDL/PeakRDL-regblock-vhdl?branch=main)
44
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/peakrdl-regblock-vhdl.svg)](https://pypi.org/project/peakrdl-regblock-vhdl)
55

66
# PeakRDL-regblock-vhdl
7-
Compile SystemRDL into a VHDL control/status register (CSR) block. This is a VHDL port of the [SystemVerliog PeakRDL-regblock exporter](https://github.com/SystemRDL/PeakRDL-regblock).
7+
Compile SystemRDL into a VHDL control/status register (CSR) block.
88

99
For the command line tool, see the [PeakRDL project](https://peakrdl.readthedocs.io).
1010

1111
## Documentation
12-
See the [PeakRDL-regblock Documentation](http://peakrdl-regblock.readthedocs.io) for more details
12+
See the [PeakRDL-regblock-vhdl Documentation](http://peakrdl-regblock-vhdl.readthedocs.io) for more details
1313

1414
## Relationship with PeakRDL-regblock
15-
This is a direct port of the SystemVerilog regblock generator PeakRDL-regblock. Updates from the upstream regblock implementation are converted to VHDL and merged into this repository.
15+
This is a direct VHDL translation of the SystemVerilog regblock generator [PeakRDL-regblock](https://github.com/SystemRDL/PeakRDL-regblock). Updates from the upstream regblock implementation are converted to VHDL and merged into this repository.
16+
17+
### Goals
18+
19+
- Maintain feature parity with the upstream SystemVerilog implementation.
20+
- Keep the code structure as close as possible to upstream to allow merging future updates.
21+
- Keep the unit tests as close as possible to upstream. In most cases they are unchanged.
22+
- Tests are written in SystemVerilog and an auto-generated test adapter is used to instantiate the VHDL regblock under test.
1623

1724
### Versioning
1825

19-
Version numbers track those in the upstream repository, with an added segment. For example, the VHDL version 0.23.0.0 would indicate the first release matching the functionality of the upstream version 0.23.0. Version 0.23.0.1 would indicate a patch update unique to the VHDL port.
26+
Version numbers track those in the upstream repository with an added segment. For example, the VHDL version 1.0.0.0 would indicate the first release matching the functionality of the upstream version 1.0.0. Version 1.0.0.1 would indicate a patch update unique to the VHDL port.
2027

2128
In some cases (such as git tags), a `+vhdl` metadata specifier is suffixed to help differentiate from the upstream versions.
2229

2330
### Issue Reporting
2431

25-
If you encounter an issue,
32+
If you encounter an issue or want to suggest a feature,
2633
1. Check if it is already reported in the upstream repository's [issue tracker](https://github.com/SystemRDL/PeakRDL-regblock/issues).
2734
2. Report it in the upstream repository unless you are sure it's unique to the VHDL port. If you are unsure, report it here and it may be moved upstream if deemed appropriate.
2835
3. The upstream fix will be merged into this VHDL port.
29-
30-
### Unit Tests
31-
32-
Unit tests are kept as close as possible to upstream. In most cases they are unchanged. They are written in SystemVerilog. An auto-generated test adapter is used to instantiate the VHDL regblock for test.

docs/api.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ Exporter API
44
If you are not using the `PeakRDL command-line tool <https://peakrdl.readthedocs.io>`_,
55
you can still generate regblocks programmatically using the exporter API:
66

7-
.. autoclass:: peakrdl_regblock.RegblockExporter
7+
.. autoclass:: peakrdl_regblock_vhdl.RegblockExporter
88
:members:
99

1010
Example
1111
-------
12-
Below is a simple example that demonstrates how to generate a SystemVerilog
12+
Below is a simple example that demonstrates how to generate a VHDL
1313
implementation from SystemRDL source.
1414

1515
.. code-block:: python
1616
:emphasize-lines: 2-4, 29-33
1717
1818
from systemrdl import RDLCompiler, RDLCompileError
19-
from peakrdl_regblock import RegblockExporter
20-
from peakrdl_regblock.cpuif.axi4lite import AXI4Lite_Cpuif
21-
from peakrdl_regblock.udps import ALL_UDPS
19+
from peakrdl_regblock_vhdl import RegblockExporter
20+
from peakrdl_regblock_vhdl.cpuif.axi4lite import AXI4Lite_Cpuif
21+
from peakrdl_regblock_vhdl.udps import ALL_UDPS
2222
2323
input_files = [
2424
"PATH/TO/my_register_block.rdl"
@@ -42,7 +42,7 @@ implementation from SystemRDL source.
4242
# A compilation error occurred. Exit with error code
4343
sys.exit(1)
4444
45-
# Export a SystemVerilog implementation
45+
# Export a VHDL implementation
4646
exporter = RegblockExporter()
4747
exporter.export(
4848
root, "path/to/output_dir",

docs/architecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Register Block Architecture
33

44
The generated register block RTL is organized into several sections.
55
Each section is automatically generated based on the source register model and
6-
is rendered into the output register block SystemVerilog RTL.
6+
is rendered into the output register block VHDL RTL.
77

88
.. figure:: diagrams/arch.png
99

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# -- Project information -----------------------------------------------------
2020

21-
project = 'PeakRDL-regblock'
21+
project = 'PeakRDL-regblock-vhdl'
2222
copyright = '%d, Alex Mykyta' % datetime.datetime.now().year
2323
author = 'Alex Mykyta'
2424

docs/configuring.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.. _peakrdl_cfg:
22

3-
Configuring PeakRDL-regblock
4-
============================
3+
Configuring PeakRDL-regblock-vhdl
4+
=================================
55

66
If using the `PeakRDL command line tool <https://peakrdl.readthedocs.io/>`_,
77
some aspects of the ``regblock`` command have additional configuration options
88
available via the PeakRDL TOML file.
99

10-
All regblock-specific options are defined under the ``[regblock]`` TOML heading.
10+
All VHDL regblock-specific options are defined under the ``[regblock-vhdl]`` TOML heading.
1111

1212
.. data:: cpuifs
1313

@@ -20,7 +20,7 @@ All regblock-specific options are defined under the ``[regblock]`` TOML heading.
2020

2121
.. code-block:: toml
2222
23-
[regblock]
23+
[regblock-vhdl]
2424
cpuifs.my-cpuif-name = "my_cpuif_module:MyCPUInterfaceClass"
2525
2626
@@ -41,5 +41,5 @@ All regblock-specific options are defined under the ``[regblock]`` TOML heading.
4141

4242
.. code-block:: toml
4343
44-
[regblock]
44+
[regblock-vhdl]
4545
default_reset = "arst"

docs/cpuif/apb.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ CPU interface.
2626

2727
The APB3 CPU interface comes in two i/o port flavors:
2828

29-
SystemVerilog Interface
29+
VHDL Record Interface
3030
* Command line: ``--cpuif apb3``
31-
* Interface Definition: :download:`apb3_intf.sv <../../hdl-src/apb3_intf.sv>`
32-
* Class: :class:`peakrdl_regblock.cpuif.apb3.APB3_Cpuif`
31+
* Interface Definition: :download:`apb3_intf_pkg.vhd <../../hdl-src/apb3_intf_pkg.vhd>`
32+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.apb3.APB3_Cpuif`
3333

3434
Flattened inputs/outputs
3535
Flattens the interface into discrete input and output ports.
3636

3737
* Command line: ``--cpuif apb3-flat``
38-
* Class: :class:`peakrdl_regblock.cpuif.apb3.APB3_Cpuif_flattened`
38+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.apb3.APB3_Cpuif_flattened`
3939

4040

4141
APB4
@@ -47,13 +47,13 @@ CPU interface.
4747

4848
The APB4 CPU interface comes in two i/o port flavors:
4949

50-
SystemVerilog Interface
50+
VHDL Record Interface
5151
* Command line: ``--cpuif apb4``
52-
* Interface Definition: :download:`apb4_intf.sv <../../hdl-src/apb4_intf.sv>`
53-
* Class: :class:`peakrdl_regblock.cpuif.apb4.APB4_Cpuif`
52+
* Interface Definition: :download:`apb4_intf_pkg.vhd <../../hdl-src/apb4_intf_pkg.vhd>`
53+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.apb4.APB4_Cpuif`
5454

5555
Flattened inputs/outputs
5656
Flattens the interface into discrete input and output ports.
5757

5858
* Command line: ``--cpuif apb4-flat``
59-
* Class: :class:`peakrdl_regblock.cpuif.apb4.APB4_Cpuif_flattened`
59+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.apb4.APB4_Cpuif_flattened`

docs/cpuif/avalon.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ CPU interface.
77

88
The Avalon interface comes in two i/o port flavors:
99

10-
SystemVerilog Interface
10+
VHDL Record Interface
1111
* Command line: ``--cpuif avalon-mm``
12-
* Interface Definition: :download:`avalon_mm_intf.sv <../../hdl-src/avalon_mm_intf.sv>`
13-
* Class: :class:`peakrdl_regblock.cpuif.avalon.Avalon_Cpuif`
12+
* Interface Definition: :download:`avalon_mm_intf_pkg.vhd <../../hdl-src/avalon_mm_intf_pkg.vhd>`
13+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.avalon.Avalon_Cpuif`
1414

1515
Flattened inputs/outputs
1616
Flattens the interface into discrete input and output ports.
1717

1818
* Command line: ``--cpuif avalon-mm-flat``
19-
* Class: :class:`peakrdl_regblock.cpuif.avalon.Avalon_Cpuif_flattened`
19+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.avalon.Avalon_Cpuif_flattened`
2020

2121

2222
Implementation Details

docs/cpuif/axi4lite.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ CPU interface.
99

1010
The AXI4-Lite CPU interface comes in two i/o port flavors:
1111

12-
SystemVerilog Interface
12+
VHDL Record Interface
1313
* Command line: ``--cpuif axi4-lite``
14-
* Interface Definition: :download:`axi4lite_intf.sv <../../hdl-src/axi4lite_intf.sv>`
15-
* Class: :class:`peakrdl_regblock.cpuif.axi4lite.AXI4Lite_Cpuif`
14+
* Interface Definition: :download:`axi4lite_intf_pkg.vhd <../../hdl-src/axi4lite_intf_pkg.vhd>`
15+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.axi4lite.AXI4Lite_Cpuif`
1616

1717
Flattened inputs/outputs
1818
Flattens the interface into discrete input and output ports.
1919

2020
* Command line: ``--cpuif axi4-lite-flat``
21-
* Class: :class:`peakrdl_regblock.cpuif.axi4lite.AXI4Lite_Cpuif_flattened`
21+
* Class: :class:`peakrdl_regblock_vhdl.cpuif.axi4lite.AXI4Lite_Cpuif_flattened`
2222

2323

2424
Pipelined Performance

docs/cpuif/customizing.rst

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,57 @@
11
Customizing the CPU interface
22
=============================
33

4-
Use your own existing SystemVerilog interface definition
4+
Use your own existing VHDL record definition
55
--------------------------------------------------------
66

7-
This exporter comes pre-bundled with its own SystemVerilog interface declarations.
8-
What if you already have your own SystemVerilog interface declaration that you prefer?
7+
This exporter comes pre-bundled with its own VHDL record interface declarations.
8+
What if you already have your own VHDL record declaration that you prefer?
99

1010
Not a problem! As long as your interface definition is similar enough, it is easy
11-
to customize and existing CPUIF definition.
11+
to customize an existing CPUIF definition.
1212

1313

14-
As an example, let's use the SystemVerilog interface definition for
14+
As an example, let's use the VHDL record definition for
1515
:ref:`cpuif_axi4lite` that is bundled with this project. This interface uses
1616
the following style and naming conventions:
1717

18-
* SystemVerilog interface type name is ``axi4lite_intf``
19-
* Defines modports named ``master`` and ``slave``
20-
* Interface signals are all upper-case: ``AWREADY``, ``AWVALID``, etc...
18+
* VHDL input record type name is ``axi4lite_slave_in_intf``
19+
* VHDL output record type name is ``axi4lite_slave_out_intf``
20+
* Record signals are all upper-case: ``AWREADY``, ``AWVALID``, etc...
2121

22-
Lets assume your preferred SV interface definition uses a slightly different naming convention:
22+
Lets assume your preferred VHDL record definition uses a slightly different naming convention:
2323

24-
* SystemVerilog interface type name is ``axi4_lite_interface``
25-
* Modports are capitalized and use suffixes ``Master_mp`` and ``Slave_mp``
24+
* VHDL input record type name is ``axi4_lite_interface_in``
25+
* VHDL output record type name is ``axi4_lite_interface_out``
2626
* Interface signals are all lower-case: ``awready``, ``awvalid``, etc...
2727

2828
Rather than rewriting a new CPU interface definition, you can extend and adjust the existing one:
2929

3030
.. code-block:: python
3131
32-
from peakrdl_regblock.cpuif.axi4lite import AXI4Lite_Cpuif
32+
from peakrdl_regblock_vhdl.cpuif.axi4lite import AXI4Lite_Cpuif
3333
3434
class My_AXI4Lite(AXI4Lite_Cpuif):
35+
3536
@property
3637
def port_declaration(self) -> str:
37-
# Override the port declaration text to use the alternate interface name and modport style
38-
return "axi4_lite_interface.Slave_mp s_axil"
38+
# Override the port declaration text to use the alternate record name and case
39+
return "\n".join([
40+
"s_axil_i : in axi4_lite_interface_in(",
41+
f" awaddr({self.addr_width-1} downto 0),",
42+
f" wdata({self.data_width-1} downto 0),",
43+
f" wstrb({self.data_width_bytes-1} downto 0),",
44+
f" araddr({self.addr_width-1} downto 0)",
45+
");",
46+
"s_axil_o : out axi4_lite_interface_out(",
47+
f" rdata({self.data_width-1} downto 0)",
48+
")",
49+
])
50+
3951
4052
def signal(self, name:str) -> str:
4153
# Override the signal names to be lowercase instead
42-
return "s_axil." + name.lower()
54+
return super().signal(name).lower()
4355
4456
Then use your custom CPUIF during export:
4557

@@ -59,9 +71,9 @@ Custom CPU Interface Protocol
5971
If you require a CPU interface protocol that is not included in this project,
6072
you can define your own.
6173

62-
1. Create a SystemVerilog CPUIF implementation template file.
74+
1. Create a VHDL CPUIF implementation template file.
6375

64-
This contains the SystemVerilog implementation of the bus protocol. The logic
76+
This contains the VHDL implementation of the bus protocol. The logic
6577
in this shall implement a translation between your custom protocol and the
6678
:ref:`cpuif_protocol`.
6779

@@ -72,7 +84,7 @@ you can define your own.
7284

7385
2. Create a Python class that defines your CPUIF
7486

75-
Extend your class from :class:`peakrdl_regblock.cpuif.CpuifBase`.
87+
Extend your class from :class:`peakrdl_regblock_vhdl.cpuif.CpuifBase`.
7688
Define the port declaration string, and provide a reference to your template file.
7789

7890
3. Use your new CPUIF definition when exporting.
@@ -94,17 +106,17 @@ Via a package's entry point definition
94106
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95107
If you are publishing a collection of PeakRDL plugins as an installable Python
96108
package, you can advertise them to PeakRDL using an entry point.
97-
This advertises your custom CPUIF class to the PeakRDL-regblock tool as a plugin
109+
This advertises your custom CPUIF class to the PeakRDL-regblock-vhdl tool as a plugin
98110
that should be loaded, and made available as a command-line option in PeakRDL.
99111

100112
.. code-block:: toml
101113
102-
[project.entry-points."peakrdl_regblock.cpuif"]
114+
[project.entry-points."peakrdl_regblock_vhdl.cpuif"]
103115
my-cpuif = "my_package.my_module:MyCPUIF"
104116
105117
106118
* ``my_package``: The name of your installable Python module
107-
* ``peakrdl-regblock.cpuif``: This is the namespace that PeakRDL-regblock will
119+
* ``peakrdl-regblock-vhdl.cpuif``: This is the namespace that PeakRDL-regblock-vhdl will
108120
search. Any cpuif plugins you create must be enclosed in this namespace in
109121
order to be discovered.
110122
* ``my_package.my_module:MyCPUIF``: This is the import path that

0 commit comments

Comments
 (0)