block has one or more CSR blocks • Used for communication between host processor and functional blocks ◦ Each CSRs has own address ▪ Host processor can specify a CSR ◦ Write data to a CSR ▪ Updating a setting of a functional block ◦ Read data from a CSR ▪ Getting a status of a functional block • Register map ◦ List of CSRs/Specification of a CSR block ◦ You need to implement a CSR block that matches the register map What is CSR?
Not difficult but easy to make mistakes ▪ A lot of similar but little different code blocks • offset address, bit position, read/write action, etc. ◦ Need to write various kinds of file ▪ RTL, UVM RAL, C header, documemts ◦ Mismatch between specifications and implementations • How to resolve? ◦ Generate CSR files from register map specifications
bit fields ◦ array register, external register, indirect register ◦ 42 types of bit fields ◦ You can generate complex registers • Support standard bus protocols ◦ APB, AXI4 Lite, Wishbone • Plugin feature ◦ You can customize RgGen by creating your own plugin ▪ Add special bit field type support ▪ Add your own bus protocol support
project Wiki ◦ https://github.com/rggen/rggen/wiki • You can get sample files from the repository below ◦ https://github.com/rggen/rggen-sample • You can also get sample TBs as integration samples ◦ https://github.com/rggen/rggen-sample-testbench
Specify address width, data width and host bus protocol ◦ Written in YAML, JSON or TOML ◦ https://github.com/rggen/rggen-sample/blob/master/config.yml • Register map specifications ◦ Describe CSR design information ▪ register • name, offset address, type, etc. ▪ bit field • name, bit assignment, type, initial value, etc. ◦ https://github.com/rggen/rggen-sample/blob/master/uart_csr.yml
our development flow • Before integration ◦ Each module designer implements CSR modules by their style ▪ Need to look into RTL code to check behavior of a CSR ◦ Mismatch between documentations and implementations • After integration ◦ Generate all CSR modules by RgGen ▪ Use YAML format for register map specifications • YAML format is good for readability and version managiment ◦ Generate Markdown documents every updating a project repository ▪ Avoid mismatch between specification, implementation and documentation