Direct instantiation of SPICE blocks within a VHDL scope is supported only using the xrun command flow. The three step method is not supported for VHDL-SPICE flows. Analogous to the Verilog-SPICE solution, AMSCB flow is required to specify SPICE blocks, boundary port maps and binding information. You can use the portmap and config mstatements in an amsd block to specify port bindings at VHDL-SPICE boundaries.
Here are some examples:
amsd{ portmap subckt=dummy_spice autobus=yes refformat=vhdl config cell=dummy_spice use=spice }
and:
amsd{ portmap subckt=dummy_spice2 autobus=yes reffile=ref.vhd refformat=vhdl config cell=dummy_spice2 use=spice }
In the example immediately above, the reffile contains a VHDL module that defines the port bindings to use from a VHDL parent to a SPICE subcircuit or instance. The config statement specifies which SPICE cell (subcircuit) or instance.
You can have user-defined types, subtypes, and records where VHDL connects to SPICE.
Consider the following example of a 16x16-bit multiplier (.SUBCKT mult16x16_spice) with two 16-bit inputs (A<15:0> and B<15:0>), a clock input (CLK), and a 32-bit output (P<31:0>).
|
You can create a VHDL reffile such as the following that defines the directions for the interface elements between SPICE and VHDL:
|
Your VHDL testbench might look like this:
|
In your control file, you include the SPICE file (which contains the mult16x16_spice subcircuit definition) using an include statement, and you specify the port bindings you want the elaborator to use at VHDL-SPICE boundaries using portmap and config statements in an amsd block as follows:
include "mult16.net"amsd{ portmap subckt=mult16x16_spice autobus=yes refformat=vhdl reffile=source/mult16x16_spice.vhd config cell=mult16x16_spice use=spice}
The portmap statement, above, indicates that you want the elaborator to use the port bindings you defined in the VHDL file, mult16x16_spice.vhd , and apply them to the SPICE subcircuit, mult16x16_spice. The config statement indicates that you want the elaborator to use the SPICE definition for the mult16x16_spice cell.
Further, you can specify conversion elements for the VHDL-to-SPICE connections using ce statements:
amsd{ portmap subckt=mult16x16_spice autobus=yes refformat=vhdl reffile=source/mult16x16_spice.vhd config cell=mult16x16_spice use=spice ce name=worklib.std_logic2e dir=input type=std_logic genericmap="vsup 2.5" ce name=worklib.e2std_logic dir=out type=std_logic genericmap="vsup 2.5"}
