Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Nov 8, 2023
1 parent 6434734 commit fbb1dde
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,19 @@ Install from [PyPi](https://pypi.org/project/peakrdl-uvm) using pip:

python3 -m pip install peakrdl-uvm

--------------------------------------------------------------------------------

## Exporter Usage
Pass the elaborated output of the [SystemRDL Compiler](http://systemrdl-compiler.readthedocs.io)
to the exporter.
## Example

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

rdlc = RDLCompiler()
The easiest way to use PeakRDL-uvm is via the [PeakRDL command line tool](https://peakrdl.readthedocs.io/):

try:
rdlc.compile_file("path/to/my.rdl")
root = rdlc.elaborate()
except RDLCompileError:
sys.exit(1)
```bash
# Install the command line tool
python3 -m pip install peakrdl

exporter = UVMExporter()
exporter.export(root, "test.sv")
# Generate UVM
peakrdl uvm your_design.rdl -o your_design.sv
```
--------------------------------------------------------------------------------


## Reference

Expand Down Expand Up @@ -74,3 +64,24 @@ Perform the export!
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](http://systemrdl-compiler.readthedocs.io)
to the exporter.

```python
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")
```

0 comments on commit fbb1dde

Please sign in to comment.