layered-firrtl


License

License

GroupId

GroupId

org.easysoc
ArtifactId

ArtifactId

layered-firrtl
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

layered-firrtl
layered-firrtl
Project URL

Project URL

https://www.easysoc.org/
Project Organization

Project Organization

EasySoC
Source Code Management

Source Code Management

https://github.com/easysoc/layered-firrtl

Download layered-firrtl

How to add to project

<!-- https://jarcasting.com/artifacts/org.easysoc/layered-firrtl/ -->
<dependency>
    <groupId>org.easysoc</groupId>
    <artifactId>layered-firrtl</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.easysoc/layered-firrtl/
implementation 'org.easysoc:layered-firrtl:1.0.0'
// https://jarcasting.com/artifacts/org.easysoc/layered-firrtl/
implementation ("org.easysoc:layered-firrtl:1.0.0")
'org.easysoc:layered-firrtl:jar:1.0.0'
<dependency org="org.easysoc" name="layered-firrtl" rev="1.0.0">
  <artifact name="layered-firrtl" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.easysoc', module='layered-firrtl', version='1.0.0')
)
libraryDependencies += "org.easysoc" % "layered-firrtl" % "1.0.0"
[org.easysoc/layered-firrtl "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.13
edu.berkeley.cs : chisel3_2.12 jar [3.4,3.5)

Project Modules

There are no modules declared in this project.

Chisel / Firrtl to ELK Graph

This project can generate ELK Graph files, which can be layout by ELK and rendered by icviewer as an interactive diagram to represent Chisel generated Firrtl circuits.

If you want to see the ELK Graph directly, you can use this online service, it's open source https://github.com/kieler/elk-live . But there may be some bugs, which are not suitable for circuit diagrams.

It is highly recommended to using the IntelliJ plugin to view your circuit. It supports interactive viewing of the sub-modules by double-click. In addition, it supports back navigation, zoom view, export SVG format and other functions.

The main idea is that the layout of graph use a layer-based algorithm provided by the Eclipse Layout Kernel, and the graph rendering is implemented by Sprotty diagramming framework. The combination of the two gives us a very intuitive circuit schematics.

The logic of circuit format conversion comes from diagrammer project and adapted to elk data generation with some optimizations.

Example

Purple Theme View this example interactively Graph Solid Theme(--flatten 2)

Graph

Using

Install

Maven

https://search.maven.org/artifact/org.easysoc/layered-firrtl_2.12

for SBT

// "org.easysoc" %% "layered-firrtl" % "1.1-SNAPSHOT"
"org.easysoc" %% "layered-firrtl" % "1.1.+"

Source

git clone https://github.com/easysoc/layered-firrtl
cd layered-firrtl

Creating graph from Chisel code

  val targetDir = "test_run_dir/gcd"
  (new ElkStage).execute(
    Array("-td", targetDir),
    Seq(ChiselGeneratorAnnotation(() => new GCD))
  )

Creating graph from Firrtl file

To create a set of graphs of a Firrtl Circuit all you need is this project and a Firrtl file (typically a file generated by Chisel with a .fir extension). Let's say you have a Firrtl file ~/projects/output/circuit.fir. From the command line you while in this directory for this project

./elk.sh -i ~/projects/output/circuit.fir

or run through fat jar

sbt assembly
./utils/bin/elk -i ~/projects/output/circuit.fir

This will create a number of files in the test_run_dir/${circuit.main} directory that representing the firrtl circuit. Each file will be a ELK Graph for each module contained in the firrtl file.

Options

  • -i, set the source firrtl to work on
  • -td,--target-dir work directory (default: "./test_run_dir")
  • --top the module in the hierarchy to start, default is the circuit top
  • --flatten the maxDepth of the flatten levels
    • It is not recommended to exceed 2, otherwise the generated graph is too complicated
  • --lowFir generate the corresponding lo.fir file
org.easysoc

EasySoC

Bringing Agile Hardware Development to the Masses.

Versions

Version
1.0.0