AccMatching.h 819 Bytes
Newer Older
Julien Balette-Pape's avatar
Julien Balette-Pape committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#ifndef LRUSECURITY_ACC_MATCHING_H
#define LRUSECURITY_ACC_MATCHING_H

#include <otawa/cfg/features.h>
#include <otawa/cfg/CFG.h>
#include <otawa/prog/Inst.h>
#include <otawa/icache/features.h>
#include <map>

namespace lrusecurity
{

class AccMatcher
{
public:
    AccMatcher(void){};
    void setupColl(otawa::CFGCollection *coll);
    void setupCFG(otawa::CFG *cfg);
    inline void insert(const otawa::icache::Access *acc, otawa::BasicBlock *bb){_match.insert({acc, bb});};

    otawa::BasicBlock *match_access(const otawa::icache::Access *access);

    inline void clean(void){_match = std::map<const otawa::icache::Access *, otawa::BasicBlock *>();};

private:
    std::map<const otawa::icache::Access *, otawa::BasicBlock *> _match;
};

} // namespace lrusecurity

#endif /* ifndef LRUSECURITY_ACC_MATCHING_H */