Skip to content

Commit

Permalink
added cache metrics in sched open + 4x4 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jefg89 committed Jul 6, 2022
1 parent 78a0178 commit 8ac3438
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 8 deletions.
Binary file added benchmarks/4x4_eigendata.bin
Binary file not shown.
17 changes: 17 additions & 0 deletions benchmarks/4x4_floorplan.flp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Line Format: <unit-name>\t<width>\t<height>\t<left-x>\t<bottom-y>
Core0-TP 0.001765 0.001765 0.000000 0.005295
Core1-TP 0.001765 0.001765 0.001765 0.005295
Core2-TP 0.001765 0.001765 0.003530 0.005295
Core3-TP 0.001765 0.001765 0.005295 0.005295
Core4-TP 0.001765 0.001765 0.000000 0.003530
Core5-TP 0.001765 0.001765 0.001765 0.003530
Core6-TP 0.001765 0.001765 0.003530 0.003530
Core7-TP 0.001765 0.001765 0.005295 0.003530
Core8-TP 0.001765 0.001765 0.000000 0.001765
Core9-TP 0.001765 0.001765 0.001765 0.001765
Core10-TP 0.001765 0.001765 0.003530 0.001765
Core11-TP 0.001765 0.001765 0.005295 0.001765
Core12-TP 0.001765 0.001765 0.000000 0.000000
Core13-TP 0.001765 0.001765 0.001765 0.000000
Core14-TP 0.001765 0.001765 0.003530 0.000000
Core15-TP 0.001765 0.001765 0.005295 0.000000
34 changes: 32 additions & 2 deletions common/scheduler/scheduler_open.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "performance_model.h"
#include "magic_server.h"
#include "thread_manager.h"
#include "stats.h"

#include "policies/dvfsMaxFreq.h"
#include "policies/dvfsFixedPower.h"
Expand All @@ -34,6 +35,7 @@ using namespace std;
int k=0;

ofstream attestFile;
ofstream cacheMetrics;

String queuePolicy; //Stores Queuing Policy for Open System from base.cfg.
String distribution; //Stores the arrival distribution of the open workload from base.cfg.
Expand Down Expand Up @@ -146,7 +148,13 @@ SchedulerOpen::SchedulerOpen(ThreadManager *thread_manager)
attestationEpoch = atol(Sim()->getCfg()->getString("scheduler/open/attestation/epoch").c_str());
sequencerDelay = (long) (software_delay / atoi(Sim()->getCfg()->getString("scheduler/open/attestation/hardware_speedup").c_str()));
sequencerDelay = (static_cast<uint>((float)sequencerDelay/1000)) * 1000;
cout << "sequencer delay = " <<sequencerDelay << "ns";

cacheMetrics.open("cacheMetrics.log", ios::app);
cacheMetrics << "accesses_l1d" << "\t" << "load_misses_l1d" << "\t" << "store_misses_l1d" << "\t" << "total_misses_l1d" << "\t"
<< "accesses_l2" << "\t" << "load_misses_l2" << "\t" << "store_misses_l2" << "\t" << "total_misses_l2" << endl;
cacheMetrics.close();


