ExistHitPrevDomain.h 1.34 KB
Newer Older
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
32
33
34
35
36
37
38
39
40
41
42
#ifndef LRUSECURITY_EXIST_HIT_DOMAIN_H_
#define LRUSECURITY_EXIST_HIT_DOMAIN_H_

#include <otawa/icat3/features.h>
#include <otawa/icache/features.h>
#include <elm/io/Output.h>

#include <lrupreanalysis/features.h>
#include "ACSSecurity.h"
namespace lrusecurity
{

class ExistHitDomain {
public:
	using t = ACSSecurity;

	ExistHitDomain(const otawa::icat3::LBlockCollection& coll, int set, const t* init);
	inline const t& bot(void) const { return _bot; }
	inline const t& top(void) const { return _top; }
	inline const t& init(void) const { return _init; }
	inline void print(const t& a, otawa::io::Output& out) const { a.print(_set, _coll, out); }
	inline elm::io::Printable<t, ExistHitDomain> print(const t& a) const { return elm::io::p(a, *this); }
	inline bool contains(const t& a, int i) { return(a[i] != otawa::icat3::BOT_AGE); }
	inline void copy(t& d, const t& s) { d.copy(s); }
	bool equals(const t& a, const t& b) const;
	void join(t& d, const t& s);
	void fetch(t& a, const otawa::icat3::LBlock *lb, lrupreanalysis::ACSManager& mustManager);
	void update(const otawa::icache::Access& access, t& a, lrupreanalysis::ACSManager& mustManager);

private:
	int _n;
	t _bot, _top;
	otawa::hard::Cache::set_t _set;
	const otawa::icat3::LBlockCollection& _coll;
	int _A;
	const t& _init;
	t _tmp;
};

} // namespace lrusecurity

#endif // LRUSECURITY_EXIST_HIT_DOMAIN_H_