21 #ifndef OTAWA_DCACHE_FEATURES_H_
22 #define OTAWA_DCACHE_FEATURES_H_
32 namespace ilp {
class Var; }
49 inline ACS(
const int _size,
const int _A,
int init = -1) :
A (_A),
size(_size),
age(new int [
size])
50 {
for (
int i = 0; i <
size; i++)
age[i] = init; }
54 inline int getA(
void)
const {
return A; }
57 {
for (
int i = 0; i <
size; i++)
age[i] = source.
age[i]; }
63 for (
int i = 0; i <
size; i++)
if (
age[i] != dom.
age[i])
return false;
67 inline void empty(
void) {
for (
int i = 0; i <
size; i++)
age[i] = -1; }
68 inline bool contains(
const int id)
const { ASSERT((
id <
size) && (
id >= 0));
return(
age[
id] != -1); }
73 inline void setAge(
const int id,
const int _age)
74 { ASSERT(
id <
size); ASSERT((_age <
A) || (_age == -1));
age[id] = _age; }
76 { ASSERT(
A == dom.
A); ASSERT(
size == dom.
size);
for(
int i = 0; i <
size; i++)
age[i] = dom.
age[i]; }
94 inline int set(
void)
const {
return _set; }
142 { ASSERT(instruction);
data.blk = &
block; }
172 inline io::Output& operator<<(io::Output& out, const Pair<int, BlockAccess *>& v) {
return out; }
200 const t&
top(
void)
const;
201 void set(
t& d,
const t& s)
const;
203 void join(
t& d,
const t& s)
const;
204 bool equals(
const t& s1,
const t& s2)
const;
int A
Definition: features.h:82
Identifier< ilp::Var * > MISS_VAR
This property gives the variable counting the number of misses of a BlockAccess.
dtd::RefAttr< BasicBlock * > source("source", dtd::STRICT|dtd::REQUIRED)
p::feature CONSTRAINTS_FEATURE
This feature ensures that the constraints associated with each data cache block categories has been t...
A block access represents a data memory access of an instruction.
Definition: features.h:125
hard::Cache::block_t last
Only for the RANGE kind, get the last accessed block.
Definition: features.h:168
int _set
Definition: features.h:100
bool equals(const ACS &dom) const
Test if two ACS are equals.
Definition: features.h:61
struct otawa::dcache::DirtyManager::t t
State for the dirty analysis.
BlockAccess(Inst *instruction, action_t action)
Build a block access of type ANY.
Definition: features.h:140
Definition: features.h:39
struct otawa::dcache::BlockAccess::@0::@1 range
dfa::BitSet _must
Definition: features.h:193
Identifier< Vector< ACS * > * > ENTRY_MAY_ACS
Configuration property giving the ACS at the startup of the task.
Definition: features.h:131
Block(int set, int index, const Address &address)
Build a simple block.
Definition: features.h:92
Identifier< cache::category_t > CATEGORY
Gives the category for a data cache block access.
union otawa::dcache::BlockAccess::@0 data
Identifier< Pair< int, BlockAccess * > > DATA_BLOCKS
Give the list of accesses to the data cache.
genstruct::Vector< ACS * > acs_table_t
Definition: features.h:214
Identifier< Address > INITIAL_SP
Provide the address of the stack pointer at the start of the task.
p::feature DATA_BLOCK_FEATURE
This feature ensures that information about the data cache accesses has been provided on each basic b...
int last(void) const
Definition: features.h:156
Identifier< data_fmlevel_t > DATA_FIRSTMISS_LEVEL
According to its value, select the way the first-miss analysis is performed: – analysis of inner lo...
void empty(void)
Set all block to age -1.
Definition: features.h:67
kind_t kind(void) const
Get the kind of the access.
Definition: features.h:151
const dfa::BitSet & may(void) const
Definition: features.h:185
elm::io::Output & operator<<(elm::io::Output &output, const MUSTProblem::Domain &dom)
Definition: dcache_ACSBuilder.cpp:155
action_t action(void) const
Get the performed action.
Definition: features.h:153
Definition: features.h:134
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
This class implements a set as a bit vector.
Definition: BitSet.h:82
Identifier< bool > DATA_PSEUDO_UNROLLING
This configuration property activates, if set to true (default), the pseudo-unrolling for the cache a...
void print(elm::io::Output &output) const
Print the ACS.
Definition: dcache_ACSBuilder.cpp:498
dfa::BitSet & must(void)
Definition: features.h:192
BlockAccess(const BlockAccess &acc)
Construction by cloning.
Definition: features.h:145
ACS(const ACS &source)
Constructor by cloning.
Definition: features.h:56
const BlockCollection & _coll
Definition: features.h:208
bool contains(int index) const
Test if the bit set contains an item.
Definition: BitSet.h:111
Inst * inst
Definition: features.h:164
Definition: features.h:258
void setAge(const int id, const int _age)
Change the age of a block.
Definition: features.h:73
int getA(void) const
Definition: features.h:54
bool mustBeDirty(int b) const
Definition: features.h:189
bool in(const Block &block) const
Test if the given block may be concerned by the current access.
Definition: dcache.cpp:60
const Block & obtain(const Address &addr)
Obtain a block matching the given address.
Definition: dcache_BlockBuilder.cpp:316
Identifier< const BlockCollection * > DATA_BLOCK_COLLECTION
Gives the list of used blocks in the data cache.
BlockAccess(void)
Build a null block access.
Definition: features.h:139
int index(void) const
Get the number of a block.
Definition: features.h:95
p::feature MAY_ACS_FEATURE
This feature that the MAY analysis has been performed for the L1 data cache and that the ACS are prov...
Identifier< BasicBlock * > CATEGORY_HEADER
When a cache access has a category of cache::FIRST_MISS, the "first" part is relative to a particular...
Definition: features.h:256
Definition: features.h:41
genstruct::Vector< acs_stack_t > acs_stack_table_t
Definition: features.h:215
Definition: features.h:129
t bot
Definition: features.h:207
A dirty manager allows to exploit the results of the dirty analysis (DIRTY_FEATURE).
Definition: features.h:176
Definition: features.h:259
bool inRange(int block) const
Test if the given block is the range of the given access.
Definition: features.h:157
Address addr
Definition: features.h:102
bool isNull(void) const
Test if the address is null.
Definition: base.h:72
Definition: features.h:179
const Block & operator[](int i) const
Definition: features.h:111
t(int s)
Definition: features.h:183
int & operator[](int i)
Definition: features.h:79
const t & bottom(void) const
Build a bottom dirty state.
Definition: Dirty.cpp:135
Block(const Block &block)
Cloning of a block.
Definition: features.h:93
t::uint32 offset_t
Definition: base.h:57
Definition: features.h:42
p::feature MUST_ACS_FEATURE
This feature ensures that the ACS (Abstract Cache State) for the MUST data cache analysis has been bu...
const Block * blk
Definition: features.h:167
Identifier< purge_t > PURGE
void setSet(int set)
Set the set number of the block collection.
Definition: features.h:113
Identifier< acs_table_t * > ENTRY_PERS_ACS
This configuration property allows to provide an non-empty ACS for the persistence analysis...
const int & operator[](int i) const
Definition: features.h:78
p::feature CATEGORY_FEATURE
This features ensures that a category each data block access have received a category describing its ...
int getAge(int id) const
Get the age of a block.
Definition: features.h:72
int set(void) const
Get the set number of a block.
Definition: features.h:94
This class contains the configuration of a level of cache of processor.
Definition: Cache.h:34
DirtyManager(const BlockCollection &coll)
Definition: Dirty.cpp:102
const t & top(void) const
Build a top dirty state.
Definition: Dirty.cpp:143
int size
Definition: features.h:82
The representation of an address in OTAWA.
Definition: base.h:54
Definition: features.h:130
void print(io::Output &out) const
Definition: dcache_BlockBuilder.cpp:452
StringOption cache(command, 'c',"cache","used cache","path","")
const dfa::BitSet & must(void) const
Definition: features.h:186
p::feature CLP_BLOCK_FEATURE
int cacheSet(void) const
Definition: features.h:116
bool inSet(int set, const hard::Cache *cache) const
Test if the given set concerns the range access.
Definition: dcache.cpp:37
dfa::BitSet _may
Definition: features.h:193
sys::SystemOutStream & out
BlockAccess & operator=(const BlockAccess &acc)
Definition: features.h:147
p::feature DIRTY_FEATURE
This feature is only useful for data cache with write-back mechanism.
int _set
Definition: features.h:119
bool mustBeDirty(const t &value, int block) const
Test if the given block must be dirty.
Definition: Dirty.cpp:127
ACS & operator=(const ACS &src)
Definition: features.h:59
Identifier< acs_table_t * > MUST_ACS
Provide for each basic block the ACS (Abstract Cache State) of the data cache for each set of the cac...
int idx
Definition: features.h:101
void set(t &d, const t &s) const
Copy a state in an existing one.
Definition: Dirty.cpp:153
~ACS()
Definition: features.h:51
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
Definition: features.h:136
Identifier< acs_table_t * > ENTRY_MUST_ACS
This configuration property is shared by all processor implementing the MUST_ACS_FEATURE.
bool isAny(void) const
Definition: features.h:152
int * age
Definition: features.h:83
t::uint32 block_t
Definition: Cache.h:64
Definition: features.h:135
kind_t
Definition: features.h:133
int getSize(void) const
Get the number of blocks of the ACS.
Definition: features.h:53
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
Identifier< Vector< ACS * > * > MAY_ACS
Provide the ACS for the MAY analysis.
void update(t &d, const BlockAccess &acc)
Update the dirty state with the given block access.
Definition: Dirty.cpp:175
void print(io::Output &out) const
Definition: Dirty.cpp:268
t::uint8 _kind
Definition: features.h:165
This a list of properties.
Definition: PropList.h:63
Inst * instruction(void) const
Get the instruction performing the access.
Definition: features.h:150
t _top
Definition: features.h:207
void join(t &d, const t &s) const
Join two dirty states.
Definition: Dirty.cpp:260
bool equals(const t &s1, const t &s2) const
Test if both dirty states are equals.
Definition: Dirty.cpp:165
p::feature WCET_FUNCTION_FEATURE
This feature provides an easy and naive way to add data cache time to the WCET computation by adding ...
Identifier< acs_table_t * > PERS_ACS
This identifier gives an array of ACS for the persistence analysis.
Identifier< AllocatedTable< DirtyManager::t > > DIRTY
This property contains information about the dirty state of a block.
p::feature PERS_ACS_FEATURE
Feature ensuring that the persistence analysis has been performed.
Represents a single block used by the data cache.
Definition: features.h:89
bool mayBeDirty(const t &value, int block) const
Test if the given block may be dirty.
Definition: Dirty.cpp:117
Identifier< acs_stack_table_t * > LEVEL_PERS_ACS
This identifier allows to get an array on a stack of ACS, one entry for each set of the analyzed cach...
int count(void) const
Get the count of blocks in this collection.
Definition: features.h:115
Definition: features.h:40
const Address & address(void) const
Definition: features.h:96
void set(const ACS &dom)
Set the ages of the given ACS to the current one.
Definition: features.h:75
Representation of an Abstract Cache State where each data cache block is represented by its age...
Definition: features.h:47
dfa::BitSet & may(void)
Definition: features.h:191
ACS(const int _size, const int _A, int init=-1)
Definition: features.h:49
data_fmlevel_t
Definition: features.h:38
t::uint8 _action
Definition: features.h:165
t(const t &i)
Definition: features.h:184
~BlockCollection(void)
Definition: dcache_BlockBuilder.cpp:306
Block(void)
Build a "any" number (with a null address).
Definition: features.h:91
BlockAccess(Inst *instruction, action_t action, Address::offset_t first, Address::offset_t last)
Build a block access of type range.
Definition: features.h:143
bool mayBeDirty(int b) const
Definition: features.h:188
genstruct::Vector< Block * > blocks
Definition: features.h:120
A block collections stores the list of data blocks used in a task for a specific line.
Definition: features.h:108
const Block & block(void) const
Only for kind BLOCK, get the accessed block.
Definition: features.h:154
Shortcut to create a feature with a maker (without the mess of SilentFeature).
Definition: AbstractFeature.h:51
void print(io::Output &out) const
Print a block.
Definition: dcache_BlockBuilder.cpp:288
int first(void) const
Definition: features.h:155
genstruct::AllocatedTable< ACS * > acs_stack_t
Definition: features.h:213
Definition: features.h:128
action_t
Definition: features.h:127
BlockAccess(Inst *instruction, action_t action, const Block &block)
Definition: features.h:141
Definition: features.h:257
Definition: features.h:260
t(void)
Definition: features.h:182
purge_t
Definition: features.h:255