RgGen is a code generation tool for ASIC/IP/FPGA/RTL engineers. It will automatically generate source code related to configuration and status registers (CSR), e.g. SytemVerilog RTL, UVM register model (UVM RAL/uvm_reg), C header file, Wiki documents, from human readable register map specifications.
RgGen has following features:
- Generate source files related to CSR from register map specifications
- RTL module
- SystemVerilog
- Verilog
- Need rggen-verilog plugin
- VHDL
- Need rggen-vhdl plugin
- Supports standard bus protocols
- AMBA APB
- AMBA AXI4-Lite
- Wishbone
- UVM register model (UVM RAL/uvm_reg)
- C header file
- Register map documents written in Markdown
- RTL module
- Register map specifications can be written in human readable format
- Ruby with APIs to describe register map information
- YAML
- JSON
- TOML
- Spreadsheet (XLSX, XLS, OSD, CSV)
- SiFive DUH
- Need rggen-duh plugin
- Customize RgGen for you environment
- E.g. add special bit field types
RgGen is written in the Ruby programing language and its required version is 2.7 or later. You need to install any of these versions of Ruby before installing RgGen tool. To install Ruby, see this page.
RgGen depends on following sub components and other Ruby libraries.
- rggen-core
- rggen-default-register-map
- rggen-systemverilog
- rggen-c-header
- rggen-markdown
- rggen-spreadsheet-loader
To install RgGen and the dependencies, use the command below:
$ gem install rggen
RgGen and dependencies will be installed on your system root.
If you want to install them on other location, you need to specify install path and set the GEM_PATH
environment variable:
$ gem install --install-dir YOUR_INSTALL_DIRECTORY rggen
$ export GEM_PATH=YOUR_INSTALL_DIRECTORY
You would get the following error message duaring installation if you have the old RgGen (version < 0.9).
ERROR: Error installing rggen:
"rggen" from rggen-core conflicts with installed executable from rggen
To resolve the above error, there are three solutions. See this page
See Wiki documents.
RgGen has plugin
feature to allow your cusomization.
See this Wiki document for futher detals.
Following EDA tools can accept the generated source files.
- Simulation tools
- Synopsys VCS
- Cadence Xcelium
- Xilinx Vivado Simulator
- Verilator
- Need
-Wno-fatal
switch
- Need
- Icarus Verilog
- Verilog RTL only
- Synthesis tools
- Synopsys Design Compiler
- Intel Quartus
- Xilinx Vivado
- Yosys
- Verilog RTL
You can get an example configuration file and register map specifications listed below:
- Configuration file
- Register map specifications
You can try to use RgGen by uisng these example files. Hit command below:
$ rggen -c config.yml -o out block_0.yml block_1.yml
-c
: Specify path to your configuration file-o
: Specify path to the directory where generated files will be written to
Then, generated files listed below will be written to out
directory.
- SystemVerilog RTL
- UVM register model
- C header file
- Markdown document
See Contributing Guide.
Feedbacks, bug reports, questions and etc. are wellcome! You can post them by using following ways:
- https://github.com/rggen/rggen-core
- https://github.com/rggen/rggen-default-register-map
- https://github.com/rggen/rggen-systemverilog
- https://github.com/rggen/rggen-c-header
- https://github.com/rggen/rggen-markdown
- https://github.com/rggen/rggen-spreadsheet-loader
- https://github.com/rggen/rggen-duh
- https://github.com/rggen/rggen-verilog
- https://github.com/rggen/rggen-vhdl
Copyright © 2019-2023 Taichi Ishitani. RgGen is licensed under the MIT License, see LICENSE for futher detils.
Everyone interacting in the RgGen project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.