Introduction
Warning
This document explains the future Pyrope, some features are still not implemented. They are documented to guide the designers.
Pyrope is a modern hardware description language, with these focus points:
- Fast parallel and incremental elaboration.
- Help hardware verification:
- Powerful synthesizable type system
- Hot-Reload support, powerful assertions
- Allows Pyrope 2 Verilog, edit Verilog, Verilog 2 Pyrope, edit Pyrope...
- Static checks as long as they not produce false positives
- Modern and concise language
- Avoiding hardware specific artifacts
- Synthesis and simulation must be equal and deterministic
- Zero cost abstraction
Hello World
Create a directory for the project:
$ mkdir hello
$ cd hello
$ mkdir src
Populate the Pyrope code
src/hello.prp
test "quite empty" {
puts "hello world"
}
Run
$prp test
All the pyrope files reside in src
directory. The prp
builder calls LiveHD to
elaborate the pyrope files and run all the tests.
Trivial GCD
Populate the Pyrope code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
Run
$prp test gcd
The gcd.prp
includes the top level module (gcd
) and the unit test. To understand the differences
with alternative HDLs, the same GCD with CHISEL:
Some of the visible differences:
- Pyrope has global type inference. The gcd.prp file doe not specify any size. The size is inferred from instantiation, in this case the test.
- Pyrope has special variable markers: $ is for inputs, % for outputs, and # for registers.
- CHISEL is a DSL. E.g: the
=
are SCALA, the===
is generated HDL. The GCDCalculator is a SCALA program, and the GCD is a generated CHISEL module.
Some not so visible differences:
Pyrope is not a DSL. There are several DSL Hardware Description Languages (HDL) like CHISEL, pyMTL, pyRTL, CλaSH. In all the DSL cases, there is a host language (SCALA, or Python, or Haskell) that must be executed. The result of the execution is the hardware description which can be Verilog or some internal IR like FIRRTL in CHISEL. The advantage of the DSL is that it can leverage the existing language to have a nice hardware generator. The disadvantage is that there are 2 languages at once, the DSL and the host language, and that it is difficult to do incremental because the generated executable from host language must be executed to generate the design.