HDL Cosimulation Components and Their Parameters

HDL cosimulation components are available in the HDL Blocks palette or library ( Insert > Component > Component Library > HDL Blocks ). The ModelSim cosimulation component is HdlCosim; the VerilogXL cosimulation component is VxlCosim; and, the NC-SIM cosimulation component is NCCosim.

Some HDL simulators require compiled HDL code before simulation. If the user code has not been compiled, HDL cosimulation can compile the user code before cosimulation or use existing compiled HDL code depending on the HdlSrcFile and HdlLibrary settings. The process is further simplified for ADS-generated Verilog code.

Note
NC-SIM cosimulation uses ncverilog for compilation and simulation. For VHDL cosimulation, the VHDL code will automatically be wrapped with a Verilog module. Refer to the NC-SIM manual for information on using ncverilog to simulate VHDL code made part of Verilog code.

Also refer to example design iir_lp_ncvhdl.dsn; access this design from the ADS Main window > File > Example Project > SDFHdlCosim > iir_filter_prj.

The components have one multi-input and one multi-output fixed-data type ports. They also have single bit input pins Clock and Set. The Clock and Set inputs are processed only if they are part of the Inputs_parameter_specification;_otherwise_they_are_ignored._If_they_are_part_of_the_Inputs_parameter,_the_behavior_is_the_same_as_explained_previously_in_the_section_Automatic Clock and Set Signals.

Note
Clock and Set must not be part of the inputs that are being connected to the multi-input port.

HDL cosimulation models have parameters that enable you to control cosimulation with the HDL simulator. The following sections describe the parameters that require user input.

HdlSrcFile

HdlSrcFile can be specified as follows:

Inputs

The Inputs parameter lists the names of the input ports of the HDL model. All the HDL input port names that need to be updated from ADS must be specified.

This list is used to make the input connections between the ADS ports and the HDL ports. The BusMerge component must be used on the input port when there is more than one input to be connected. The first (last) input port in the list is connected to the bottom (top) most input port on the BusMerge, and so on. The BusMerge must have a number of input ports equal to the number of strings specified in the Inputs string array, except if the model has pins named Clock and Set. The BusMerge component must not have pins corresponding to Clock and Set, instead they must be connected to the Clock and Set ports of the ADS HdlCosim component. To use automatic Clock and Set signals, leave the Clock and Set ports unconnected or hanging.

InputPhases

The InputPhases parameter delays the application of the input to the HDL model. It is an array of integers. The time unit is the same as specified by the TimeUnit parameter, described later. The InputPhases parameter specifies the delay for the application inputs during an iteration, as explained in the section Automatic Clock and Set Signals The delay specified for the Clock signal is ignored if the Clock signal is not connected and an automatic clock is being used.

If Clock and Set are unconnected and the InputPhases parameter is not specified, the inputs are automatically delayed for 3/4 times the IterationTime specified during each cycle for the reasons mentioned in earlier section Automatic Clock and Set Signals If any phase delay values are specified by the user, those values will be used.

In the case of the ADS HdlCosim component, the order of the delay specification must be the same as the order of the input names specified in the Inputs parameter.

InputPrecisions

The InputPrecisions parameter specifies the precision and arithmetic type to be used for a particular input.

The order of the precision specification must be the same as the order of the input names specified in the Inputs parameter.

Precision and arithmetic type specification was explained earlier in the section Precision for Bit-Vector Type Ports

Outputs

The Outputs parameter lists the names of the output ports of the HDL model. All HDL output port names that need to be read into ADS must be specified.

This list is used when making the output connections between the ADS Ptolemy ports and the HDL ports. The BusSplit component is used on the output port. The first (last) output port in the list is connected to the bottom (top) most output port on the BusSplit, and so on. The BusSplit component must have a number of output ports equal to the number of strings specified in the Outputs string array.

Note
In the case of an inout VHDL port, specify the port name in the Inputs as well as the Outputs parameter.

OutputPrecisions

The OutputPrecisions parameter specifies the precision and arithmetic type to be used for a particular output.

The order of the precision specification must be the same as the order of the output names specified in the Outputs parameter, see Outputs.

Precision and arithmetic type specification was explained earlier in the section Precision for Bit-Vector Type Ports.

HdlModelName

HdlModelName is the name of the HDL entity or module to cosimulate with.

For a Verilog module, specify the module name to cosimulate with. For a VHDL entity you can specify this parameter in the following ways:

See example design iir_lp_confvhdl.dsn (ADS Main window > File > Example Project > SDFHdlCosim > iir_filter_prj).

HdlLibrary

The HdlLibrary parameter does not exist for VerilogXL cosimulation (VxlCosim) and NC-SIM cosimulation (NCCosim).

In the case of ModelSim cosimulation (HdlCosim), this parameter specifies the library from which the compiled HDL module or entity must be loaded. This parameter can control the compilation as follows:

HdlSimulatorGUI

The HdlSimulatorGUI parameter determines the user interface mode of the HDL simulator. If the HdlSimulatorGUI is On, the HDL simulator is started with its graphical user interface on. You can view the progress of the simulation, graph signals, and edit values while the simulation is running.

The ModelSim command Restart is not supported during cosimulation. To restart HDL cosimulation, quit and restart the ADS simulation.

Note
If the HdlSimulatorGUI is On and IterationTime is negative, use run -all in ModelSim to perform cosimulation. The other run commands will only increment the HDL simulation time and will not cosimulate.

If the HdlSimulatorGUI is Off, the simulator is run in the background. ADS will start the HDL simulator, run the simulation, and close the simulator at the end of simulation without user interaction.

CmdArgs

The CmdArgs parameter specifies special simulator command invocation arguments required for simulation of the HDL model.

IterationTime

IterationTime is the time that the HDL simulation is run during each firing of the HDL cosimulation component. If the integer value provided is positive, the HDL simulator will simulate for the specified number of time units (where the time units are specified by the parameter TimeUnit) then send data to ADS. This does not check to see if there are any events still to be processed in the simulator. This feature is useful if you are running a model whose output data is to be sampled periodically at a predetermined time.

Note
The value can never be specified as 0 because the simulation will stop with a range error flagged.

Negative iteration time is valid only for ModelSim VHDL cosimulation. If the value is negative, the HDL simulator is run until all the events are processed. The magnitude of the value specifies the minimum amount of time to run before checking to see if there are any events still to be processed. The output data is read after the event queue becomes empty. This facility can slow down the simulation due to the overhead of monitoring the simulation event queue. The lower the magnitude, the slower the execution because the event queue must be polled more often. This facility is useful when the time the model takes to provide stable/correct data output varies. This will not work for certain models that never run out of events, such as those with internal clock signals.

When a negative iteration time is specified for a Verilog module to be cosimulated using ModelSim, a VHDL wrapper is used to instantiate the Verilog module.

Note
Negative iteration time will not work with Cadence NCsim or VerilogXL cosimulation.

TimeUnit

The TimeUnit parameter specifies the HDL simulation time resolution unit: fs, ps, ns, us, ms or sec.

For VHDL simulation using ModelSim, TimeUnit will control the VHDL simulation time resolution.

For Verilog simulation with any supported HDL simulator, TimeUnit will add timescale directives to the top-level cosimulation wrapper. Users can have timescale directives for different modules in their code. If any user module does not have a timescale specified, TimeUnit will be used to generate a default timescale. The smallest of the different timescale specifications will control the Verilog simulation time resolution.

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources