23 #ifndef OTAWA_DCACHE_PERSPROBLEM_H_
24 #define OTAWA_DCACHE_PERSPROBLEM_H_
27 #include <elm/assert.h>
35 namespace otawa {
namespace dcache {
42 inline Item(
const int _size,
const int _A):
ACS(_size, _A, -1) { }
48 { ASSERT((
id >= 0) && (
id <
size));
if ((newage != -1) && ((
age[
id] > newage) || (
age[
id] == -1)))
age[id] = newage; }
62 {
for (
int i = 0; i < source.
data.length(); i++)
data.add(
new Item(*source.
data[i])); }
77 inline void addDamage(
const int id,
const int index,
int damage) { ASSERT(!
isBottom);
data[index]->addDamage(
id, damage); }
79 inline void refresh(
const int id,
const int index,
int newage) { ASSERT(!
isBottom);
data[index]->refresh(
id, newage); }
80 void refresh(
const int id,
int newage);
91 int m =
min(
data.count(), d.count());
92 for(
int i = m; i <
data.count(); i++)
94 data.setLength(d.count());
95 for(
int i = 0; i < m; i++)
97 for(
int i = m; i < d.count(); i++)
ACS for the multi-level data cache persistence analysis.
Definition: PERSProblem.h:40
CFG * cfg
Definition: PERSProblem.h:140
int A
Definition: features.h:82
void update(Domain &out, const Domain &in, BasicBlock *bb)
Definition: dcache_ACSBuilder.cpp:579
Item(const ACS &source)
Definition: PERSProblem.h:44
dtd::RefAttr< BasicBlock * > source("source", dtd::STRICT|dtd::REQUIRED)
~PERSProblem(void)
Definition: dcache_ACSBuilder.cpp:568
void assign(Domain &a, const Domain &b) const
Definition: PERSProblem.h:117
A block access represents a data memory access of an instruction.
Definition: features.h:125
void addDamage(const int id, const int index, int damage)
Definition: PERSProblem.h:77
const Domain & bottom(void) const
Definition: dcache_ACSBuilder.cpp:571
void leaveContext(Domain &dom, BasicBlock *header, util::hai_context_t ctx)
Definition: PERSProblem.h:131
void refresh(const int id, const int index, int newage)
Definition: PERSProblem.h:79
void inject(MUSTProblem::Domain *must, const int id)
Consider that an access to the designed block is performed.
Definition: dcache_ACSBuilder.cpp:803
void addDamage(const int id, int damage)
Change the age of the designed block considering the given damage to the ACS.
Definition: dcache_ACSBuilder.cpp:823
void print(elm::io::Output &output) const
Display the ACS.
Definition: dcache_ACSBuilder.cpp:988
intn_t min(intn_t a, intn_t b)
Return the min with a signed comparison.
Definition: clp_analysis.cpp:171
elm::io::Output & operator<<(elm::io::Output &output, const MUSTProblem::Domain &dom)
Definition: dcache_ACSBuilder.cpp:155
void refresh(int id, int newage)
Definition: PERSProblem.h:47
Definition: ACSBuilder.h:37
Item & getItem(const int idx) const
Definition: PERSProblem.h:85
bool contains(const int id) const
Test if a block is in the ACS , that is, its each age is in the interval [0, A[ where A is the associ...
Definition: features.h:68
void lub(Domain &a, const Domain &b) const
Definition: PERSProblem.h:116
Item(const int _size, const int _A)
Definition: PERSProblem.h:42
void enterContext(void)
Called when a loop context is entered to add a level.
Definition: dcache_ACSBuilder.cpp:1010
Domain ent
Definition: PERSProblem.h:144
const Domain & entry(void) const
Definition: dcache_ACSBuilder.cpp:575
void lub(const Domain &dom)
Compute the join of the current value with the given one and the result is left in the current ACS...
Definition: dcache_ACSBuilder.cpp:867
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
~Domain(void)
Definition: PERSProblem.h:63
void purge(Item &item, const BlockAccess &acc)
Apply the given purge action to the given item.
Definition: dcache_ACSBuilder.cpp:590
void lub(const Item &dom)
Perform join on persistent ACS.
Definition: dcache_ACSBuilder.cpp:776
PERSProblem(const int _size, const BlockCollection *_lbset, WorkSpace *_fw, const hard::Cache *_cache, const int _A)
Definition: dcache_ACSBuilder.cpp:549
Domain callstate
Definition: PERSProblem.h:108
void enterContext(Domain &dom, BasicBlock *header, util::hai_context_t ctx)
Definition: PERSProblem.h:124
void ageAll(void)
Consider that an unknown access is performed and, therefore, all blocks must be aged.
Definition: dcache_ACSBuilder.cpp:635
Domain bot
Definition: PERSProblem.h:143
bool equals(const Domain &a, const Domain &b) const
Definition: PERSProblem.h:118
Domain(const int _size, const int _A)
Definition: PERSProblem.h:60
int length(void) const
Definition: PERSProblem.h:84
Item whole
Definition: PERSProblem.h:102
bool isPersistent(const int id)
Definition: PERSProblem.h:53
Item & operator=(const Item &src)
Definition: PERSProblem.h:45
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
This class contains the configuration of a level of cache of processor.
Definition: Cache.h:34
int getAge(const int id, const int index) const
Definition: PERSProblem.h:75
bool isWiped(const int id)
Definition: PERSProblem.h:52
void inject(MUSTProblem::Domain *must, const int id)
Consider that the designed block is accessed.
Definition: dcache_ACSBuilder.cpp:950
bool isBottom
Definition: PERSProblem.h:104
genstruct::Vector< Item * > data
Definition: PERSProblem.h:103
const hard::Cache * cache
Definition: PERSProblem.h:142
void setNotBottom(void)
Definition: PERSProblem.h:87
sys::SystemOutStream & out
Definition: PERSProblem.h:58
const int line
Definition: PERSProblem.h:145
Domain & operator=(const Domain &src)
Assignement of persistence analysis ACS.
Definition: dcache_ACSBuilder.cpp:838
hai_context_t
Definition: HalfAbsInt.h:50
ACS & operator=(const ACS &src)
Definition: features.h:59
Problem for computing the PERS ACS of L-blocks.
Definition: PERSProblem.h:37
void empty(void)
Empty the domain.
Definition: dcache_ACSBuilder.cpp:924
Definition: HalfAbsInt.h:51
bool contains(const int id, const int index)
Definition: PERSProblem.h:72
bool isPersistent(const int id, const int index)
Definition: PERSProblem.h:76
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
int * age
Definition: features.h:83
WorkSpace * fw
Definition: PERSProblem.h:141
bool isWiped(const int id, const int index)
Definition: PERSProblem.h:74
void ageAll(void)
Consider that an unknown access is performed and, therefore, all blocks must be aged.
Definition: dcache_ACSBuilder.cpp:646
Item & operator=(const ACS &src)
Definition: PERSProblem.h:46
bool equals(const Domain &dom) const
Test if two ACS are equals.
Definition: dcache_ACSBuilder.cpp:912
Domain(const Domain &source)
Definition: PERSProblem.h:61
void set(const ACS &w, const genstruct::Table< ACS * > &d)
Definition: PERSProblem.h:88
void leaveContext(void)
Called when a loop context is left to remove the top-level.
Definition: dcache_ACSBuilder.cpp:1022
bool equals(const Item &dom) const
Test if two ACS are equals.
Definition: dcache_ACSBuilder.cpp:789
Item(const Item &source)
Definition: PERSProblem.h:43
void setToBottom(void)
Set the bottom value in the ACS.
Definition: dcache_ACSBuilder.cpp:936
Representation of an Abstract Cache State where each data cache block is represented by its age...
Definition: features.h:47
const BlockCollection * lbset
Definition: PERSProblem.h:139
A block collections stores the list of data blocks used in a task for a specific line.
Definition: features.h:108
Item & getWhole(void)
Definition: PERSProblem.h:71