better exercise description in README.md

This commit is contained in:
Nils Hölscher 2022-05-16 11:55:40 +02:00
parent 1ae6af2eb6
commit e7ca0a68ef
3 changed files with 13 additions and 9 deletions

View File

@ -215,15 +215,15 @@ struct CacheAnalysisPass : PassInfoMixin<CacheAnalysisPass> {
} }
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM) { PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM) {
FunctionAnalysisManager &FAM = // FunctionAnalysisManager &FAM =
MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); // MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
addressCollector(M); addressCollector(M);
Function *EntryFunction; // Function *EntryFunction;
for (Function &F : M.getFunctionList()) { for (Function &F : M.getFunctionList()) {
// Start iterating through CFG from entry point // Start iterating through CFG from entry point
if (F.getName().equals(EntryPoint)) { if (F.getName().equals(EntryPoint)) {
EntryFunction = &F; // EntryFunction = &F;
initEdges(F); initEdges(F);
} }
if (PrintAddresses) if (PrintAddresses)

View File

@ -1,10 +1,16 @@
# RTSA-lab01-CacheAnalysis # RTSA-lab01-CacheAnalysis
In this lab session you will learn how to implement a LRU cache in abstract representation. In this lab session you will learn how to implement a LRU cache in abstract representation.
The Goal is to implement an LRU must Join in include/AbstractState.h.
For this we assume a "Set-Associative LRU Cache", with 16 sets an associativity of 4 and a cacheline size of two times instruction size. ## Exercise
Implement a LRU Must-Join as described in the lecture, WCET - Cache Analysis.
A 16 SetCache with an associativity of 4 Assumed, and cache lines can hold two memory words -> CacheSize 1024kB.
In order to do so, complete the function "mustJoin" inside [include/AbstractState.h:138](https://git.cs.tu-dortmund.de/nils.hoelscher/RTSA-lab01-CacheAnalysis/src/branch/master/include/AbstractState.h#L138).
The goal is to join the inbound state into the "this" state.
The Project can be build, tested and Evaluated with the "helper" script. The Project can be build, tested and Evaluated with the "helper" script.
The Setup and some nice to knows are described in the following sections.
## Disclaimer ## Disclaimer

View File

@ -92,7 +92,7 @@ public: // everything is public, because IDGAF
} }
Visited[Visitor.first] = true; Visited[Visitor.first] = true;
} }
return false; return Ret;
} }
/** /**
@ -104,8 +104,6 @@ public: // everything is public, because IDGAF
void removeNestedLoops( void removeNestedLoops(
std::list<unsigned int> LoopBodyIn, std::list<unsigned int> LoopBodyIn,
std::map<unsigned int, unsigned int> OrigNodeToUnrolledNode) { std::map<unsigned int, unsigned int> OrigNodeToUnrolledNode) {
unsigned int LoopHead = LoopBodyIn.front();
unsigned int LoopTail = LoopBodyIn.back();
unsigned int NestLoopTail; unsigned int NestLoopTail;
for (unsigned int NodeNr : LoopBodyIn) { for (unsigned int NodeNr : LoopBodyIn) {
bool IsLoopHead = false; bool IsLoopHead = false;