A method of designing hardware includes entering source code into a source code file. The source code uses a context-free grammar that describes a job the hardware being designed has to do rather than describing an implementation of the hardware. The method also includes compiling the source code file to generate an output file which describes an optimized state machine for implementing the hardware. The output file is written in a C-based code which is then translated to a HDL (e.g., VHDL or Verilog).
展开▼