Home
Vatios 1.0 Programmer`s Manual
Contents
1. sim vatios c power vatios c Your variable should be declared as global Since power vatios includes power c when it s compiled you will have to declare your int var1 var as global and add a call to opt_reg_int in the function void regOptions struct If you want to give a value to your variable through the command line you also have to opt_odb_t dataBase the same way add this line at sim_reg_options struct opt_odb_t odb you have done with sim vatios c opt reg int oclo Y yarl Veriaolew 14 evyari der 0 TRUE NULL Now we are going to give a more detailed explanation of this Due to constraint in the options c h library the architectural variables should be declared as global variables in sim vatios c and you have to register them like other parameters in the function void sim_reg_options struct opt odb t odb Make sure that the opt_reg_XXXXxX call has the print parameter set to TRUE because otherwise it won t be dumped to the config file Note XXXX can be double uint int string If you need the full list of functions please read options h 8 PFC Vatios Juan Antonio Victorio Ferrer You have to do the same at power vatios c You have to declare the variables as global in a section where you can find the comment KKK KKK KKK KKK KKK KK GLOBAL VARIABLE DECLARATIONS KK KK KK KKK KKK int opcode_length 8 int inst_length 32 int ruu_issue_width 4 inte RUU
2. ASCALE LSCALE LSCALE area scaling factor VSCALE 0 3 voltage scaling factor VTSCALE 0 5046 threshold voltage scaling factor SSCALE 0 64 sense voltage scaling factor GEN POWER SCALE break case 400 4 Adding new power models First of all we want to introduce what a power model is In Vatios a power model is simply an algorithm that calculates a unit s peak power For one unit can be defined several power models for example we can have a cache and two power models the first one that uses the functions defined by Wattch and the second one that uses the latest version of CACTI When you are using your simulator you can select the model for the unit introducing this parameter in the command line unit_name model power_model Example dcache model 3 You may want to add new power models to improve or to give different choices when calculating the energy of a unit The power model calculates the power of the unit and returns a double value First of all you have to write the C code that calculates the maximum power that this unit can consume in one cycle There s a file in the main program directory whose name is calculatePower h For every unit there s a switch instruction and at least case O and case 1 and case 2 What you have to do is to add another case where is the number you are going to use for this model Let s see an example This wou
3. of the access and use information 1s rename accesses S409 547 1567 552 2228 357 9505 bpred accesses AIGO POO TEUD icache accesses S1714 2040 1 dcache accesses ALO by TOZI y2 OOLZOOFZO dcache2 accesses MOND ySU ST r2 Oy Z 2150280 WO gUx7ZOAo LLES lo 494 2 Ol O67 O72 Ox ILO 7 42 1 019 67 7Tresultbussar KOO 4 te soso OU Oo Zora AoA 1 0042 2005125 Of course in the dumped file you will have to include all the information needed by your power models power vatios depends on all this libraries so you will have to include them from the Vatios tar gz file from the Web Don t forget to include the c files as well access _vatios h vatios_strings h Cpelons power h cache h misc h Note the function dump_access_vectors FILE stream access_data_t access_data depends on a extern variable declarated as extern char dumpConfigFileName You have to make sure that this variable has the name of the file where all other information has been dumped when you call the function Now you only have to modify the files you have included to map the units in your simulator The guide to this process can be found at previous sections of this manual Vatios 1 0 Programmer s Manual 19 Note There are some units whose power depends on an activity factor These units should be treated specially because not only the number of accesses should be count but also the activity factor of the results Regfile
4. steps O O O Declaring the unit Adding auxiliary strings Counting the number of accesses Creating the power models Adding the call to the function that calculates power energy 5 1 Declaring the Unit First of all you will have to modify the access_vatios h file You will have to increment the NUM_UNITS constant you will also have to add a new identifier in the first enum for example define NUM _UNITS 15 LSQ_ WAKEUP LSQ_ PREG MY_UNIT The name used here is not relevant Be careful to use an unused identifier 5 2 Adding auxiliary strings Once you have done that you will have to add new strings for your unit at the file vatios_strings h this strings will be used by the user to refer to this unit and by the simulator to display information char varUnitNames rename ppred 10 PFC Vatios Juan Antonio Victorio Ferrer lsq wakeup r MSO preg my unit i char comentars Rename Accesses Bpred ACCeSsoecs Lsq wakeup Accesses Lsq preg Accesses My unit Accesses E Attention The order of these strings IS relevant It should match with the order of the units declared in the enum at the previous section 5 3 Counting the number of accesses Wattch and sim vatios models the Clock gating technique to calculate energy consumption The different clock gating techniques are explained at Wattch s Report To use this technique to
5. E stream Output stream Vatios if dumpConfigFileName NULL dump_access_vectors stream amp access_data calculate access _data accesses access_data activity energyMode ls The last step is to add at the main simulator one call to clear_access_stats and one call to update_access_stats amp access_data at these points of the main loop TOC ae RUU LSQ sanity checks 1f RUU num lt LSO num panic RUU_num lt LSQ num if RUU_head RUU num RUU_size RUU tail panic RUU_head RUU_tail wedged if LSQ head LSO num LSO size LSO tail panic LSQ head LSQ tail wedged added for Wattch to clear hardware access counters Vatios 1 0 Programmer s Manual 15 clear _ access _ stats else ruu_fetch_issue_delay Added by Wattch to update per cycle power statistics update_access_ stats amp access_data f update DULTer oCecipancy Stats 4 IFQ count fetch_num The rest of the work depends on the units in your simulator and your power models It s recommended to understand the differences between sim vatios c and the original sim outorder c before including Vatios to an existing SimpleScalar based simulator To compile the project you will have to modify the Makefile You can take the Makefile distributed with Vatios as an example 16 PFC Vatios Juan Antonio Victorio Ferrer 7 Adding Vatios to a non Sim
6. Resultbus Window LSQ If you are going to add a new unit and you want to measure the activity factor please take a look at how these units are modelled The process is similar but you will have to add extra code in some points
7. Sa we 8 int myNewVar 10 You also have to register the variables in a function called Void FegOptlons Struct opt odb t dataBase opt_reg_int dataBase myNewVar My new Var amp myNewVar MY_NEW_VAR_DEFAULT_VAL print TRUE format NULL Be careful there are a lot of opt_reg_XXXXX functions so use the appropriate one depending on the type of your new variable Finally you have to declare your variable as extern at the beginning of the power c file extern 1 data_width extern I res_ialu extern 1 res_fpalu extern 1 res_memport extern i myNewVar That s all If you have some trouble try to understand the compiler messages and how are defined other variables used in other power models One of the easiest power models is the one for the IALU you can follow this unit s model as an example This model uses a parameter called res_ialu Vatios 1 0 Programmer s Manual 5 Adding a new unit with its power model Adding a new unit means that you are going to model a processor with another piece of hardware for example we can think of adding a L3 cache structure First of all we have to modify our simulator to include this L3 cache structure If we only do this this would be transparent for Vatios Therefore we also have to tell Vatios that we are going to calculate the power energy for this unit and how we are going to do this We have divided this process in these
8. Vatios 1 0 Programmer s Manual Juan Antonio Victorio Ferrer University of Zaragoza Vatios 1 0 Programmer s Manual II Table of contents Table Of CONCH osisn n A E E tatuuertanetonsnt aa naete I t Prosoma Oiee EA T S l 2 SMUN SON are AT NECU Geaen A O A 2 3 Adding another technology point srce a A a ia 4 de Addin NEW Power mode lS ern R alot auseate evalua dessiasiens 5 5 Adding a new unit with its power model sseccrers prenien a a 9 Dees Decano Ce NG teething cutee eaten Naseem osaneattaden eta dane inansn se Cos eueattneenee te 9 22s Addn AU AT YSN Se cette ae icine alent ede A acetal need Danan 9 5 Gountine the number Of ACCESSES s cccdeceecostaiedcaetondaivaiedetheicncasiaiedianteiausivtesusstauadiens 10 JA Crean TNE DOWER mode IS asns a S 11 5 5 Adding the call to the function that calculates power energy ccseseeeseeeeeeeeeees 12 6 Adding the Vatios library to an existing SimpleScalar based simulator 0 0 13 7 Adding Vatios to a non SimpleScalar based simulatOL ccccccccccccsssseeseeeceeeeeeaaeeeeees 16 Vatios 1 0 Programmer s Manual l 1 Presentation Vatios is a free simulator written in C that can be used to get power and energy consumption values from super scalar processors It implements the same architecture as Wattch and not only provides the same functionality but also gives more flexibility and new interesting features Vatios has been developed trying to al
9. _access This function is called at the end of every cycle and increments the correspondent position of the vector previously explained You will have to count the accesses to your unit you will have to know where your unit is used at file sim vatios or the name of your simulator main file and every time you use your unit you have increment the correspondent counter my _unit_accesst t 5 4 Creating the power models Then you have to create a section at the file calculatePower h that calculates at least one power model for the new unit If you need help adding power models please read the previous section in this document Here there is an example of the section for a unit 12 PFC Vatios Juan Antonio Victorio Ferrer KKK k k k k k k k k k k k k k k KKK MY UNIT K ke K e ke ke e ke k ke ke k ke k k k k k k k k kk kkk Power model selection switch energyModels MY_UNIT case 0 Don t count this unit power powerAF Independent MY_UNIT 0 0 break case 1 Default power model power powerAFIndependent MY_UNIT myUnitPowerModel case 2 power powerAF Independent MY_UNIT userPowerAF Independent MY_UNIT break default fprintf stderr Invalid energyModel for s n varUnitNames MY_UNIT exit 1 5 5 Adding the call to the function that calculates power energy The last step is to add one line in a function at power c The name of the function 1s v
10. calculate energy consumption we need to know how many times one unit is accessed Therefore during the temporal execution of the simulator we have to count the number of accesses Specifically we have to count the number of times that one unit is used every cycle and then increment one position of a vector Our goal is to create a vector for each unit which has this structure Number of cycles that this unit has been accessed CO ames re 2 CIMES e If you think that your unit is going to be used 30 o more times per cycle please increment this constant defined at access_vatios h define MAX ACCESS CYCLE 30 To achieve this goal these steps are necessary There are some things you have to add at access_vatios c First of all as global variables Co nter t ialu u access Vatios 1 0 Programmer s Manual 1 counter t Targ acoess CoUnter t Besultous ACCESS counter_t my_unit_access These variables should be also declared as extern in the sim vatios c file as you are going to modify them in that program to count accesses At the function clear _access_stats lalu_access 0 falu_access 0 resultbus_access 0 my _unit_access 0 clear_access_stats is called at the beginning of every cycle You also have to add one line at the function void update_access_stats access_data_t access_data access _data gt accesses LSQ PREG lsq_preg_access access data gt accesses MY_UNIT my_unit
11. code width 4 instruction issue B W insts cycle issue width 4 run pipeline with in order issue issue inorder false issue instructions down wrong execution paths 1ssue wrongpath true instruction commit B W insts cycle COmmMmaLtL WI dh 4 register update unit RUU size ruu size 1 6 t load store queue LSQ size SISOS 276 8 11 data cache config i e lt config gt none cache dll GLE LAS P3224 21 For every unit you are going to calculate energy predictions you will have to write access and use information using the function void dump_access_vectors FILE stream access _data_t access_data included in access_vatios h or with this format unitName accesses CyclesO Cycles1 Cycles2 CyclesN Where CyclesO is the number of cycles when this unit has been accessed 0 times Cycles is the number of cycles when this unit has been accessed time and so on For units that depends on an Activity factor that can vary between 0 and 1 you will have to write the Activity factor information with this format unitName_af Eermo Cerin Term ya erm Where termX is the addition of all the activity factors resulting from cycles where the number of accesses to this unit have been X The activity factor can be calculated using pop_count function You have predefined functions to do all of this in the acces_vatios h library 18 PFC Vatios Juan Antonio Victorio Ferrer An example
12. e files as SimpleScalar but there are 2 files that have been modified options c has been slightly modified to allow dump use access info Sim outorder c has been renamed to sim vatios c and we have added the code to measure the use of the units and dump that use to a file We have replaced the CACTI 1 0 tool with CACTI 4 2 therefore you will find a directory called cacti4_2 We use CACTI to calculate subbanking of cache memories and to directly calculate the power of cache like arrays We have created a new executable power vatios created from power vatios c that uses files dumped by sim vatios to calculate power energy consumption allowing the user to modify power models frequency technology We have created access _ vatios c and access_vatios h In these files we define the number of units that the processor is made of and we define functions to count the use of units These functions are used by sim vatios c In vatios_strings h we have written the strings used to refer to the units and used to display information to the user At the file calculatePower h we have written the code power models to calculate the peak power of a unit which will be escalated to calculate the actual energy consumption In this file we call CACTI when necessary This file is included in power c In power c and power h you will find generic functions to calculate the power of a unit You will find the calculate function which calcu
13. lates and displays all the energy power results and is called by power vatios and by sim vatios Once you have compiled the simulator 2 executable files will be generated sim vatios and power vatios Vatios 1 0 Programmer s Manual This diagram shows the simulator software architecture CACTI 4 2 toy Vatios_strings h Calculate Power h String definitios for units Algorithms that calculate power Power models Ly Access_vatios c h Power c h en Provides functions to calculate l Provides eD power energy Functions to count and dump use activity in sim Uses global vars defined at sim testvatios p vatios or power vatios Number of units and Identifiers Sim vatios Power vatios Simulates temporal excution Reads access use Statistics amp Architecture Calculates power energy File Dumps access use Statistics amp Architecture File Calculates power energy Architecture params Access use file 4 PFC Vatios Juan Antonio Victorio Ferrer 3 Adding another technology point A technology point is the definition of some parameters determined by your fabrication process Vatios comes with some technology point defined but if you want to make simulations in a technology point not defined in Vatios you can add the information needed to simulate in that point Wattch s author developed some functions to calculate the power of several kind
14. ld be the code after adding my new model 6 PFC Vatios Juan Antonio Victorio Ferrer Switch energyModels RENAME Case 0 7 Don ke Count thie Unit lt 7 power powerAFIndependent RENAME 0 0 break case 1 Default Wattch model power powerAF Independent RENAME rat_power dcl_power inst_decoder_power break case 2 power powerAF Independent RENAME userPowerAF Independent RENAME break case 3 power powerAF Independent RENAME myNewRenamePower break qefTauLt fprintf stderr Invalid energyModel Tor 4s n varUnitNames RENAME re cal ae ele Inside your algorithm you will need some architectural parameters for example if you are modelling the power of a cache you will probably need the cache size the cache assoc the block size of if you are modelling the ALU unit you will probably need the number of ALUs If the parameter you need is present in another power model you will be able to read the value and that would be enough and you don t have to read the rest of this chapter but if you creating a more detailed power model it could be possible that you need a new parameter Then you have to understand how architectural parameters are defined and used in Vatios Vatios 1 0 Programmer s Manual 7 This is the variable architecture in Sim vatios Power c Variables used in power models are defined here as extern Example extern ant vari
15. low the advanced user to modify it with few effort In order to do that it s recommended to be familiar with the SimpleScalar simulator As Vatios and Wattch are based on SimpleScalar if you have a modified simulator based on SimpleScalar you can easily add power energy prediction only including some headers their correspondent files in the directory and some code in your simulator Moreover if you have a simulator that isn t based on SimpleScalar you can generate a file with the same structure and required information as the dump files that sim vatios generates and then you can process it with power vatios calculating the predictions This manual has been written to help you understanding how Vatios works and will guide you if you try to modify Vatios If you are not familiar with the simulator or you haven t read the user manual we strongly recommend doing that first Basically there are 4 ways you would like to modify Vatios o Add another technology point o Add anew power model for a unit a new way of calculating the peak power of a unit o Add anew unit with its power model o Add the Vatios library to an existing SimpleScalar based simulator o Use the Vatios library to calculate power energy based on the statistics generated by a non SimpleScalar based simulator 2 PFC Vatios Juan Antonio Victorio Ferrer 2 Simulator Software Architecture This simulator is based on SimpleScalar thus it contains the sam
16. oid calculate int accesses MAX ACCESS CYCLE double activity MAX_ACCESS_CYCLE int energyModels NUM_UNITS You have to add one line next to the last call to the function calculateEnergyAndDisplay And the line you have to add looks like calculateEnergyAndDisplay accesses MY_UNIT power my_unit_max_a ccess FALSE NULL 0O totalEnergy MY_UNIT is the identifier you have declared at access_vatios h and my_unit_max_access 1s the max number of accesses to your unit at a cycle Vatios 1 0 Programmer s Manual 13 6 Adding the Vatios library to an existing SimpleScalar based simulator Basically Vatios is composed of a standard SimpleScalar simulator plus some files and some modifications to sim outorder c These modifications are only made to counter use and activity of the units not to modify the behaviour of the simulator In this chapter we are going to explain what has to be done to add Vatios to another SimpleScalar based simulator First of all you have to add to your project the cacti4_2 directory the access Veat1oS c A POwer lt c7 hf calculatePower h and vatios_strings h Additionally the options c file is slightly modified so you will have to replace the original Now you will have to modify your simulator to link it with the Vatios library At the beginning of your simulator usually sim outorder c you will have to include the access_vatios library added for Vatios include acce
17. pleScalar based simulator If you are using a simulator that is not based on SimpleScalar you won t have a sim outorder file Despite that you could use the Vatios library and power vatios You only have to modify your simulator to dump some stats and architectural parameters to a file with a certain format This would be the simulator architecture CACTI 4 2 Ty Calculate Power h Vatios_strings h Algorithms that calculate power Power models String definitios for units Power c h Provides functions to calculate power energy Access vatios c h Uses global vars defined at sim 7 testvatios or power vatios Provides Functions to count and dump use activity in sim testvatios Your non SimpleScalar Number of units and Identifiers based simulator Power vatios Architecture params __ _ gt Reads access use eure amp Architecture Calculates power energy Access use file It s highly recommended to be familiar with Vatios and how to add new power models units First of all you should generate a file readable by the SimpleScalar options h library with all the information needed by power vatios Any option should look like optionName value Vatios 1 0 Programmer s Manual 17 Lines that begin with are considered as comments For example instruction decode B W insts cycle de
18. s of structures for example RAM CAM These functions use some variables whose initial values depend on some parameters CSCALE RSCALE LSCALE ASCALE VSCALE VTSCALE SSCALE GEN POWER SCALE which are factors relative to the 0 80um fabrication process that represent the wire capacitance wire resistance length area voltage threshold voltage sense voltage and power So let s see how we would add a new technology point In the file power c there is a function called void init_vatios_tech_params double techPoint At the beginning of this function there s a switch clause You have to add your technology point there As an example you can see how the tech point for 90nm is defined Numbers are not real The 8 scaling factors you have to define for your tech point are relative to the 800nm fabrication process case 180 CSCALE 19 7172 wire capacitance scaling factor RSCALE 20 0000 wire resistance scaling factor hSCALE 0 77 50 m venotn feature sealing factor 7i ASCALE LSCALE LSCALE I area Scaling factor VSCALE 0 4 I FOltage scaling factor 3 VTSCALE 0 5046 enres hold voltage scaling Ticor 33 SSCALE 0 85 sense voltage scaling factor GEN POWER_SCALE 1 break 90 CSCALE 35 232 wire capacitance scaling factor RSCALE 37 5000 wire resistance scaling factor Vatios 1 0 Programmer s Manual 5 LSCALE 0 1150 length feature scaling factor
19. ss vatios h Then as global variables you will have to declare these variables Vatios extern char dumpConfigFileName access data _t access data int energyModels NUM_UNITS int va_size 48 int technologyPoint 350 double crossover_scaling 1 2 double turnoff factor 0 1 int opcode_length 8 int inst_length 32 extern char varUnitNames extern char varAfNames extern char comentars extern char afComentars char modelOption NUM_UNITS 128 In the function that registers simulator specific options you will have to include these new options 14 PFC Vatios Juan Antonio Victorio Ferrer The function will look like register simulator specific options VOLG Sim reg Opcions SUrUCT Ope Odor odbp Vatios int Jj for j 0 J lt NUM_UNITS j sprintf modelOption j ss model varUnitNames j opt_reg_int odb modelOption j Energy Model amp energyModels j 1 FALSE NULL We use 1 as default value because in Vatios 0 means that this unit consumes 0 energy opt_reg_double odb tech Tech point Double in nm amp technologyPoint 350 FALSE NULL The next step is to add the code to show the results and to dump all the access use info to a file You have to find the sim_aux_stats function and modify it so that it begins like dump simulator specific auxiliary simulator statistics VOLG Sim_aux_stats FIL
Download Pdf Manuals
Related Search
Related Contents
BRAS Claudia Patricia Costa Dissertação mestrado Caso MCG 25 FS1A Safety Controller URGENT - Notice corrective de matériel médical Epson R300 Product Support Bulletin Manual for Modbus P18 - London Electronics Ltd. Copyright © All rights reserved.
Failed to retrieve file