Product Documentation
Real Number Modeling Guide
Product Version 22.09, September 2022

Multiple Driven Wreals

While the resulting values of multiply driven 4-state logic nets are relatively obvious, it is not obvious what the result value on a wreal net should be if one driver provides 2.7 and another -4.87 at the same time. You can use the six built-in resolution functions that Cadence delivers, to instruct the elaborator how to resolve wreal nets that have more than one driver. The built-in resolution function can be specified using the -wreal_resolution command-line option with xmelab or xrun.

Syntax

The syntax is:

-wreal_resolution resolutionFunction

where, resolutionFunction can be any one of the following six resolution functions are:

The following shows the results of a wreal, which is being driven by two drivers using different resolution functions:

D1

D2

Default

4state

sum

avg

min

max

x

x

x

x

x

x

x

x

x

z

x

x

x

x

x

x

x

1.1

x

x

x

x

x

x

z

z

z

z

z

z

z

z

z

1.1

1.1

1.1

1.1

1.1

1.1

1.1

2.2

1.1

x

x

3.3

1.65

1.1

2.2

1.1

1.1

x

1.1

2.2

1.1

1.1

1.1

Example

The following example illustrates the use of multiple drivers on a wreal net. The top-level wire real_wire is driven by the two blocks source1 and source2. A third module is reading and displaying the result value of the net.

`include "disciplines.vams"
module top();
  wreal real_wire;
  source1 I1 (real_wire);
  source2 I2 (real_wire);
  sink I3 (real_wire);
endmodule

module source1(r);

  output r;
  wreal r;
  real realnumber;
  initial begin
    #1 realnumber = `wrealXState;
    #1 realnumber = `wrealXState;
    #1 realnumber = `wrealXState;
    #1 realnumber = `wrealZState;
    #1 realnumber = `wrealZState;
    #1 realnumber = 2.2;
    #1 realnumber = 1.1;
    #1 $stop;
  end
  assign r = realnumber;
endmodule // send

module source2(r);
  output r;
  wreal r;
  real realnumber;
  initial begin
    #1 realnumber = `wrealXState;
    #1 realnumber = `wrealZState;
    #1 realnumber = 1.1;
    #1 realnumber = `wrealZState;
    #1 realnumber = 1.1;
    #1 realnumber = 1.1;
    #1 realnumber = 1.1;
    #1 $stop;
  end
  assign r = realnumber;
endmodule // send

module sink(r);
  input r;
  wreal r;
  always @(r) begin
    $display(" real value = %f", r);
  end
endmodule

The output of the simulation depends on the –wreal_resolution argument to xrun. For example, if the following statement is used for simulation:

xrun multi_driver.vams -exit -wreal_resolution sum

The resulting output is displayed as shown below:

real value = `wrealXState
real value = `wrealXState
real value = `wrealXState
real value = `wrealZState
real value = 1.100000
real value = 3.300000
real value = 2.200000

In the given example, the wreal drivers and receivers are nicely separated in different modules; however, the resolution function feature works the same way inside a single model. If you display r and realnumber in one of the source modules in the example, you will notice that the driven real value realnumber and the received wreal value r are different. The received wreal value represents the end result of the overall resolution process.  

The resolution function provides you the ability to model analog behaviors, such as current summing nodes, in a straightforward manner. 

The resolution function defined by the –wreal_resolution command line switch is a global setting that applies to all wreal nets in the design. However, Cadence also supports local resolution functions defined using disciplines.

Related Topics





 ⠀
X