Languages

CommunityCategory: XMODELThe xreal type in XMODEL

XMODEL

The xreal type in XMODEL

SA Support Team Staff 2020-06-29

How is the xreal type in XMODEL different from the real type in SystemVerilog? Can it really make a big difference in the simulation speed or accuracy?

1 Answers
Best Answer
SA Support Team Staff 2020-06-29

The xreal type in XMODEL is introduced to express analog signals in a way to enable fast and accurate event-driven simulation in SystemVerilog. Its key difference compared to the real type is that it uses a functional expression to describe how an analog signal varies over time rather than relying on a set of value-change events.

This functional expression used by the xreal type essentially removes the common trade-offs between the speed and accuracy found in many other analog simulators, including SPICE and Real-Number Verilog. In those simulators, a continuous-time analog waveform is described by a set of points and the higher accuracy requires the larger set of points to be computed, leading to the slower speed. However, XMODEL recognizes changes of input value as events, triggering fewer events than other simulators, which in turn, does not slow down the simulation time while improving the accuracy.

The xreal type of XMODEL describes an analog waveform using the following functional expression, which can describe the response of an arbitrary linear dynamical system:

An event of an xreal-type signal is triggered only when this functional expression changes; and each event is represented with a set of coefficient values (ci, mi, ai) describing the above functional expression in addition to a time offset and a flag. The time offset and the flag indicate when the event is exactly triggered and whether the event is triggered, respectively. These variables are bundled into a SystemVerilog’s struct type named xreal.

The following figure illustrates this key difference between the real type and xreal type. For the real type signal, its true waveform is approximated by a piecewise-constant waveform using a set of events. Increase in the time step to reduce the number of events would sacrifice the accuracy while decrease in the time step to improve the accuracy would make the simulation run slower. On the other hand, for the xreal-type signal, its true waveform is directly expressed by the functional expression and an event is triggered only when this expression changes. Hence, the highest possible accuracy is achieved with the fast simulation speed.