Giter Club home page Giter Club logo

uvm_code_gen's Introduction

⚡️ uvm_code_gen

Simple template-based UVM code generator.

💡 Rationale

UVM is great for reuse and standardization of RTL verification.
However, it is very verbose.

uvm_code_gen generates a full UVM testbench skeleton based on simple configuration files.
Once generated, we only have to write a couple of lines to finish it.

✨ Features

uvm_code_gen generates the following code:

  • VIPs (agent, interface, sequence, coverage)
  • top-level environment
    • testbench
    • env (scoreboard, VIP, coverage)
    • virtual sequence
  • run script

🚀 Usage

Basic

./main.py examples/fifo/fifo_in.conf examples/fifo/fifo_out.conf

Generated files are in ./output.

run simulation

  1. create bin/dut_files.f
  2. edit dut instantiation in top/tb/top_th.sv
  3. cd bin and ./run

edit to your liking

  • VIP
    • clocking blocks in vip/*/*_if.sv
    • do_drive() in vip/*/*_driver.sv
    • do_mon() in vip/*/*_monitor.sv
  • TOP
    • write_from_*() in top/top_scoreboard.sv
    • top/top_seq_lib.sv

Advanced

top_env_name

# top-level environment default name is "top"
./main.py examples/fifo/fifo_in.conf examples/fifo/fifo_out.conf

# top-level environment name is "fifo"
./main.py examples/fifo/fifo_in.conf examples/fifo/fifo_out.conf -t fifo

top_map

By default:

  • each VIP is instiated once
  • instance name is the name of the VIP

This can be changed using the --top_map option.

# multiple instances of the VIPs
./main.py examples/noc/*.conf --top_map examples/noc/top.map

# you can also refer to VIPs that are not defined by a config file:
#  - the top-level env/scoreboard/etc will be correctly generated
#  - the VIP directory won't be generated
./main.py --top_map examples/noc/top.map

has_master_and_slave

Adding has_master_and_slave = 1 in the configuration file will

  • add *_master_driver.sv and *_slave_driver.sv
  • add is_master field in the VIP's config class and use it in the *_agent.sv
  • set is_master in the top_config.sv to 1 if the instance name matches master
  • add a master and slave instance by default (unless --top_map is used)
./main.py examples/handshake/handshake.conf

🚧 TODO

  • change seq name to something less generic ?
  • change convert2string() formatting ?

🙏 Credits

The UVM code generation and coding guidelines are heavily inspired by Doulos' easier_uvm.
Thanks a lot to all the contributors.

uvm_code_gen's People

Contributors

antoinemadec avatar vmorillon avatar

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.