m_core_mask.resize(Sim()->getConfig()->getApplicationCores());
for (core_id_t core_id = 0; core_id < (core_id_t)Sim()->getConfig()->getApplicationCores(); core_id++) {
m_core_mask[core_id] = Sim()->getCfg()->getBoolArray("scheduler/open/core_mask", core_id);
Expand Down Expand Up @@ -1328,6 +1336,27 @@ void SchedulerOpen::periodic(SubsecondTime time) {
exit (1);
}

if (time.getNS() % 1000000 == 0) {
UInt64 accesses_l1d = Sim()->getStatsManager()->getMetricObject("L1-D", 0, "loads")->recordMetric() +
Sim()->getStatsManager()->getMetricObject("L1-D", 0, "stores")->recordMetric();

UInt64 load_misses_l1d = Sim()->getStatsManager()->getMetricObject("L1-D", 0, "load-misses")->recordMetric();
UInt64 store_misses_l1d= Sim()->getStatsManager()->getMetricObject("L1-D", 0, "store-misses")->recordMetric();
UInt64 total_misses_l1d = load_misses_l1d + store_misses_l1d;

UInt64 accesses_l2 = Sim()->getStatsManager()->getMetricObject("L2", 0, "loads")->recordMetric() +
Sim()->getStatsManager()->getMetricObject("L2", 0, "stores")->recordMetric();

UInt64 load_misses_l2 = Sim()->getStatsManager()->getMetricObject("L2", 0, "load-misses")->recordMetric();
UInt64 store_misses_l2 = Sim()->getStatsManager()->getMetricObject("L2", 0, "store-misses")->recordMetric();
UInt64 total_misses_l2 = load_misses_l2+ store_misses_l2;

cacheMetrics.open("cacheMetrics.log", ios::app);
cacheMetrics << accesses_l1d << "\t" << load_misses_l1d << "\t" << store_misses_l1d << "\t" << total_misses_l1d << "\t"
<< accesses_l2 << "\t" << load_misses_l2 << "\t" << store_misses_l2 << "\t" << total_misses_l2 << endl;
cacheMetrics.close();
}

if (attestationPolicy != NULL) {
// Writting attestation-matter performance metrics to file
attestFile.open ("Attestation_Report.log", ios::app);
Expand All @@ -1343,7 +1372,6 @@ void SchedulerOpen::periodic(SubsecondTime time) {
}
}


if ((attestationPolicy != NULL) && (time.getNS() == 2000000)) { //% attestationEpoch == 0)) {
cout << "\n[Scheduler]: Attestation invoked at " << formatTime(time) << endl;
executeAttestationPolicy();
Expand Down Expand Up @@ -1451,3 +1479,5 @@ std::string SchedulerOpen::formatTime(SubsecondTime time) {
ss << formatLong(time.getNS()) << " ns";
return ss.str();
}


1 change: 1 addition & 0 deletions common/scheduler/scheduler_open.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class SchedulerOpen : public SchedulerPinnedBase {
long software_delay = 50000;
long sequencerDelay;



};

Expand Down
10 changes: 5 additions & 5 deletions config/base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ suppress_stdout = false # Suppress the application's output to stdout
suppress_stderr = false # Suppress the application's output to stderr

# Total number of cores in the simulation
total_cores = 64
total_cores = 16

enable_icache_modeling = false

Expand Down Expand Up @@ -366,9 +366,9 @@ max_frequency = 4.0
max_frequency = 4.0 # cfg:4.0GHz
frequency_step_size = 0.1
dvfs_epoch = 1000000
#dvfs_epoch = 1000000 # cfg:slowDVFS
dvfs_epoch = 1000000 # cfg:slowDVFS
#dvfs_epoch = 250000 # cfg:mediumDVFS
dvfs_epoch = 100000 # cfg:fastDVFS
#dvfs_epoch = 100000 # cfg:fastDVFS
reserved_cores_are_active = false

[scheduler/open/dvfs/fixed_power]
Expand Down Expand Up @@ -433,8 +433,8 @@ tp = true # Total Power
[periodic_thermal]
enabled = true
#enabled = false # cfg:nothermal
floorplan = ../benchmarks/8x8_manycore.flp
thermal_model = ../benchmarks/8x8_eigendata.bin
floorplan = ../benchmarks/4x4_floorplan.flp
thermal_model = ../benchmarks/4x4_eigendata.bin
ambient_temperature = 45
max_temperature = 80
inactive_power = 0.27
Expand Down
2 changes: 1 addition & 1 deletion simulationcontrol/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
SNIPER = os.path.dirname(HERE)

RESULTS_FOLDER = os.path.join(SNIPER, 'results')
NUMBER_CORES = 64
NUMBER_CORES = 16
SNIPER_CONFIG = 'gainestown'

0 comments on commit 8ac3438

Please sign in to comment.