Otawa
0.10
|
Fast implementation of abstract domain on the functional state of a microprocessor including the registers and the memory content. More...
#include <otawa/dfa/FastState.h>
Classes | |
struct | node_t |
struct | state_t |
Public Types | |
typedef t::uint32 | address_t |
typedef t::uint32 | register_t |
typedef D::t | value_t |
typedef state_t * | t |
Public Member Functions | |
FastState (D *d, dfa::State *state, StackAllocator &alloc) | |
Build a state. More... | |
int | getMultiMax (void) const |
Get the max number of multiple load/store before jumping to top. More... | |
void | setMultiMax (int new_multi_max) |
Set the maximum number of multiple load/store before approximating to top. More... | |
value_t | get (t s, register_t r) |
Get register value. More... | |
t | set (t s, register_t r, value_t v) |
Set a register value. More... | |
t | store (t s, address_t a, value_t v) |
Perform a store to memory. More... | |
value_t | load (t s, address_t a) |
Perform a load at the given address. More... | |
t | store (t s, address_t a, address_t b, ot::size off, value_t v) |
Perform a multiple-store (joining on all memories that are modified). More... | |
t | storeAtTop (t s) |
Store to T address (set all memory to T). More... | |
value_t | load (t s, address_t a, address_t b, ot::size off) |
Load multiple values from a memory area. More... | |
t | join (t s1, t s2) |
Perform join of both states. More... | |
template<class W > | |
t | map (t s, W &w) |
Apply a function to transform a state. More... | |
bool | equals (t s1, t s2) |
Test if both states are equal. More... | |
void | print (io::Output &out, t s) |
Display the state. More... | |
template<class W > | |
t | combine (t s1, t s2, W &w) |
Apply a function to combine two states. More... | |
Public Attributes | |
t | top |
t | bot |
Private Types | |
typedef struct otawa::dfa::FastState::node_t | node_t |
typedef struct otawa::dfa::FastState::state_t | stat_t |
Private Member Functions | |
t | make (bool bot) |
Make a basic state. More... | |
Private Attributes | |
D * | dom |
elm::t::size | nrblock |
StackAllocator & | allocator |
int | multi_max |
dfa::State * | istate |
Static Private Attributes | |
static const elm::t::size | rblock_shift = 3 |
static const elm::t::size | rblock_mask = (1 << rblock_shift) - 1 |
static const elm::t::size | rblock_size = 1 << rblock_shift |
Fast implementation of abstract domain on the functional state of a microprocessor including the registers and the memory content.
D | Domain of values. |
typedef t::uint32 otawa::dfa::FastState< D >::address_t |
|
private |
typedef t::uint32 otawa::dfa::FastState< D >::register_t |
|
private |
typedef state_t* otawa::dfa::FastState< D >::t |
typedef D::t otawa::dfa::FastState< D >::value_t |
|
inline |
Build a state.
d | Domain manager. |
proc | Analyzed process. |
alloc | Stack allocator to use. |
|
inline |
Apply a function to combine two states.
This function assumes that the applied operation is idempotent and monotonic and use it to speed up the combination.
The worker object must match the following concept:
s1 | First state. |
s2 | Second state. |
w | Worker object. |
References otawa::dfa::FastState< D >::state_t::mem, otawa::dfa::FastState< D >::node_t::n, and otawa::dfa::FastState< D >::state_t::regs.
|
inline |
Test if both states are equal.
s1 | First state. |
s2 | Second state. |
References otawa::dfa::FastState< D >::node_t::a, otawa::dfa::FastState< D >::state_t::mem, otawa::dfa::FastState< D >::node_t::n, otawa::dfa::FastState< D >::state_t::regs, and otawa::dfa::FastState< D >::node_t::v.
|
inline |
|
inline |
Get the max number of multiple load/store before jumping to top.
|
inline |
Perform join of both states.
References otawa::dfa::FastState< D >::state_t::mem, otawa::dfa::FastState< D >::node_t::n, and otawa::dfa::FastState< D >::state_t::regs.
|
inline |
Perform a load at the given address.
s | Current state. |
a | Address to load from. |
References otawa::dfa::FastState< D >::state_t::mem, and otawa::dfa::FastState< D >::node_t::n.
|
inline |
Load multiple values from a memory area.
s | State to load from. |
a | First address of the area. |
b | Last address past the area. |
off | Offset of objects between the area. |
References otawa::dfa::FastState< D >::node_t::a, and otawa::dfa::FastState< D >::state_t::mem.
|
inlineprivate |
Make a basic state.
bot | True if it is a bottom state, false else. |
|
inline |
Apply a function to transform a state.
The worker object must match the following concept:
in | Input state. |
w | Worker object. |
The worker object must match the following concept:
W | Type of the worker. |
in | Input state. |
w | Worker object. |
References otawa::dfa::FastState< D >::node_t::a, copy(), otawa::dfa::FastState< D >::state_t::mem, otawa::dfa::FastState< D >::node_t::n, otawa::dfa::FastState< D >::state_t::regs, and otawa::dfa::FastState< D >::node_t::v.
|
inline |
Display the state.
out | Stream to display to. |
s | State to display. |
References otawa::dfa::FastState< D >::state_t::mem, otawa::dfa::FastState< D >::node_t::n, and otawa::dfa::FastState< D >::state_t::regs.
|
inline |
Set a register value.
References elm::array::copy(), otawa::dfa::FastState< D >::state_t::mem, and otawa::dfa::FastState< D >::state_t::regs.
|
inline |
Set the maximum number of multiple load/store before approximating to top.
new_multi_max | New maximum number of multiple load/store. |
|
inline |
Perform a store to memory.
References otawa::dfa::FastState< D >::node_t::a, otawa::dfa::FastState< D >::state_t::mem, otawa::dfa::FastState< D >::node_t::n, and otawa::dfa::FastState< D >::state_t::regs.
|
inline |
Perform a multiple-store (joining on all memories that are modified).
FastState::value_t FastState::load(t s, address_t a); Perform a load at the given address.
s | State to store in. |
a | Start address of the area. |
b | Last address past the area. |
off | Offset between stored objects. |
v | Value to set. |
s | Current state. |
a | Address to load from. |
Perform a multiple-store (joining on all memories that are modified).
s | State to store in. |
a | Start address of the area. |
b | Last address past the area. |
off | Offset between stored objects. |
v | Value to set. |
References otawa::dfa::FastState< D >::node_t::a, otawa::dfa::FastState< D >::state_t::mem, and otawa::dfa::FastState< D >::state_t::regs.
|
inline |
Store to T address (set all memory to T).
s | State to store to. |
References otawa::dfa::FastState< D >::state_t::regs.
|
private |
t otawa::dfa::FastState< D >::bot |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
t otawa::dfa::FastState< D >::top |