All Projects → olofk → Edalize

olofk / Edalize

Licence: bsd-2-clause
An abstraction library for interfacing EDA tools

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Edalize

xeda
Cross EDA Abstraction and Automation
Stars: ✭ 25 (-90.74%)
Mutual labels:  fpga, vhdl, eda, verilog, synthesis
JSON-for-VHDL
A JSON library implemented in VHDL.
Stars: ✭ 56 (-79.26%)
Mutual labels:  fpga, simulation, vhdl, synthesis
Vtr Verilog To Routing
Verilog to Routing -- Open Source CAD Flow for FPGA Research
Stars: ✭ 466 (+72.59%)
Mutual labels:  verilog, fpga, eda, synthesis
Livehd
Live Hardware Development (LiveHD), a productive infrastructure for Synthesis and Simulation
Stars: ✭ 110 (-59.26%)
Mutual labels:  verilog, fpga, synthesis, simulation
docker
Scripts to build and use docker images including GHDL
Stars: ✭ 27 (-90%)
Mutual labels:  simulation, vhdl, verilog, synthesis
hwt
VHDL/Verilog/SystemC code generator, simulator API written in python/c++
Stars: ✭ 145 (-46.3%)
Mutual labels:  fpga, vhdl, verilog
Symbiflow Arch Defs
FOSS architecture definitions of FPGA hardware useful for doing PnR device generation.
Stars: ✭ 137 (-49.26%)
Mutual labels:  verilog, fpga, synthesis
fpga-docker
Tools for running FPGA vendor toolchains with Docker
Stars: ✭ 54 (-80%)
Mutual labels:  fpga, vhdl, verilog
vscode-terosHDL
VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
Stars: ✭ 325 (+20.37%)
Mutual labels:  fpga, vhdl, verilog
J1sc
A reimplementation of a tiny stack CPU
Stars: ✭ 64 (-76.3%)
Mutual labels:  verilog, fpga, vhdl
SpinalDev
Docker Development Environment for SpinalHDL
Stars: ✭ 17 (-93.7%)
Mutual labels:  fpga, vhdl, verilog
math
Useful m-scripts for DSP (CIC, FIR, FFT, Fast convolution, Partial Filters etc.)
Stars: ✭ 15 (-94.44%)
Mutual labels:  fpga, vhdl, verilog
getting-started
List of ideas for getting started with TimVideos projects
Stars: ✭ 50 (-81.48%)
Mutual labels:  fpga, vhdl, verilog
Open Register Design Tool
Tool to generate register RTL, models, and docs using SystemRDL or JSpec input
Stars: ✭ 126 (-53.33%)
Mutual labels:  verilog, fpga, eda
Tinytpu
Implementation of a Tensor Processing Unit for embedded systems and the IoT.
Stars: ✭ 153 (-43.33%)
Mutual labels:  verilog, fpga, vhdl
SpinalCrypto
SpinalHDL - Cryptography libraries
Stars: ✭ 36 (-86.67%)
Mutual labels:  fpga, vhdl, verilog
intfftk
Fully pipelined Integer Scaled / Unscaled Radix-2 Forward/Inverse Fast Fourier Transform (FFT) IP-core for newest Xilinx FPGAs (Source language - VHDL / Verilog). GNU GPL 3.0.
Stars: ✭ 43 (-84.07%)
Mutual labels:  fpga, vhdl, verilog
Vexriscv
A FPGA friendly 32 bit RISC-V CPU implementation
Stars: ✭ 1,041 (+285.56%)
Mutual labels:  verilog, fpga, vhdl
Rggen
Code generation tool for configuration and status registers
Stars: ✭ 54 (-80%)
Mutual labels:  verilog, fpga, eda
async fifo
A dual clock asynchronous FIFO written in verilog, tested with Icarus Verilog
Stars: ✭ 117 (-56.67%)
Mutual labels:  fpga, verilog, synthesis

Edalize

.. image:: https://github.com/olofk/edalize/workflows/CI/badge.svg :target: https://github.com/olofk/edalize/actions?query=workflow%3ACI :alt: CI status

.. image:: https://readthedocs.org/projects/edalize/badge/?version=latest :target: https://edalize.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

.. image:: https://img.shields.io/pypi/dm/edalize.svg?label=PyPI%20downloads :target: https://pypi.org/project/edalize/ :alt: PyPI downloads

.. image:: https://www.librecores.org/olofk/edalize/badge.svg?style=flat :target: https://www.librecores.org/olofk/edalize :alt: LibreCores

What's this?

Edalize is a Python Library for interacting with EDA tools. It can create project files for supported tools and run them in batch or GUI mode (where supported).

Award-winning Edalize introduction video_

