Skip to content

Commit

Permalink
Fix DFS frequency caluclation.
Browse files Browse the repository at this point in the history
- having repeater_none_t running at default_core_frequency was messing up
the timestep calculation in global_step().
- added a check for repeater_default and DFS, which are incompatible.
- fixed reversed frequency calculation in McPAT integration.

Change-Id: I88326bdd9ef5a7fa0c719ba1a1b9ae6933bf4d53
  • Loading branch information
s-kanev committed Apr 1, 2015
1 parent 85d0fbb commit e1fa982
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
13 changes: 12 additions & 1 deletion ZCOMPS-repeater/repeater-none.cpp
Expand Up @@ -23,9 +23,20 @@ if(!strcasecmp(COMPONENT_NAME,type))
}

#else

extern double LLC_speed;

class repeater_none_t: public repeater_t {
public:
repeater_none_t(struct core_t * const _core, const char * const _name, struct cache_t * const _next_level) : repeater_t (_core, _name, _next_level) { speed = _core->knobs->default_cpu_speed; };
repeater_none_t(struct core_t * const _core, const char * const _name, struct cache_t * const _next_level) :
repeater_t (_core, _name, _next_level)
{
// Run at uncore speeds. This is important for correct DFS timing calculations
// in global_step().
// The real repeater implementation (repeater_default_t) has to run at core
// speeds, so we have to rethink its clock domains if we want DFS to work with it.
speed = LLC_speed;
}
virtual void step() { };
virtual int enqueuable(const enum cache_command cmd, const int asid, const md_addr_t addr) { return true; }
virtual void enqueue(const enum cache_command cmd,
Expand Down
4 changes: 4 additions & 0 deletions sim-slave.cpp
Expand Up @@ -340,6 +340,10 @@ sim_post_init(void)
cores[i]->vf_controller = vf_controller_create(knobs.dvfs_opt_str,cores[i]);
}

if (strcasecmp(knobs.dvfs_opt_str, "none") &&
strcasecmp(knobs.exec.repeater_opt_str,"none"))
fatal("DVFS is not compatible with the memory repeater.");

// Time between updating global state (uncore, different nocs)
sync_interval = MIN(1e-3 / LLC_speed, 1e-3 / cores[0]->memory.mem_repeater->speed);

Expand Down
7 changes: 5 additions & 2 deletions zesto-power.cpp
Expand Up @@ -391,7 +391,10 @@ void core_power_t::translate_stats(struct stat_sdb_t* sdb, system_core *core_sta

struct core_knobs_t* knobs = core->knobs;
(void) L2_stats;
core_stats->vdd = 1.0;
//XXX: Ignore McPAT's DVFS calculation for now. We do our own scaling in
// compute_power(). That is, until we can validate that McPAT is doing
// more or less the right thing.
core_stats->vdd = core_power_t::default_vdd;

stat = stat_find_core_stat(sdb, coreID, "oracle_total_uops");
core_stats->total_instructions = stat->variant.for_sqword.end_val;
Expand All @@ -413,7 +416,7 @@ void core_power_t::translate_stats(struct stat_sdb_t* sdb, system_core *core_sta

// get average frequency for this period
stat = stat_find_stat(sdb, "sim_cycle");
core_stats->clock_rate = (int) ceil(stat->variant.for_sqword.end_val * knobs->default_cpu_speed / (double) core_stats->total_cycles);
core_stats->clock_rate = (int) ceil(core_stats->total_cycles * knobs->default_cpu_speed / (double) stat->variant.for_sqword.end_val);

core_stats->idle_cycles = 0;
core_stats->busy_cycles = core_stats->total_cycles - core_stats->idle_cycles;
Expand Down

0 comments on commit e1fa982

Please sign in to comment.