Code Monkey home page Code Monkey logo

livehd's Introduction

LiveHD

LiveHD: Live Hardware Development

Summary

CodeFactor codecov CI

LiveHD is a "compiler" infrastructure for hardware design optimized for synthesis and simulation. The goals is to enable a more productive flow where the ASIC/FPGA designer can work with multiple hardware description languages like CHISEL, Pyrope, or Verilog.

Goal

LiveHD: a fast and friendly hardware development flow that you can trust

To be "Fast", LiveHD aims to be parallel, scalable, and incremental/live flow.

To be "friendly", LiveHD aims to build new models to have good error reporting.

To "trust", LiveHD has CI and many random tests with logic equivalence tests (LEC).

⚠️ LiveHD is beta under active development and we keep improving the API. Semantic versioning is a 0.+, significant API changes are expect.

LiveHD Framework

LiveHD stands for Live Hardware Development. By live, we mean that small changes in the design should have the synthesis and simulation results in a few seconds.

As the goal of "seconds," we do not need to perform too fine grain incremental work. Notice that this is a different goal from having an typical incremental synthesis, where many edges are added and removed in the order of thousands of nodes/edges.

LiveHD is optimized for synthesis and simulation. The main components of LiveHD includes LGraph, LNAST, integrated 3rd-party tools, code generation, and "live" techniques. The core of LiveHD is a graph structure called LGraph (Live Graph). LGraph is built for fast synthesis and simulation, and interfaces other tools like Yosys, ABC, OpenTimer, and Mockturtle. LNAST stands for language neutral AST, which is a high-level IR on both front/back-end of LGraph. LNAST helps to bridge different HDLs and HLS into LiveHD and is useful for HDLs/C++ code generation.

LiveHD overall flow

Contribute to LiveHD

Contributors are welcome to the LiveHD project. This project is led by the MASC group from UCSC.

There is a list of available projects.md to further improve LiveHD. If you want to contribute or seek for MS/undergraduate thesis projects, please contact [email protected] to query about them.

You can also donate to the LiveHD project. The funds will be used to provide food for meetings, equipment, and support to students/faculty at UCSC working on this project.

The instructions for installation and internal LiveHD passes can be found at Documentation

If you are not one of the code owners, you need to create a pull request as indicated in CONTRIBUTING.md.

Publications

For more detailed information and paper reference, please refer to the following publications. If you are doing research or projects corresponding to LiveHD, please send us a notification, we are glad to add your paper.

  1. A Multi-threaded Fast Hardware Compiler for HDLs, Sheng-Hong Wang, Hunter Coffman, Kenneth Mayer, Sakshi Garg, and Jose Renau. International Conference on Compiler Construction (CC), February 2023.

  2. LiveHD: A Productive Live Hardware Development Flow, Sheng-Hong Wang, Rafael T. Possignolo, Haven Skinner, and Jose Renau, IEEE Micro Special Issue on Agile and Open-Source Hardware, July/August 2020.

  3. LiveSim: A Fast Hot Reload Simulator for HDLs, Haven Skinner, Rafael T. Possignolo, Sheng-Hong Wang, and Jose Renau, International Symposium on Performance Analysis of Systems and Software (ISPASS), April 2020. (Best Paper Nomination)

  4. SMatch: Structural Matching for Fast Resynthesis in FPGAs, Rafael T. Possignolo and Jose Renau, Design Automation Conference (DAC), June 2019.

  5. LiveSynth: Towards an Interactive Synthesis Flow, Rafael T. Possignolo, and Jose Renau, Design Automation Conference (DAC), June 2017.

LGraph

  1. LGraph: A Unified Data Model and API for Productive Open-Source Hardware Design, Sheng-Hong Wang, Rafael T. Possignolo, Qian Chen, Rohan Ganpati, and Jose Renau, Second Workshop on Open-Source EDA Technology (WOSET), November 2019.

  2. LGraph: A multi-language open-source database for VLSI, Rafael T. Possignolo, Sheng-Hong Wang, Haven Skinner, and Jose Renau. First Workshop on Open-Source EDA Technology (WOSET), November 2018. (Best Tool Nomination)

LNAST

  1. LNAST: A Language Neutral Intermediate Representation for Hardware Description Languages, Sheng-Hong Wang, Akash Sridhar, and Jose Renau, Second Workshop on Open-Source EDA Technology (WOSET), 2019.

livehd's People

Contributors

alidezhihui avatar arikyueh avatar bhawandeepsingh avatar birdeclipse avatar bokket avatar clrighthand0 avatar crhilber avatar hcoffman avatar jesec avatar joshuapena avatar jsg831 avatar kabylkas avatar markzakharov avatar maximiliantiao avatar mgkapp avatar olyad avatar qchen63 avatar rabieifk avatar rafaeltp avatar renaidisco avatar renau avatar renovate[bot] avatar rohan-ganpati avatar sakshi15108 avatar shahzaibk23 avatar sloanyliu avatar swang203 avatar tnetuser avatar wait-how avatar zacharypotter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

