A Hardware Description Language is used to… describe hardware!
So instead of drawing out an inverter using a tool like Magic we can write a line like this:
output = !input;
Which describes what an inverter does. The ! means invert.
Common HDLs are Verilog and VHDL. There are also higher level languages like nMigen, Migen, chisel, spinal. These are often implemented
as a library to a programming language like Python. Then you can express more complex hardware in fewer lines.
Verilog is the most common HDL and the one most well supported by the Open Source tools. It’s well known for the number of ‘foot guns’ it has!
Be careful, describing hardware with an HDL is nothing like programming a CPU with a sequential language like C or Python.
Circuits operate all at once, parallelism is easy. If you want sequences of things you have to build a sequencer first (like a state machine).
A CPU executes one instruction at a time and if you want parallelism you either ‘fake’ it by interleaving programs or you have multiple cores on your CPU.
A good short course (targetted at FPGAs) introducing Verilog is WTFPGA
After writing your design in an HDL, you have to synthesise into a netlist so it can be recreated in the
actual building blocks you have in the PDK
The part I enjoyed the most was going back to the Verilog and seeing test benches pass. In particular the waveform viewer. At the latter parts of course you're simulating the entire Caravel system on chip with a RISCV core. Being able to drill down into everything inside that core, I can log the program counter, I can log all the address and data buses and you can just see in exquisite detail what the system is doing, and it's doing that because I programmed it. Being able to drill down into that detail was really fascinating.