170 likes | 308 Views
Power Profiling using Sim-Panalyzer. Andria Dyess and Trey Brakefield CPE631 Spring 2005. Presentation Overview. Introduction to Sim-Panalyzer Project Goals Current Status Future Work. What is Sim-Panalyzer?.
E N D
Power Profiling using Sim-Panalyzer Andria Dyess and Trey Brakefield CPE631 Spring 2005
Presentation Overview • Introduction to Sim-Panalyzer • Project Goals • Current Status • Future Work
What is Sim-Panalyzer? • Developed by researchers at the University of Michigan and the University of Colorado • Based on the SimpleScalar processor simulator • Builds on Sim-Outorder • Adds statistics for power estimation • Compiled with gcc • Runs in Linux environment
Estimating Power Consumption with Sim-Panalyzer • User supplies a .cfg file which defines the CPU architecture • A separate .cmd file specifies voltages, capacitance, and other values needed to calculate power consumption for each architectural element
Project Goals • Become familiar with the Sim-Panalyzer software • Add support for turning on and off the collection of power statistics • Add support for power profiling • Run simple simulations to test the new features
Sim-Panalyzer Software Environment • Options database for registering command line options • Stats database for managing performance statistics • Register Update Unit (RUU) • Load/Store Queue (LSQ) • Pipeline stages: Fetch/Decode, Issue, Execution (out of order), and Commit
Project Goal #1:Start and Stop Flags for Simulation Stats • Allows the user to profile specific sections of the test program (e.g. a single subroutine) • The test program writes to a designated memory address to control collection of stats • Simulator traps writes to this memory address and performs the appropriate action
Implementation Specifics • Added a new command line option, “profiling: addr” • Added code to watch for the specified memory address just before each store instruction is committed • Overhead associated with this additional instruction (effective address calculation)
Implementation Specifics • Added code around all statistics updating to check if statistics counting is on. • Added code to Stats database to reset all of the statistics registered. • Implemented the function calls needed to start, stop, dump, and reset stats in sim-profiling.h/c.
Sample Code (capturing a start_stop memory access) if (LSQ[LSQ_head].addr == start_stop_addr){ switch (/*value being written*/) { case 1 : profile_off(); /* Stop counters */ break; case 2 : profile_on(); /* Start counters */ break; case 3 : profile_reset(power_sdb); /* Reset counters */ break; case 4 : profile_dump(power_sdb, fd);/* Dump counters */ break; /* to output file */ } }
Sample Code (resetting statistics) stat_reset_stat(struct stat_sdb_t *sdb, /* stat database */ struct stat_stat_t *stat,/* stat variable */ FILE *fd) /* output stream */ { struct eval_value_t val; switch (stat->sc) { case sc_int: *(stat->variant.for_int.var)=stat->variant.for_int.init_val; break; . . . default: panic("bogus stat class"); } }
Sample Code (not counting statistics) #ifdef PROFILING if ( counting_on) #endif /* PROFILING */ { <statistics counting> }
Project Goal #2:Power Profiling • Allows user to get power statistics supplied by sim-panalyzer in slices • Builds on work already done for project Goal #1. • The simulator will watch the instruction count. • When instruction count meets user-defined number, stats are stopped, dumped, reset, and restarted.
Implementation Specifics • Added a new command line option, “profiling: inst” • Add code to watch instruction count
Sample Code (profiling output) /* profiling? */ if ( sim_num_insn >= profile_inst_count ) { profile_iter++; fprintf(fd, "/n***** Profiling (%d) ******/n/n", profile_iter); profile_dump(power_sdb, fd); profile_reset(power_sdb); }
Project Status • Command line arguments have been added and tested • The stats database provides the ability to easily dump and reset stats • Most difficult task is finding the code that increments counters and adding a check for the flag (with out effecting the simulation).
Future Work • Long-term goal is to develop “power monitoring counters” that can be implemented in future CPUs (similar to the performance monitoring counters that are common today) • Expand profiling beyond the power profiling statistics alone.