livehd's Issues

Forward/backward traversal with subgraph visit

Current forward/backward does not visit subgraphs. It can be done manually opennning
the subgraph, but not neat.

The idea is to have the same forward/backward/fast iterators but with a non default option of also traversing subgraphs.

(Add a loop detector and raise exception of needed)

Get rid of duplicate pass directories

The current pass directory structure has:

cse/
dce/
droute/
fluid/
gvn_pre/
lgopt/
lgopt_dce/
lgopt_fluid/
lgopt_gvn_pre/
vectorize/ 

The lgopt_* only have binaries for the respective passes (lgopt_dce and dce for instance).
We should get rid of the lgopt_ directories, either through the python interface or by using the shared lgopt/ binary.

However, there are test inputs in some of those directories that need to be preserved.
The regression tests also need to be updated to take the new location of the test inputs into account.

Graph_Node copy constructor

It is a problem to copy Graph_Nodes by mistake (edges) get out of graph, and stops working properly.

Difficult bugs to catch.

The solution is to avoid a public constructor for Graph_Node and lgedges

New flatten command

graph->flatten(std::vector subs);

This flatten command would flatten to the main graph calling the subgraphs included in list. If list if empty, it flattens (recursively) everything.

Python Binary Wheel

Since we need a binary for our python, we need to create what is called a bdist_wheel in pip

https://packaging.python.org/tutorials/distributing-packages/

The issue is that to create a bdist, we need to use an old linux (centos) which in python world, is called manylinux1

https://www.python.org/dev/peps/pep-0513/

To do so, we should create a centos docker image (see previous link for prebuild image), and compile
the python package (lgraph) inside.

Let's create this as a first step with a simple "hello" in C++ class using the lgraph pip package.

The login is renau
The pip password for lgraph is XXX (send me an email to ask)

Created the docs/Python.md to document how to build python, upload, and use

Reverse edge

We use to have a reverse edge method when the graph was unidirectional. The code is all over. We should remove it and make sure that the removed places work fine.

edgeiter redundant code

Hi Rafael,

I saw this, but I did not want to fix because you are working on it. The idea is to avoid code replication:

Found 6 duplicate lines with fingerprint b53414fc0bea3244708a22d18c9af296 in the following files:
Between lines 256 and 264 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Between lines 152 and 160 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Found 6 duplicate lines with fingerprint 82e00c78ebbd6bb2f90f7fcdca435c5e in the following files:
Between lines 886 and 891 in /mada/users/renau/projs/lgraph/core/lgraphbase.cpp
Between lines 849 and 854 in /mada/users/renau/projs/lgraph/core/lgraphbase.cpp
Found 9 duplicate lines with fingerprint 01907d7871adaef31d4f05c1fb573cf1 in the following files:
Between lines 191 and 203 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Between lines 298 and 310 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp

abc test runtime optimization

The tests for abc runtime are pretty high.
I assume it is the checking, since all other tasks should be pretty fast.

Check if there are options to try to speed up the check.
If we are able to move to yosys for the testing (which include generating verilog) the tests should be faster (they should be roughly the same as for the yosys inou tests).

Python interface preparation for inou

The current inou class has "generate" and parses the parameters.

Change to the interface to prepare for python integration. Remove the generate, and replace with an interface similar to the python

lgraph.inou.path = "./lgdb" # lgraph.inou.set_path(const std::string &path)

lgraph.open("xx", [options]) # Raw graph in lgdb path

lgraph.rand.read("graph_name", [some options])
lgraph.rand.xxx = xxx # sets one of the options. in C++ set_xxx(xxx)

lgraph.json.read("file", ["graph_name"])
lgraph.json.write("file", [some options])
lgraph.json.xxx = xx # sets one option like (compressed json or not)

lgraph.pyrope.read() # Not suported in pyrope
lgraph.pyrope.write("file.prp")
lgraph.pyrope.xxx = xx # options like indentation...

The arguments would be processed in the lg*.cpp main file.

Reuse node ids after deletion

After nodes are deleted, we want to reuse the space opened for new nodes.

  • Keep a list of free nodes using the alignment node space
  • Whenever a node is deleted, add the ID in the free node list right before the ID page
  • Keep a pointer to the first alignment node with free space in NID 0 to prevent having to search
  • When a node is added, check if there are free nodes before allocating extra space

Not all the fields for all the graphs

CFG just needs type, srcloc

Synth only, does not need place,route....

At graph open, we should populate only if fields are needed. Assertion checking otherwise.

The graph storage should remember fields are load-time. If we force a new field, we may want to use the default contructor. Eg: if we get a synth graph, and add place, we just put 0 for all the placement fields.

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.