Giter Club home page Giter Club logo

rtlgen's Introduction

RTL generator

CI

Generator of SystemC, VHDL and SystemVerilog projects.

Main Idea

River CPU and peripheries libraries have different RTL implementation versions: System Verilog and VHDL (see riscv_vhdl project). It is quite compilcate to maintain the precise SystemC that matches to these RTL implementations. To support consistency of all these implementations (SystemC, SystemVerilog and VHLD) this generator is used.

Code generator features:

  • Preserve project structure and files
  • Support commentaries in the same way as in the current manual implementation
  • Dynamically track global and local configuration parameters to compute their values
  • Preserve text names of configuration parameters in the signal bus declarations
  • Automatically detect unconnected IO-ports
  • Avoid and fixing latches instead of FFs.

Code structure

  • librtlgen library that implements API with the generic C++ classes which are used to describe any RTL model: project, file, parameter, module, port, signal etc.
  • rivergen RTL project implements River CPU using librtlgen generic classes.

Generated Example System Verilog:

// Code comment
localparam int CFG_PARAM1 = 128;
localparam int CFG_PARAM2 = CFG_PARAM1 - 64;    // comment 2

logic [CFG_PARAM1-1:0] A;
logic [CFG_PARAM1-CFG_PARAM2-1:0] B;

Generated Example SystemC:

// Code comment
static const int CFG_PARAM1 = 128;
static const int CFG_PARAM2 = CFG_PARAM1 - 64;  // comment 2

sc_biguint<CFG_PARAM1> A;
sc_uint<CFG_PARAM1-CFG_PARAM2> B;

Generator preserves all parameter names and automatically calculates bus widths to properly use sc_uint/sc_biguint definitions.

Windows: Use CMake and generate MS Visual Studio project.

Linux:

> cd rtlgen
> cmake -S . -B output_dir
> cd output_dir
> make
> ./bin/rivergen

Generated code examples:

rtlgen's People

Contributors

sergeykhbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mfkiwl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.