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
- Modern and concise language
- Avoiding hardware specific artifacts
- Allows optional hierarchical calls
- Supports instantiation optimization with typical software syntax
- Supports pipelining constructs
- No mismatch simulation vs synthesis
- Single reset mechanism
- Avoid non-blocking assignments
- Checks on invalid code
- Random on multi value logic when doing control flow
- Zero cost abstraction
- Help hardware verification:
- Powerful 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
Hello world¶
Create a directory for the project:
$ mkdir hello
$ cd hello
$ mkdir src
Populate the Pyrope code
src/hello.prp
test "my first test" {
puts "hello world"
}
Run
$prp test
All the pyrope files reside in the src
directory. The prp
builder calls LiveHD to
elaborate the pyrope files and run all the tests.
Trivial GCD¶
Populate the Pyrope code
src/gcd.prp:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
src/my_cpp_gcd.cpp
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
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 |
|
Run
$prp test check.gcd
The gcd.prp
includes the top-level module (gcd
) and the unit test.
-
Some Pyrope features not common in other HDLs (CHISEL):
-
Pyrope is not a DSL. Most modern HDLs like CHISEL, pyMTL, pyRTL, CλaSH are DSL cases. In these 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 the host language must be executed to generate the design.
-
Global type inference. In the gcd example, the input/outputs are inferred.
-
Synthesizable object system with runtime polymorphism
-
Immutable objects
-
Language support for several hardware constructs
-
-
Some Pyrope features not common in other languages
-
No object references, only pass by value
-
Pipelining support
-