You can define a resolution function for each net in a design on a per scope basis by using the Verilog-AMS discipline mechanism. You can also designate a global resolution function that can be used for undisciplined nets and for the nets with disciplines that do not define a wreal resolution function.
You can define resolution function in the following ways:
- Defining a wreal Resolution Function for a Discipline. You can define
wrealresolution functions for a discipline in the following two methods:-
Defining a Resolution Function Directly in the Discipline Definition. To define a
wrealresolution function for a discipline, use therealresolveparameter in the discipline definition. The syntax of this parameter is as follows:realresolve resolveFunctionwhere the
resolveFunctionbe any of the predefined wreal resolution functions such asdefault,fourstate,sum,avg,min,max,none. See Predefined wreal Resolution Functions.Note that wreal resolution function names are case-sensitive. Therefore, if you specify the
sumresolution function name asSumorSUM, it will result in an error.If you specify the value of
resolveFunctionasnone, it is equivalent to not using therealresolveparameter at all. Nets of such disciplines use the global resolution function. An error occurs if an invalid value is specified for theresolveFunctionvariable.The following example defines a discrete discipline named
wrealavgthat uses theavgresolution function for wreal nets.discipline wrealavg domain discrete; realresolve avg; enddisicipline
-
Defining a Resolution Function with the AMSCB connectmap Card. You can use the
realresolveparameter with theconnectmapcard to define a resolution function for one or more disciplines. See connectmap.
-
- Defining a Global wreal Resolution Function. You define a global
wrealresolution function in the following two methods:-
Defining Global wreal Resolution Function Using -wreal_resolution. You can use the
-wreal_resolutioncommand-line option withxmelaborxrunto specify how you want the elaborator to resolve nets that have more than one driver. The format of this command-line option is as follows:-wreal_resolution resolutionFunctionwhere
resolutionFunctioncan be any of the predefined wreal resolution functions such asdefault,fourstate,sum,avg,min,max,none. See Predefined wreal Resolution Functions.If you do not specify a resolution function using this command-line option, the elaborator uses the
defaultresolution function algorithm.For those cases where the elaborator issues a run-time warning message, you can cause the message to be fatal using the-xmfatalcommand-line option. For more information about this option, see-xmfatal.The
noneresolution function is not a valid option to-wreal_resolution. It is only a valid value to therealresolutionparameter of the discipline. An error will be issued ifnoneis passed as an argument to-wreal_resolution. -
Defining Global wreal Resolution Function Using the AMSCB connectmap Card. For a
connectmapcard, if thedisciplineparameter is absent, the resolution function specified by therealresolveparameter applies globally to all disciplines that are not covered by otherconnectmapcards.Consider the following example:
amsd{connectmap realresolve=maxconnectmap discipline="disc1 disc2" realresolve=minconnectmap discipline="disc3 disc4" realresolve=sum}In the above example:
- The
disc1anddisc2disciplines will have the resolution functionmin. -
The
disc3anddisc4disciplines will have the resolution functionsum. - Any other discipline will have the resolution function
max.
- The
-
- The resolution function defined through the
-wreal_resolutioncommand-line option has precedence over the one defined through the AMSCBconnectmapcard. So, if both methods are used and they specify different resolution functions, the globalwrealresolution function takes its value from the command-line option and a warning is printed on the screen. - If no global
wrealresolution function is specified using these two methods, it is set to thedefault wrealresolution function.
Order of Precedence for Determining the Resolution Function on a Net
If a discipline has a resolution function defined in the discipline definition and also has a resolution function defined in the AMS Control Block using the connectmap card, the connectmap card resolution function will take precedence and will be used as the resolution function for all nets of that discipline. This allows you to override the resolution function without changing the discipline definition.
Following is the order of precedence for determining the resolution function on a net:
- Explicitly declared resolution on a net it is connected to (typed wreal or SV-RNM nettype)
- Resolution function explicitly defined in the AMS Control Block using the
connectmapcard - Resolution function explicitly defined in the nets discipline definition
- Resolution function of the discipline of the net to which a given net is connected
- Global resolution function specified with the
-wreal_resolutioncommand-line option - Global resolution function specified with the
connectmapcard (without thedisciplineparameter) - The
defaultglobal resolution function
Rules to Determine the Resolved Resolution Function for Connected wreal Nets
During elaboration, the connected wreal nets are collapsed into a single simulated wreal net with a single resolution function. The resolved value of this simulated wreal net is determined by considering all its drivers and processing their values through the resolved resolution function.
The set of rules listed below are followed to determine the resolved resolution function.
-
If all connected
wrealnets have the same resolution function, the resolved resolution function is that resolution function.The connected
wrealnets need not have the same discipline as long as the resolution function of each net is the same. - If two or more
wrealnets are connected together and they do not have the samewrealresolution function, an error occurs. - If a
wrealnet does not belong to any discipline or its discipline does not have a specified resolution function, the resolution function of thewrealnet is the global resolution function. When awrealnet with the global resolution function is connected to otherwrealnets, its resolution function is ignored for the purpose of determining the resolved resolution function for the connection.
- If none of the
wrealnets in a connection has a specified resolution function, the resolved resolution function for the connection will be the global resolution function.
The table below summarizes how the resolved resolution function is determined from the resolution functions of the three wreal nets: w1, w2, and w3.
|
w1 |
w2 |
w3 |
Resolved |
|---|---|---|---|
|
|
|
|
|
|
|
UNSPECIFIED |
UNSPECIFIED |
|
|
|
UNSPECIFIED |
|
ERROR |
|
UNSPECIFIED |
UNSPECIFIED |
UNSPECIFIED |
GLOBAL |
