Giter Site home page Giter Site logo

unidanny / peakrdl-uvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from systemrdl/peakrdl-uvm

0.0 0.0 0.0 65 KB

Generate UVM register model from compiled SystemRDL input

License: GNU General Public License v3.0

Shell 2.97% Python 51.22% SystemVerilog 45.81%

peakrdl-uvm's Introduction

build PyPI - Python Version

PeakRDL-uvm

Generate UVM register model from compiled SystemRDL input.

For the command line tool, see the PeakRDL project.

Installing

Install from PyPi using pip:

python3 -m pip install peakrdl-uvm

Example

The easiest way to use PeakRDL-uvm is via the PeakRDL command line tool:

# Install the command line tool
python3 -m pip install peakrdl

# Generate UVM
peakrdl uvm your_design.rdl -o your_design.sv

Reference

UVMExporter(**kwargs)

Constructor for the UVM Exporter class

Optional Parameters

  • user_template_dir
    • Path to a directory where user-defined template overrides are stored.
  • user_template_context
    • Additional context variables to load into the template namespace.

UVMExporter.export(node, path, **kwargs)

Perform the export!

Parameters

  • node
    • Top-level node to export. Can be the top-level RootNode or any internal AddrmapNode.
  • path
    • Output file.

Optional Parameters

  • export_as_package
    • If True (Default), UVM register model is exported as a SystemVerilog package. Package name is based on the output file name.
    • If False, register model is exported as an includable header.
  • reuse_class_definitions
    • If True (Default), exporter attempts to re-use class definitions where possible. Class names are based on the lexical scope of the original SystemRDL definitions.
    • If False, class definitions are not reused. Class names are based on the instance's hierarchical path.
  • use_uvm_factory
    • If True, class definitions and class instances are created using the UVM factory.
    • If False (Default), UVM factory is disabled. Classes are created directly via new() constructors.

API Example

Pass the elaborated output of the SystemRDL Compiler to the exporter.

import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl_uvm import UVMExporter

rdlc = RDLCompiler()

try:
    rdlc.compile_file("path/to/my.rdl")
    root = rdlc.elaborate()
except RDLCompileError:
    sys.exit(1)

exporter = UVMExporter()
exporter.export(root, "test.sv")

peakrdl-uvm's People

Contributors

amykyta3 avatar dragon-git avatar krcb197 avatar zhajio1988 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.