UPF Design Examples
UPF Design Examples
It is well-known fact that power is an important driving factor for today’s complex electronic designs. The advent
of portable and smart electronic devices have forced engineers to change the way they think (or made them think
if they were not doing so earlier!) about power consumption of their designs.
Various techniques have been around for how one can reduce power consumed by his/her design. However, usual
approach was to design the RTL and then add power intent into the netlist level. The problem with this approach
is that it may result in unnecessary respins in the design cycle as it may take longer time to come up with optimum
power strategy for the RTL which was designed irrespective of power strategy.
So, the idea is to introduce power strategies at the early stage of the design phase. However, the hardware
description languages have not been designed taking “power factor” in account. Hence, there is no consistent way
to describe the power strategies in the design. The Unified Power Format (UPF) provides an easy and effective way
of describing “power intent” of the design and hence introduces power reduction techniques in the RTL stage
itself.
» It is HDL independent.
» It consists of simple and verbose TCL commands to describe the power intent.
» Standardized as IEEE 1801-2009.
» No need to modify the RTL explicitly.
» It allows power-aware simulation of the design by appropriately controlling the power strategies
described in the power intent.
» It can be used for electronic designs or IPs.
» It allows power to be considered at the earliest stages of the design. This helps in two ways:
» Precious time in the design cycle is saved.
» Consistent power strategy is maintained from start to the end by having the same UPF file as reference.
UPF has the following capabilities as far as the power intent of the design is concerned:
We will have a look all these features one by one and then we will explore each of them in detail with an example.
Every practical design will have a hierarchy of design elements or components. The level at which one can
introduce the power control strategies at different levels in the design.
The upf allows this by setting the scope of the design. There are two relevant upf commands: set_design_top and
set_scope. Syntaxes of both are as shown below:
The common practice maybe to set the scope as design top and specify the design elements with respect to that
level in design hierarchy. The top level module need not be the design top for upf as one may be interested in
working at some intermediate level in the hierarchy. The following example explains this:
set_design_top top/dma/state_mc
set_scope top/dma/state_mc
or
set_scope
Power domain is the collection of design elements. One can define a power domain at different levels of design
hierarchy. It may be a single design block or a collection of few such blocks. The following figure shows the
example of power domains in a hierarchical design. The upf syntax for creating power domain is as follows:
Supply Network
Supply ports
Supply nets
Power switches
All the above components can be easily created for a power domain using UPF commands. Supply network is
specified apart from the logic design; logic design specification remains independent of specific power supply
network. Supply network is said to be complete, when at least one ground power supply is created.
Supply port is basically used for connecting the ports of the module to the main power supply. It is a port that
originates a supply state and voltage value. Each supply port has one or more supply state defined. The port can
drive only one state at a given time. Supply ports provide the ability to connect a supply net to the design
element. Supply ports provide supply interfaces to the switches. Supply ports and supply nets can be created
either in UPF or HDL. If the net or port is created in HDL, that will be of type supply net created in UPF
systemverilog. The name of supply port cannot be the same with the existing net.
Supply ports have two halves. The first half is known as Highconn and the second half is known as Lowconn. The
Highconn is visible external to the design elements whose interface contains the port whereas the Lowconn is
visible internal to the design elements whose interface contains the ports. When a supply net in the active mode is
connected to the logic port in the child instance, the supply port is connected to highconn. The supply port is
connected to lowconn when a supply net in active mode is connected to the logic port of same instance. UPF
provides create_supply_port command to create supply ports. This command creates a port on power domain.
They are defined for switches in create_power_switch. Each supply port has one or more supply nets defined by
itself. The supply port can drive only one state at a given time.
As mentioned earlier, supply ports can drive one state at a time. The driven state is propagated by the supply net.
To understand supply nets better, we can just mention it as a simple wire which is used for connecting two
elements. Supply nets are connected to supply ports and logic gates. They propagate a supply state. The supply
states are 0, 1 and voltage values. Each supply state has one or more supply state defined in it. Supply nets carry
an electrical current. During simulation, each supply port and supply net maintains two kinds of information: a
supply state and a voltage state. The supply state consists of two states: on/off state and full/partial state. Each
pair of supply nets, a power and a ground supply net, connected to one or more design elements belongs to a
simulation process. Supply nets are automatically connected to supply ports of design element in the power
domain. They propagate the state (on, off, voltage value). Individual supply net can be connected to supply ports
using the command connect_supply_net. This command connects the supply port to supply net. The name of
supply nets or ports should not conflict with the existing port or net designed for the element. This command can
be used only once per net until the –reuse is specified. Resolution mechanism determines the state and voltage of
the supply net from the state and the voltage values supplied by each of switches. Individual supply nets are
connected automatically to the supply ports. The basic syntax for creating the supply nets is:
After creating the supply nets, we need to connect the supply nets to the ports of the module. The basic syntax for
connecting the supply nets is:
Retention Cell:
Sometimes, modules will be switched on and off in order to reduce the current consumption. But for some of the
modules, there is a necessity that they need to retain their values. In order to retain the values, retention is used.
In retention, current is consumed more than that required. But the module values are recovered very fast after
getting up from sleepy mode. At the gate level, special retention cells like flip-flops are used to provide retention
capability. The retention modules are instantiated in the DUT but are part of power intent. The simulator
communicates with the model and connects the model to the clock, reset, and power.
There are two types of signals associated with retention, save signal and restore signal. These two operations are
triggered either by using a single control statement or using two control statements. But problem occurs if race
condition occurs between the two control statements. If the race condition occurs between the save and restore
signal, the retention value stored in the retention register may be corrupted. Therefore, UPF provides a
mechanism for such scenarios. Some registers have retention ability. They can preserve their value after a shut
down also. There are separate simulators that support this kind of retention behavior.
Sometimes we need a fast restart of operation before entering into sleepy mode. Here, it is necessary to save the
present state of the design before it goes into sleepy mode. In such situations, save signals are useful. After
entering into active mode (non-sleepy mode), it is necessary that we need to restore the previous value. In this
way restore signal is useful. The retention cells are not instantiated in the Device under Test (DUT) but, they are
the part of the power system. Using a high level retention model allows us to match the behavior of the retention
cells and then the cells will be inserted at the gate level. We need to verify that proper timing of control signal
(save) is provided for retention registers to save the values before the power is off. Proper timing of control signals
are provided to the retention registers to store the values of the registers when the power is on. Clock or reset
signals should not be provided to the power gated system with which the registers are storing the information.UPF
provides set_retention and set_retention_control commands to instantiate the retention environment in the
design.
The above figure explains the concept of retention clearly. During simulation, each registers which are to be
retained creates two processes: one with respect to the save signal and another with respect to the restore signal.
A retention memory is also created for each element which needs to be retained. This retention memory is called
shadow register. Whenever the save signal changes the values and matches with the corresponding save sense, the
value is stored and updated in the shadow register. If the save signal is X or Z, the shadow registers are stored with
their default initial value. If the restore signal is X or Z, the registers are stored with the default values. The basic
syntax for the initiating the retention environment in the design is:
Mapping capabilities can be enhanced using map_retention_cell command port mapping enables the connection of
cell ports to the signals . Identifying incorrect retention behavior is very important in the design. Incorrect state of
registers like clocks, set can cause incorrect retention vales on the memory. Therefore it’s necessary to identify
the proper behavior of the retention during the simulation. Sometimes retention may be absent in the retention
register. This error occurs usually when the save or restore signal operation fails. The current value of the register
is not stored due to the failed save signal operation which obviously results in the failure of the restore signal
operation.
Isolation:
Sometimes the modules get switched off and they cannot drive their outputs anymore. In this case, the modules
outputs become floating modes. This might be a problem. The main reason behind this unexpected value is of
some inappropriate logic levels. To overcome this problem, isolation cells are used. Isolation cells are always
placed between the power domains which drive 0, 1 or latches the old value. It ensures that the output has some
predefined value. It also sees that active domains are not affected. Isolation logic can be categorized under static
verification in structural part which looks for the missing isolation cells in the design. Isolation is used to clamp the
output value. UPF provides set_isolation and set_isolation_control commands to add isolation cells in the design.
These two commands are used to determine which ports are to be isolated and where the isolated cells are to be
placed. The following figure gives a clear picture of the isolation strategy. UPF provides few commands through
which the isolation cells can be inserted in the design.
Isolation can be performed by clamping the output values to either 0, 1, z or latch. It is not mandatory that only
output values are clamped but the isolation can be performed by clamping the input vales also. The clamp value
when set as ‘0’ works as a basic AND gate. On the other hand, initializing the clamp value ‘1’ can be inferred as
OR gate functionality. Application of clamp values depends on many factors like the logic to be implemented, the
designers requirement, etc. Pull up transistor clamps the output to ‘1’ and pull down transistor clamps the output
to ‘0’ when it receives the isolation signal from the power controller. When the isolation signal goes low, isolation
cell becomes low and clamps the output of the signal to 0; else the isolation cell becomes inactive. In some cases
we want to map the isolation to a specific cell within the same driver or sometimes different one.
map_isolation_cell command supports this facility mapping cells.
During simulation each signal corresponds to the process which is sensitive to both the non-isolated and the control
commands. Every time the control signals value changes, the new value is compared with the isolation value. If
the control signal and the isolated values are same, then the clamp value is the isolated signal, else the non-
isolated signal is driven as the clamp value. Sometimes, the designs are very complicated that it may include much
number of power domains, supply ports and nets. In such cases, it is difficult to identify whether the isolation cells
are placed at the right place or not. It’s still tougher to identify the scenario during the simulation time. Therefore
identifying the missing isolation cells plays a vital role. The following algorithm helps in finding the missing
isolation cells:
1. Ensure that the isolation strategy is created in the design which can be done using set_isolation command.
2. If set_isolation command is not specified, and if the signal is going from one active domain to another, implies
that the isolation strategy is required by the particular signal. The simulator generates an appropriate message
stating that the isolation cells are missing.
A switch is an element that connects one or more input supply nets to the output supply net according to the
logical state of the nets. Power switch is used to connect the power to the power domain from the main power
supply. The power switch is created during the simulation process, which plays a key role in understanding how the
blocks are switched on and off. It always enables two inputs. This corresponds to the process which is sensitive to
the changes in the input as well as the control ports. Whenever the control value changes, the Boolean values are
evaluated. The switch is closed when the on state function is true. At this stage, the input port is switched into
the output port. In the other case, if the switch is open, the output port is assigned OFF state. Here, there is no
specific voltage value. If the control signals are X or Z, the input supply is undetermined. The diagrammatic
representation of the power switch makes us easy to understand the concept of power switch in a better way.
Level Shifters:
Another important concept involved in UPF is level shifters. They are also known as buffer-type level cells. Level
shifter insertion is done based on the Power State Table along with some additional information extracted from
the set_level_shift command. Level shifters are placed on the connection between two domains that operate at
different voltage levels. The placement of level shifters is very important. The output driver for the level shifter
requires more power that that of the input stage. Therefore, level shifters are usually placed in the destination
side of the domain. They are usually not placed when the voltage difference between two power domains is less
than that of threshold value. Level shifters are taken into account when the logic conversation of signals from one
voltage domain to another is required. The main purpose of level shifter is to convert the signal voltage to the
correct voltage.
Shifting the voltage down: This is an easy process. Shifting the voltage from high to low can be just a simple
inverter or buffer.
Shifting the voltage high: This is a bit complex process. Careful placements of the cells to minimize the area are
required.
Level shifters are used to manage the voltage dip between two domains, in which both the domains are operating
at different voltages. Let us consider we have two domains, Domain 1 and Domain 2. Domain 1 has voltages
operating at 0.9v and 1.2v and Domain 2 has two operating voltages at 1.2v and 1.6v. There may be chances of
wrong detection of voltage levels in these two domains i.e., an input 1010 in domain 1 can be detected as 0101 in
domain 2. This may happen because of the variation in voltage level. In order to avoid these voltage variations
between the domains, the level shifters are used. Its core function is to ensure that there is no flip in the voltage.
UPF provides various commands like create_power_domain, set_domain_supply_net which facilitates the users to
easily insert level shifters strategy in their design. The set_level_shifter command is automatic rule based
insertion. Users can separate the design based on the primary and ground power supply using
create_power_domain. It also allows the users to add instances in the RTL design. The set_domain_supply_net
identify the primary and ground supply net in the designs. These pins are implicitly connected to all the logic
ports. The supply power is necessary for normal operations.
UPF provides the following constructs to build level shifters environment in our design.
set_level_shifter <shiftername> –domain <power_domain_name>
-applies_to_outputs
-location fanout
set_level_shifter <shiftername> –domain <power_domain_name>
-applies_to_inputs
-location fanout
Detecting incorrect level shifters also plays a key role in designing UPF. If the user has specified a level shifter
strategy saying “high to low level shifter”, the simulation tool checks whether the level shifter is placed between
the main power at a higher voltage than the other one. This is possible because the simulation tool is aware of the
exact voltage values at which the port operates. Absence of any level shifter or if incorrect values are provided,
the tool immediately displays a message saying that the incorrect shifter values are given. Assertions are also used
to check the consistency of the level shifters in our design.
Inside UPF, there is a very important part called power state table (PST). Any power management strategy starts
with PST. Power states can be referenced by object_name. They are attributes of object. The following objects
may have power states assigned to them:
Power domain.
Supply nets.
Supply ports.
We won’t list PST’s on objects. The definition of PST state should refer to the definition of another PST state. It
defines at what power stage the design is working and when the design can be switched can be on and off. The
power state table is basically used for implementation, especially for synthesis, analysis, etc. Each power state
represents regions (power-domains) and the voltage values supplied to it. They define all the possible power state
combinations which can exist at the same time during the operation of design. An error occurs if the declared
supply net has not been created earlier in the design. UPF provides create_pst command to create power state
table (PST) in the design. Power state table is used for verification. It also verifies isolation gates and level
shifters.
Let us consider we have three power rails main, VDD_domain1, VDD_domain2. First we need to define the voltage
values for these power rails.
// implies that the voltage values are either 1.2 or 0.8 or 0.2.
An error occurs if an add_pst_state command defines a state in which the same supply nets or ports have different
values. Any state defined by add_pst_state is by default a legal state.