LLHD: A multi-level intermediate representation for hardware description languages