- + Issue 17: Filters for foreign languages

[Kevin Cameron, 22 Feb 2001]


Follow-up >

Rationale

Most CAD design systems use legacy design languages (e.g. Spice - which has many variants, Spectre and Mast). Stipulating that Verilog-AMS simulators should read any of these languages directly is an unreasonble onus on simulator developers, even if the DOD requires Spice compatibility. It is also unreasonable (and sometimes impracticable) to have users maintain multiple copies of the same data in different formats.

Proposal

The "external module" proposal should be extended with parameters and/or keywords indicating a source file, the language of the source file and a filter program which will translate the specified source into Verilog-AMS. Filter programs could be supplied by users or by vendors.

Example:

  extern module my_spf;
    parameter source   = "/proj/big_chip/big.spf"; // may be list
    parameter language = "HSpice";
    parameter filter   = "spc2vams"; // may include arguments
  endmodule

If the simulator can read the specified file type directly (and the file exists) it may do so, otherwise a "pipe" is created and the filter called (see Unix "popen") as:
      <filter> -module=<module name> -language=<language>\
               -simulator=<caller name> -version=<caller version>\
               <source> 

  e.g.:

      spc2vams -module=my_spf -language=HSpice\
               -simulator=vams -version=0.99.1\
               /proj/big_chip/big.spf

The output of the filter should be read in the same manner as a `include'd file.

Since the filter program may need extra information, it's standard input stream should be the (post-processed) text from extern to endmodule so that it can read any parameters and attributes associated with the definition.

If the filter returns a non-zero status the simulator should abort.

Notes:

  • The source specification does not have to be a file, it can be a database reference (e.g. milkyway) or some other logical name that the filter understands (e.g. WWW URL's and encrypted files).
  • If we want to do this as part of pre-processing we should probably use `extern rather than extern, and maybe add `endextern