Forewords — My journey with the Amaranth HDL

Where I tell what this serie of article is, what it is not, and why I ended up with the Amaranth toolchain.

David Sporn
3 min readAug 27, 2023

I will start with what it is not : a tutorial about how to design logic using the HDL toolchain named Amaranth. There already are a few tutorials about that, and thus I do not feel like writing another one. There will be some explaination of what I do, but the reader is expected to know a little bit about it, or to gloss over the documentation –the previous links– and to try it by oneself.

What it is, then : a loosely organized set of notes that will underline how I did some tasks. I will start with how setting up a project and write automated tests, as I appreciate TDD in my daily life as a software engineer.

Then I may write further about some projects where I am writing actual hardware description.

[This is a part of my series about Amaranth HDL.]

But, why the Amaranth toolchain ?

My previous attempt at hardware description was with VHDL, and I selected this language over Verilog for this very reason : VHDL’s crown jewel.

And I started writing some code. But I did not went far. To create a package is tedious, I was quickly fed up. I was also not happy with using closed source packages. And other projects of mine went on top of my to do list.

On the subject of open source toolchain for VHDL, I was quite angry when I discovered that the OSS CAD Suite was limited to Verilog. VHDL support requires the paid “Tabby CAD Suite”.

Thus, I decided to ditch VHDL as well as Verilog, and looked for alternatives. I even fancied writing my own language, but I quickly ruled out that in favor of existing alternatives. I was aware of a python toolset called “Migen”, a derived framework named “LiteX”, and another one named “MyHDL”. A Scala toolset named “Chisel” was also on my radar, but having a bias against Scala (I admit that I am a Java fanboy), I was not compelled to look at it.

If the OSS CAD Suite was disappointing for VHDL support, it provided “Migen” and “Amaranth” as “python toolbox for building complex digital hardware” –Amaranth being qualified of “refreshed Python toolbox”–.

It also happens that I worked with python on some personnal projects, thus I could leverage that practice with python based toolchains.

Amaranth being a refreshed Migen, I decided to toy with it a little, I got hooked with it, and here we are now.

What is the plan ?

After toying a little to understand how to work, do simulations and unit test, I wanted to develop some ideas into projects.

Being a software developper in my everyday life, I want to use some best practices, essentially the management of dependencies, fundationnal code reuse, and tests. Especially, there are no framework to write tests, thus I was inspired by the framework I usually use, and I ended up implementing a system heavily inspired by how tests are described in javascript projects –javascript developpers have seen the hint pointing to the framework using describe(“my test”, () => {/*test stuff…*/})–.

So we will cover those points in the next installments.

See you soon…

--

--

David Sporn

French software developper. Writing software since 1990 ; writing software for a living since 2000.