[libre-riscv-dev] HDL selection

Jacob Lifshay programmerjake at gmail.com
Wed Nov 21 00:35:08 GMT 2018


On Tue, Nov 20, 2018 at 3:47 PM lkcl <lkcl at libre-riscv.org> wrote:

> On Tue, Nov 20, 2018 at 10:34 PM Jacob Lifshay <programmerjake at gmail.com>
> wrote:
> >
> > On Tue, Nov 20, 2018, 04:28 lkcl <lkcl at libre-riscv.org wrote:
>
> > >  so it's part of the compiler, not an actual variable??  it's like an
> > > __intrinsic__ in gcc or something.
> > >
> > It is an actual Scala variable. You can think of Chisel as a Scala
> library
> > that generates Verilog from the Chisel AST, which is built by compiling
> and
> > running the Chisel code as a Scala executable. This is similar to how
> > SystemC is really just C++ that is using the SystemC libraries.
>
>  so essentially, chisel3 is a hack.  it wasn't thought through:
> someone encountered (or knew about) scala, and went "that'll save some
> time" as opposed to, "if we were to write a logical, obvious, clean
> and useful HDL that was easy to learn, and fixed many of the problems
> of the past and brought HDL up to modern OO software development
> practices and standards, what would we do?"
>
I disagree. Scala is a well known programming language outside of the HDL
field, and, from what I can tell, if you already know Scala, Chisel is
really simple to get started with (assuming you also know how HDLs work).

>
>  by contrast, with migen/litex, we get to use the full power of python
> (which can't be done with myhdl, you have to use a subset of python),
> its OO capabilities, all of the documentation-generating tools
> (epydoc), all of the unit test infrastructure that exists (nose,
> cocotb) all of the tutorials online that will allow us to bring new
> developers up to speed extremely quickly, and its huge popularity and
> readability will make long-term maintenance one hell of a lot easier.
>
>From what I can tell, Chisel is actually very similar in design to Migen in
that both of them are programs that use a HDL library to build an AST for
the HDL at runtime and the only major difference is that Migen is written
in Python and Chisel is written in Scala.

Also, you can use the same OO capabilities and existing infrastructure for
Scala with Chisel. It's just more difficult for someone who doesn't already
know Scala as Scala has quite a few operators set aside for overloading
(like =/= and ===), with no default definition (from what I can tell).
Scala has to also deal with the limitations of compiling to JVM bytecode,
influencing the object model, naming, and other portions.

Note that I am a Scala newbie, so I probably got some things incorrect.

Jacob


More information about the libre-riscv-dev mailing list