Skip to content
Snippets Groups Projects
Commit ced24800 authored by Bouquillon Fabien's avatar Bouquillon Fabien
Browse files

add total UCB to UCB_local plugin

parent aafbafa2
No related branches found
No related tags found
No related merge requests found
fabien@fabien-UX410UAK.5040:1581070544
\ No newline at end of file
......@@ -118,7 +118,31 @@ namespace otawa {
}
}
}
// COMPUTATION OF THE TOTAL UCB MULTISET
Mathset::Multiset<int> total_ucb;
for (CFGCollection::Iter cfg_iter(*coll); cfg_iter(); cfg_iter++)
{
for (CFG::BlockIter block_iter = cfg_iter->blocks(); block_iter(); block_iter++)
{
if (block_iter->isBasic())
{
BasicBlock *bb = block_iter->toBasic();
initialize_RMB_LMB::Memory_block *mb = initialize_RMB_LMB::MB_STRUCT(bb);
int tmp = mb->block_id;
Mathset::Multiset<int> tmp_ucb_in = UCB_LOCAL_IN(bb);
Mathset::Multiset<int> tmp_ucb_out = UCB_LOCAL_OUT(bb);
total_ucb = math_multiset_fusion(total_ucb, tmp_ucb_in);
total_ucb = math_multiset_fusion(total_ucb, tmp_ucb_out);
}
}
}
TOTAL_UCB(ws) = total_ucb;
}
......@@ -126,5 +150,6 @@ namespace otawa {
Identifier<Mathset::Multiset<int>> UCB_LOCAL_IN("otawa::UCB_local::UCB_LOCAL_IN");
Identifier<Mathset::Multiset<int>> UCB_LOCAL_OUT("otawa::UCB_local::UCB_LOCAL_OUT");
Identifier<Mathset::Multiset<int>> TOTAL_UCB("otawa::UCB_local::TOTAL_UCB");
}
}
File deleted
File deleted
......@@ -36,4 +36,25 @@ int main(int argc, char **argv) {
ws = manager.load(argv[1], conf);
ws->require(DynFeature("otawa::UCB_local::UCB_LOCAL_FEATURE"), conf);
const CFGCollection *coll = INVOLVED_CFGS(ws);
for (CFGCollection::Iter cfg_iter(*coll); cfg_iter(); cfg_iter++)
{
for (CFG::BlockIter block_iter = cfg_iter->blocks(); block_iter(); block_iter++)
{
if (block_iter->isBasic())
{
BasicBlock *bb = block_iter->toBasic();
Mathset::Multiset<int> ucb_in = UCB_LOCAL_IN(bb);
Mathset::Multiset<int> ucb_out = UCB_LOCAL_OUT(bb) ;
std::cout << "-------------------------" << std::endl;
std::cout << "BLOCK:" << bb->id() << std::endl;
ucb_in.print_vector();
ucb_out.print_vector();
std::cout << "-------------------------" << std::endl;
}
}
}
}
File deleted
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
File deleted
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<cache-config>
<icache>
<block_bits>4</block_bits>
<block_bits>2</block_bits>
<way_bits>1</way_bits>
<row_bits>0</row_bits>
<row_bits>3</row_bits>
<miss_penalty>70</miss_penalty>
</icache>
</cache-config>
......@@ -8,7 +8,6 @@
#include <fstream>
#include <sstream>
#include <functional>
#include <multiset.h>
#include <otawa/cfg.h>
......@@ -34,5 +33,7 @@ extern p::feature UCB_LOCAL_FEATURE;
extern Identifier<Mathset::Multiset<int>> UCB_LOCAL_IN;
extern Identifier<Mathset::Multiset<int>> UCB_LOCAL_OUT;
extern Identifier<Mathset::Multiset<int>> TOTAL_UCB;
} }
#endif
No preview for this file type
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
{ ID(otawa::CACHE_CONFIG_PATH) = ./cache_simple.xml, ID(otawa::VERBOSE) = true, ID(otawa::TASK_ENTRY) = main, ID(otawa::NO_SYSTEM) = true }
\ No newline at end of file
void foo() {
int i;
if (i) {
i++;
}
}
void bar() {
int i;
for (i = 0; i < 10; i++) {
}
}
int main(void) {
int i = 0;
int i;
for (i = 0; i < 10; i++) {
if (i % 2) {
foo();
foo();
int j = 0;
} else {
bar();
}
if (i % 3) {
continue;
}
i += 2;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<cache-config>
<icache>
<block_bits>6</block_bits>
<block_bits>2</block_bits>
<way_bits>1</way_bits>
<row_bits>1</row_bits>
<row_bits>4</row_bits>
<miss_penalty>70</miss_penalty>
</icache>
</cache-config>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment