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

Local Resolution Functions for Disciplines

Initially, wreal resolution functions were limited to one global resolution function. This was not appropriate in larger designs where wreals are used to model different types of interconnects (For example, voltage and currents).

As a solution to this, Cadence introduced the concept of defining wreal resolution function for disciplines. This differentiates which resolution function should be used for which net. Disciplines definitions can contain realresolve statements that control the resolution function for the discipline.

The following code example defines a sum resolution function for the wreal_current discipline. 

discipline wreal_current
  domain discrete;
  realresolve sum;
enddiscipline

The xrun switch +wreal_res__info provides information of the resolution function used for net in a design.

If you specify discipline using the -setdiscipline option or in the ams control file, resolution function is applied to a discipline during the elaboration time and gives the same result as when defined in the hardcoded example.

Design Example

Considering the above definition for the resolution function, the following example illustrates how wreal resolution function is defined separately for individual blocks that work with discipline. Two drivers are stimulating the same net and a receiver displays the resolution values. In this case, there are two instances of all three blocks in the top-level and the resolution function is controlled for both. Discrete disciplines wreal_current and wreal_voltage are used for the two wreal wires. The discipline and the related resolution functions are defined first. The wreal_current discipline is using the sum resolution function assuming that current summing is the appropriate behavior in this case. The voltage-related wreal discipline is using the average function that provides the right output value under the assumption that the driver strengths are equivalent.

`include "disciplines.vams"
`timescale 1ns/1ps

discipline wreal_current
   domain discrete;
   realresolve sum;
enddiscipline

discipline wreal_voltage
   domain discrete;
   realresolve avg;
enddiscipline

module top();
   wreal real_wire1;
   wreal_current real_wire1;
   source1 I11 (real_wire1);
   source2 I21 (real_wire1);
   sink I31 (real_wire1);
   wreal real_wire2;
   wreal_voltage real_wire2;
   source1 I12 (real_wire2);
   source2 I22 (real_wire2);
   sink I32 (real_wire2);
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("%m --> real value @ %f = %f", $abstime/1n, r);
   end
endmodule

Related Topics




 ⠀
X