Skip to main content

Not-only RTL.

Project description

noRTL - Hardware design beyond register transfer level

noRTL (Not-only RTL) is a Python-based code generation framework for designing and implementing hardware description language (HDL) modules, particularly SystemVerilog state machines. It provides a high-level, Pythonic API for describing sets of finite state machines (FSMs) and hardware components with built-in correctness guarantees.

noRTL aims to make the design of complex digital systems easier by reducing the shortcommings of current hardware description languages that use the register transfer level (RTL) to model digital circuit's behavior. This tool goes beyond this level of abstraction: We digital designers want to describe behavior with cycle-level accuracy but do not want do deal with the complexity of state naming, state coding, starting parallel processes, etc. noRTL realizes this tedious part of digital design inside its core.

The code that is written for noRTL is pure Python code. The noRTL package realizes state handling and data structure assembly for you while the Python code is executed. noRTL can be understood as a fancy generator that assembles state machines and provides the tooling to render it to SystemVerilog and tools for verifying your code.

Main ideas

noRTL is built with the following concepts and ideas.

  • Each hardware description is an executable Python program. The hardware structure is assembled during execution. There is no need for static code analysis or parsing.
  • There should be no need to declare states explicitely. The number of states is determined during execution of the code.
  • The behavior description should be easily readable and feel procedural. Control structures should work similar to Python equivalents.
  • Checks and Optimizations are to be done during runtime of the Python code. Post-Optimization has not been necessary (yet).

Installation

A prerequisite for noRTL is the availablility of icarus Verilog in your path. This can be installed using your system's package manager or using the oss-cad-suite (https://github.com/YosysHQ/oss-cad-suite-build)

Method 1: Using pip (Public Registry)

# Install nortl
pip install nortl

Method 2: Using uv (Recommended)

# Clone the repository
git clone https://github.com/IMMS-Ilmenau/nortl
cd nortl

# Install dependencies
uv sync

# Activate the virtual environment
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

Method 3: Development Installation

For development work, install in editable mode:

# Clone the repository
git clone https://github.com/IMMS-Ilmenau/nortl
cd nortl

# Install development dependencies
uv sync --all-extras

# Activate the virtual environment
source .venv/bin/activate

Your First State Machine

Let's create a simple state machine that toggles an output based on an input.

from nortl import Engine, Const

# Create an engine with a module name -- Clock and reset signal is automatically included
engine = Engine("my_first_engine")

# Define input and output signals
enable = engine.define_input("enable", width=1)
output = engine.define_output("output", width=1, reset_value=0)

# Don't define states -- define behavior!
with engine.while_loop(Const(1)):
    engine.wait_for(enable == 1)
    engine.set(output, 1)
    engine.sync() # Wait one clock cycle
    engine.set(output, 0)
    engine.wait_for(enable == 0)

# Generate SystemVerilog code
from nortl.renderer import VerilogRenderer
renderer = VerilogRenderer()
verilog_code = renderer.render(engine)

print(verilog_code)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nortl-1.4.0.tar.gz (139.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nortl-1.4.0-py3-none-any.whl (74.6 kB view details)

Uploaded Python 3

File details

Details for the file nortl-1.4.0.tar.gz.

File metadata

  • Download URL: nortl-1.4.0.tar.gz
  • Upload date:
  • Size: 139.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nortl-1.4.0.tar.gz
Algorithm Hash digest
SHA256 397bcb059ff75b97b4f556c77299300c0d153e58434cdfd202a2a6b7ab1715ef
MD5 45d68f766c054fcb6f9d603a912d99e6
BLAKE2b-256 dbed11b25cafa3e72c4f3b7c565a91455015197fe5029f7639e009c450766c49

See more details on using hashes here.

File details

Details for the file nortl-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: nortl-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 74.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nortl-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a4b9658d17a89bd59c6df59ca9111c9268aa67039e09cace1456a86388b5e1c
MD5 94b8ebc2cf0ca1b62cdd01b1ed1d90d0
BLAKE2b-256 06d52246d10670d2e18ff59c0f5d82e89a4313e5c0385d1dfdab66e79d7dd229

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page