Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm hoping to try MyHDL someday. If it's good, great, otherwise probably I'll try to develop my own metaprogramming (likely based on R7RS scheme) system on top of VHDL.


When it comes to Python 'frontends'/'preprocessors'/'high-level-synthesis tools' I prefer Migen over MyHDL, mostly because of the vastly different abstraction level.

MyHDL parses a normal Python AST and translates it to Verilog statements. In the end, you seem to end up with the exactly same abstraction layer as Verilog/VHDL, just with a Python syntax. There is a very limited subset of advanced Python composability constructs you can use without hitting a limitation of the AST walker and translator. And when you do hit it, it's fairly annoying to debug. In the end, I don't see it's use over writing straight Verilog/VHDL, apart from it being easier to test.

Migen, on the other hand, is a system where you write native Python code that doesn't pretend to be then running on the FPGA. Instead, your code stitches together an RTL AST, which can then be either simulated or converted to Verilog. Your Python code is effectively a RTL logic generator (AFAIK this is exactly how Chisel/SpinalHDL work, too). You can then compose these low-level constructs into higher layer abstractions- for instance, the stock Migen framework comes with an FSM abstractions, which takes care of all the boilerplate if declaring state machines (state register and values, separate synchronous/combinatorial logic statements, etc.). It also comes with abstractions for Arrays, (B)RAM, FIFOs, priority encoders...

Finally, Migen is the base of the MiSoC project, which abstracts away enough digital logic to let you connect, in Python, high-level constructs like buses, CPUs, DRAM controllers, etc. in order to dynamically construct a system-on-chip.


Thanks. I'll definitely give Migen a try. Looks like right up my creek.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: