I wrote my own HDL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

I wrote my own HDL

tuzz
I had a go at writing my own hardware description language (parser and emulator).

It's minimalist and probably slow, but it works! You can check it out here: https://github.com/tuzz/hdl

I wrote it in Ruby and used a gem called 'Treetop' to define my grammar. I then build structured data and do lots of validation and circular dependency checking to make sure the input is valid. The emulation code was a bit tricky, and recursive in places.

I left out support for buses, although I'm regretting that decision now as I'd like to build some larger chips (hundreds of pins).

My plan is to eventually use it to generate conjunctive normal form expressions for gate logic. That way, I could attempt to represent some problem as circuitry, reduce it to CNF and have one of the many SAT solvers do their work on it!

What do you think? Any ideas? Your feedback would be awesome.

~ Chris
Reply | Threaded
Open this post in threaded view
|

Re: I wrote my own HDL

cadet1620
Administrator
Nicely done!

About the only thing I remember about SAT is that it was one of the earliest proven NP-complete problems...

--Mark