Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/refactor #44

Merged
merged 74 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
27d6079
refactor: Cache
atsmith3 Jun 11, 2020
876b243
refactor: Split Core Source
atsmith3 Jun 11, 2020
1b7e204
refactor: Changed cache interface, need to update the DataCache and I…
atsmith3 Jun 11, 2020
1eefdef
Added branchPredictor
Jun 17, 2020
57c7db5
Merge pull request #16 from atsmith3/feature/branch_predictor
atsmith3 Jun 17, 2020
19ff96a
mmu done
Jun 17, 2020
772f0fd
Error in Ececute unit
Jun 18, 2020
d194747
error in bypass in execute unit due to regfile
Jun 18, 2020
4e2f975
regfile error fixed
Jun 18, 2020
be92176
Regfile-Scheduler-Renaming done
Jun 18, 2020
9135fe0
Merge pull request #18 from atsmith3/feature/MMU
atsmith3 Jun 18, 2020
2ccaaad
Merge pull request #20 from atsmith3/feature/Regfile-Scheduler-Renaming
atsmith3 Jun 18, 2020
29b0c02
experimental merge: Preparing to merge
atsmith3 Jun 20, 2020
a86a3ab
Merge branch 'feature/refactor-cache' into feature/refactor-cache-merge
atsmith3 Jun 20, 2020
29a6fc1
Fixed error in renaming.cc
Jun 21, 2020
fc8c308
rename unit:
atsmith3 Jun 21, 2020
0607d43
Merge pull request #22 from atsmith3/feature/RenamingFileErrorFixed
atsmith3 Jun 21, 2020
24f9563
Merge branch 'feature/refactor-cache' into feature/refactor-cache-merge
atsmith3 Jun 21, 2020
69f427e
Merge pull request #24 from atsmith3/feature/refactor-cache-merge
atsmith3 Jun 21, 2020
9b7ceda
Merge pull request #25 from atsmith3/feature/refactor-cache
atsmith3 Jun 21, 2020
57a10c6
functional-unit:
atsmith3 Jun 21, 2020
63059dc
functional-unit:
atsmith3 Jun 21, 2020
459db3c
Merge pull request #27 from atsmith3/feature/refactor-functional-unit
atsmith3 Jun 21, 2020
9b5c644
refactor: NoC updated
atsmith3 Jun 21, 2020
23dcf8a
Merge pull request #28 from atsmith3/feature/refactor-noc
atsmith3 Jun 21, 2020
852f4b7
refactor: Interconnect updated
atsmith3 Jun 21, 2020
974fb8a
Merge pull request #29 from atsmith3/feature/refactor-interconnect
atsmith3 Jun 21, 2020
43e85bd
refactor: Preparing processor class for refactor
atsmith3 Jun 21, 2020
32f4264
refoactor: Processor
atsmith3 Jun 21, 2020
8b980a3
serialization: Debugging double counting
atsmith3 Jun 21, 2020
2c73fa8
Selection_logic Dep_resource & EXECU
Jun 22, 2020
28a9a6d
Added stats comment
Jun 22, 2020
7537993
Merge pull request #30 from atsmith3/feature/refactor-SelectionLogic-…
atsmith3 Jun 22, 2020
2797d31
Fix one bug another 10 appear....
atsmith3 Jun 22, 2020
1b292db
Fixed bug
Jun 22, 2020
b06b9ab
Merge pull request #31 from atsmith3/feature/refactor-bug-fix
atsmith3 Jun 22, 2020
ca89bb4
Inst_decoder unit donw
Jun 23, 2020
3269b09
Done with the ID units
Jun 23, 2020
bd7c499
NoC calculation incorrect by a factor of 1/2 for all niagra based tests
atsmith3 Jun 23, 2020
72194ee
Merge pull request #32 from atsmith3/feature/refactor-Instruction_dec…
atsmith3 Jun 23, 2020
2d65451
Merge branch 'feature/refactor' into feature/serialization-merge-refa…
atsmith3 Jun 23, 2020
53a8a4e
Unit Test Update & Merge & bugfix
atsmith3 Jun 23, 2020
47df78e
preliminary IF unit changes
Jun 23, 2020
038fc20
Updated to Unit Test Scripts and Formatting of Text Data
atsmith3 Jun 23, 2020
96fb04a
Merge pull request #33 from atsmith3/feature/refactor-Instruction_Fetch
atsmith3 Jun 23, 2020
62bf410
Merge branch 'feature/refactor' into feature/serialization-merge-refa…
atsmith3 Jun 23, 2020
2ba7cb0
Merge pull request #34 from atsmith3/feature/serialization-merge-refa…
atsmith3 Jun 23, 2020
cbf2381
Merge pull request #35 from atsmith3/feature/serialization
atsmith3 Jun 23, 2020
bc738f9
Unit Test in Parallel
atsmith3 Jun 23, 2020
48f88aa
Merge branch 'feature/serialization-merge-refactor' of https://github…
atsmith3 Jun 23, 2020
2ff0567
Merge branch 'feature/refactor' into feature/serialization-merge-refa…
atsmith3 Jun 23, 2020
f2e4cb0
Merge pull request #36 from atsmith3/feature/serialization-merge-refa…
atsmith3 Jun 23, 2020
44d9521
instruction fetch unit finally DONE
kanungoramakrishna Jun 23, 2020
658f46e
Merge pull request #37 from atsmith3/feature/refactor-IF_Unit
atsmith3 Jun 23, 2020
3a9aee7
refactor: Load Store Unit
atsmith3 Jun 23, 2020
c18e98f
Merge branch 'feature/refactor' into feature/refactor-lsqueue
atsmith3 Jun 23, 2020
1eff27e
Merge pull request #38 from atsmith3/feature/refactor-lsqueue
atsmith3 Jun 23, 2020
3efd789
Bugfix in merge
atsmith3 Jun 23, 2020
cfd37ff
Merge pull request #39 from atsmith3/feature/refactor-bugfix-ifu
atsmith3 Jun 23, 2020
9351d14
Initiating changes in the undiff_core
kanungoramakrishna Jun 24, 2020
54e564a
Completed the undiff core
kanungoramakrishna Jun 24, 2020
03fde96
Corepipe fixed
kanungoramakrishna Jun 24, 2020
d3df757
refactor: cacti/decoder
atsmith3 Jun 24, 2020
16db390
core done
kanungoramakrishna Jun 24, 2020
6219082
Merge pull request #40 from atsmith3/feature/refactor-core
atsmith3 Jun 24, 2020
1d8081e
Adding more fields to inst_decoder & predec_blk
atsmith3 Jun 24, 2020
93fb7c3
Merge branch 'feature/refactor' into feature/serialization-core-merge
atsmith3 Jun 24, 2020
dc7c5da
merge: feature/refactor
atsmith3 Jun 24, 2020
3943ed4
Merge pull request #41 from atsmith3/feature/serialization-core-merge
atsmith3 Jun 24, 2020
d658b04
ExecU ALUs not calculating power properly
atsmith3 Jun 24, 2020
ee61a7b
serialization: Serialization Complete
atsmith3 Jun 24, 2020
2f97299
organized code
kanungoramakrishna Jun 24, 2020
b144f0f
Merge pull request #42 from atsmith3/feature/serialization-core-arranged
atsmith3 Jun 24, 2020
5df7d61
Merge pull request #43 from atsmith3/feature/serialization-core
atsmith3 Jun 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Create a separate build directory")
endif()

