Power / PowerTable
Block Name: PowerTable
Code File Location: VisualSim/actor/lib/power/Power_Manager
The PowerTable is used to optimize the system architecture with power as one of the metrics. The PowerTable works in conjunction with the Battery and energy harvesters are used to measure the power consumption, experiment power management algorithms, and size the battery and energy harvesters. The Power platform in VisualSim works on the concept of dynamic state change and duration within a state for each device. The POwer Table works in conjunction with the timing of the model. The Power Table does introduce a delay overhead reated to transition time between states.
Custom blocks: The custom block
can be a single instance which has multiple states. The power
state is changed using the powerUpdate RegEx. Custom devices can
also be a block with multiple indentical
instances within a single device. A good example are the Root Complex
ports of the PCIe. Here the ports differ in the number of
lanes. The power for different lanes counts would be the custom
state columns- Active_4, Active_8 etc. Each port is a queue
number. As each port receives a request, it can be added to the
Power Table as a queue instance of the PCIe. This is done using the
powerUpdateN RegEx operator.
The Power Table supports the following blocks. All others are treated as custom blocks.
* System_Resouce_Extend
* System_Resource
* Server- Single definition for all Queues. You cna change the state or
the state power value for a single queue using the RegEx function-
* Channel
* Custom Device- Single
* Custom Device-Multiple instances of same block.
* Processor
* Cache
* Bus Controller
* RAM
* HW-DRAM
* AXI Bus
* AHB/APB
Basic Facts about the PowerTable
Note: The user can add any number of Power States and Parameters. The columns listed below are the minimum required.
Device Name |
Power States |
Operating State |
State Transitions |
Parameters |
|||||||
Architecture_Blcok |
Name Format |
State 1: Active |
State 2: Standby |
State 3: Wait |
State 4: Idle |
Existing |
OffState |
OnState |
t_OnOff |
Mhz |
LDO |
Device suported by PowerTable |
Each device has a predefined name format, Device name must follow some prefix. |
Power consumption when device is processing a task |
Power consumption when device is idle |
Power Consumption when device is waiting for a response |
Power consumption during Off state of the device |
Initial state of the device |
Off state of the device |
Active/ON state of the device |
transistion time delay from Active state to other |
(used for compution |
(used for compution done in Expression List) |
SystemResource |
Scheduler_(System Resource name) |
50.0 |
30.0 |
0.0 |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
Server |
STR_(Server name) |
50.0 |
30.0 |
0.0 |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
Processor |
(ArchitectureSetup |
100.0 |
70.0 |
30.0 (Wait, Flush and Stall use this) |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
BusArbiter, Cache, DMA, AHB, APB, PCI and PCIx |
(ArchitectureSetup |
80.0 |
60.0 |
0.0 |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
Cache | (Cache)_(Cache_Name) eg: Cache_I1_Cache |
80.0 |
60.0 |
0.0 |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
AXI |
(Bus_Name) eg: AXI Bus_Name + "_Rd_Address_Channel" eg: AXI_Rd_Address_Channel Bus_Name + "_Wr_Address_Channel" eg:AXI__Wr_Address_Channel "STR_"+Bus_Name + "_Rd_Darta_Channel" eg:STR_AXI__Rd_Darta_Channel "STR_"+Bus_Name + "_Wr_Darta_Channel" eg: STR_AXI__Wr_Darta_Channel |
80.0 |
60.0 |
0.0 |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
DRAM |
(ArchitectureSetup |
120.0 |
100.0 |
80.0 |
0.0 |
Standby |
Idle |
Active |
1.0e-6/Cycle_t |
1000.0 |
80.0 |
Custom or User-Defined Block Name | (Device Name) | 120.0 (Add any number of additional columns) | 100.0 | 80.0 | 0.0 | Standby | Idle | Active | 1.0e-6/Cycle_t | 1000.0 | 80.0 |
HW_DRAM (See below for the Power Settings) | (Device Name) | 120.0 | 100.0 | 80.0 | 0.0 | Standby | Idle | Active | 1.0e-6/Cycle_t | 1000.0 | 80.0 |
AXi Bus | (Device Name) | 120.0 | 100.0 | 80.0 | 0.0 | Standby | Idle | Active | 1.0e-6/Cycle_t | 1000.0 | 80.0 |
Note: All units in the PowerTable configuration are in the Units of the parameter- Battery_Units.
The user can add any number of additional states to the device, E.g. Sleep, Deep_Sleep, etc.
Multiple lines associated with the HW_DRAM block:
--------- Name ----------- ---- Power State ---- Cycles - */ Architecture_Block Active Standby Down Wait Idle Existing OffState OnState t_OnOff Mhz Volts ; ACT_Standby_DDR0 0.1 37.6 22.4 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; /* No Rd, Wr */ ACT_Standby_DDR1 0.1 37.6 22.4 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; /* No Rd, Wr */ ACT_Active_DDR0 20.6 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; /* No Rd, Wr */ ACT_Active_DDR1 20.6 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; /* No Rd, Wr */ WTR_Power_DDR0 115.8 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; /* Same as Wr */ WTR_Power_DDR1 115.8 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; /* Same as Wr */ Write_Power_DDR0 115.8 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; Write_Power_DDR1 115.8 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; Read_Power_DDR0 210.1 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; Read_Power_DDR1 210.1 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RRD_Power_DDR0 7.4 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RRD_Power_DDR1 7.4 0.0 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_0_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_1_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_2_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_3_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_4_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_5_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_6_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_7_DDR0 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_0_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_1_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_2_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_3_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_4_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_5_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_6_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; RFSH_Power_7_DDR1 6.4 6.3 0.0 0.0 0.0 Standby Standby Active 0.0 1000.0 1.0 ; |
Multiple lines associated with AXI Bus
STR_TOP_LEVEL_AXI_Rd_Data_Channel
75.0 250.0
0.0 0.0
Standby Standby Active
1.0e-8 1000.0
1.0 ; STR_TOP_LEVEL_AXI_Wr_Data_Channel 75.0 200.0 0.0 10.0 Idle Standby Active 0.0 1000.0 1.0 ; Where the format is STR_ + AXI_Bus_Name + _Rd_Data_Channel is for rhe Read channel and STR_ + AXI_Bus_Name + _Wr_Data_Channel is for rhe Write channel |
Name |
Explanation |
Units |
|
Internally Maintained Statistics Field |
|||
Cumulative |
Device Cumulative |
This
is the accumulation of all energy per device. PowerTable generates a
statistics text file in the model directory once the simulation is
completed. This file contains the name of the device and the cumulative
enrgy consumed by that device. |
Watt second |
Device per state cumulative |
This
is the accumulation of all enrgy per statePowerTable generates a
statistics text file in the model directory once the simulation is
completed. This file contains the cumulative energy consumed by the
device in each state. E.g. c_Active, c_Standby etc. |
||
Total |
Cumulative |
This
is the accumulation of all the energy from all the devices listed in
the PowerTable's Manager_Setup table. The PowerTable generates a
statistics text file in the model directory once the simulation is
completed. This file contains a row named as Total, which includes
this value. |
Watt second |
Average |
This
is the average of the instantaneous power consumed by all the devices
listed in the PowerTable so far in the simulation. This value is
mentioned in the statistics text file generated by the PowerTable
located in the model directory. |
||
instant_pwr_out |
First
output port of the PowerTable. This port outputs the instantaneous
power consumption values of the devices. If this is the top level
PowerTable then output from this port is the accumulation of the
current power values of all devices of this PowerTable and the other PowerTables (if any) run below it (inside hierarchical blocks).
Note that if PowerTables present in the subsequent levels,
instant_pwr_out output power value corresponding to that PowerTable
only. |
Watt |
|
average_pwr_out |
Second output port of the PowerTable. This the average of the instataneous power. This port outputs every time there is a change in power level for any device. |
Watt |
|
State_Change |
Third output port of the PowerTable. This port outputs a string everytime when there is change in the state of the devices. The Output string is in the form of: Time,Hierarchy_Name,Device_Name,State |
String |
|
powerManager("<Table_name>") |
Argument: Name of the Power Table in "". |
Various |
|
stateChange(<table_name>,<device name>,<operating state>,<new_state>) |
Argument: Name of the Power Table in "". |
All blocks |
|
updatePowerN (“STR_ServerName”, New State, (_queue_number+1)) | Argument: Name of the Server block including the STR prefix in"". | All blocks | |
powerUpdateN (StringToken power_table, StringToken block_ref_, StringToken new_power_state_, IntToken (_queue_number)) | Argument: Name of the Power Table in "". Name of the custom block- block_ref_ in "". | All blocks |
Function 1:
powerManager(String Table_Name)
Eg: Result_A = powerManager("Manager_1")
Description: This
is the PowerTable statistics. The output is a array of data
structures. Each data structure appears on a single line and has
all the information on one device. All device between this level
of hierarchy are included in this table. There is one data
structure for each device.
Each data structure is identified by the name entered in
the Manager_Setup. Each devices's data structure contains Device
name, Time, Operating states,power states, transistion cycles,
Parameters, etc.
The final line row called total and contains the consolidation of all the devices.
{Scheduler_Sw1 = {Time =
1.000001, OffState = "Standby", t_Idle = 1.0E-6, Architecture_Block =
"Scheduler_Sw1", t_Wait = 1.0E-6, Idle = 10.0, c_Standby = 7.0E-5,
c_Active = 299.9999999999999, OnState = "Active", Volts = 1.0, t_Active
= 1.0E-6, c_Idle = 0.0, Mhz = 1000.0, c_Wait = 0.0, Cumulative =
300.0000699999999, Average = 299.9997700002299, Standby = 70.0,
t_Standby = 1.0E-6, Active = 300.0, Extend = false, NewState =
"Standby", Wait = 0.0, Current = 70.0, Existing = "Standby"},
total
= {Average = 299.9997700002299, Cumulative =
300.0000699999999, Time = 1.000001, Current = 70.0}}
Function 2:
stateChange(<Manager_Name> (String), <Prefix + Block_Name>(String), <Operating_State>(String), <New_State>(String) )
Eg: Result_A = stateChange("Manager_1", "Scheduler_cpu", "Existing", "Idle")
Description: This function updates the specified opearing state to the New state specified in the function. The Manager_Name must match name in the PowerTable block, while the Block_Name (device name) must match the name (Appropriate Prefix + Block_Name) in the Manager_Setup table. Operating_State must be one of the three operating states, i.e. Existing, Onstate, or Offstate. New_State must be declared in the manager_Setup upfront. New_State can be one of the many power states. General power states are Active, Statndby, Wait, Idle.
Function 3:
updatePowerN (“STR_ServerName”, New State, (_queue_number+1))
Eg: Result_A = updatePowerN (“STR_Bus1, Active4, 5)
Description: This function works exclusively with the Server block. This RegEx updates the power state for a single queue of the Server block. The Block_Name (device name) must match a existng Server block in the model. Operating_State must be "Existing". New_State must be declared in the manager_Setup upfront. New_State can be one of the many power states. General power states are Active, Statndby, Wait, Idle.
Function 2:
Eg: Result_A = stateChange("Manager_1", "Scheduler_cpu", "Existing", "Idle")
Description: This function updates the specified opearing state to the New state specified in the function. The Manager_Name must match name in the PowerTable block, while the Block_Name (device name) must match the name (Appropriate Prefix + Block_Name) in the Manager_Setup table. Operating_State must be one of the three operating states, i.e. Existing, Onstate, or Offstate. New_State must be declared in the manager_Setup upfront. New_State can be one of the many power states. General power states are Active, Statndby, Wait, Idle.
Parameter |
Explanation |
Type |
Example |
Manager_Name |
This is an unique name of the PowerTable block. |
String |
"Manager_1" |
fileorURL |
any text, csv files containing Manager_Setup details |
String |
powerTable.txt |
Manager_Setup |
This
text window can contain a table or reference a .csv or txt files. This
will contain the power level and state table. The units are in
the Battery Units parameter. Each line must be ended with ';'. No
parameter must be left unspecified |
String |
/*
Power_Table. First row contains Column Names, expressions valid
for entries except Device
Name.
|
Delay_to_Change_State |
Designers can make use of this Table to implement the asynchronous state change behavior of the devices. This feature helps in modeling dynamic nature of the device. In this table, the device can be made to go to some other state after a specified time (or expression) by itself. Each line must end with ';'. More on Async_State_Change block is given below |
String |
/* Async_State_Change. First row contains Column Names, expressions valid for entries except Device Name. |
Expression_List |
Designer
can implement different logic regarding the power values and the state
change in this table. This section supports whatever the logic,
regEx suported by an ExpressionList block. the expression must be of
single line and must be terminated with ';' in the end. |
String |
Cycle_t 1.0E-6 / Mhz ; |
Battery_Units |
This is the units for the Battery Charge and the power states of the devices. This is a drop-down menu to select Microwatts, Milli-Watts or Watts. |
String |
Milli_Watts |
State_Plot_Enable | This
enables the state activity plot of all the devices to be saved in
GNUPlot format in the _results folder of the model directory. | Checkbox | Boolean |
Manager_Setup consits the power
values of the devices at different states. The Manager_Setup consists
four different sections they are: Block name, Power States, Operating
States, State Transitions and Parameters.
Block Names: These
are the are names of the Architecture Blocks whose power consuption is
to be monitored. PowerTable supports Processor, DRAM, Cache,
BusArbiter, SystemResource, Queue and Servers by default as shown in
the Table. Designer can declare his own device. Block Name must be a string
Power States:
By default PowerTable provides Standby, Active, Wait and Idle power
states. Designer can declare custom states like Sleep, Deep_Sleep etc. Values entered for these power states can either be double value or String. If
it is a string it must be declared as a parameter in BDE, declared in
the Expression_List section or a variable declared in the VariableList
block.
Operating States:
There are three states defined in Operating States, i.e. Existing,
OffState and OnState. Exsting state corresponds to the initial state of
the device during the simulation, by default this is set to Standby.
Designer can change this state in the middle of the simulation
according to the logic defined in the Expression_List window which will
change the state of device at current time stamp. The default
OnState is set to Active State. However an Architectur element like
processor may have multiple active states while performing different
tasks. E.g. if a processor has to execute different tasks say Task_1,
Task_2, Task_3 and so on, during execution of each Task, processor will
have different active states say Active_1, Active_2, Active_3 and so
on, each Active states may have different power values; to accomplish
this; state name is specified in OnState allowing that device to go to
one of the active states. OnState of the device can be dynamically
changed according to the tasks it is executing based on the logic
defined in the Expression_List or using regEx function.
OffState is the state in which the device is not working and hence turned off; by default it is set to Standby.
State names entered here must be String
State_Transistion: This
specifies amount of time that the device will have to wait while
going from one state to another state. By default Transition time
for default states are defined E.g. t_Active, t_Standby etc. t_Active
specifies the time delay from Active State to any other state.
Similarly for other states also. Designer has to declare the transition
time for custom States if declared any. The Value entered can either be a double value or a string.
If it is a string it must be defined as the parameter in BDE, in the
Expression_List window or as a variable declared in the VariableList
block.
Parameters: Any
number of parameters can be defined in the Manager_Setup window.
Example Mhz, LDO_Efficiency etc. Parameter declared here will be
limited to the PowerTable. These paramters can be used for the
computations and defining the logic.
Each line in the Manager_Set must end with a ';'
Note: In State_Transistion; if the delay is same for all the states one can use t_All as a replacement for individual states and can enter the value.
Async_State_Change window is
used if the block changes its state asynchronously. The format is
"<Device_Name> <State>
<Time_or_Expression>
<Next_State>". Device_Name is the name of the device whose
state is to be changed asynchronously. State is the name of the device
power state (Active, Standby, Wait, Idle etc.). Time_or_Expression
specifies the maximum time for that device to stay in that
State. Next_State specifies the next state that the device has to
go to once the specified time is elapsed. Example, if the device
(Scheduler_cpu) is in Standby state and it has to go to Idle state
after 10ns if no change in the state occured; to accomplish this, one
can define the following: "Scheduler_cpu Standby 10.0e-9 Idle ; ".
Every single line must end with a ';'
Expression_List can be used to
define the logic and declare the values that can be used elsewhere in
the PowerTable. One can write as many expessions as needed. Like
in an ExpressionList block, each expression must be a single line. Note
that every expression must end with a ';'
The format for using Expression_List is "<Name> <vaule or expression> ; ". Eg.
" Cycle_t 1.0E-6 / Mhz ; " From this expression
the value Cycle_t is computed which can be used for the State
Transistion or Power States etc. the parameter Mhz can either be
declared in Manager_Setup, as a parameter decalred outside of the block
in the BDE or a variable declared in the VariableList.
Port |
Explanation |
instant_pwr_out |
This
outputs the instantaneous power of all the devices listed in the
Manager_Setup field. If this PowerTable is the top level PowerTable
this port outputs the sum of instataneous power consumption from the
PowerTables run below it (in hierarchical bloks). This port is
connected to From_BatteryTable port of the Battery to monitor the
overall load charecteristics the system. |
average_pwr_out |
This outputs the average power consumed so far during the simulation. This is in Watt. |
State_Change |
This
port outputs a string everytime when ther is a change in the device
state. The output string is in the form of :
Time,Hierarchy_Name,Device_Name,State |
Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework