On 17/05/2013 09:34, Lawrence Walker wrote:> The Verilog "programming"
If you want to process a language that is not Mathematica friendly, it
is probably best to store the text in a file, and read it in through a
simple parser written in Mathematica.
Alternatively, you could write a simple translator to take Verilog into
something more Mathematica friendly - perhaps 3'b101' could become "101"
or "b101" if there were no ambiguity with strings of other information.
You could pad with leading zeros if necessary to specify the bit length
- e.g. 5'b101 would be "b00101" .
My gut feeling is that fooling about with $Pre and $PreRead, etc. is a
recipe for wasting time handling too many gotcha's!
David Bailey
http://www.dbaileyconsultancy.co.uk