Skip to content

Commit

Permalink
Actually create dvfs controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-kanev committed Apr 7, 2013
1 parent e076e54 commit b331c1a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions sim-slave.cpp
Expand Up @@ -108,6 +108,7 @@
#include "zesto-uncore.h"
#include "zesto-MC.h"
#include "zesto-power.h"
#include "zesto-dvfs.h"

#include "interface.h"
#include "synchronization.h"
Expand Down Expand Up @@ -339,6 +340,7 @@ sim_post_init(void)
cores[i]->decode = decode_create(knobs.model,cores[i]);
cores[i]->fetch = fetch_create(knobs.model,cores[i]);
cores[i]->power = power_create(knobs.model,cores[i]);
cores[i]->vf_controller = vf_controller_create(knobs.dvfs_opt_str,cores[i]);
}

min_coreID = 0;
Expand Down Expand Up @@ -432,6 +434,8 @@ void sim_main_slave_pre_pin(int coreID)
cores[coreID]->sim_cycle++;

cores[coreID]->ns_passed += 1e-3 / cores[coreID]->cpu_speed;

fprintf(stderr, "%.3f %.3f\n", cores[coreID]->ns_passed * 1e9, (1e6 / LLC_speed));
}

/* Time to sync with uncore */
Expand Down
7 changes: 4 additions & 3 deletions zesto-core.cpp
Expand Up @@ -82,11 +82,12 @@ seq_t core_t::global_seq = 0;

/* CONSTRUCTOR */
core_t::core_t(const int core_id):
knobs(NULL), current_thread(NULL), id(core_id),
knobs(NULL), current_thread(NULL), id(core_id), ns_passed(0.0),
num_emergency_recoveries(0), last_emergency_recovery_count(0),
oracle(NULL), fetch(NULL), decode(NULL), alloc(NULL),
exec(NULL), commit(NULL), global_action_id(0),
num_signals_in_pipe(0)
exec(NULL), commit(NULL), num_signals_in_pipe(0),
global_action_id(0)

{
memzero(&memory,sizeof(memory));
memzero(&stat,sizeof(stat));
Expand Down
2 changes: 2 additions & 0 deletions zesto-core.h
Expand Up @@ -211,6 +211,8 @@ class core_t {
class repeater_t * mem_repeater;
} memory;

class vf_controller_t * vf_controller;

/**********************/
/* VARIOUS STATISTICS */
/**********************/
Expand Down
4 changes: 4 additions & 0 deletions zesto-opts.cpp
Expand Up @@ -178,6 +178,10 @@ sim_reg_options(struct opt_odb_t *odb)
uncore_reg_options(odb);
dram_reg_options(odb);
repeater_reg_options(odb);

opt_reg_string(odb, "-dvfs", "dvfs controller configuration string",
&knobs.dvfs_opt_str, /* default */"none", /* print */true, /* format */NULL);

}

/* check simulator-specific option values */
Expand Down
1 change: 1 addition & 0 deletions zesto-structs.h
Expand Up @@ -325,6 +325,7 @@ struct core_knobs_t
{
const char * model;
double default_cpu_speed; /* in MHz */
const char * dvfs_opt_str;

struct {
int byteQ_size;
Expand Down
3 changes: 2 additions & 1 deletion zesto-uncore.cpp
Expand Up @@ -132,7 +132,6 @@ uncore_t::uncore_t(
const char * MC_opt_string)
: fsb_speed(arg_fsb_speed),
fsb_DDR(arg_fsb_DDR),
sim_cycle(0),
total_sim_time(0.0)
{
/* temp variables for option-string parsing */
Expand Down Expand Up @@ -274,6 +273,8 @@ uncore_reg_options(struct opt_odb_t * const odb)
void uncore_reg_stats(struct stat_sdb_t * const sdb)
{
stat_reg_note(sdb,"\n#### LAST-LEVEL CACHE STATS ####");
stat_reg_counter(sdb, true, "uncore.sim_cycle", "number of uncore cycles simulated", &uncore->sim_cycle, 0, TRUE, NULL);

LLC_reg_stats(sdb, uncore->LLC);
bus_reg_stats(sdb, NULL, uncore->LLC_bus);

Expand Down

0 comments on commit b331c1a

Please sign in to comment.