Commit 731f82aa authored by Gaurav Kukreja's avatar Gaurav Kukreja

Renmed project map_cfg to instrument

Signed-off-by: Gaurav Kukreja's avatarGaurav Kukreja <gaurav@gauravk.in>
parent d6939e5b
#Define install directory
export MYBASEDIR:=/home/gaurav/eclipse-workspace/sls_thesis_project
export MYBASEDIR:=/home/gaurav/eclipse-workspace/hostCompiledSimulation
#Directory for IR to C tool source
IR2CDIR=$(MYBASEDIR)/ir2c
......
......@@ -7,7 +7,7 @@ include ../../Makefile.macros
APP1 = my_ctop
TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g
IRDUMP = 1 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
......@@ -11,7 +11,7 @@ APP1 = my_ctop_IR
#PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc
TREEDUMP = -fdump-tree-all-blocks-details
OPT = -g -O1 #is O3 in original MiBench download. Use O3 for final testing
OPT = -g -O2 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g
#IRDUMP = 1 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
This diff is collapsed.
......@@ -33,14 +33,14 @@ struct adpcm_state coder_1_state;
int main() {
long unsigned int end_46;
int i_45;
long unsigned int end_44;
long unsigned int end_43;
long unsigned int start_40;
uintptr_t ivtmp_34;
int D_2229;
uintptr_t ivtmp_28;
long unsigned int end_62;
long unsigned int end_61;
long unsigned int end_60;
int i_59;
long unsigned int start_56;
uintptr_t ivtmp_50;
int D_2245;
uintptr_t ivtmp_44;
long unsigned int count;
long unsigned int end;
long unsigned int start;
......@@ -53,21 +53,21 @@ mainbb_2:
ARR_SIZE_0 = ARR_SIZE;
j = ARR_SIZE_0 / 10240;
if (j != 0)
goto mainbb_14;
goto mainbb_13;
else
goto mainbb_7;
// # SUCC: 14 [91.0%] (true,exec) 7 [9.0%] (false,exec)
// # SUCC: 13 [91.0%] (true,exec) 7 [9.0%] (false,exec)
mainbb_14:
mainbb_13:
// # PRED: 2 [91.0%] (true,exec)
end_43 = 0;
end_61 = 0;
count = 0;
// # SUCC: 3 [100.0%] (fallthru)
mainbb_3:
// # PRED: 13 [100.0%] (fallthru) 14 [100.0%] (fallthru)
end_46 = end_43 + 10240;
if (end_43 < end_46)
end_62 = end_61 + 10240;
if (end_61 < end_62)
goto mainbb_4;
else
goto mainbb_6;
......@@ -75,36 +75,36 @@ mainbb_3:
mainbb_4:
// # PRED: 3 [99.0%] (true,exec)
i_45 = (int) end_43;
ivtmp_34 = (uintptr_t)&in_Data[i_45];
end_44 = end_43;
i_59 = (int) end_61;
ivtmp_50 = (uintptr_t)&in_Data[i_59];
end_60 = end_61;
// # SUCC: 5 [100.0%] (fallthru,exec)
mainbb_5:
// # PRED: 5 [99.0%] (true,exec) 4 [100.0%] (fallthru,exec)
pcmdata[end_44 - end_43] = *(short int*)((uintptr_t)ivtmp_34);
i_45 = i_45 + 1;
end_44 = (long unsigned int) i_45;
ivtmp_34 = ivtmp_34 + 2;
if (end_44 < end_46)
// # PRED: 5 [99.0%] (dfs_back,true,exec) 4 [100.0%] (fallthru,exec)
pcmdata[end_60 - end_61] = *(short int*)((uintptr_t)ivtmp_50);
i_59 = i_59 + 1;
end_60 = (long unsigned int) i_59;
ivtmp_50 = ivtmp_50 + 2;
if (end_60 < end_62)
goto mainbb_5;
else
goto mainbb_6;
// # SUCC: 5 [99.0%] (true,exec) 6 [1.0%] (false,exec)
// # SUCC: 5 [99.0%] (dfs_back,true,exec) 6 [1.0%] (false,exec)
mainbb_6:
// # PRED: 5 [1.0%] (false,exec) 3 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, 10240, &coder_1_state);
count = count + 1;
if (j > count)
goto mainbb_13;
goto mainbb_14;
else
goto mainbb_7;
// # SUCC: 13 [91.0%] (true,exec) 7 [9.0%] (false,exec)
// # SUCC: 14 [91.0%] (dfs_back,true,exec) 7 [9.0%] (false,exec)
mainbb_13:
// # PRED: 6 [91.0%] (true,exec)
end_43 = end_46;
mainbb_14:
// # PRED: 6 [91.0%] (dfs_back,true,exec)
end_61 = end_62;
goto mainbb_3;
// # SUCC: 3 [100.0%] (fallthru)
......@@ -118,9 +118,9 @@ mainbb_7:
mainbb_8:
// # PRED: 7 [61.0%] (true,exec)
start_40 = j * 10240;
start = j * 10240;
end = ARR_SIZE;
if (start_40 < end)
if (start < end)
goto mainbb_9;
else
goto mainbb_11;
......@@ -128,27 +128,27 @@ mainbb_8:
mainbb_9:
// # PRED: 8 [99.0%] (true,exec)
i = (int) start_40;
ivtmp_28 = (uintptr_t)&in_Data[i];
D_2229 = (int) end;
start = start_40;
i = (int) start;
ivtmp_44 = (uintptr_t)&in_Data[i];
D_2245 = (int) end;
start_56 = start;
// # SUCC: 10 [100.0%] (fallthru,exec)
mainbb_10:
// # PRED: 10 [99.0%] (true,exec) 9 [100.0%] (fallthru,exec)
pcmdata[start - start_40] = *(short int*)((uintptr_t)ivtmp_28);
// # PRED: 10 [99.0%] (dfs_back,true,exec) 9 [100.0%] (fallthru,exec)
pcmdata[start_56 - start] = *(short int*)((uintptr_t)ivtmp_44);
i = i + 1;
start = (long unsigned int) i;
ivtmp_28 = ivtmp_28 + 2;
if (i != D_2229)
start_56 = (long unsigned int) i;
ivtmp_44 = ivtmp_44 + 2;
if (i != D_2245)
goto mainbb_10;
else
goto mainbb_11;
// # SUCC: 10 [99.0%] (true,exec) 11 [1.0%] (false,exec)
// # SUCC: 10 [99.0%] (dfs_back,true,exec) 11 [1.0%] (false,exec)
mainbb_11:
// # PRED: 10 [1.0%] (false,exec) 8 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, (int) (end - start_40), &coder_1_state);
adpcm_coder (&pcmdata, &adpcmdata, (int) (end - start), &coder_1_state);
// # SUCC: 12 [100.0%] (fallthru,exec)
mainbb_12:
......
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>map_cfg</name>
<name>instrument</name>
<comment></comment>
<projects>
</projects>
......
This diff is collapsed.
/***********************************************************
Intermediate representation of
adpcm/app_dir/my_ctop.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/*
** Timing - Test timing on adpcm coder and decoder.
**
** The program creates 10Kb garbage, and runs the compressor and
** the decompressor on it.
*/
#include <stdio.h>
#include "adpcm.h"
#include "in_small.h"
//#include "in_large.h"
#include "my_variables.h"
#define DATASIZE 10*1024 /* Data block size */
//ARR_SIZE is the number of short type elements in
//input data array. defined in in_data_small.h
//unsigned int ARR_SIZE = 13305601;
//unsigned int ARR_SIZE = 684433;
short int pcmdata[DATASIZE];
char adpcmdata[DATASIZE/2];
struct adpcm_state coder_1_state;
int main() {
long unsigned int end_62;
long unsigned int end_61;
long unsigned int end_60;
int i_59;
long unsigned int start_56;
uintptr_t ivtmp_50;
int D_2245;
uintptr_t ivtmp_44;
long unsigned int count;
long unsigned int end;
long unsigned int start;
long unsigned int j;
int i;
unsigned int ARR_SIZE_0;
mainbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
ARR_SIZE_0 = ARR_SIZE;
j = ARR_SIZE_0 / 10240;
if (j != 0)
goto mainbb_13;
else
goto mainbb_7;
// # SUCC: 13 [91.0%] (true,exec) 7 [9.0%] (false,exec)
mainbb_13:
// # PRED: 2 [91.0%] (true,exec)
end_61 = 0;
count = 0;
// # SUCC: 3 [100.0%] (fallthru)
mainbb_3:
// # PRED: 13 [100.0%] (fallthru) 14 [100.0%] (fallthru)
end_62 = end_61 + 10240;
if (end_61 < end_62)
goto mainbb_4;
else
goto mainbb_6;
// # SUCC: 4 [99.0%] (true,exec) 6 [1.0%] (false,exec)
mainbb_4:
// # PRED: 3 [99.0%] (true,exec)
i_59 = (int) end_61;
ivtmp_50 = (uintptr_t)&in_Data[i_59];
end_60 = end_61;
// # SUCC: 5 [100.0%] (fallthru,exec)
mainbb_5:
// # PRED: 5 [99.0%] (dfs_back,true,exec) 4 [100.0%] (fallthru,exec)
pcmdata[end_60 - end_61] = *(short int*)((uintptr_t)ivtmp_50);
i_59 = i_59 + 1;
end_60 = (long unsigned int) i_59;
ivtmp_50 = ivtmp_50 + 2;
if (end_60 < end_62)
goto mainbb_5;
else
goto mainbb_6;
// # SUCC: 5 [99.0%] (dfs_back,true,exec) 6 [1.0%] (false,exec)
mainbb_6:
// # PRED: 5 [1.0%] (false,exec) 3 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, 10240, &coder_1_state);
count = count + 1;
if (j > count)
goto mainbb_14;
else
goto mainbb_7;
// # SUCC: 14 [91.0%] (dfs_back,true,exec) 7 [9.0%] (false,exec)
mainbb_14:
// # PRED: 6 [91.0%] (dfs_back,true,exec)
end_61 = end_62;
goto mainbb_3;
// # SUCC: 3 [100.0%] (fallthru)
mainbb_7:
// # PRED: 6 [9.0%] (false,exec) 2 [9.0%] (false,exec)
if (ARR_SIZE_0 % 10240 != 0)
goto mainbb_8;
else
goto mainbb_12;
// # SUCC: 8 [61.0%] (true,exec) 12 [39.0%] (false,exec)
mainbb_8:
// # PRED: 7 [61.0%] (true,exec)
start = j * 10240;
end = ARR_SIZE;
if (start < end)
goto mainbb_9;
else
goto mainbb_11;
// # SUCC: 9 [99.0%] (true,exec) 11 [1.0%] (false,exec)
mainbb_9:
// # PRED: 8 [99.0%] (true,exec)
i = (int) start;
ivtmp_44 = (uintptr_t)&in_Data[i];
D_2245 = (int) end;
start_56 = start;
// # SUCC: 10 [100.0%] (fallthru,exec)
mainbb_10:
// # PRED: 10 [99.0%] (dfs_back,true,exec) 9 [100.0%] (fallthru,exec)
pcmdata[start_56 - start] = *(short int*)((uintptr_t)ivtmp_44);
i = i + 1;
start_56 = (long unsigned int) i;
ivtmp_44 = ivtmp_44 + 2;
if (i != D_2245)
goto mainbb_10;
else
goto mainbb_11;
// # SUCC: 10 [99.0%] (dfs_back,true,exec) 11 [1.0%] (false,exec)
mainbb_11:
// # PRED: 10 [1.0%] (false,exec) 8 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, (int) (end - start), &coder_1_state);
// # SUCC: 12 [100.0%] (fallthru,exec)
mainbb_12:
// # PRED: 7 [39.0%] (false,exec) 11 [100.0%] (fallthru,exec)
return 0;
// # SUCC: EXIT [100.0%]
}
......@@ -286,6 +286,10 @@ def map_cfg(listISCFileNames, listObjdumpFileNames, listBinaryFileNames):
gdbMapping = getGDBMapping(binaryFileName, objdumpLineNumForAddress)
print_debug_isc (listISCFunctions)
print_debug_binary (listObjdumpFunctions, gdbMapping)
display_cfgs(app, listISCFunctions[0].cfg, listObjdumpFunctions[0].cfg, "%s" % listISCFunctions[0].functionName)
mappingStackISC = []
mappingStackObj = []
......@@ -300,14 +304,12 @@ def map_cfg(listISCFileNames, listObjdumpFileNames, listBinaryFileNames):
else:
logging.debug( "Fuck my life!!!")
# print_debug_isc (listISCFunctions)
# print_debug_binary (listObjdumpFunctions, gdbMapping)
print_debug_isc (listISCFunctions)
print_debug_binary (listObjdumpFunctions, gdbMapping)
printDebugMapCFG(listISCFunctions, listObjdumpFunctions, gdbMapping)
display_cfgs(app, listISCFunctions[0].cfg, listObjdumpFunctions[0].cfg, "%s" % listISCFunctions[0].functionName)
# display_cfg(app, listISCFunctions[1].cfg, "%s" % listISCFunctions[0].functionName)
# app.exec_()
return listISCFunctions, listObjdumpFunctions
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment