What is it?
RHDL (Ruby Hardware Description Language) is a DSL for describing and
simulating digital circuits. It looks very similar to VHDL.
Where does it live?
“Why should I be interested?”, you ask.
If you’re a hardware type you probably already know why, but let’s
you’re a Ruby programmer who is not also a hardware designer type
person… You might be interested in RHDL because it’s a DSL and maybe
it’s a reasonable example of a DSL built on Ruby (or maybe you’ll think
it’s really a very scary example of how to do a DSL in Ruby once you
looking at the code…). Another reason you might be interested: RHDL
really all about dataflow programming and dataflow programming could be
pretty useful in the future for dealing with parallelism in
systems… or maybe you want to learn about Event Driven Simulation
RHDL now has at least 50% more Ruby metaprogramming goodness! The DSL
been changed to remove some of the Ruby-isms that were in RHDL’s
incarnations (class, super - these are now gone replaced with the model
declaration). Examples have been updated to reflect the new ‘syntax’
many unit tests have been added (more still needed).
- <= has replaced << for signal assignment ( <= has lower operator
precedence which is a good thing)
- lte (less than or equal) method has been introduced now that <= has
taken for assignment (I really wish we had a definable := operator which
very low operator precedence for assignment semantics, hint, hint… but
digress) (gte - greater than or equal - method has also been introduced
for signals for orthogonality with lte)
- models instead of classes - see docs. Big change to the RHDL syntax.
Hopefully it makes things less confusing for non-Ruby programmers who
to use RHDL.
- named argument associations in model constructors (again, see docs and
examples) [oh, and model constructors themselves are created for you now
(more of that metaprogramming goodness!) so you don’t have to define an
- inputs, outputs, generics (see docs)
- lots of unit tests added (but more are stil needed)
- bug fixes
- lots of other stuff I’m forgetting about…
In future releases RHDL will (hopefully) interoperate with BLIF
Logic Interchange Format) and also be translatable to VHDL… but don’t
hold your breath - note that it’s been something like 3
years since the last release of RHDL.
How much would you pay for all of this?
Send cash, checks, MacBook pros to me at… oh, wait, actually it’s free
and under the same license as Ruby. Damn - I really was looking forward
that MacBook Pro.