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/hdlI 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