From 296c9abfd7e5fe1c821433261fb7637b2b602df7 Mon Sep 17 00:00:00 2001 From: sixshotx Date: Fri, 3 Feb 2017 10:45:28 -0500 Subject: [PATCH 1/5] update kitfox_proxy framework for cache-counters --- models/cache/mcp-cache/L1_cache.h | 28 +- models/cache/mcp-cache/L2_cache.h | 29 +- models/cache/mcp-cache/Makefile.am | 2 +- models/cache/mcp-cache/configure.ac | 32 ++ models/kitfox/proxy/kitfox_proxy.cc | 540 +++++++++++++++++- models/kitfox/proxy/kitfox_proxy.h | 490 ++-------------- models/network/iris/genericTopology/torus6p.h | 380 ++++++------ simulator/smp/common/cache_builder.cc | 53 ++ simulator/smp/common/cache_builder.h | 21 + simulator/smp/common/proc_builder.cc | 2 +- uarch/DestMap.h | 2 +- uarch/kitfoxCounter.h | 40 +- 12 files changed, 962 insertions(+), 657 deletions(-) diff --git a/models/cache/mcp-cache/L1_cache.h b/models/cache/mcp-cache/L1_cache.h index e9c917d..185fe68 100644 --- a/models/cache/mcp-cache/L1_cache.h +++ b/models/cache/mcp-cache/L1_cache.h @@ -11,6 +11,9 @@ #include "uarch/DestMap.h" #include "uarch/networkPacket.h" +#ifdef LIBKITFOX +#include "uarch/kitfoxCounter.h" +#endif namespace manifold { @@ -27,7 +30,7 @@ struct L1_cache_settings { class L1_cache : public manifold::kernel::Component { public: - enum {PORT_PROC=0, PORT_L2}; + enum {PORT_PROC=0, PORT_L2, PORT_KITFOX}; L1_cache (int nid, const cache_settings&, const L1_cache_settings&); virtual ~L1_cache (void); @@ -61,6 +64,11 @@ class L1_cache : public manifold::kernel::Component { CREDIT_MSG = credit; } +#ifdef LIBKITFOX + template + void handle_kitfox_proxy_request(int temp, T *kitfox_proxy_request); +#endif + private: //void issue_to_client (cache_req *request); //void issue_to_manager (cache_req *request); @@ -170,6 +178,10 @@ class L1_cache : public manifold::kernel::Component { unsigned stats_stall_buffer_max_size; unsigned long stats_table_occupancy; //accumulated hash table occupancy unsigned stats_table_empty_cycles; + +#ifdef LIBKITFOX + manifold::uarch::cache_counter_t counter; +#endif }; @@ -198,6 +210,20 @@ void L1_cache :: handle_processor_request(int, T* request) } +#ifdef LIBKITFOX +template +void L1_cache :: handle_kitfox_proxy_request(int temp, T *kitfox_proxy_request) +{ + assert(kitfox_proxy_request->get_type() == manifold::uarch::KitFoxType::l1cache_type); + assert(kitfox_proxy_request->get_id() == node_id); + + kitfox_proxy_request->set_counter(counter); + counter.clear(); + + Send(PORT_KITFOX, kitfox_proxy_request); +} +#endif // LIBKITFOX + } //namespace mcp_cache diff --git a/models/cache/mcp-cache/L2_cache.h b/models/cache/mcp-cache/L2_cache.h index 6e3475f..36b9dfb 100644 --- a/models/cache/mcp-cache/L2_cache.h +++ b/models/cache/mcp-cache/L2_cache.h @@ -10,6 +10,10 @@ #include "uarch/networkPacket.h" #include "uarch/DestMap.h" +#ifdef LIBKITFOX +#include "uarch/kitfoxCounter.h" +#endif + using namespace std; @@ -29,7 +33,7 @@ struct L2_cache_settings { class L2_cache : public manifold::kernel::Component { public: - enum {PORT_L1=0}; + enum {PORT_L1=0, PORT_KITFOX}; L2_cache (int nid, const cache_settings&, const L2_cache_settings&); virtual ~L2_cache (void); @@ -59,6 +63,12 @@ class L2_cache : public manifold::kernel::Component { MEM_MSG = mem; CREDIT_MSG = credit; } + +#ifdef LIBKITFOX + template + void handle_kitfox_proxy_request(int temp, T *kitfox_proxy_request); +#endif + private: void process_client_request (Coh_msg* request, bool first); void process_client_reply (Coh_msg* reply); @@ -152,6 +162,10 @@ class L2_cache : public manifold::kernel::Component { unsigned stats_mshr_empty_cycles; unsigned stats_read_mem; unsigned stats_dirty_to_mem; + +#ifdef LIBKITFOX + manifold::uarch::cache_counter_t counter; +#endif }; @@ -193,6 +207,19 @@ void L2_cache :: handle_incoming (int, manifold::uarch::NetworkPacket* pkt) } +#ifdef LIBKITFOX +template +void L2_cache :: handle_kitfox_proxy_request(int temp, T *kitfox_proxy_request) +{ + assert(kitfox_proxy_request->get_type() == manifold::uarch::KitFoxType::l2cache_type); + assert(kitfox_proxy_request->get_id() == node_id); + + kitfox_proxy_request->set_counter(counter); + counter.clear(); + + Send(PORT_KITFOX, kitfox_proxy_request); +} +#endif // LIBKITFOX diff --git a/models/cache/mcp-cache/Makefile.am b/models/cache/mcp-cache/Makefile.am index a9f6b0e..0a9ebb9 100644 --- a/models/cache/mcp-cache/Makefile.am +++ b/models/cache/mcp-cache/Makefile.am @@ -61,7 +61,7 @@ pkginclude_mcp_cache_HEADERS = \ lp_lls_unit.h \ mux_demux.h -libmcp_cache_a_CPPFLAGS = -I$(KERNEL_INC) +libmcp_cache_a_CPPFLAGS = -I$(KERNEL_INC) -I$(KITFOX_INC) --std=c++11 EXTRA_DIST = doc diff --git a/models/cache/mcp-cache/configure.ac b/models/cache/mcp-cache/configure.ac index 754f53f..7f8af07 100644 --- a/models/cache/mcp-cache/configure.ac +++ b/models/cache/mcp-cache/configure.ac @@ -94,6 +94,38 @@ if test "x${forecast_null}" = xyes ; then AC_DEFINE(FORECAST_NULL) fi +# check kitfox integration +AC_ARG_WITH([kitfox], + [AS_HELP_STRING([--without-kitfox], + [do not use QSim @<:@default: no@:>@])], + [kitfox=${enableval}], [kitfox=yes]) + +if test "x${kitfox}" = xyes ; then + #check if QSim header files exist + # We allow user to specify the location of the header files, e.g., + # configure KITFOXINC=/foo/kitfox + if test -z "$KITFOXINC" ; then + KITFOXINC='/usr/local/include' + fi + + if test ! -e "$KITFOXINC/kitfox.h"; then + AC_MSG_ERROR([ + ----------------------------------------- + ERROR: kitfox.h not found in $KITFOXINC! + ----------------------------------------- + ]) + else + AC_DEFINE(LIBKITFOX) + AC_SUBST([KITFOX_INC], [$KITFOXINC]) + fi +else # use_kitfox disabled + AC_MSG_WARN([ + ----------------------------------------------------------------- + LIBKITFOX disabled! Building only processor models not using KitFox. + -----------------------------------------------------------------]) + AC_SUBST([KITFOX_INC], ["."]) +fi + # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL diff --git a/models/kitfox/proxy/kitfox_proxy.cc b/models/kitfox/proxy/kitfox_proxy.cc index a7047be..dbeeb7a 100644 --- a/models/kitfox/proxy/kitfox_proxy.cc +++ b/models/kitfox/proxy/kitfox_proxy.cc @@ -26,6 +26,7 @@ kitfox_proxy_t::kitfox_proxy_t(const char *ConfigFile, pair kitfox_component_id = kitfox->component_id_range; +#if 0 /* Check which components are associated with which libraries. */ for(Comp_ID pseudo_component_id = kitfox_component_id.first; pseudo_component_id <= kitfox_component_id.second; @@ -39,12 +40,11 @@ kitfox_proxy_t::kitfox_proxy_t(const char *ConfigFile, add_kitfox_thermal_component(pseudo_component_id); } /* Pseudo component is associated with reliability library. */ -#if 0 if(kitfox->get_reliability_library(pseudo_component_id)) { add_kitfox_reliability_component(pseudo_component_id); } -#endif } +#endif cout << "Finished initializing KitFox" << endl; } @@ -64,15 +64,40 @@ void kitfox_proxy_t::tick() return ; int core_id = 0; - for (CompId_t& id : manifold_node) { + int l1cache_id = 0; + int l2cache_id = 0; + for (auto id: manifold_node) { // core_model only, FIXME add test function for other models here // difference between manifold_node id and core_id??? - kitfox_proxy_request_t *req = - new kitfox_proxy_request_t (core_id, KitFoxType::core_type, m_clk->NowTicks() * m_clk->period); - Send(id, req); - core_id++; - } + switch (id.second) { + case KitFoxType::core_type: { + kitfox_proxy_request_t *req; + req = new kitfox_proxy_request_t (core_id, id.second, m_clk->NowTicks() * m_clk->period); + Send(id.first, req); + core_id++; + break; + } + case KitFoxType::l1cache_type: { + kitfox_proxy_request_t *req; + req = new kitfox_proxy_request_t (l1cache_id, id.second, m_clk->NowTicks() * m_clk->period); + Send(id.first, req); + l1cache_id++; + break; + } + case KitFoxType::l2cache_type: { + kitfox_proxy_request_t *req; + req = new kitfox_proxy_request_t (l2cache_id, id.second, m_clk->NowTicks() * m_clk->period); + Send(id.first, req); + l2cache_id++; + break; + } + default: + cerr << "error manifold_node type!" << endl; + exit(1); + } + + } #if 0 uint64_t clock_cycle = m_clk->NowTicks(); @@ -109,18 +134,18 @@ void kitfox_proxy_t::tock() /* Nothing to do */ } -/* Add Manifold components to withdraw couters. */ -void kitfox_proxy_t::add_manifold_node(CompId_t NodeId) +/* Add Manifold components to withdraw counters. */ +void kitfox_proxy_t::add_manifold_node(CompId_t CompId, KitFoxType t) { /* Check if there already exists the same node ID. */ - for(vector::iterator it = manifold_node.begin(); - it != manifold_node.end(); it++) { - if((*it) == NodeId) { return; } + for(auto comp: manifold_node) { + if(comp.first == CompId) { return; } } - manifold_node.push_back(NodeId); + manifold_node.push_back(make_pair(CompId, t)); } +#if 0 /* Add KitFox components to calculate power. */ void kitfox_proxy_t::add_kitfox_power_component(Comp_ID ComponentID) { @@ -147,7 +172,7 @@ void kitfox_proxy_t::add_kitfox_thermal_component(Comp_ID ComponentID) } /* Add KitFox components to calculate reliability. */ -#if 0 + void kitfox_proxy_t::add_kitfox_reliability_component(Comp_ID ComponentID) { /* Check if there already exists the same component ID. */ @@ -160,4 +185,489 @@ void kitfox_proxy_t::add_kitfox_reliability_component(Comp_ID ComponentID) } #endif +void kitfox_proxy_t::calculate_power(manifold::uarch::pipeline_counter_t c, manifold::kernel::Time_t t, const string prefix) +{ + string comp; + libKitFox::Comp_ID comp_id; + + // l1_btb + comp = prefix + ".l1_btb"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.l1_btb); + + // l2_btb + comp = prefix + ".l2_btb"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.l2_btb); + + // predictor_chooser + comp = prefix + ".predictor_chooser"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.predictor_chooser); + + // global_predictor + comp = prefix + ".global_predictor"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.global_predictor); + + // l1_local_predictor + comp = prefix + ".l1_local_predictor"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.l1_local_predictor); + + // l2_local_predictor + comp = prefix + ".l2_local_predictor"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.l2_local_predictor); + + // ras + comp = prefix + ".ras"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.ras); + + // inst_cache + comp = prefix + ".inst_cache"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.inst_cache); + + // inst_cache_miss_buffer + comp = prefix + ".inst_cache_miss_buffer"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.inst_cache_miss_buffer); + + // inst_tlb + comp = prefix + ".inst_tlb"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.inst_tlb); + + // latch_ic2ib + comp = prefix + ".latch_ic2ib"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_ic2ib); + + // pc + comp = prefix + ".pc"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.pc); + + // inst_buffer + comp = prefix + ".inst_buffer"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.inst_buffer); + + // latch_ib2id + comp = prefix + ".latch_ib2id"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_ib2id); + + // inst_decoder + comp = prefix + ".inst_decoder"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.inst_decoder); + + // operand_decoder + comp = prefix + ".operand_decoder"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.operand_decoder); + + // uop_sequencer + comp = prefix + ".uop_sequencer"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.uop_sequencer); + + // latch_id2uq + comp = prefix + ".latch_id2uq"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_id2uq); + + // uop_queue + comp = prefix + ".uop_queue"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.uop_queue); + + // latch_uq2rr + comp = prefix + ".latch_uq2rr"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_uq2rr); + + // rat + comp = prefix + ".rat"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.rat); + + // freelist + comp = prefix + ".freelist"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.freelist); + + // dependency_check + comp = prefix + ".dependency_check"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.dependency_check); + + // latch_id2iq (in-order) + // comp = prefix + ".latch_id2iq"; + // comp_id = kitfox->get_component_id(comp); + // assert(comp_id != INVALID_COMP_ID); + // kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_id2iq); + + // latch_rr2rs + comp = prefix + ".latch_rr2rs"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_rr2rs); + + // rs + comp = prefix + ".rs"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.rs); + + // issue_select + comp = prefix + ".issue_select"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.issue_select); + + // latch_rs2ex + comp = prefix + ".latch_rs2ex"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_rs2ex); + + // reg_int + comp = prefix + ".reg_int"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.reg_int); + + // reg_fp + comp = prefix + ".reg_fp"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.reg_fp); + + // rob + comp = prefix + ".rob"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.rob); + + // latch_rob2rs + comp = prefix + ".latch_rob2rs"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_rob2rs); + + // latch_rob2reg + comp = prefix + ".latch_rob2reg"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_rob2reg); + + // alu + comp = prefix + ".alu"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.alu); + + // mul + comp = prefix + ".mul"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.mul); + + // int_bypass + comp = prefix + ".int_bypass"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.int_bypass); + + // latch_ex_int2rob + comp = prefix + ".latch_ex_int2rob"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_ex_int2rob); + + // fpu + comp = prefix + ".fpu"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.fpu); + + // fp_bypass + comp = prefix + ".fp_bypass"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.fp_bypass); + + // latch_ex_fp2rob + comp = prefix + ".latch_ex_fp2rob"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_ex_fp2rob); + + // stq + comp = prefix + ".stq"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.stq); + + // latch_stq2dcache + comp = prefix + ".latch_stq2dcache"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_stq2dcache); + + // latch_stq2ldq + comp = prefix + ".latch_stq2ldq"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_stq2ldq); + + // ldq + comp = prefix + ".ldq"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.ldq); + + // latch_ldq2dcache + comp = prefix + ".latch_ldq2dcache"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_ldq2dcache); + + // latch_ldq2rs + comp = prefix + ".latch_ldq2rs"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_ldq2rs); + + // lsq (in-order) + // comp = prefix + ".lsq"; + // comp_id = kitfox->get_component_id(comp); + // assert(comp_id != INVALID_COMP_ID); + // kitfox->calculate_power(comp_id, t, m_clk->period, c.lsq); + + // latch_lsq2dcache (in-order) + // comp = prefix + ".latch_lsq2dcache"; + // comp_id = kitfox->get_component_id(comp); + // assert(comp_id != INVALID_COMP_ID); + // kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_lsq2dcache); + + // latch_lsq2reg (in-order) + // comp = prefix + ".latch_lsq2reg"; + // comp_id = kitfox->get_component_id(comp); + // assert(comp_id != INVALID_COMP_ID); + // kitfox->calculate_power(comp_id, t, m_clk->period, c.latch_lsq2reg); + + // data_cache + comp = prefix + ".data_cache"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.data_cache); + + // data_cache_miss_buffer + comp = prefix + ".data_cache_miss_buffer"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.data_cache_miss_buffer); + + // data_cache_prefetch_buffer + comp = prefix + ".data_cache_prefetch_buffer"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.data_cache_prefetch_buffer); + + // data_cache_writeback_buffer + comp = prefix + ".data_cache_writeback_buffer"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.data_cache_writeback_buffer); + + // data_tlb + comp = prefix + ".data_tlb"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.data_tlb); + + // l2_tlb + comp = prefix + ".l2_tlb"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.l2_tlb); + + // undiff + comp = prefix + ".undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.undiff); + +#if 0 + // frontend_undiff + comp = prefix + "frontend_undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.frontend_undiff); + + // scheduler_undiff + comp = prefix + "scheduler_undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.scheduler_undiff); + + // ex_int_undiff + comp = prefix + "ex_int_undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.ex_int_undiff); + + // ex_fp_undiff + comp = prefix + "ex_fp_undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.ex_fp_undiff); + + // lsu_undiff + comp = prefix + "lsu_undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.lsu_undiff); + + // package + comp = prefix + "package"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.package); + + // core + comp = prefix + "core"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.core); + + // frontend + comp = prefix + "frontend"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.frontend); + + // lsu + comp = prefix + "lsu"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.lsu); + + // scheduler + comp = prefix + "scheduler"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.scheduler); + + // ex_int + comp = prefix + "ex_int"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.ex_int); + + // ex_fp + comp = prefix + "ex_fp"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.ex_fp); + + // execute + comp = prefix + "execute"; + assert(comp_id != INVALID_COMP_ID); + comp_id = kitfox->get_component_id(comp); + kitfox->calculate_power(comp_id, t, m_clk->period, c.execute); +#endif + + // synchronize core power + comp = prefix; + comp_id = kitfox->get_component_id(comp); + kitfox->synchronize_data(comp_id, t, m_clk->period, libKitFox::KITFOX_DATA_POWER); + + // print core power + libKitFox::power_t power; + assert(kitfox->pull_data(comp_id, t, m_clk->period, libKitFox::KITFOX_DATA_POWER, &power) == libKitFox::KITFOX_QUEUE_ERROR_NONE); + cerr << prefix + ".power = " << power.get_total() << "W (dynamic = " << power.dynamic << "W, leakage = " << power.leakage << "W) @" << t << endl; + +} + +void kitfox_proxy_t::calculate_power(manifold::uarch::cache_counter_t c, manifold::kernel::Time_t t, const string prefix) +{ + string comp; + libKitFox::Comp_ID comp_id; + + // cache + comp = prefix + ".cache"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.cache); + + // prefetch + comp = prefix + ".prefetch"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.prefetch); + + // missbuf + comp = prefix + ".missbuf"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.missbuf); + + // linefill + comp = prefix + ".linefill"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.linefill); + + // writeback + comp = prefix + ".writeback"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.writeback); + + // undiff + comp = prefix + ".undiff"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.undiff); + + // synchronize core power + comp = prefix; + comp_id = kitfox->get_component_id(comp); + kitfox->synchronize_data(comp_id, t, m_clk->period, libKitFox::KITFOX_DATA_POWER); + + // print core power + libKitFox::power_t power; + assert(kitfox->pull_data(comp_id, t, m_clk->period, libKitFox::KITFOX_DATA_POWER, &power) == libKitFox::KITFOX_QUEUE_ERROR_NONE); + cerr << prefix + ".power = " << power.get_total() << "W (dynamic = " << power.dynamic << "W, leakage = " << power.leakage << "W) @" << t << endl; +} + #endif //USE_KITFOX diff --git a/models/kitfox/proxy/kitfox_proxy.h b/models/kitfox/proxy/kitfox_proxy.h index 9db7e60..fa164bb 100644 --- a/models/kitfox/proxy/kitfox_proxy.h +++ b/models/kitfox/proxy/kitfox_proxy.h @@ -17,9 +17,9 @@ class kitfox_proxy_request_t { public: kitfox_proxy_request_t() {} - kitfox_proxy_request_t(int CoreID, manifold::uarch::KitFoxType s, manifold::kernel::Time_t t) : core_id(CoreID), type(s), time(t) { counter.clear(); } + kitfox_proxy_request_t(int NodeID, manifold::uarch::KitFoxType s, manifold::kernel::Time_t t) : node_id(NodeID), type(s), time(t) { counter.clear(); } ~kitfox_proxy_request_t() {} - int get_id() const { return core_id; } + int get_id() const { return node_id; } manifold::uarch::KitFoxType get_type() const { return type; } manifold::kernel::Time_t get_time() const { return time; } void set_counter (const T c) { counter = c; } @@ -36,7 +36,7 @@ class kitfox_proxy_request_t // } private: - int core_id; + int node_id; manifold::kernel::Time_t time; manifold::uarch::KitFoxType type; T counter; @@ -53,483 +53,81 @@ class kitfox_proxy_t : public manifold::kernel::Component void tock(); /* Add Manifold components to calculate power. */ - void add_manifold_node(manifold::kernel::CompId_t); + void add_manifold_node(manifold::kernel::CompId_t, manifold::uarch::KitFoxType); +#if 0 void pair_counter_to_power_component(manifold::kernel::CompId_t); - /* Add KitFox components to invoke calculations. */ void add_kitfox_power_component(libKitFox::Comp_ID); void add_kitfox_thermal_component(libKitFox::Comp_ID); -#if 0 void add_kitfox_reliability_component(libKitFox::Comp_ID); #endif + void calculate_power(manifold::uarch::pipeline_counter_t c, manifold::kernel::Time_t t, const string prefix); + void calculate_power(manifold::uarch::cache_counter_t c, manifold::kernel::Time_t t, const string prefix); template void handle_kitfox_proxy_response(int temp, kitfox_proxy_request_t *Req); private: libKitFox::kitfox_t *kitfox; size_t comp_num; - //int comp_num; - std::vector manifold_node; + std::vector> manifold_node; +#if 0 std::vector > kitfox_power_component; std::vector kitfox_thermal_component; -#if 0 std::vector kitfox_reliability_component; #endif }; + template void kitfox_proxy_t::handle_kitfox_proxy_response(int temp, kitfox_proxy_request_t *Req) { assert(Req != NULL); T c = Req->get_counter(); - - //FIXME: core model only, add support for other models later - assert(Req->get_type() == manifold::uarch::KitFoxType::core_type); + string prefix; if (Req->get_type() == manifold::uarch::KitFoxType::core_type) { - string prefix = "package.core_die.core" + std::to_string(Req->get_id()); - string comp; - libKitFox::Comp_ID comp_id; - - // l1_btb - comp = prefix + ".l1_btb"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.l1_btb); - - // l2_btb - comp = prefix + ".l2_btb"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.l2_btb); - - // predictor_chooser - comp = prefix + ".predictor_chooser"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.predictor_chooser); - - // global_predictor - comp = prefix + ".global_predictor"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.global_predictor); - - // l1_local_predictor - comp = prefix + ".l1_local_predictor"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.l1_local_predictor); - - // l2_local_predictor - comp = prefix + ".l2_local_predictor"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.l2_local_predictor); - - // ras - comp = prefix + ".ras"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.ras); - - // inst_cache - comp = prefix + ".inst_cache"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.inst_cache); - - // inst_cache_miss_buffer - comp = prefix + ".inst_cache_miss_buffer"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.inst_cache_miss_buffer); - - // inst_tlb - comp = prefix + ".inst_tlb"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.inst_tlb); - - // latch_ic2ib - comp = prefix + ".latch_ic2ib"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_ic2ib); - - // pc - comp = prefix + ".pc"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.pc); - - // inst_buffer - comp = prefix + ".inst_buffer"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.inst_buffer); - - // latch_ib2id - comp = prefix + ".latch_ib2id"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_ib2id); - - // inst_decoder - comp = prefix + ".inst_decoder"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.inst_decoder); - - // operand_decoder - comp = prefix + ".operand_decoder"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.operand_decoder); - - // uop_sequencer - comp = prefix + ".uop_sequencer"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.uop_sequencer); - - // latch_id2uq - comp = prefix + ".latch_id2uq"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_id2uq); - - // uop_queue - comp = prefix + ".uop_queue"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.uop_queue); - - // latch_uq2rr - comp = prefix + ".latch_uq2rr"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_uq2rr); - - // rat - comp = prefix + ".rat"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.rat); - - // freelist - comp = prefix + ".freelist"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.freelist); - - // dependency_check - comp = prefix + ".dependency_check"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.dependency_check); - - // latch_id2iq (in-order) - // comp = prefix + ".latch_id2iq"; - // comp_id = kitfox->get_component_id(comp); - // assert(comp_id != INVALID_COMP_ID); - // kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_id2iq); - - // latch_rr2rs - comp = prefix + ".latch_rr2rs"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_rr2rs); - - // rs - comp = prefix + ".rs"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.rs); - - // issue_select - comp = prefix + ".issue_select"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.issue_select); - - // latch_rs2ex - comp = prefix + ".latch_rs2ex"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_rs2ex); - - // reg_int - comp = prefix + ".reg_int"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.reg_int); - - // reg_fp - comp = prefix + ".reg_fp"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.reg_fp); - - // rob - comp = prefix + ".rob"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.rob); - - // latch_rob2rs - comp = prefix + ".latch_rob2rs"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_rob2rs); - - // latch_rob2reg - comp = prefix + ".latch_rob2reg"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_rob2reg); - - // alu - comp = prefix + ".alu"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.alu); - - // mul - comp = prefix + ".mul"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.mul); - - // int_bypass - comp = prefix + ".int_bypass"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.int_bypass); - - // latch_ex_int2rob - comp = prefix + ".latch_ex_int2rob"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_ex_int2rob); - - // fpu - comp = prefix + ".fpu"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.fpu); - - // fp_bypass - comp = prefix + ".fp_bypass"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.fp_bypass); - - // latch_ex_fp2rob - comp = prefix + ".latch_ex_fp2rob"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_ex_fp2rob); - - // stq - comp = prefix + ".stq"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.stq); - - // latch_stq2dcache - comp = prefix + ".latch_stq2dcache"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_stq2dcache); - - // latch_stq2ldq - comp = prefix + ".latch_stq2ldq"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_stq2ldq); - - // ldq - comp = prefix + ".ldq"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.ldq); - - // latch_ldq2dcache - comp = prefix + ".latch_ldq2dcache"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_ldq2dcache); - - // latch_ldq2rs - comp = prefix + ".latch_ldq2rs"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_ldq2rs); - - // lsq (in-order) - // comp = prefix + ".lsq"; - // comp_id = kitfox->get_component_id(comp); - // assert(comp_id != INVALID_COMP_ID); - // kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.lsq); - - // latch_lsq2dcache (in-order) - // comp = prefix + ".latch_lsq2dcache"; - // comp_id = kitfox->get_component_id(comp); - // assert(comp_id != INVALID_COMP_ID); - // kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_lsq2dcache); - - // latch_lsq2reg (in-order) - // comp = prefix + ".latch_lsq2reg"; - // comp_id = kitfox->get_component_id(comp); - // assert(comp_id != INVALID_COMP_ID); - // kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.latch_lsq2reg); - - // data_cache - comp = prefix + ".data_cache"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.data_cache); - - // data_cache_miss_buffer - comp = prefix + ".data_cache_miss_buffer"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.data_cache_miss_buffer); - - // data_cache_prefetch_buffer - comp = prefix + ".data_cache_prefetch_buffer"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.data_cache_prefetch_buffer); - - // data_cache_writeback_buffer - comp = prefix + ".data_cache_writeback_buffer"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.data_cache_writeback_buffer); - - // data_tlb - comp = prefix + ".data_tlb"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.data_tlb); - - // l2_tlb - comp = prefix + ".l2_tlb"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.l2_tlb); - - // undiff - comp = prefix + ".undiff"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.undiff); - -#if 0 - // frontend_undiff - comp = prefix + "frontend_undiff"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.frontend_undiff); - - // scheduler_undiff - comp = prefix + "scheduler_undiff"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.scheduler_undiff); - - // ex_int_undiff - comp = prefix + "ex_int_undiff"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.ex_int_undiff); - - // ex_fp_undiff - comp = prefix + "ex_fp_undiff"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.ex_fp_undiff); - - // lsu_undiff - comp = prefix + "lsu_undiff"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.lsu_undiff); - - // package - comp = prefix + "package"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.package); - - // core - comp = prefix + "core"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.core); - - // frontend - comp = prefix + "frontend"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.frontend); - - // lsu - comp = prefix + "lsu"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.lsu); - - // scheduler - comp = prefix + "scheduler"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.scheduler); - - // ex_int - comp = prefix + "ex_int"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.ex_int); - - // ex_fp - comp = prefix + "ex_fp"; - comp_id = kitfox->get_component_id(comp); - assert(comp_id != INVALID_COMP_ID); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.ex_fp); - - // execute - comp = prefix + "execute"; - assert(comp_id != INVALID_COMP_ID); - comp_id = kitfox->get_component_id(comp); - kitfox->calculate_power(comp_id, Req->get_time(), m_clk->period, c.execute); -#endif - - // synchronize core power - comp = prefix; - comp_id = kitfox->get_component_id(comp); - kitfox->synchronize_data(comp_id, Req->get_time(), m_clk->period, libKitFox::KITFOX_DATA_POWER); - - // print core power - libKitFox::power_t power; - assert(kitfox->pull_data(comp_id, Req->get_time(), m_clk->period, libKitFox::KITFOX_DATA_POWER, &power) == libKitFox::KITFOX_QUEUE_ERROR_NONE); - cerr << prefix + ".power = " << power.get_total() << "W (dynamic = " << power.dynamic << "W, leakage = " << power.leakage << "W) @" << Req->get_time() << endl; - - comp_num += 1; + prefix = "package.core_die.core" + std::to_string(Req->get_id()); + } else if (Req->get_type() == manifold::uarch::KitFoxType::l1cache_type) { + prefix = "package.core_die.l1cache" + std::to_string(Req->get_id()); + } else if (Req->get_type() == manifold::uarch::KitFoxType::l2cache_type) { + prefix = "package.llc_die.cache" + std::to_string(Req->get_id()); + } else { + cerr << "unknown counter type!" << endl; + exit(1); } + calculate_power(c, Req->get_time(), prefix); + comp_num += 1; if (comp_num == manifold_node.size()) { libKitFox::Comp_ID package_id = kitfox->get_component_id("package"); assert(package_id != INVALID_COMP_ID); kitfox->calculate_temperature(package_id, Req->get_time(), m_clk->period); - for(int i = 0; i < manifold_node.size(); i++){ + for(unsigned int i = 0; i < manifold_node.size(); i++){ libKitFox::Kelvin t; - string partition = "package.core_die.core" + std::to_string(i); - libKitFox::Comp_ID par_id = kitfox->get_component_id(partition); + string partition; + libKitFox::Comp_ID par_id; + + switch (manifold_node[i].second) { + case manifold::uarch::KitFoxType::core_type: { + partition = "package.core_die.core" + std::to_string(i); + break; + } + case manifold::uarch::KitFoxType::l1cache_type: { + partition = "package.core_die.l1cache" + std::to_string(i); + break; + } + case manifold::uarch::KitFoxType::l2cache_type: { + partition = "package.llc_die.cache" + std::to_string(i); + break; + } + default: + cerr << "error manifold_node type!" << endl; + exit(1); + } + + par_id = kitfox->get_component_id(partition); assert(kitfox->pull_data(par_id, Req->get_time(), m_clk->period, libKitFox::KITFOX_DATA_TEMPERATURE, &t) == libKitFox::KITFOX_QUEUE_ERROR_NONE); cerr << partition + ".temperature = " << t << "Kelvin @" << Req->get_time() << endl; diff --git a/models/network/iris/genericTopology/torus6p.h b/models/network/iris/genericTopology/torus6p.h index 381f33b..bc01c80 100644 --- a/models/network/iris/genericTopology/torus6p.h +++ b/models/network/iris/genericTopology/torus6p.h @@ -42,23 +42,23 @@ class Torus6p public: //constructor and deconstructor //Torus (manifold::kernel::Clock& clk, torus_init_params* params, const Terminal_to_net_mapping* mapping, SimulatedLen*, VnetAssign*, int ni_credit_type, int lp=0); //all interfaces and routers in one LP - //! @param \c node_lp router idx to LP mapping + //! @param \c node_lp router idx to LP mapping Torus6p (manifold::kernel::Clock& clk, torus6p_init_params* params, const Terminal_to_net_mapping* mapping, SimulatedLen*, VnetAssign*, int ni_credit_type, vector* node_lp); ~Torus6p (); //connect all components together void connect_interface_routers(void); void connect_routers(void); - - const std::vector *>& get_interfaces() { return interfaces; } - const std::vector & get_routers() {return routers; } + + const std::vector *>& get_interfaces() { return interfaces; } + const std::vector & get_routers() {return routers; } //the interfaces' component id const std::vector & get_interface_id() { return interface_ids; } - - //the routers' component id - const std::vector & get_router_id() { return router_ids; } - void print_stats(std::ostream&); + + //the routers' component id + const std::vector & get_router_id() { return router_ids; } + void print_stats(std::ostream&); #ifndef IRIS_TEST private: @@ -66,25 +66,25 @@ class Torus6p // variables const unsigned x_dim; // x dimension const unsigned y_dim; // y dimension - manifold::kernel::Clock& clk_t; //the clock for routers and interfaces + manifold::kernel::Clock& clk_t; //the clock for routers and interfaces std::vector routers; //the routers std::vector * > interfaces; //the interfaces std::vector router_ids; //the routers' component ID - std::vector interface_ids; //the interfaces' component ID - + std::vector interface_ids; //the interfaces' component ID + //the node to lp map - vector* node_lp; -#ifdef IRIS_TEST - //trace file that using in debugging - std::ofstream outFile_data; + vector* node_lp; +#ifdef IRIS_TEST + //trace file that using in debugging + std::ofstream outFile_data; std::ofstream outFile_signal; -#endif +#endif unsigned int intf_per_router; - - protected: -}; + + protected: +}; //! @param \c clk The clock passing from callor //! @param \c params The configure parameters for torus network @@ -100,36 +100,36 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c { #ifdef IRIS_TEST uint grid_count = 0; - + //open trace file outFile_data.open("torus6p_data.tr"); //handle exception if(outFile_data.fail()) std::cout<<"fail to open file"<ni_up_credits > 0); assert(ni_credit_type != 0); assert(params->ni_upstream_buffer_size > 0); - + //parameters for interface inf_init_params i_p_inf; - + i_p_inf.linkWidth = params->link_width; i_p_inf.num_credits = params->credits; i_p_inf.upstream_credits = params->ni_up_credits; i_p_inf.up_credit_msg_type = ni_credit_type; - i_p_inf.num_vc = params->no_vcs; + i_p_inf.num_vc = params->no_vcs; i_p_inf.upstream_buffer_size = params->ni_upstream_buffer_size; - + //parameters for router router_init_params i_p_rt; @@ -140,8 +140,8 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c i_p_rt.no_ports = 4 + intf_per_router; i_p_rt.no_vcs = params->no_vcs; i_p_rt.credits = params->credits; - i_p_rt.rc_method = TORUS6P_ROUTING; - + i_p_rt.rc_method = TORUS6P_ROUTING; + NIInit niInit(mapping, slen, vn); const unsigned no_nodes = x_dim * y_dim; @@ -150,7 +150,7 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c if (node_lp->size() != no_nodes) { cout<<"Bad node to lp mapping!!"<size(); i++) @@ -160,9 +160,9 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c #ifdef IRIS_TEST outFile_data<< "0.0 N " << i << " " << i << " " << 0 << std::endl; outFile_signal<< "0.0 N " << i << " " << i << " " << 0 << std::endl; -#endif - router_ids.push_back( manifold::kernel::Component::Create(node_lp->at(i), i, &i_p_rt) ); -// cout<<"node id: "<< node_lp->at(i).node_id <<" node lp: "<at(i).lp<(node_lp->at(i), i, &i_p_rt) ); +// cout<<"node id: "<< node_lp->at(i).node_id <<" node lp: "<at(i).lp<::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c { outFile_data<< "0.0 N " << i + no_nodes << " " << double(i%x_dim) + 6 + 0.5<< " " << 1 + grid_count*2<< std::endl; outFile_signal<< "0.0 N " << i + no_nodes << " " << double(i%x_dim) + 6 + 0.5<< " " << 1 + grid_count*2<< std::endl; - } + } } else { @@ -183,19 +183,19 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c { outFile_data<< "0.0 N " << i + no_nodes << " " << i%x_dim + 6<< " " << 2 + grid_count*2 << std::endl; outFile_signal<< "0.0 N " << i + no_nodes << " " << i%x_dim + 6<< " " << 2 + grid_count*2 << std::endl; - } + } if (grid_count%2 == 1) { outFile_data<< "0.0 N " << i + no_nodes << " " << double(i%x_dim) + 6 + 0.5<< " " << 2 + grid_count*2 << std::endl; outFile_signal<< "0.0 N " << i + no_nodes << " " << double(i%x_dim) + 6 + 0.5<< " " << 2 + grid_count*2 << std::endl; - } + } } - + if (i%x_dim == (x_dim - 1)) grid_count++; -#endif +#endif } - + //register interfaces to clock for ( uint i=0; i< interface_ids.size(); i++) { @@ -205,9 +205,9 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c manifold::kernel::Clock::Register< GenNetworkInterface > (clk_t, interface, &GenNetworkInterface::tick, &GenNetworkInterface::tock); //pass clock from out side } - interfaces.push_back(interface); + interfaces.push_back(interface); } - + //register router to clock for ( uint i=0; i< router_ids.size(); i++) { @@ -216,17 +216,17 @@ Torus6p::Torus6p(manifold::kernel::Clock& clk, torus6p_init_params* params, c { manifold::kernel::Clock::Register(clk_t, rr, &SimpleRouter::tick, &SimpleRouter::tock); } - routers.push_back(rr); + routers.push_back(rr); } - + for ( uint i=0; i< interface_ids.size(); i++) { GenNetworkInterface* interface = manifold::kernel::Component::GetComponent< GenNetworkInterface >(interface_ids.at(i)); if ( interface != NULL ) { - SimpleRouter* rr= manifold::kernel::Component::GetComponent(router_ids.at(i / intf_per_router)); - assert(rr); - interface->set_router(rr); - } + SimpleRouter* rr= manifold::kernel::Component::GetComponent(router_ids.at(i / intf_per_router)); + assert(rr); + interface->set_router(rr); + } } @@ -253,27 +253,27 @@ void Torus6p::connect_interface_routers() { int LATENCY = 1; - // Connect for the output links of the router + // Connect for the output links of the router for( uint i=0; i::ROUTER_PORT, - router_ids.at(i), SimpleRouter::PORT_NI, - &SimpleRouter::handle_link_arrival , static_cast(LATENCY)); - manifold::kernel::Manifold::Connect(router_ids.at(i), SimpleRouter::PORT_NI, - interface_ids.at(i*intf_per_router), GenNetworkInterface::ROUTER_PORT, - &GenNetworkInterface::handle_router , static_cast(LATENCY)); - - manifold::kernel::Manifold::Connect(interface_ids.at(i*intf_per_router+1), GenNetworkInterface::ROUTER_PORT, + manifold::kernel::Manifold::Connect(interface_ids.at(i*intf_per_router), GenNetworkInterface::ROUTER_PORT, + router_ids.at(i), SimpleRouter::PORT_NI, + &SimpleRouter::handle_link_arrival , static_cast(LATENCY)); + manifold::kernel::Manifold::Connect(router_ids.at(i), SimpleRouter::PORT_NI, + interface_ids.at(i*intf_per_router), GenNetworkInterface::ROUTER_PORT, + &GenNetworkInterface::handle_router , static_cast(LATENCY)); + + manifold::kernel::Manifold::Connect(interface_ids.at(i*intf_per_router+1), GenNetworkInterface::ROUTER_PORT, router_ids.at(i), SimpleRouter::PORT_MC, &SimpleRouter::handle_link_arrival , static_cast(LATENCY)); - manifold::kernel::Manifold::Connect(router_ids.at(i), SimpleRouter::PORT_MC, + manifold::kernel::Manifold::Connect(router_ids.at(i), SimpleRouter::PORT_MC, interface_ids.at(i*intf_per_router+1), GenNetworkInterface::ROUTER_PORT, &GenNetworkInterface::handle_router , static_cast(LATENCY)); - #ifdef IRIS_TEST + #ifdef IRIS_TEST if(interfaces.at(i)) - outFile_data<< "0.0 L " << interfaces.at(i)->id << " " << routers.at(i)->node_id + x_dim*y_dim<< std::endl; -// cout<< "0.0 L " << interfaces.at(i)->id << " " << routers.at(i)->node_id + x_dim*y_dim<< std::endl; - #endif + outFile_data<< "0.0 L " << interfaces.at(i)->id << " " << routers.at(i)->node_id + x_dim*y_dim<< std::endl; +// cout<< "0.0 L " << interfaces.at(i)->id << " " << routers.at(i)->node_id + x_dim*y_dim<< std::endl; + #endif } } @@ -290,40 +290,40 @@ Torus6p::connect_routers() for ( uint i=0; iat(i*x_dim + j) != node_lp->at(i*x_dim + j-1)){ - if (routers[i*x_dim + j]) - routers[i*x_dim + j]->set_port_cross_lp(SimpleRouter::PORT_WEST); - if (routers[i*x_dim + j-1]) - routers[i*x_dim + j-1]->set_port_cross_lp(SimpleRouter::PORT_EAST); - //cout<<"router: "<at(i*x_dim + j)<<" WEST to router: "<at(i*x_dim + j-1)<<" EAST "<at(i*x_dim + j) != node_lp->at(i*x_dim + j-1)){ + if (routers[i*x_dim + j]) + routers[i*x_dim + j]->set_port_cross_lp(SimpleRouter::PORT_WEST); + if (routers[i*x_dim + j-1]) + routers[i*x_dim + j-1]->set_port_cross_lp(SimpleRouter::PORT_EAST); + //cout<<"router: "<at(i*x_dim + j)<<" WEST to router: "<at(i*x_dim + j-1)<<" EAST "<node_id + no_nodes << " " - << routers.at(i*x_dim + j-1)->node_id + no_nodes<< std::endl; - #endif - #endif - // going east -> - // Router->Router DATA - manifold::kernel::Manifold::Connect(rno2, SimpleRouter::PORT_EAST, - rno, SimpleRouter::PORT_WEST, - &SimpleRouter::handle_link_arrival, LATENCY); - #ifdef IRIS_TEST + const unsigned no_nodes = x_dim * y_dim; + outFile_data<< "0.0 L " << routers.at(i*x_dim + j)->node_id + no_nodes << " " + << routers.at(i*x_dim + j-1)->node_id + no_nodes<< std::endl; + #endif + #endif + // going east -> + // Router->Router DATA + manifold::kernel::Manifold::Connect(rno2, SimpleRouter::PORT_EAST, + rno, SimpleRouter::PORT_WEST, + &SimpleRouter::handle_link_arrival, LATENCY); + #ifdef IRIS_TEST #if 0 - outFile_data<< "0.0 L " << routers.at(i*x_dim + j)->node_id + no_nodes<< " " - << routers.at(i*x_dim + j-1)->node_id + no_nodes<< std::endl; - #endif - #endif + outFile_data<< "0.0 L " << routers.at(i*x_dim + j)->node_id + no_nodes<< " " + << routers.at(i*x_dim + j-1)->node_id + no_nodes<< std::endl; + #endif + #endif } } @@ -331,40 +331,40 @@ Torus6p::connect_routers() for ( uint i=1; iat(i*x_dim + j) != node_lp->at((i-1)*x_dim + j)){ - if (routers[i*x_dim + j]) - routers[i*x_dim + j]->set_port_cross_lp(SimpleRouter::PORT_NORTH); - if (routers[(i-1)*x_dim + j]) - routers[(i-1)*x_dim + j]->set_port_cross_lp(SimpleRouter::PORT_SOUTH); - //cout<<"router: "<at(i*x_dim + j)<<" NORTH to router: "<<(i-1)*x_dim + j<<" at lp: "<at((i-1)*x_dim + j)<<" SOUTH "<at(i*x_dim + j) != node_lp->at((i-1)*x_dim + j)){ + if (routers[i*x_dim + j]) + routers[i*x_dim + j]->set_port_cross_lp(SimpleRouter::PORT_NORTH); + if (routers[(i-1)*x_dim + j]) + routers[(i-1)*x_dim + j]->set_port_cross_lp(SimpleRouter::PORT_SOUTH); + //cout<<"router: "<at(i*x_dim + j)<<" NORTH to router: "<<(i-1)*x_dim + j<<" at lp: "<at((i-1)*x_dim + j)<<" SOUTH "<node_id + no_nodes<< " " - << routers.at(i*x_dim + j- x_dim)->node_id + no_nodes<< std::endl; - #endif - #endif - // going south-> - // Router->Router DATA - manifold::kernel::Manifold::Connect(up_rno, SimpleRouter::PORT_SOUTH, - rno, SimpleRouter::PORT_NORTH, - &SimpleRouter::handle_link_arrival, LATENCY); - #ifdef IRIS_TEST + outFile_data<< "0.0 L " << routers.at(i*x_dim + j)->node_id + no_nodes<< " " + << routers.at(i*x_dim + j- x_dim)->node_id + no_nodes<< std::endl; + #endif + #endif + // going south-> + // Router->Router DATA + manifold::kernel::Manifold::Connect(up_rno, SimpleRouter::PORT_SOUTH, + rno, SimpleRouter::PORT_NORTH, + &SimpleRouter::handle_link_arrival, LATENCY); + #ifdef IRIS_TEST #if 0 - outFile_data<< "0.0 L " << routers.at(i*x_dim + j)->node_id + no_nodes<< " " - << routers.at(i*x_dim + j- x_dim)->node_id + no_nodes<< std::endl; - #endif - #endif + outFile_data<< "0.0 L " << routers.at(i*x_dim + j)->node_id + no_nodes<< " " + << routers.at(i*x_dim + j- x_dim)->node_id + no_nodes<< std::endl; + #endif + #endif } } @@ -372,80 +372,80 @@ Torus6p::connect_routers() // connect edge nodes East-west for ( uint i=0; iat(i*x_dim) != node_lp->at(i*x_dim+x_dim-1)){ - if (routers[i*x_dim]) - routers[i*x_dim]->set_port_cross_lp(SimpleRouter::PORT_WEST); - if (routers[i*x_dim+x_dim-1]) - routers[i*x_dim+x_dim-1]->set_port_cross_lp(SimpleRouter::PORT_EAST); - //cout<<"router: "<at(i*x_dim)<<" WEST to router: "<at(i*x_dim+x_dim-1)<<" EAST "<at(i*x_dim) != node_lp->at(i*x_dim+x_dim-1)){ + if (routers[i*x_dim]) + routers[i*x_dim]->set_port_cross_lp(SimpleRouter::PORT_WEST); + if (routers[i*x_dim+x_dim-1]) + routers[i*x_dim+x_dim-1]->set_port_cross_lp(SimpleRouter::PORT_EAST); + //cout<<"router: "<at(i*x_dim)<<" WEST to router: "<at(i*x_dim+x_dim-1)<<" EAST "<node_id + no_nodes<< " " - << routers.at(i*x_dim + x_dim-1)->node_id + no_nodes<< std::endl; - #endif - #endif - - // going east -> - manifold::kernel::Manifold::Connect(end_rno, SimpleRouter::PORT_EAST, - rno, SimpleRouter::PORT_WEST, - &SimpleRouter::handle_link_arrival, LATENCY); - #ifdef IRIS_TEST + outFile_data<< "0.0 L " << routers.at(i*x_dim)->node_id + no_nodes<< " " + << routers.at(i*x_dim + x_dim-1)->node_id + no_nodes<< std::endl; + #endif + #endif + + // going east -> + manifold::kernel::Manifold::Connect(end_rno, SimpleRouter::PORT_EAST, + rno, SimpleRouter::PORT_WEST, + &SimpleRouter::handle_link_arrival, LATENCY); + #ifdef IRIS_TEST #if 0 - outFile_data<< "0.0 L " << routers.at(i*x_dim)->node_id + no_nodes<< " " - << routers.at(i*x_dim + x_dim-1)->node_id + no_nodes<< std::endl; - #endif - #endif + outFile_data<< "0.0 L " << routers.at(i*x_dim)->node_id + no_nodes<< " " + << routers.at(i*x_dim + x_dim-1)->node_id + no_nodes<< std::endl; + #endif + #endif } // connect edge nodes north-south for ( uint i=0; iat(i) != node_lp->at((y_dim-1)*x_dim+i)){ - if (routers[i]) - routers[i]->set_port_cross_lp(SimpleRouter::PORT_NORTH); - if (routers[(y_dim-1)*x_dim+i]) - routers[(y_dim-1)*x_dim+i]->set_port_cross_lp(SimpleRouter::PORT_SOUTH); - //cout<<"router: "<at(i)<<" NORTH to router: "<<(y_dim-1)*x_dim+i<<" at lp: "<at((y_dim-1)*x_dim+i)<<" SOUTH "<at(i) != node_lp->at((y_dim-1)*x_dim+i)){ + if (routers[i]) + routers[i]->set_port_cross_lp(SimpleRouter::PORT_NORTH); + if (routers[(y_dim-1)*x_dim+i]) + routers[(y_dim-1)*x_dim+i]->set_port_cross_lp(SimpleRouter::PORT_SOUTH); + //cout<<"router: "<at(i)<<" NORTH to router: "<<(y_dim-1)*x_dim+i<<" at lp: "<at((y_dim-1)*x_dim+i)<<" SOUTH "<node_id + no_nodes<< " " - << routers.at((no_nodes/x_dim-1)*x_dim+i)->node_id + no_nodes<< std::endl; + outFile_data<< "0.0 L " << routers.at(i)->node_id + no_nodes<< " " + << routers.at((no_nodes/x_dim-1)*x_dim+i)->node_id + no_nodes<< std::endl; #endif - #endif + #endif - // going east -> - manifold::kernel::Manifold::Connect(end_rno, SimpleRouter::PORT_SOUTH, - rno, SimpleRouter::PORT_NORTH, - &SimpleRouter::handle_link_arrival, LATENCY); - #ifdef IRIS_TEST + // going east -> + manifold::kernel::Manifold::Connect(end_rno, SimpleRouter::PORT_SOUTH, + rno, SimpleRouter::PORT_NORTH, + &SimpleRouter::handle_link_arrival, LATENCY); + #ifdef IRIS_TEST #if 0 - outFile_data<< "0.0 L " << routers.at(i)->node_id + no_nodes<< " " - << routers.at((no_nodes/x_dim-1)*x_dim+i)->node_id + no_nodes<< std::endl; + outFile_data<< "0.0 L " << routers.at(i)->node_id + no_nodes<< " " + << routers.at((no_nodes/x_dim-1)*x_dim+i)->node_id + no_nodes<< std::endl; #endif - #endif + #endif } } @@ -454,13 +454,13 @@ template void Torus6p :: print_stats(std::ostream& out) { for(unsigned i=0; iprint_stats(out); + if(interfaces[i]) + interfaces[i]->print_stats(out); } for(unsigned i=0; iprint_stats(out); + if(routers[i]) + routers[i]->print_stats(out); } } @@ -468,5 +468,5 @@ void Torus6p :: print_stats(std::ostream& out) } //Iris } //Manifold -#endif +#endif /* ----- #ifndef MANIFOLD_IRIS_TORUS6P_H ----- */ diff --git a/simulator/smp/common/cache_builder.cc b/simulator/smp/common/cache_builder.cc index 27b5f5c..ef66579 100644 --- a/simulator/smp/common/cache_builder.cc +++ b/simulator/smp/common/cache_builder.cc @@ -10,6 +10,13 @@ #include "mcp-cache/MESI_L2_cache.h" #include "sysBuilder_l1l2.h" +#ifdef LIBKITFOX +#include "kitfox_proxy.h" +#include "kitfox_builder.h" +using namespace manifold::kitfox_proxy; +using namespace manifold::uarch; +#endif + using namespace manifold::kernel; using namespace manifold::uarch; using namespace manifold::mcp_cache_namespace; @@ -219,8 +226,29 @@ void MCP_lp_lls_builder :: print_stats(ostream& out) } } +//==================================================================== +//==================================================================== +#ifdef LIBKITFOX +void MCP_lp_lls_builder :: connect_cache_kitfox_proxy(KitFoxBuilder* kitfox_builder) +{ + int kitfox_cid = kitfox_builder->get_component_id(); + for(map::iterator it = m_caches.begin(); it != m_caches.end(); ++it) { + LP_LLS_unit* unit = (*it).second; + int l1_cid = unit->get_llp_cid(); + int l2_cid = unit->get_lls_cid(); + + Manifold :: Connect (l1_cid, L1_cache::PORT_KITFOX, &L1_cache::handle_kitfox_proxy_request>, kitfox_cid, l1_cid, &kitfox_proxy_t::handle_kitfox_proxy_response, Clock::Master(), Clock::Master(), 1, 1); + + Manifold :: Connect (l2_cid, L2_cache::PORT_KITFOX, &L2_cache::handle_kitfox_proxy_request>, kitfox_cid, l2_cid, &kitfox_proxy_t::handle_kitfox_proxy_response, Clock::Master(), Clock::Master(), 1, 1); + if (kitfox_builder->get_kitfox()) { + kitfox_builder->get_kitfox()->add_manifold_node(l1_cid, KitFoxType::l1cache_type); + kitfox_builder->get_kitfox()->add_manifold_node(l2_cid, KitFoxType::l2cache_type); + } + } +} +#endif #if 0 using namespace libconfig; @@ -421,3 +449,28 @@ void MCP_l1l2_builder :: print_stats(ostream& out) } } +//==================================================================== +//==================================================================== +#ifdef LIBKITFOX +void MCP_l1l2_builder :: connect_cache_kitfox_proxy(KitFoxBuilder* kitfox_builder) +{ + int kitfox_cid = kitfox_builder->get_component_id(); + + for(map::iterator it = m_l1_cids.begin(); it != m_l1_cids.end(); ++it) { + int l1_cid = (*it).second; + Manifold :: Connect (l1_cid, L1_cache::PORT_KITFOX, &L1_cache::handle_kitfox_proxy_request>, kitfox_cid, l1_cid, &kitfox_proxy_t::handle_kitfox_proxy_response, Clock::Master(), Clock::Master(), 1, 1); + + if (kitfox_builder->get_kitfox()) + kitfox_builder->get_kitfox()->add_manifold_node(l1_cid, KitFoxType::l1cache_type); + } + + for(map::iterator it = m_l2_cids.begin(); it != m_l2_cids.end(); ++it) { + int l2_cid = (*it).second; + Manifold :: Connect (l2_cid, L2_cache::PORT_KITFOX, &L2_cache::handle_kitfox_proxy_request>, kitfox_cid, l2_cid, &kitfox_proxy_t::handle_kitfox_proxy_response, Clock::Master(), Clock::Master(), 1, 1); + + if (kitfox_builder->get_kitfox()) + kitfox_builder->get_kitfox()->add_manifold_node(l2_cid, KitFoxType::l2cache_type); + } + +} +#endif diff --git a/simulator/smp/common/cache_builder.h b/simulator/smp/common/cache_builder.h index 57be4fc..75d2819 100644 --- a/simulator/smp/common/cache_builder.h +++ b/simulator/smp/common/cache_builder.h @@ -6,6 +6,11 @@ #include "mcp-cache/lp_lls_unit.h" #include "network_builder.h" +#ifdef LIBKITFOX +#include "kitfox_builder.h" +using namespace manifold::kitfox_proxy; +#endif + class SysBuilder_llp; @@ -27,6 +32,10 @@ class CacheBuilder { virtual void print_config(std::ostream&) {} virtual void print_stats(std::ostream&) = 0; +#ifdef LIBKITFOX + virtual void connect_cache_kitfox_proxy(KitFoxBuilder* kitfox_builder) = 0; +#endif + protected: SysBuilder_llp* m_sysBuilder; }; @@ -46,6 +55,10 @@ class MCP_cache_builder : public CacheBuilder { int get_mem_type() { return m_MEM_MSG_TYPE; } int get_credit_type() { return m_CREDIT_MSG_TYPE; } +#ifdef LIBKITFOX + void connect_cache_kitfox_proxy(KitFoxBuilder* kitfox_builder) {} +#endif + protected: manifold::mcp_cache_namespace::cache_settings l1_cache_parameters; @@ -79,6 +92,10 @@ class MCP_lp_lls_builder : public MCP_cache_builder { void print_config(std::ostream&); void print_stats(std::ostream&); +#ifdef LIBKITFOX + void connect_cache_kitfox_proxy(KitFoxBuilder* kitfox_builder); +#endif + private: std::map m_caches; @@ -104,6 +121,10 @@ class MCP_l1l2_builder : public MCP_cache_builder { std::map& get_l1_cids() { return m_l1_cids; } +#ifdef LIBKITFOX + void connect_cache_kitfox_proxy(KitFoxBuilder* kitfox_builder); +#endif + private: std::map m_l1_cids; //map node id to cid diff --git a/simulator/smp/common/proc_builder.cc b/simulator/smp/common/proc_builder.cc index 1c10681..7be0b0a 100644 --- a/simulator/smp/common/proc_builder.cc +++ b/simulator/smp/common/proc_builder.cc @@ -515,7 +515,7 @@ void Spx_builder :: connect_proc_kitfox_proxy(KitFoxBuilder* kitfox_builder) kitfox_cid, proc_cid, &kitfox_proxy_t::handle_kitfox_proxy_response, Clock::Master(), Clock::Master(), 1, 1); if (kitfox_builder->get_kitfox()) - kitfox_builder->get_kitfox()->add_manifold_node(proc_cid); + kitfox_builder->get_kitfox()->add_manifold_node(proc_cid, KitFoxType::core_type); } } #endif diff --git a/uarch/DestMap.h b/uarch/DestMap.h index e8e047c..9b26759 100644 --- a/uarch/DestMap.h +++ b/uarch/DestMap.h @@ -43,7 +43,7 @@ class PageBasedMap : public manifold::uarch::DestMap { int get_idx(int m_id) { - for (int i = 0; i < m_nodes.size(); i++) { + for (unsigned int i = 0; i < m_nodes.size(); i++) { if (m_nodes[i] == m_id) return i; } diff --git a/uarch/kitfoxCounter.h b/uarch/kitfoxCounter.h index 9f279cd..4092caf 100644 --- a/uarch/kitfoxCounter.h +++ b/uarch/kitfoxCounter.h @@ -11,7 +11,8 @@ namespace uarch { enum KitFoxType { null_type = 0, core_type, - cache_type, + l1cache_type, + l2cache_type, network_type, dram_type, num_types @@ -221,7 +222,44 @@ class pipeline_counter_t counter_t execute, undiff; }; +class cache_counter_t +{ +public: + cache_counter_t() { clear(); } + ~cache_counter_t() {} + + void clear() + { + cache.clear(); + missbuf.clear(); prefetch.clear(); + linefill.clear(); writeback.clear(); + undiff.clear(); + } + + void operator=(const cache_counter_t &c) + { + cache = c.cache; + missbuf = c.missbuf; prefetch = c.prefetch; + linefill = c.linefill; writeback = c.writeback; + undiff = c.undiff; + } + void operator*=(const libKitFox::Count &c) + { + cache = cache*c; + missbuf = missbuf*c; prefetch = prefetch*c; + linefill = linefill*c; writeback = writeback*c; + undiff = undiff*c; + } + + // cache_banks + counter_t cache; + // cache queues + counter_t missbuf, prefetch; + counter_t linefill, writeback; + // undiff + counter_t undiff; +}; } // namespace uarch } //namespace manifold From 24950db9ccdd878ed1ce6f67abd83011d0ee29df Mon Sep 17 00:00:00 2001 From: sixshotx Date: Mon, 6 Feb 2017 15:55:48 -0500 Subject: [PATCH 2/5] add performance counters in mcp-cache, and update the kitfox configuration file --- models/cache/mcp-cache/L1_cache.cpp | 56 + models/cache/mcp-cache/L2_cache.cpp | 40 +- models/cache/mcp-cache/LLP_cache.h | 2 +- models/cache/mcp-cache/LLS_cache.h | 3 +- models/kitfox/proxy/kitfox_proxy.cc | 6 + models/kitfox/proxy/kitfox_proxy.h | 8 +- simulator/smp/common/sysBuilder_llp.cc | 1 + .../smp/config/conf2x2_spx_t6p_llp.a64.cfg | 2 +- simulator/smp/config/kitfox-4core.config | 1579 ++++++++++++++++- uarch/kitfoxCounter.h | 7 +- 10 files changed, 1685 insertions(+), 19 deletions(-) diff --git a/models/cache/mcp-cache/L1_cache.cpp b/models/cache/mcp-cache/L1_cache.cpp index 9c48032..abd8bd1 100644 --- a/models/cache/mcp-cache/L1_cache.cpp +++ b/models/cache/mcp-cache/L1_cache.cpp @@ -146,6 +146,23 @@ void L1_cache :: process_processor_request (cache_req *request, bool first) DBG_L1_CACHE_TICK_ID( cout, "###### " << " process_processor_request(): addr= " <addr <op_type==OpMemLd) ? " LD" : " ST") << "\n" ); +#ifdef LIBKITFOX + if(request->op_type==OpMemLd) { + counter.cache.read += 3; + counter.cache.search += 3; + counter.cache.read_tag += 3; + } else { + counter.cache.write += 3; + counter.cache.search += 3; + counter.cache.read_tag += 3; + counter.cache.write_tag += 3; + } + counter.tlb.search += 3; + counter.tlb.read += 3; + counter.tlb.write += 3; + counter.tlb.read_tag += 3; +#endif + /** This code may be modified in the future to enable parallel events while transient (read while waiting for previous read-unblock). For the time being, just assume no parallel events for a single address */ if (mshr->has_match(request->addr)) { @@ -189,6 +206,17 @@ void L1_cache :: process_processor_request (cache_req *request, bool first) if (!my_table->has_match (request->addr)) { DBG_L1_CACHE(cout, " miss.\n"); +#ifdef LIBKITFOX + counter.missbuf.search += 3; + counter.missbuf.read_tag += 3; + counter.missbuf.write_tag += 3; + counter.missbuf.write += 3; + counter.prefetch.search += 3; + counter.prefetch.read_tag += 3; + counter.prefetch.write_tag += 3; + counter.prefetch.write += 3; +#endif + /** Check if an invalid block exists already or the LRU block can begin eviction. */ hash_table_entry = my_table->reserve_block_for (request->addr); @@ -200,6 +228,16 @@ void L1_cache :: process_processor_request (cache_req *request, bool first) DBG_L1_CACHE(cout, " start eviction line= " <get_replacement_entry(request->addr)->get_line_addr() <rw == 0) { + counter.cache.read += 3; + counter.cache.search += 3; + counter.cache.read_tag += 3; + } else { + counter.cache.write += 3; + counter.cache.search += 3; + counter.cache.read_tag += 3; + counter.cache.write_tag += 3; + } + + counter.tlb.search += 3; + counter.tlb.read += 3; + counter.tlb.write += 3; + counter.tlb.read_tag += 3; +#endif + if(request->type == Coh_msg::COH_RPLY) { DBG_L1_CACHE(cout, " it is a reply.\n"); diff --git a/models/cache/mcp-cache/L2_cache.cpp b/models/cache/mcp-cache/L2_cache.cpp index 69f9037..d68b328 100644 --- a/models/cache/mcp-cache/L2_cache.cpp +++ b/models/cache/mcp-cache/L2_cache.cpp @@ -116,7 +116,15 @@ void L2_cache :: process_incoming_coh(Coh_msg* request) { DBG_L2_CACHE_TICK_ID(cout, "###### handle_incoming()_coh, srcID= " << request->src_id << " type= " << int(request->type) << " addr=(" <addr <rw == 1) { //write + counter.cache.write_tag += 100; + counter.cache.write += 100; + } else + counter.cache.read += 100; +#endif if(request->type == Coh_msg :: COH_REQ) { stats_num_reqs++; @@ -141,6 +149,15 @@ void L2_cache :: process_mem_resp (Mem_msg *request) { DBG_L2_CACHE_TICK_ID(cout, "######## process_mem_resp(), addr= " << hex << request->addr << dec << endl); +#ifdef LIBKITFOX + counter.cache.read_tag += 100; + counter.cache.search += 100; + if (request->op_type == OpMemSt) { //write + counter.cache.write_tag += 100; + counter.cache.write += 100; + } else + counter.cache.read += 100; +#endif if(request->op_type == OpMemLd) { assert(l2_map); @@ -225,6 +242,17 @@ void L2_cache::process_client_request (Coh_msg* request, bool first) { DBG_L2_CACHE(cout, " L2_cache: request is miss.\n"); +#ifdef LIBKITFOX + counter.missbuf.search += 35; + counter.missbuf.read_tag += 35; + counter.missbuf.write_tag += 35; + counter.missbuf.write += 35; + counter.prefetch.search += 35; + counter.prefetch.read_tag += 35; + counter.prefetch.write_tag += 35; + counter.prefetch.write += 35; +#endif + //first check if request is an invalidation request; a missed invalidation request should //be ignored. if(managers[0]->is_invalidation_request(request)) { @@ -259,6 +287,16 @@ void L2_cache::process_client_request (Coh_msg* request, bool first) assert(mshr->has_match(victim->get_line_addr()) == false); //victim shouldn't have an mshr entry. start_eviction(victim_manager, request); + +#ifdef LIBKITFOX + counter.linefill.search += 35; + counter.linefill.write_tag += 35; + counter.linefill.write += 35; + counter.writeback.search += 35; + counter.writeback.write_tag += 35; + counter.writeback.write += 35; +#endif + } else { diff --git a/models/cache/mcp-cache/LLP_cache.h b/models/cache/mcp-cache/LLP_cache.h index 2e6fed0..b7c567c 100644 --- a/models/cache/mcp-cache/LLP_cache.h +++ b/models/cache/mcp-cache/LLP_cache.h @@ -15,7 +15,7 @@ class LLP_cache : public L1_cache { public: friend class MuxDemux; - enum {PORT_LOCAL_L2=2}; + enum {PORT_LOCAL_L2=3}; // enum {LLP_ID=234, LLS_ID}; diff --git a/models/cache/mcp-cache/LLS_cache.h b/models/cache/mcp-cache/LLS_cache.h index 7f61265..da128dc 100644 --- a/models/cache/mcp-cache/LLS_cache.h +++ b/models/cache/mcp-cache/LLS_cache.h @@ -15,7 +15,8 @@ class LLS_cache : public L2_cache { public: friend class MuxDemux; - enum {PORT_L1=0, PORT_LOCAL_L1}; + // enum {PORT_L1=0, PORT_LOCAL_L1=2}; + enum {PORT_LOCAL_L1=3}; LLS_cache (int nid, const cache_settings&, const L2_cache_settings&); ~LLS_cache (void); diff --git a/models/kitfox/proxy/kitfox_proxy.cc b/models/kitfox/proxy/kitfox_proxy.cc index dbeeb7a..723990d 100644 --- a/models/kitfox/proxy/kitfox_proxy.cc +++ b/models/kitfox/proxy/kitfox_proxy.cc @@ -629,6 +629,12 @@ void kitfox_proxy_t::calculate_power(manifold::uarch::cache_counter_t c, manifol assert(comp_id != INVALID_COMP_ID); kitfox->calculate_power(comp_id, t, m_clk->period, c.cache); + // tlb + comp = prefix + ".tlb"; + comp_id = kitfox->get_component_id(comp); + assert(comp_id != INVALID_COMP_ID); + kitfox->calculate_power(comp_id, t, m_clk->period, c.cache); + // prefetch comp = prefix + ".prefetch"; comp_id = kitfox->get_component_id(comp); diff --git a/models/kitfox/proxy/kitfox_proxy.h b/models/kitfox/proxy/kitfox_proxy.h index fa164bb..2f00bf2 100644 --- a/models/kitfox/proxy/kitfox_proxy.h +++ b/models/kitfox/proxy/kitfox_proxy.h @@ -104,22 +104,22 @@ void kitfox_proxy_t::handle_kitfox_proxy_response(int temp, kitfox_proxy_request assert(package_id != INVALID_COMP_ID); kitfox->calculate_temperature(package_id, Req->get_time(), m_clk->period); - for(unsigned int i = 0; i < manifold_node.size(); i++){ + for(unsigned int i = 0, core_id = 0, l1_id = 0, l2_id = 0; i < manifold_node.size(); i++){ libKitFox::Kelvin t; string partition; libKitFox::Comp_ID par_id; switch (manifold_node[i].second) { case manifold::uarch::KitFoxType::core_type: { - partition = "package.core_die.core" + std::to_string(i); + partition = "package.core_die.core" + std::to_string(core_id++); break; } case manifold::uarch::KitFoxType::l1cache_type: { - partition = "package.core_die.l1cache" + std::to_string(i); + partition = "package.core_die.l1cache" + std::to_string(l1_id++); break; } case manifold::uarch::KitFoxType::l2cache_type: { - partition = "package.llc_die.cache" + std::to_string(i); + partition = "package.llc_die.cache" + std::to_string(l2_id++); break; } default: diff --git a/simulator/smp/common/sysBuilder_llp.cc b/simulator/smp/common/sysBuilder_llp.cc index 1ca2d55..21175bb 100644 --- a/simulator/smp/common/sysBuilder_llp.cc +++ b/simulator/smp/common/sysBuilder_llp.cc @@ -666,6 +666,7 @@ void SysBuilder_llp :: connect_components() #ifdef LIBKITFOX if(m_kitfox_builder){ m_proc_builder->connect_proc_kitfox_proxy(m_kitfox_builder); + m_cache_builder->connect_cache_kitfox_proxy(m_kitfox_builder); } #endif } diff --git a/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg b/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg index 8cc1278..5fad502 100644 --- a/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg +++ b/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg @@ -1,4 +1,4 @@ -simulation_stop = 5e6; +simulation_stop = 50e6; default_clock = 1e9; qsim_interrupt_handler_clock = 1e3; kitfox_config = "../config/kitfox-4core.config"; diff --git a/simulator/smp/config/kitfox-4core.config b/simulator/smp/config/kitfox-4core.config index 32cfb92..236286e 100644 --- a/simulator/smp/config/kitfox-4core.config +++ b/simulator/smp/config/kitfox-4core.config @@ -18,7 +18,7 @@ component = { thermal_analysis_type = "steady"; ambient_temperature = 300.0; temperature = 300.0; - chip_width = 5.0e-3; // 5mm + chip_width = 6.0e-3; // 5mm chip_height = 5.0e-3; // 5mm grid_rows = 50; grid_columns = 50; @@ -65,6 +65,21 @@ component = { }; }; }; + LLC_IC: { + layer: { + // IMPORTANT: Layers must be listed sequentially from the top to bottom. + SOURCE_LAYER: { + height = 20e-6; + material = "SILICON"; + is_source_layer = true; + }; + BOTTOM_LAYER: { + height = 100e-6; + material = "SILICON"; + is_source_layer = false; + }; + }; + }; }; stack: { @@ -75,6 +90,10 @@ component = { material = "SILICON"; is_source_layer = false; }; + llc_die: { + type = "die"; + die = "LLC_IC"; + }; core_die: { type = "die"; die = "PROC_IC"; @@ -84,7 +103,15 @@ component = { floorplan = ["package.core_die.core0", "package.core_die.core1", "package.core_die.core2", - "package.core_die.core3"]; + "package.core_die.core3", + "package.core_die.l1cache0", + "package.core_die.l1cache1", + "package.core_die.l1cache2", + "package.core_die.l1cache3", + "package.llc_die.cache0", + "package.llc_die.cache1", + "package.llc_die.cache2", + "package.llc_die.cache3"]; }; /* End of "package" library */ component: { // package component @@ -1168,7 +1195,6 @@ component = { /************************************* Undifferentiated Core (Non-Functional Portion): - scaling = 0.1 (LSU is assumed to take 10% of Undifferentiated Core area) *************************************/ undiff: { library: { @@ -1176,6 +1202,7 @@ component = { energy_model = "undiff_core"; pipeline_stages = 32; issue_width = 6; + scaling = 0.41; }; }; // package.core_die.core0.undiff }; // package.core_die.core0.component @@ -1239,7 +1266,7 @@ component = { # target_MTTF = 5.048524800e9; // 5 years (in seconds) x 32 cores dimension: { - left = 2.5e-3; + left = 3.5e-3; bottom = 0.0e-3; width = 2.5e-3; height = 2.5e-3; @@ -2254,7 +2281,6 @@ component = { /************************************* Undifferentiated Core (Non-Functional Portion): - scaling = 0.1 (LSU is assumed to take 10% of Undifferentiated Core area) *************************************/ undiff: { library: { @@ -2262,6 +2288,7 @@ component = { energy_model = "undiff_core"; pipeline_stages = 32; issue_width = 6; + scaling = 0.41; }; }; // package.core_die.core1.undiff }; // package.core_die.core1.component @@ -3340,7 +3367,6 @@ component = { /************************************* Undifferentiated Core (Non-Functional Portion): - scaling = 0.1 (LSU is assumed to take 10% of Undifferentiated Core area) *************************************/ undiff: { library: { @@ -3348,6 +3374,7 @@ component = { energy_model = "undiff_core"; pipeline_stages = 32; issue_width = 6; + scaling = 0.41; }; }; // package.core_die.core2.undiff }; // package.core_die.core2.component @@ -3411,7 +3438,7 @@ component = { # target_MTTF = 5.048524800e9; // 5 years (in seconds) x 32 cores dimension: { - left = 2.5e-3; + left = 3.5e-3; bottom = 2.5e-3; width = 2.5e-3; height = 2.5e-3; @@ -4426,7 +4453,6 @@ component = { /************************************* Undifferentiated Core (Non-Functional Portion): - scaling = 0.1 (LSU is assumed to take 10% of Undifferentiated Core area) *************************************/ undiff: { library: { @@ -4434,13 +4460,1546 @@ component = { energy_model = "undiff_core"; pipeline_stages = 32; issue_width = 6; + scaling = 0.41; }; }; // package.core_die.core3.undiff }; // package.core_die.core3.component }; // package.core_die.core3 - }; /* End of "package.core_die" sub-components */ - }; /* End of "package.core_die" */ + l1cache0: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache0 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "core"; + core_type = "ooo"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + opt_for_clk = true; + embedded = false; + longer_channel_device = false; + energy_scaling = 3.0; + + dimension: { + left = 2.5e-3; + bottom = 0.0e-3; + width = 0.5e-3; + height = 2.5e-3; + die_index = 0; + die_name = "core_die"; + }; + }; // package.core_die.l1cache0.library + + /************************************* + package.core_die.l1cache0 components + *************************************/ + component: { + /************************************* + L1 Cache Array: + 8-byte line size (64-bit address) + 8-way assoc + 32KB size + 1024 sets + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 8; + size = 32768; + tag_width = 51; + num_rw_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache0.cache + + /************************************* + L1 Cache TLB: + 5-byte line size (64-bit address) + 640 entires + 4K page size + tag bits = virtual addreess(64 bits) - offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 640; + tag_width = 58; + num_rd_ports = 2; + num_wr_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache0.tlb + + /************************************* + L1 Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 2; + access_time = 2; + access_mode = "fast"; + }; + }; // package.core_die.l1cache0.prefetch + + /************************************* + L1 Cache Missbuf: + 8-byte line size (64-bit address) + 640 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 51; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache0.missbuf + + /************************************* + L1 Cache Linefill: + 8-byte line size (64-bit address) + 512 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 512; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache0.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache0.writeback + + /************************************* + L1 Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.11; + }; + }; // package.core_die.l1cache0.undiff + }; // package.core_die.l1cache0.component + }; // package.core_die.l1cache0 + + l1cache1: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "core"; + core_type = "ooo"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + opt_for_clk = true; + embedded = false; + longer_channel_device = false; + energy_scaling = 3.0; + + dimension: { + left = 3.0e-3; + bottom = 0.0e-3; + width = 0.5e-3; + height = 2.5e-3; + die_index = 0; + die_name = "core_die"; + }; + }; // package.core_die.l1cache1.library + + /************************************* + package.core_die.l1cache1 components + *************************************/ + component: { + /************************************* + L1 Cache Array: + 8-byte line size (64-bit address) + 8-way assoc + 32KB size + 1024 sets + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 8; + size = 32768; + tag_width = 51; + num_rw_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache1.cache + + /************************************* + L1 Cache TLB: + 5-byte line size (64-bit address) + 640 entires + 4K page size + tag bits = virtual addreess(64 bits) - offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 640; + tag_width = 58; + num_rd_ports = 2; + num_wr_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache1.tlb + + /************************************* + L1 Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 2; + access_time = 2; + access_mode = "fast"; + }; + }; // package.core_die.l1cache1.prefetch + + /************************************* + L1 Cache Missbuf: + 8-byte line size (64-bit address) + 640 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 51; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache1.missbuf + + /************************************* + L1 Cache Linefill: + 8-byte line size (64-bit address) + 512 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 512; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache1.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache1.writeback + + /************************************* + L1 Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.11; + }; + }; // package.core_die.l1cache1.undiff + }; // package.core_die.l1cache1.component + }; // package.core_die.l1cache1 + + l1cache2: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "core"; + core_type = "ooo"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + opt_for_clk = true; + embedded = false; + longer_channel_device = false; + energy_scaling = 3.0; + + dimension: { + left = 2.5e-3; + bottom = 2.5e-3; + width = 0.5e-3; + height = 2.5e-3; + die_index = 0; + die_name = "core_die"; + }; + }; // package.core_die.l1cache2.library + + /************************************* + package.core_die.l1cache2 components + *************************************/ + component: { + /************************************* + L1 Cache Array: + 8-byte line size (64-bit address) + 8-way assoc + 32KB size + 1024 sets + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 8; + size = 32768; + tag_width = 51; + num_rw_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache2.cache + + /************************************* + L1 Cache TLB: + 5-byte line size (64-bit address) + 640 entires + 4K page size + tag bits = virtual addreess(64 bits) - offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 640; + tag_width = 58; + num_rd_ports = 2; + num_wr_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache2.tlb + + /************************************* + L1 Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 2; + access_time = 2; + access_mode = "fast"; + }; + }; // package.core_die.l1cache2.prefetch + + /************************************* + L1 Cache Missbuf: + 8-byte line size (64-bit address) + 640 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 51; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache2.missbuf + + /************************************* + L1 Cache Linefill: + 8-byte line size (64-bit address) + 512 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 512; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache2.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache2.writeback + + /************************************* + L1 Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.11; + }; + }; // package.core_die.l1cache2.undiff + }; // package.core_die.l1cache2.component + }; // package.core_die.l1cache2 + + l1cache3: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "core"; + core_type = "ooo"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + opt_for_clk = true; + embedded = false; + longer_channel_device = false; + energy_scaling = 3.0; + + dimension: { + left = 3.0e-3; + bottom = 2.5e-3; + width = 0.5e-3; + height = 2.5e-3; + die_index = 0; + die_name = "core_die"; + }; + }; // package.core_die.l1cache3.library + + /************************************* + package.core_die.l1cache3 components + *************************************/ + component: { + /************************************* + L1 Cache Array: + 8-byte line size (64-bit address) + 8-way assoc + 32KB size + 1024 sets + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 8; + size = 32768; + tag_width = 51; + num_rw_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache3.cache + + /************************************* + L1 Cache TLB: + 5-byte line size (64-bit address) + 640 entires + 4K page size + tag bits = virtual addreess(64 bits) - offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 640; + tag_width = 58; + num_rd_ports = 2; + num_wr_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache3.tlb + + /************************************* + L1 Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 2; + access_time = 2; + access_mode = "fast"; + }; + }; // package.core_die.l1cache3.prefetch + + /************************************* + L1 Cache Missbuf: + 8-byte line size (64-bit address) + 640 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 51; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache3.missbuf + + /************************************* + L1 Cache Linefill: + 8-byte line size (64-bit address) + 512 entries + tag bits = virtual addreess(64 bits) - set(10 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 512; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 8; + access_time = 3; + access_mode = "fast"; + }; + }; // package.core_die.l1cache3.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 256 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 51; + num_rw_ports = 2; + num_search_ports = 2; + cycle_time = 3; + access_time = 3; + access_mode = "normal"; + }; + }; // package.core_die.l1cache3.writeback + + /************************************* + L1 Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.11; + }; + }; // package.core_die.l1cache3.undiff + }; // package.core_die.l1cache3.component + }; // package.core_die.l1cache3 + + }; /* End of "package.core_die" sub-components */ + }; /* End of "package.core_die" */ + + + /* "package.llc_die" component */ + llc_die: { + /* "package.llc_die" includes the following components + as its sub-components (children). */ + component: { + + cache0: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "llc"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + longer_channel_device = false; + energy_scaling = 2.0; + + dimension: { + left = 0.0e-3; + bottom = 0.0e-3; + width = 3.0e-3; + height = 2.5e-3; + die_index = 1; + die_name = "llc_die"; + }; + }; // package.llc_die.cache0.library + + /************************************* + package.llc_die.cache0 components + *************************************/ + component: { + /************************************* + LLC Cache Array: + 8-byte line size (64-bit address) + 16-way assoc + 2MB size + 16K sets + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 16; + nbanks = 16; + size = 2097152; + tag_width = 47; + num_rw_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "sequential"; + }; + }; // package.llc_die.cache0.cache + + /************************************* + LLC Cache TLB: + 5-byte line size (64-bit address) + 0 entires + tag bits = virtual addreess(64 bits) - page offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 1; + tag_width = 58; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache0.tlb + + /************************************* + LLC Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache0.prefetch + + /************************************* + LLC Cache Missbuf: + 8-byte line size (64-bit address) + 272 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache0.missbuf + + /************************************* + LLC Cache Linefill: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache0.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache0.writeback + + /************************************* + LLC Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.48; + }; + }; // package.llc_die.cache0.undiff + }; // package.llc_die.cache0.component + }; // package.llc_die.cache0 + + cache1: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "llc"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + longer_channel_device = false; + energy_scaling = 2.0; + + dimension: { + left = 3.0e-3; + bottom = 0.0e-3; + width = 3.0e-3; + height = 2.5e-3; + die_index = 1; + die_name = "llc_die"; + }; + }; // package.llc_die.cache1.library + + /************************************* + package.llc_die.cache1 components + *************************************/ + component: { + /************************************* + LLC Cache Array: + 8-byte line size (64-bit address) + 16-way assoc + 2MB size + 16K sets + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 16; + nbanks = 16; + size = 2097152; + tag_width = 47; + num_rw_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "sequential"; + }; + }; // package.llc_die.cache1.cache + + /************************************* + LLC Cache TLB: + 5-byte line size (64-bit address) + 0 entires + tag bits = virtual addreess(64 bits) - page offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 1; + tag_width = 58; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache1.tlb + + /************************************* + LLC Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache1.prefetch + + /************************************* + LLC Cache Missbuf: + 8-byte line size (64-bit address) + 272 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache1.missbuf + + /************************************* + LLC Cache Linefill: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache1.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache1.writeback + + /************************************* + LLC Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.48; + }; + }; // package.llc_die.cache1.undiff + }; // package.llc_die.cache1.component + }; // package.llc_die.cache1 + + cache2: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "llc"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + longer_channel_device = false; + energy_scaling = 2.0; + + dimension: { + left = 0.0e-3; + bottom = 2.5e-3; + width = 3.0e-3; + height = 2.5e-3; + die_index = 1; + die_name = "llc_die"; + }; + }; // package.llc_die.cache2.library + + /************************************* + package.llc_die.cache2 components + *************************************/ + component: { + /************************************* + LLC Cache Array: + 8-byte line size (64-bit address) + 16-way assoc + 2MB size + 16K sets + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 16; + nbanks = 16; + size = 2097152; + tag_width = 47; + num_rw_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "sequential"; + }; + }; // package.llc_die.cache2.cache + + /************************************* + LLC Cache TLB: + 5-byte line size (64-bit address) + 0 entires + tag bits = virtual addreess(64 bits) - page offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 1; + tag_width = 58; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache2.tlb + + /************************************* + LLC Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache2.prefetch + + /************************************* + LLC Cache Missbuf: + 8-byte line size (64-bit address) + 272 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache2.missbuf + + /************************************* + LLC Cache Linefill: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache2.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache2.writeback + + /************************************* + LLC Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.48; + }; + }; // package.llc_die.cache2.undiff + }; // package.llc_die.cache2.component + }; // package.llc_die.cache2 + + cache3: { + //pthread_init = true; + /************************************* + These library settings are commonly + applied to l1cache1 components. + *************************************/ + library: { + model = "none"; + feature_size = 16e-9; + voltage = 0.8; + clock_frequency = 2.0e9; + component_type = "llc"; + wire_type = "global"; + wiring_type = "global"; + device_type = "hp"; + interconnect_projection = "aggressive"; + longer_channel_device = false; + energy_scaling = 2.0; + + dimension: { + left = 3.0e-3; + bottom = 2.5e-3; + width = 3.0e-3; + height = 2.5e-3; + die_index = 1; + die_name = "llc_die"; + }; + }; // package.llc_die.cache3.library + + /************************************* + package.llc_die.cache3 components + *************************************/ + component: { + /************************************* + LLC Cache Array: + 8-byte line size (64-bit address) + 16-way assoc + 2MB size + 16K sets + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + cache: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 16; + nbanks = 16; + size = 2097152; + tag_width = 47; + num_rw_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "sequential"; + }; + }; // package.llc_die.cache3.cache + + /************************************* + LLC Cache TLB: + 5-byte line size (64-bit address) + 1 entires + tag bits = virtual addreess(64 bits) - page offset (12 bits) + overhead (6 bits) + *************************************/ + tlb: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 5; + assoc = 0; + size = 1; + tag_width = 58; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache3.tlb + + /************************************* + LLC Cache Prefetch Buffer: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + prefetch: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 35; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache3.prefetch + + /************************************* + LLC Cache Missbuf: + 8-byte line size (64-bit address) + 272 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + missbuf: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 640; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache3.missbuf + + /************************************* + LLC Cache Linefill: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) - set(14 bits) - offset(3 bits) + *************************************/ + linefill: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 1024; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache3.linefill + + /************************************* + L1 Cache Writeback: + 8-byte line size (64-bit address) + 1024 entries + tag bits = virtual addreess(64 bits) + overhead (5 bits) + *************************************/ + writeback: { + library: { + model = "mcpat"; + energy_model = "array"; + energy_submodel = "cache"; + line_size = 8; + assoc = 0; + size = 256; + tag_width = 47; + num_rw_ports = 1; + num_search_ports = 1; + cycle_time = 16; + access_time = 35; + access_mode = "normal"; + }; + }; // package.llc_die.cache3.writeback + + /************************************* + LLC Cache Undiff + *************************************/ + undiff: { + library: { + model = "mcpat"; + energy_model = "undiff_core"; + pipeline_stages = 32; + issue_width = 6; + scaling = 0.48; + }; + }; // package.llc_die.cache3.undiff + }; // package.llc_die.cache3.component + }; // package.llc_die.cache3 + + }; /* End of "package.llc_die" sub-components */ + }; /* End of "package.llc_die" */ + + }; /* End of package sub-components */ }; // package }; // config.component diff --git a/uarch/kitfoxCounter.h b/uarch/kitfoxCounter.h index 4092caf..5d0bc4e 100644 --- a/uarch/kitfoxCounter.h +++ b/uarch/kitfoxCounter.h @@ -231,14 +231,16 @@ class cache_counter_t void clear() { cache.clear(); + tlb.clear(); missbuf.clear(); prefetch.clear(); linefill.clear(); writeback.clear(); undiff.clear(); - } + } void operator=(const cache_counter_t &c) { cache = c.cache; + tlb = c.tlb; missbuf = c.missbuf; prefetch = c.prefetch; linefill = c.linefill; writeback = c.writeback; undiff = c.undiff; @@ -247,6 +249,7 @@ class cache_counter_t void operator*=(const libKitFox::Count &c) { cache = cache*c; + tlb = tlb*c; missbuf = missbuf*c; prefetch = prefetch*c; linefill = linefill*c; writeback = writeback*c; undiff = undiff*c; @@ -254,6 +257,8 @@ class cache_counter_t // cache_banks counter_t cache; + // tlb + counter_t tlb; // cache queues counter_t missbuf, prefetch; counter_t linefill, writeback; From de4b210e55218515fb285e34133867a7c44bce50 Mon Sep 17 00:00:00 2001 From: sixshotx Date: Mon, 6 Feb 2017 19:12:14 -0500 Subject: [PATCH 3/5] fix newline in README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 4dd4966..d705600 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,7 @@ A Parallel Simulation Framework For Multicore Systems **Installation Instructions** -If you are on Ubuntu (>= 14.04), just run setup.sh script in the root directory -after QSim is installed. This will link the manifold to the QSim library specifi -ed by $QSIM_PREFIX variable, download multi-thread benchmarks supported by manif -old, and build the manifold components and simulators. +If you are on Ubuntu (>= 14.04), just run setup.sh script in the root directory after QSim is installed. This will link the manifold to the QSim library specified by $QSIM_PREFIX variable, download multi-thread benchmarks supported by manifold, and build the manifold components and simulators. Manifold now integrates [KitFox multi-physics library](http://manifold.gatech.edu/projects/kitfox) to simulate physical phenomena including power, thermal and lifetime reliability models. After KitFox framework is installed and exported to system variable $KITFOX_PREFIX, the setup.sh script will configure manifold to enable KitfoxProxy that interacts with the given KitFox framekwork. The lastest KitFox source code tarball can be found [here](http://manifold.gatech.edu/wp-content/uploads/2017/01/kitfox-v1.1.tar.gz). Please refer to [KitFox user manual](http://manifold.gatech.edu/wp-content/uploads/2015/04/kitfox-v1.0.0.pdf) for details. From 64610bd5e67e47b9b66726dbebca0f29b2b1f18a Mon Sep 17 00:00:00 2001 From: sixshotx Date: Mon, 6 Feb 2017 19:33:46 -0500 Subject: [PATCH 4/5] move the statefile args into manifold config file --- setup.sh | 2 +- simulator/smp/QsimProxy/smp_l1l2.cc | 2 +- simulator/smp/QsimProxy/smp_llp.cc | 6 +++--- simulator/smp/common/qsim_builder.cc | 17 ++++++++------- simulator/smp/common/qsim_builder.h | 6 +++--- simulator/smp/common/sysBuilder_llp.cc | 8 +++---- simulator/smp/common/sysBuilder_llp.h | 4 ++-- .../smp/config/conf2x2_spx_t6p_llp.a64.cfg | 21 ++++++++++--------- simulator/smp/config/conf2x2_spx_t6p_llp.cfg | 21 ++++++++++--------- .../smp/config/conf2x3_spx_torus_l1l2.cfg | 1 + .../smp/config/conf2x3_spx_torus_llp.a64.cfg | 1 + .../smp/config/conf2x3_spx_torus_llp.cfg | 1 + .../smp/config/conf2x3_zesto_torus_l1l2.cfg | 1 + .../smp/config/conf2x3_zesto_torus_llp.cfg | 1 + simulator/smp/config/conf4x4_spx_t6p_llp.cfg | 1 + .../config/conf4x5_simpleproc_torus_llp.cfg | 1 + .../smp/config/conf4x5_spx_torus_llp.cfg | 1 + .../smp/config/conf4x5_zesto_torus_l1l2.cfg | 1 + .../smp/config/conf4x5_zesto_torus_llp.cfg | 1 + simulator/smp/config/kitfox-4core.config | 8 +++---- 20 files changed, 59 insertions(+), 46 deletions(-) diff --git a/setup.sh b/setup.sh index c4e70ac..08d563f 100755 --- a/setup.sh +++ b/setup.sh @@ -85,5 +85,5 @@ if [ $? -eq "0" ]; then echo -e "\n${bold}Manifold built successfully!${normal}\n\n" echo -e "Simulation Example:" echo -e "cd simulator/smp/QsimProxy" - echo -e "smp_llp ../config/conf2x3_spx_torus_llp.cfg ../state/state.4 ../benchmark/graphbig_x86/bc.tar" + echo -e "./smp_llp ../config/conf2x2_spx_t6p_llp.cfg ../benchmark/graphbig_x86/bc.tar" fi diff --git a/simulator/smp/QsimProxy/smp_l1l2.cc b/simulator/smp/QsimProxy/smp_l1l2.cc index d384f0c..2ab3181 100644 --- a/simulator/smp/QsimProxy/smp_l1l2.cc +++ b/simulator/smp/QsimProxy/smp_l1l2.cc @@ -68,7 +68,7 @@ int main(int argc, char** argv) std::cout.rdbuf(DBG_LOG.rdbuf()); // redirect cout #endif - sysBuilder.build_system(args, argv[2], argv[3], N_LPs, SysBuilder_llp::PART_1); + sysBuilder.build_system(args, argv[2], N_LPs, SysBuilder_llp::PART_1); //========================================================================== diff --git a/simulator/smp/QsimProxy/smp_llp.cc b/simulator/smp/QsimProxy/smp_llp.cc index 226b46e..7775641 100644 --- a/simulator/smp/QsimProxy/smp_llp.cc +++ b/simulator/smp/QsimProxy/smp_llp.cc @@ -44,8 +44,8 @@ using namespace manifold::kernel; int main(int argc, char** argv) { - if(argc != 4) { - cerr << "Usage: mpirun -np " << argv[0] << " " << endl; + if(argc != 3) { + cerr << "Usage: mpirun -np " << argv[0] << " " << endl; exit(1); } @@ -78,7 +78,7 @@ int main(int argc, char** argv) std::cout.rdbuf(DBG_LOG.rdbuf()); // redirect cout #endif - sysBuilder.build_system(args, argv[2], argv[3], N_LPs, SysBuilder_llp::PART_1); + sysBuilder.build_system(args, argv[2], N_LPs, SysBuilder_llp::PART_1); //========================================================================== diff --git a/simulator/smp/common/qsim_builder.cc b/simulator/smp/common/qsim_builder.cc index a291314..88b95c7 100644 --- a/simulator/smp/common/qsim_builder.cc +++ b/simulator/smp/common/qsim_builder.cc @@ -9,13 +9,12 @@ using namespace manifold::uarch; using namespace manifold::qsim_proxy; using namespace Qsim; -void QsimProxyBuilder::read_config(Config& config, const char* stateFile, const char*appFile) +void QsimProxyBuilder::read_config(Config& config, const char*appFile) { - strcpy(state_file, stateFile); - strcpy(app_file, appFile); - try { qsim_interrupt_handler_clock = config.lookup("qsim_interrupt_handler_clock"); + const char* stateFile = config.lookup("processor.state"); + strcpy(state_file,stateFile); uint64_t default_clock = config.lookup("default_clock"); qsim_interrupt_interval = default_clock/qsim_interrupt_handler_clock; } @@ -27,6 +26,8 @@ void QsimProxyBuilder::read_config(Config& config, const char* stateFile, const cout << e.getPath() << " has incorrect type." << endl; exit(1); } + + strcpy(app_file, appFile); } void QsimProxyBuilder::create_qsim(int LP) @@ -54,13 +55,12 @@ void QsimProxyBuilder::print_stats(std::ostream& out) -void QsimLibBuilder::read_config(Config& config, const char* stateFile, const char* appFile) +void QsimLibBuilder::read_config(Config& config, const char* appFile) { - strcpy(state_file, stateFile); - strcpy(app_file, appFile); - try { qsim_interrupt_handler_clock = config.lookup("qsim_interrupt_handler_clock"); + const char* stateFile = config.lookup("processor.state"); + strcpy(state_file,stateFile); } catch(SettingNotFoundException e) { cout << e.getPath() << " not set." << endl; @@ -70,6 +70,7 @@ void QsimLibBuilder::read_config(Config& config, const char* stateFile, const ch cout << e.getPath() << " has incorrect type." << endl; exit(1); } + strcpy(app_file, appFile); } void QsimLibBuilder::create_qsim(int LP) diff --git a/simulator/smp/common/qsim_builder.h b/simulator/smp/common/qsim_builder.h index 93b597a..0b87f1d 100644 --- a/simulator/smp/common/qsim_builder.h +++ b/simulator/smp/common/qsim_builder.h @@ -16,7 +16,7 @@ class QsimBuilder { int get_component_id() const { return component_id; } Qsim::OSDomain* get_qsim_osd() const { return qsim_osd; } - virtual void read_config(libconfig::Config& config, const char* stateFile, const char* appFile) = 0; + virtual void read_config(libconfig::Config& config, const char* appFile) = 0; virtual void create_qsim(int LP) = 0; virtual void print_config(std::ostream&) = 0; virtual void print_stats(std::ostream&) = 0; @@ -38,7 +38,7 @@ class QsimProxyBuilder : public QsimBuilder { QsimProxyBuilder(SysBuilder_llp* b) : QsimBuilder(b) {} ~QsimProxyBuilder() {} - void read_config(libconfig::Config& config, const char* stateFile, const char* appFile); + void read_config(libconfig::Config& config, const char* appFile); void create_qsim(int LP); void print_config(std::ostream&); void print_stats(std::ostream&); @@ -54,7 +54,7 @@ class QsimLibBuilder : public QsimBuilder { QsimLibBuilder(SysBuilder_llp* b) : QsimBuilder(b) {} ~QsimLibBuilder() {} - void read_config(libconfig::Config& config, const char* stateFile, const char* appFile); + void read_config(libconfig::Config& config, const char* appFile); void create_qsim(int LP); void print_config(std::ostream&); void print_stats(std::ostream&); diff --git a/simulator/smp/common/sysBuilder_llp.cc b/simulator/smp/common/sysBuilder_llp.cc index 21175bb..8052b68 100644 --- a/simulator/smp/common/sysBuilder_llp.cc +++ b/simulator/smp/common/sysBuilder_llp.cc @@ -294,7 +294,7 @@ void SysBuilder_llp :: build_system(Qsim::OSDomain* qsim_osd, vector& ar //==================================================================== // For QsimProxy front-end //==================================================================== -void SysBuilder_llp :: build_system(vector& args, const char *stateFile, const char* appFile, int n_lps, int part) +void SysBuilder_llp :: build_system(vector& args, const char* appFile, int n_lps, int part) { assert(m_conf_read == true); @@ -317,7 +317,7 @@ void SysBuilder_llp :: build_system(vector& args, const char *stateFile, assert(m_proc_builder->get_fe_type() == ProcBuilder::INVALID_FE_TYPE); m_proc_builder->set_fe_type(ProcBuilder::QSIMPROXY); - create_qsimproxy_nodes(args,stateFile,appFile,n_lps,part); + create_qsimproxy_nodes(args,appFile,n_lps,part); //connect components connect_components(); @@ -413,10 +413,10 @@ void SysBuilder_llp :: create_qsimlib_nodes(Qsim::OSDomain* qsim_osd, vector& args, const char* stateFile, const char* appFile, int n_lps, int part) +void SysBuilder_llp :: create_qsimproxy_nodes(vector& args, const char* appFile, int n_lps, int part) { m_qsim_builder = new QsimProxyBuilder(this); - m_qsim_builder->read_config(m_config, stateFile, appFile); + m_qsim_builder->read_config(m_config, appFile); m_qsim_builder->create_qsim(0); switch(m_proc_builder->get_proc_type()) { diff --git a/simulator/smp/common/sysBuilder_llp.h b/simulator/smp/common/sysBuilder_llp.h index 4d6fdd9..02bfa96 100644 --- a/simulator/smp/common/sysBuilder_llp.h +++ b/simulator/smp/common/sysBuilder_llp.h @@ -40,7 +40,7 @@ class SysBuilder_llp { void config_system(); void build_system(FrontendType type, int n_lps, std::vector& args, int part); //for QSim client and tracefile void build_system(Qsim::OSDomain* osd, std::vector& args); //for QSimLib - void build_system(std::vector& args, const char* stateFile, const char* appFile, int n_lps, int part); // for QSimProxy + void build_system(std::vector& args, const char* appFile, int n_lps, int part); // for QSimProxy void pre_simulation(); void print_config(std::ostream& out); @@ -104,7 +104,7 @@ class SysBuilder_llp { void create_qsimclient_nodes(int n_lps, std::vector& argv, int part); void create_qsimlib_nodes(Qsim::OSDomain* qsim_osd, vector& args); - void create_qsimproxy_nodes(vector& args, const char* stateFile, const char* appFile, int n_lps, int part); + void create_qsimproxy_nodes(vector& args, const char* appFile, int n_lps, int part); void create_trace_nodes(int n_lps, vector& args, int part); #ifdef LIBKITFOX diff --git a/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg b/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg index 5fad502..972c269 100644 --- a/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg +++ b/simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg @@ -27,6 +27,7 @@ processor: type = "SPX"; node_idx = [0, 1, 2, 3]; config = "../config/spx-outorder.a64.config"; + state = "../state/state.4.a64" }; llp_cache: @@ -34,10 +35,10 @@ llp_cache: name = "L1"; type = "DATA"; size = 0x8000; //32K - assoc = 4; - block_size = 32; - hit_time = 2; - lookup_time = 5; + assoc = 8; + block_size = 64; + hit_time = 3; + lookup_time = 3; replacement_policy = "LRU"; mshr_size = 8; @@ -48,13 +49,13 @@ lls_cache: { name = "L2"; type = "DATA"; - size = 0x40000; //256K - assoc = 8; - block_size = 32; - hit_time = 2; - lookup_time = 5; + size = 0x200000; // 2MB + assoc = 16; + block_size = 64; + hit_time = 35; + lookup_time = 100; replacement_policy = "LRU"; - mshr_size = 16; + mshr_size = 32; downstream_credits = 20; //credits for sending to network }; diff --git a/simulator/smp/config/conf2x2_spx_t6p_llp.cfg b/simulator/smp/config/conf2x2_spx_t6p_llp.cfg index 6a8607a..dc3274d 100644 --- a/simulator/smp/config/conf2x2_spx_t6p_llp.cfg +++ b/simulator/smp/config/conf2x2_spx_t6p_llp.cfg @@ -27,6 +27,7 @@ processor: type = "SPX"; node_idx = [0, 1, 2, 3]; config = "../config/spx-outorder.config"; + state = "../state/state.4" }; llp_cache: @@ -34,10 +35,10 @@ llp_cache: name = "L1"; type = "DATA"; size = 0x8000; //32K - assoc = 4; - block_size = 32; - hit_time = 2; - lookup_time = 5; + assoc = 8; + block_size = 64; + hit_time = 3; + lookup_time = 3; replacement_policy = "LRU"; mshr_size = 8; @@ -48,13 +49,13 @@ lls_cache: { name = "L2"; type = "DATA"; - size = 0x40000; //256K - assoc = 8; - block_size = 32; - hit_time = 2; - lookup_time = 5; + size = 0x200000; //2MB + assoc = 16; + block_size = 64; + hit_time = 35; + lookup_time = 100; replacement_policy = "LRU"; - mshr_size = 16; + mshr_size = 32; downstream_credits = 20; //credits for sending to network }; diff --git a/simulator/smp/config/conf2x3_spx_torus_l1l2.cfg b/simulator/smp/config/conf2x3_spx_torus_l1l2.cfg index 80d807e..7ebc7ba 100644 --- a/simulator/smp/config/conf2x3_spx_torus_l1l2.cfg +++ b/simulator/smp/config/conf2x3_spx_torus_l1l2.cfg @@ -24,6 +24,7 @@ processor: node_idx = [0, 1, 3, 4]; type = "SPX"; config = "../config/spx-outorder.config"; + state = "../state/state.4"; }; diff --git a/simulator/smp/config/conf2x3_spx_torus_llp.a64.cfg b/simulator/smp/config/conf2x3_spx_torus_llp.a64.cfg index c94d954..1be4f07 100644 --- a/simulator/smp/config/conf2x3_spx_torus_llp.a64.cfg +++ b/simulator/smp/config/conf2x3_spx_torus_llp.a64.cfg @@ -27,6 +27,7 @@ processor: type = "SPX"; node_idx = [0, 1, 3, 4]; config = "../config/spx-outorder.a64.config"; + state = "../state/state.4.a64"; }; llp_cache: diff --git a/simulator/smp/config/conf2x3_spx_torus_llp.cfg b/simulator/smp/config/conf2x3_spx_torus_llp.cfg index db6ac2e..784661c 100644 --- a/simulator/smp/config/conf2x3_spx_torus_llp.cfg +++ b/simulator/smp/config/conf2x3_spx_torus_llp.cfg @@ -25,6 +25,7 @@ processor: type = "SPX"; node_idx = [0, 1, 3, 4]; config = "../config/spx-outorder.config"; + state = "../state/state.4"; }; llp_cache: diff --git a/simulator/smp/config/conf2x3_zesto_torus_l1l2.cfg b/simulator/smp/config/conf2x3_zesto_torus_l1l2.cfg index 6858214..3962dc4 100644 --- a/simulator/smp/config/conf2x3_zesto_torus_l1l2.cfg +++ b/simulator/smp/config/conf2x3_zesto_torus_l1l2.cfg @@ -24,6 +24,7 @@ processor: node_idx = [0, 1, 3, 4]; type = "ZESTO"; config = "../config/zesto-6issue.config"; + state = "../state/state.4"; }; diff --git a/simulator/smp/config/conf2x3_zesto_torus_llp.cfg b/simulator/smp/config/conf2x3_zesto_torus_llp.cfg index 22ff378..847841e 100644 --- a/simulator/smp/config/conf2x3_zesto_torus_llp.cfg +++ b/simulator/smp/config/conf2x3_zesto_torus_llp.cfg @@ -24,6 +24,7 @@ processor: node_idx = [0, 1, 3, 4]; type = "ZESTO"; config = "../config/zesto-6issue.config"; + state = "../state/state.4"; }; llp_cache: diff --git a/simulator/smp/config/conf4x4_spx_t6p_llp.cfg b/simulator/smp/config/conf4x4_spx_t6p_llp.cfg index 8528b89..8fec18b 100644 --- a/simulator/smp/config/conf4x4_spx_t6p_llp.cfg +++ b/simulator/smp/config/conf4x4_spx_t6p_llp.cfg @@ -25,6 +25,7 @@ processor: type = "SPX"; node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; config = "../config/spx-outorder.config"; + state = "../state/state.16"; }; llp_cache: diff --git a/simulator/smp/config/conf4x5_simpleproc_torus_llp.cfg b/simulator/smp/config/conf4x5_simpleproc_torus_llp.cfg index 487c4dc..de9710b 100644 --- a/simulator/smp/config/conf4x5_simpleproc_torus_llp.cfg +++ b/simulator/smp/config/conf4x5_simpleproc_torus_llp.cfg @@ -24,6 +24,7 @@ processor: { node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19]; type = "SIMPLE"; + state = "../state/state.16"; }; llp_cache: diff --git a/simulator/smp/config/conf4x5_spx_torus_llp.cfg b/simulator/smp/config/conf4x5_spx_torus_llp.cfg index 37e5426..2ccddb9 100644 --- a/simulator/smp/config/conf4x5_spx_torus_llp.cfg +++ b/simulator/smp/config/conf4x5_spx_torus_llp.cfg @@ -25,6 +25,7 @@ processor: type = "SPX"; node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19]; config = "../config/spx-outorder.config"; + state = "../state/state.16"; }; llp_cache: diff --git a/simulator/smp/config/conf4x5_zesto_torus_l1l2.cfg b/simulator/smp/config/conf4x5_zesto_torus_l1l2.cfg index 34e004f..d0cb14c 100644 --- a/simulator/smp/config/conf4x5_zesto_torus_l1l2.cfg +++ b/simulator/smp/config/conf4x5_zesto_torus_l1l2.cfg @@ -24,6 +24,7 @@ processor: node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19]; type = "ZESTO"; config = "../config/zesto-6issue.config"; + state = "../state/state.16"; }; diff --git a/simulator/smp/config/conf4x5_zesto_torus_llp.cfg b/simulator/smp/config/conf4x5_zesto_torus_llp.cfg index b5080e2..144d1eb 100644 --- a/simulator/smp/config/conf4x5_zesto_torus_llp.cfg +++ b/simulator/smp/config/conf4x5_zesto_torus_llp.cfg @@ -24,6 +24,7 @@ processor: node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19]; type = "ZESTO"; config = "../config/zesto-6issue.config"; + state = "../state/state.16"; }; llp_cache: diff --git a/simulator/smp/config/kitfox-4core.config b/simulator/smp/config/kitfox-4core.config index 236286e..72efc5f 100644 --- a/simulator/smp/config/kitfox-4core.config +++ b/simulator/smp/config/kitfox-4core.config @@ -5296,7 +5296,7 @@ component = { size = 2097152; tag_width = 47; num_rw_ports = 1; - cycle_time = 35; + cycle_time = 100; access_time = 35; access_mode = "sequential"; }; @@ -5484,7 +5484,7 @@ component = { size = 2097152; tag_width = 47; num_rw_ports = 1; - cycle_time = 35; + cycle_time = 100; access_time = 35; access_mode = "sequential"; }; @@ -5672,7 +5672,7 @@ component = { size = 2097152; tag_width = 47; num_rw_ports = 1; - cycle_time = 35; + cycle_time = 100; access_time = 35; access_mode = "sequential"; }; @@ -5860,7 +5860,7 @@ component = { size = 2097152; tag_width = 47; num_rw_ports = 1; - cycle_time = 35; + cycle_time = 100; access_time = 35; access_mode = "sequential"; }; From ce9cfc0a199eefe35cb32e79e1a01efb2b5b39d2 Mon Sep 17 00:00:00 2001 From: sixshotx Date: Sun, 12 Feb 2017 23:20:46 -0500 Subject: [PATCH 5/5] update clock freq in kitfox-4core.config --- simulator/smp/config/kitfox-4core.config | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/simulator/smp/config/kitfox-4core.config b/simulator/smp/config/kitfox-4core.config index 72efc5f..ea5b154 100644 --- a/simulator/smp/config/kitfox-4core.config +++ b/simulator/smp/config/kitfox-4core.config @@ -133,7 +133,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -1219,7 +1219,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -2305,7 +2305,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -3391,7 +3391,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -4476,7 +4476,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -4668,7 +4668,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -4860,7 +4860,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -5052,7 +5052,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "core"; core_type = "ooo"; wire_type = "global"; @@ -5254,7 +5254,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "llc"; wire_type = "global"; wiring_type = "global"; @@ -5442,7 +5442,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "llc"; wire_type = "global"; wiring_type = "global"; @@ -5630,7 +5630,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "llc"; wire_type = "global"; wiring_type = "global"; @@ -5818,7 +5818,7 @@ component = { model = "none"; feature_size = 16e-9; voltage = 0.8; - clock_frequency = 2.0e9; + clock_frequency = 1.0e9; component_type = "llc"; wire_type = "global"; wiring_type = "global";