All EDA tools such as Icarus, Yosys, ModelSim, Vivado, Verilator, GHDL, Quartus etc get input HDL files (Verilog and VHDL) and some tool-specific files (constraint files, memory initialization files, IP description files etc). Together with the files, perhaps a couple of Verilog `defines, some top-level parameters/generics or some tool-specific options are set. Once the configuration is done, a simulation model, netlist or FPGA image is built, and in the case of simulations, the model is also executed, maybe with some extra run-time parameters.

The thing is, all these tools are doing this in completely different ways and there's generally no way to import configurations from one simulator to another.

Dread not! Edalize takes care of this for you. By telling Edalize what files you have, together with some info, what parametrization to use at compile- and run-time (e.g. plusargs, defines, generics, parameters), VPI library sources (when applicable) and any other tool-specific options not already mentioned, it will create the necessary project files and offer to build and run it for you.

This will save you from having to deal with the boring stuff of interfacing the EDA tools yourself, while still have pretty much full power to set up the project the way you want.

It allows you to quickly switch tools, at least when it comes to simulators. This is highly useful to shake out tool-specific bugs, or just to let you work with your weapon of choice.

It can also be used to just get a quick template that you can open up in the tool's GUI if there is such, and continue working from there.

It can be directly integrated as a library for your existing Python-powered HDL project, or can be used stand-alone (soon anyway) to feed Edalize from projects written in other languages.

Install it

Edalize is a Python module. Then once downloaded we can install it with following Python command::

$ cd edalize
$ python -m pip install -e .

The reporting modules have been made optional due to their use of a number of dependencies for data analysis. These can be installed with

$ python -m pip install -e ".[reporting]"

How to use it?

Ok, this sounds great. Now, how do I get started?

Assume we have a project that consists of a Verilog source file called blinky.v. Then there's also a testbench called blinky_tb.v and a constraints file for synthesis called constraints.sdc. You can get those files from blinky <https://github.com/fusesoc/blinky>_ and for vlog_tb_utils.v in orpsoc-cores <https://github.com/fusesoc/vlog_tb_utils/blob/master/vlog_tb_utils.v>_.

For a simulation, we want to use the two Verilog files, build it in a subdirectory called build, and then run it with a parameter to control simulated clock frequency.

Edalize is a Python tool, then we can run it inside a Python script file or directly in the Python console.

First we have to import Edalize objects::

from edalize import *

The os module is also required for this tutorial::

import os

Then register the files to use::

work_root = 'build'

files = [ {'name' : os.path.relpath('blinky.v', work_root), 'file_type' : 'verilogSource'}, {'name' : os.path.relpath('blinky_tb.v', work_root), 'file_type' : 'verilogSource'}, {'name' : os.path.relpath('vlog_tb_utils.v', work_root), 'file_type' : 'verilogSource'} ]

The design has a toplevel Verilog parameter with the name clk_freq_hz that accepts integers. We set its default value to 1000. The testbench also has an option to enable waveform dumping by setting a plusarg called vcd::

parameters = {'clk_freq_hz' : {'datatype' : 'int', 'default' : 1000, 'paramtype' : 'vlogparam'}, 'vcd' : {'datatype' : 'bool', 'paramtype' : 'plusarg'}}

Let Edalize know we intend to use Icarus Verilog for our simulation::

tool = 'icarus'

And put it all into a single data structure together with some info about the toplevel and name for the project::

edam = { 'files' : files, 'name' : 'blinky_project', 'parameters' : parameters, 'toplevel' : 'blinky_tb' }

Now we need to get ourselves a backend object from Edalize::

backend = get_edatool(tool)(edam=edam, work_root=work_root)

Create the directory and the project files::

os.makedirs(work_root) backend.configure()

At this point, we still haven't run the actual EDA tool and the files in the work_root directory can be used without Edalize if that is preferred. But let's continue the example with Edalize.

Build the simulation model::

backend.build()

And finally run it, with our arguments. Some types of parameters (e.g. plusargs) are defined aat runtime, and at this point we can change their value by passing the name and new value to run(). Or we could skip it altogether, and the default value from the configure stage would be used. Let's run with VCD logging enabled::

args = {'vcd' : True} backend.run(args)

Tada! We have simulated. As an exercise, try to just change the tool variable to e.g. modelsim, xsim or any of the other simulators supported by Edalize and see if it works without any changes.

Now it's time to create an FPGA image instead

As you have seen, Edalize is an award-winning tool for interfacing EDA tools, so

Edalize it, don't criticize it! Edalize it, and I will advertise it!

See source code for further details.

.. _Edalize introduction video: https://www.youtube.com/watch?v=HuRtkpZqB34

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].