cmake_minimum_required (VERSION 3.1)
cmake_minimum_required (VERSION 3.12)

project(mcpat DESCRIPTION "Power Timing Area Calculator"
LANGUAGES CXX)

find_package(Boost 1.56 REQUIRED COMPONENTS
program_options)
program_options
serialization)

set(THREADS_PREFER_PTHREAD_FLAG ON)

find_package(Threads REQUIRED)


set (MCPAT_VERSION_MAJOR 1)
set (MCPAT_VERSION_MINOR 3)
set (MCPAT_VERSION_PATCH 0)
Expand Down
21 changes: 13 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
add_subdirectory(cacti)
add_subdirectory(cache)
add_subdirectory(core)
add_subdirectory(iocontrollers)
add_subdirectory(logic)
add_subdirectory(memoryctrl)

add_library(top
Expand All @@ -8,37 +11,39 @@ add_library(top
array.cc
basic_components.h
basic_components.cc
core.h
core.cc
globalvar.h
interconnect.h
interconnect.cc
logic.h
logic.cc
noc.h
noc.cc
options.h
options.cc
processor.h
processor.cc
sharedcache.h
sharedcache.cc
version.h
xmlParser.h
xmlParser.cc
XML_Parse.h
XML_Parse.cc
)
target_include_directories(top PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(top LINK_PUBLIC cacti iocontrollers memoryctrl)
target_link_libraries(top
LINK_PUBLIC
cache
cacti
core
logic
iocontrollers
memoryctrl)

add_executable(mcpat main.cc)

target_link_libraries(mcpat
LINK_PUBLIC
top
Threads::Threads
Boost::program_options)
Boost::program_options
Boost::serialization)

add_custom_command(TARGET mcpat POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:mcpat> ${PROJECT_BINARY_DIR}/mcpat
Expand Down
11 changes: 6 additions & 5 deletions src/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,13 @@ void ArrayST::optimize_array() {
// For array structures except CAM and FA, Give warning but still provide
// a result with best timing found
if (throughput_overflow == true)
cout << "Warning: " << name
<< " array structure cannot satisfy throughput constraint."
<< endl;
std::cerr << "Warning: " << name
<< " array structure cannot satisfy throughput constraint."
<< std::endl;
if (latency_overflow == true)
cout << "Warning: " << name
<< " array structure cannot satisfy latency constraint." << endl;
std::cerr << "Warning: " << name
<< " array structure cannot satisfy latency constraint."
<< std::endl;
}

// else
Expand Down
59 changes: 16 additions & 43 deletions src/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#include "const.h"
#include "parameter.h"

#include <boost/serialization/assume_abstract.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/list.hpp>
#include <boost/serialization/utility.hpp>
#include <iostream>
#include <string>

Expand Down Expand Up @@ -79,51 +83,20 @@ class ArrayST : public Component {
virtual void optimize_array();
virtual void compute_base_power();
void leakage_feedback(double temperature);
};

class InstCache : public Component {
public:
ArrayST *caches;
ArrayST *missb;
ArrayST *ifb;
ArrayST *prefetchb;
powerDef power_t; // temp value holder for both (max) power and runtime power
InstCache() {
caches = 0;
missb = 0;
ifb = 0;
prefetchb = 0;
};
~InstCache() {
if (caches) { // caches->local_result.cleanup();
delete caches;
caches = 0;
}
if (missb) { // missb->local_result.cleanup();
delete missb;
missb = 0;
}
if (ifb) { // ifb->local_result.cleanup();
delete ifb;
ifb = 0;
}
if (prefetchb) { // prefetchb->local_result.cleanup();
delete prefetchb;
prefetchb = 0;
}
};
};
// Serialization
friend class boost::serialization::access;

class DataCache : public InstCache {
public:
ArrayST *wbb;
DataCache() { wbb = 0; };
~DataCache() {
if (wbb) { // wbb->local_result.cleanup();
delete wbb;
wbb = 0;
}
};
template <class Archive>
void serialize(Archive &ar, const unsigned int version) {
ar &name;
ar &power_t;
ar &stats_t;
ar &tdp_stats;
ar &rtp_stats;
ar &local_result;
Component::serialize(ar, version);
}
};

#endif /* __ARRAY_H__ */
43 changes: 24 additions & 19 deletions src/basic_components.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include "XML_Parse.h"
#include "parameter.h"

#include <boost/serialization/assume_abstract.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/list.hpp>
#include <boost/serialization/utility.hpp>
#include <vector>

const double cdb_overhead = 1.1;
Expand All @@ -45,8 +49,6 @@ enum Renaming_type { RAMbased, CAMbased };

enum Scheduler_type { PhysicalRegFile, ReservationStation };

enum cache_level { L2, L3, L1Directory, L2Directory };

enum MemoryCtrl_type {
MC, // memory controller
FLASHC // flash controller
Expand Down Expand Up @@ -90,6 +92,16 @@ class statsComponents {
const statsComponents &y);
friend statsComponents operator*(const statsComponents &x,
double const *const y);

// Serialization
friend class boost::serialization::access;

template <class Archive>
void serialize(Archive &ar, const unsigned int version) {
ar &access;
ar &hit;
ar &miss;
}
};

class statsDef {
Expand All @@ -107,6 +119,16 @@ class statsDef {

friend statsDef operator+(const statsDef &x, const statsDef &y);
friend statsDef operator*(const statsDef &x, double const *const y);

// Serialization
friend class boost::serialization::access;

template <class Archive>
void serialize(Archive &ar, const unsigned int version) {
ar &readAc;
ar &writeAc;
ar &searchAc;
}
};

double longer_channel_device_reduction(enum Device_ty device_ty = Core_device,
Expand Down Expand Up @@ -163,23 +185,6 @@ class CoreDynParam {
~CoreDynParam(){};
};

class CacheDynParam {
public:
CacheDynParam(){};
CacheDynParam(ParseXML *XML_interface, int ithCache_);
string name;
enum Dir_type dir_ty;
double clockRate, executionTime;
double capacity, blockW, assoc, nbanks;
double throughput, latency;
double duty_cycle, dir_duty_cycle;
// double duty_cycle;
int missb_size, fu_size, prefetchb_size, wbb_size;
double vdd;
double power_gating_vcc;
~CacheDynParam(){};
};

class MCParam {
public:
MCParam(){};
Expand Down
12 changes: 12 additions & 0 deletions src/cache/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
add_library(cache
cache_param.h
cache_param.cc
datacache.h
datacache.cc
instcache.h
instcache.cc
sharedcache.h
sharedcache.cc
)
target_include_directories(cache PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(cache LINK_PUBLIC cacti top)
132 changes: 132 additions & 0 deletions src/cache/cache_param.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*****************************************************************************
* McPAT
* SOFTWARE LICENSE AGREEMENT
* Copyright 2012 Hewlett-Packard Development Company, L.P.
* All Rights Reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer;
* redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution;
* neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.”
*
***************************************************************************/

#include "cache_param.h"

#include <vector>

void CacheDynParam::set_params_l2_cache(const ParseXML *XML,
const int ithCache) {
this->name = "L2";
this->clockRate = XML->sys.L2[ithCache].clockrate;
this->clockRate *= 1e6;
this->executionTime =
XML->sys.total_cycles / (XML->sys.target_core_clockrate * 1e6);
this->capacity = XML->sys.L2[ithCache].L2_config[0];
this->blockW = XML->sys.L2[ithCache].L2_config[1];
this->assoc = XML->sys.L2[ithCache].L2_config[2];
this->nbanks = XML->sys.L2[ithCache].L2_config[3];
this->throughput = XML->sys.L2[ithCache].L2_config[4] / this->clockRate;
this->latency = XML->sys.L2[ithCache].L2_config[5] / this->clockRate;
this->missb_size = XML->sys.L2[ithCache].buffer_sizes[0];
this->fu_size = XML->sys.L2[ithCache].buffer_sizes[1];
this->prefetchb_size = XML->sys.L2[ithCache].buffer_sizes[2];
this->wbb_size = XML->sys.L2[ithCache].buffer_sizes[3];
this->duty_cycle = XML->sys.L2[ithCache].duty_cycle;
if (!XML->sys.L2[ithCache].merged_dir) {
this->dir_ty = NonDir;
} else {
this->dir_ty = SBT;
this->dir_duty_cycle = XML->sys.L2[ithCache].dir_duty_cycle;
}
}

void CacheDynParam::set_params_l3_cache(const ParseXML *XML,
const int ithCache) {
this->name = "L3";
this->clockRate = XML->sys.L3[ithCache].clockrate;
this->clockRate *= 1e6;
this->executionTime =
XML->sys.total_cycles / (XML->sys.target_core_clockrate * 1e6);
this->capacity = XML->sys.L3[ithCache].L3_config[0];
this->blockW = XML->sys.L3[ithCache].L3_config[1];
this->assoc = XML->sys.L3[ithCache].L3_config[2];
this->nbanks = XML->sys.L3[ithCache].L3_config[3];
this->throughput = XML->sys.L3[ithCache].L3_config[4] / this->clockRate;
this->latency = XML->sys.L3[ithCache].L3_config[5] / this->clockRate;
this->missb_size = XML->sys.L3[ithCache].buffer_sizes[0];
this->fu_size = XML->sys.L3[ithCache].buffer_sizes[1];
this->prefetchb_size = XML->sys.L3[ithCache].buffer_sizes[2];
this->wbb_size = XML->sys.L3[ithCache].buffer_sizes[3];
this->duty_cycle = XML->sys.L3[ithCache].duty_cycle;
if (!XML->sys.L2[ithCache].merged_dir) {
this->dir_ty = NonDir;
} else {
this->dir_ty = SBT;
this->dir_duty_cycle = XML->sys.L2[ithCache].dir_duty_cycle;
}
}

void CacheDynParam::set_params_l1_directory(const ParseXML *XML,
const int ithCache) {
this->name = "First Level Directory";
this->dir_ty = (enum Dir_type)XML->sys.L1Directory[ithCache].Directory_type;
this->clockRate = XML->sys.L1Directory[ithCache].clockrate;
this->clockRate *= 1e6;
this->executionTime =
XML->sys.total_cycles / (XML->sys.target_core_clockrate * 1e6);
this->capacity = XML->sys.L1Directory[ithCache].Dir_config[0];
this->blockW = XML->sys.L1Directory[ithCache].Dir_config[1];
this->assoc = XML->sys.L1Directory[ithCache].Dir_config[2];
this->nbanks = XML->sys.L1Directory[ithCache].Dir_config[3];
this->throughput =
XML->sys.L1Directory[ithCache].Dir_config[4] / this->clockRate;
this->latency =
XML->sys.L1Directory[ithCache].Dir_config[5] / this->clockRate;
this->missb_size = XML->sys.L1Directory[ithCache].buffer_sizes[0];
this->fu_size = XML->sys.L1Directory[ithCache].buffer_sizes[1];
this->prefetchb_size = XML->sys.L1Directory[ithCache].buffer_sizes[2];
this->wbb_size = XML->sys.L1Directory[ithCache].buffer_sizes[3];
this->duty_cycle = XML->sys.L1Directory[ithCache].duty_cycle;
}

void CacheDynParam::set_params_l2_directory(const ParseXML *XML,
const int ithCache) {
this->name = "Second Level Directory";
this->dir_ty = (enum Dir_type)XML->sys.L2Directory[ithCache].Directory_type;
this->clockRate = XML->sys.L2Directory[ithCache].clockrate;
this->clockRate *= 1e6;
this->executionTime =
XML->sys.total_cycles / (XML->sys.target_core_clockrate * 1e6);
this->capacity = XML->sys.L2Directory[ithCache].Dir_config[0];
this->blockW = XML->sys.L2Directory[ithCache].Dir_config[1];
this->assoc = XML->sys.L2Directory[ithCache].Dir_config[2];
this->nbanks = XML->sys.L2Directory[ithCache].Dir_config[3];
this->throughput =
XML->sys.L2Directory[ithCache].Dir_config[4] / this->clockRate;
this->latency =
XML->sys.L2Directory[ithCache].Dir_config[5] / this->clockRate;
this->missb_size = XML->sys.L2Directory[ithCache].buffer_sizes[0];
this->fu_size = XML->sys.L2Directory[ithCache].buffer_sizes[1];
this->prefetchb_size = XML->sys.L2Directory[ithCache].buffer_sizes[2];
this->wbb_size = XML->sys.L2Directory[ithCache].buffer_sizes[3];
this->duty_cycle = XML->sys.L2Directory[ithCache].duty_cycle;
}
Loading