first intent
This commit is contained in:
parent
1ae6af2eb6
commit
42b533434b
|
@ -10,3 +10,4 @@ build/
|
||||||
*.solution
|
*.solution
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
llvm/
|
llvm/
|
||||||
|
.idea
|
|
@ -56,10 +56,10 @@ struct CacheAnalysisPass : PassInfoMixin<CacheAnalysisPass> {
|
||||||
bool PrintEdgesPost = false;
|
bool PrintEdgesPost = false;
|
||||||
bool DumpToDot = false;
|
bool DumpToDot = false;
|
||||||
bool DumpNodes = false;
|
bool DumpNodes = false;
|
||||||
bool LoopUnrolling = true;
|
bool LoopUnrolling = false;
|
||||||
|
|
||||||
// Assume a 4kB Cache
|
// Assume a 4kB Cache
|
||||||
// with 16 Sets, associativity of 4 and Cachelines fitting two
|
// with 16 Sets, associativity of 4 and Cachelines fitting two times the instruction size
|
||||||
CacheType Cache = CacheType(16, 4, 128);
|
CacheType Cache = CacheType(16, 4, 128);
|
||||||
StringRef EntryPoint = "main";
|
StringRef EntryPoint = "main";
|
||||||
unsigned int EntryAddress;
|
unsigned int EntryAddress;
|
||||||
|
|
|
@ -7,7 +7,7 @@ clean () {
|
||||||
}
|
}
|
||||||
|
|
||||||
config () {
|
config () {
|
||||||
echo "==== Crating build folder ===="
|
echo "==== Creating build folder ===="
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
echo "==== Configuring cmake ===="
|
echo "==== Configuring cmake ===="
|
||||||
|
|
|
@ -100,10 +100,6 @@ public: // everything is public, because IDGAF
|
||||||
Unrolled = UnrolledIn;
|
Unrolled = UnrolledIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AbstractState(Address Addr) {
|
|
||||||
// Sets[Addr.Index].Associativity[0] = {{Addr.Tag}};
|
|
||||||
// }
|
|
||||||
|
|
||||||
void setUnrolled(unsigned int In) { Unrolled = In; }
|
void setUnrolled(unsigned int In) { Unrolled = In; }
|
||||||
|
|
||||||
bool operator==(AbstractState In) {
|
bool operator==(AbstractState In) {
|
||||||
|
@ -140,6 +136,35 @@ public: // everything is public, because IDGAF
|
||||||
* The exercise is to Fill this function with an LRU must Join.
|
* The exercise is to Fill this function with an LRU must Join.
|
||||||
* For this you need to use Sets. Associativity and Blocks.
|
* For this you need to use Sets. Associativity and Blocks.
|
||||||
*/
|
*/
|
||||||
|
// TODO: Due date 08.06.2022
|
||||||
|
|
||||||
|
// Loop through all 16 sets
|
||||||
|
for (int Index; Index < 16; Index++) {
|
||||||
|
|
||||||
|
// create a temporary set of associativity
|
||||||
|
struct Set temp_set;
|
||||||
|
|
||||||
|
// loop through all 4 Ages
|
||||||
|
for (int Age; Age < 4; Age++) {
|
||||||
|
struct Set current_set = Sets[Index];
|
||||||
|
struct Set incoming_set = In.Sets[Index];
|
||||||
|
|
||||||
|
// loop through current set and build list of all contained blocks
|
||||||
|
for (auto age: current_set.Associativity) {
|
||||||
|
std::cout << age.first
|
||||||
|
<< ":";
|
||||||
|
for (auto block : age.second.Blocks)
|
||||||
|
std::cout << block << std::endl;
|
||||||
|
}
|
||||||
|
// loop through incoming set and build list of all contained blocks
|
||||||
|
for (auto E2 : In.Sets[Index].Associativity[Age].Blocks) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Sets[Index] = temp_set;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -244,6 +269,5 @@ public: // everything is public, because IDGAF
|
||||||
}
|
}
|
||||||
llvm::outs() << "}\n";
|
llvm::outs() << "}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // namespace
|
}; // namespace
|
||||||
#endif // STATE_H
|
#endif // STATE_H
|
Loading…
Reference in New Issue