ZDDMayDomainPolicy.h 1.29 KB
Newer Older
Valentin Touzeau's avatar
WIP    
Valentin Touzeau 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
#ifndef ZDD_MAY_DOMAIN_POLICY_H
#define ZDD_MAY_DOMAIN_POLICY_H

#include "ZDDAbstractValue.h"
#include "MayAbstractValuePolicy.h"

namespace exactlru
{

class ZDDMayDomainPolicy
{
public:
	using ManagerPtr = std::shared_ptr<ZDDManager>;
	using AbstractValue = ZDDAbstractValue<MayAbstractValuePolicy>;

	ZDDMayDomainPolicy(const otawa::icat3::LBlock*,
	                   const otawa::icat3::LBlockCollection& coll,
	                   int set,
	                   const AbstractValue*) :
		m_manager(new ZDDManager(coll[set]))
	{
	}

	AbstractValue createBot(const otawa::icat3::LBlock*,
	                        const otawa::icat3::LBlockCollection&,
	                        int)
	{
Valentin Touzeau's avatar
WIP    
Valentin Touzeau committed
28
		return AbstractValue();
Valentin Touzeau's avatar
WIP    
Valentin Touzeau committed
29
	}
Valentin Touzeau's avatar
WIP    
Valentin Touzeau committed
30
31
32
	AbstractValue createTop(const otawa::icat3::LBlock* focus,
	                        const otawa::icat3::LBlockCollection& coll,
	                        int set)
Valentin Touzeau's avatar
WIP    
Valentin Touzeau committed
33
	{
Valentin Touzeau's avatar
WIP    
Valentin Touzeau committed
34
		return AbstractValue(focus, coll, set);
Valentin Touzeau's avatar
WIP    
Valentin Touzeau committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
	}

	ManagerPtr getManager() const
	{
		return m_manager;
	}

	void fetch(AbstractValue& a, const otawa::icat3::LBlock *lb, int k, const otawa::icat3::LBlock* focus)
	{
		a.update(m_manager, lb, k, focus);
	}

	bool isAlwaysMiss(const AbstractValue& a) const
	{
		return a.isAlwaysMiss(*this);
	}
private:
	ManagerPtr m_manager;
};

} // namespace exactlru

#endif // ZDD_MAY_DOMAIN_POLICY_H