small changes
[IRC.git] / Robust / src / buildscript
index 0691524d332dd8cd174558361aeacf9ea81a818f..7a80b40acb0698513d5dbcdc15ad15a89110b770 100755 (executable)
@@ -74,6 +74,7 @@ echo "-rawpath print out execute path information for raw version (should be use
 echo "-useprofile use profiling data for scheduling (should be used together with -raw)"
 echo -printscheduling print out scheduling graphs
 echo -printschedulesim print out scheduling simulator result graphs
+echo "-tilera_output_dir specify the output directory for the generated TILERA code"
 echo "-tilera_bme generate tilera version binary for Bare Mental Environment (should be used together with -multicore"
 echo "-tilera_zlinux generate tilera version binary for Zero-Overhead Linux with multi-process mode (should be used together with -multicore"
 echo "-tileraconfig config tilera simulator/pci as nxm (should be used together with -tilera)"
@@ -85,6 +86,7 @@ echo -profile_interrupt build with profile information of interrupts
 echo "-useio use standard io to output profiling data (should be used together with -raw and -profile), it only works with single core version"
 echo
 echo Multicore GC options
+echo -perfcount performance counters
 echo -multicoregc generate multi-core binary with garbage collection
 echo -pmc parallel collector
 echo "-numcore4gc set the number of cores for gc (should be used together with -multicoregc), defaultly set as 0"
@@ -208,6 +210,7 @@ USEIOFLAG=false
 INTERRUPTFLAG=false
 THREADSIMULATEFLAG=false;
 MULTICOREGCFLAG=false;
+PERFCOUNT=false;
 PMCFLAG=false;
 GCMEMLOCALFLAG=false;
 GCMEMFIXEDFLAG=false;
@@ -246,6 +249,7 @@ ASSEMBLY=false
 GCCORES=''
 TILERAN1COREFLAG=false
 TILERA56COREFLAG=false
+TILERAOUTPUTDIR=''
 
 if [[ -z $1 ]]
 then
@@ -457,6 +461,10 @@ elif [[ $1 = '-raw' ]]
 then
 RAWFLAG=true
 JAVAOPTS="$JAVAOPTS -raw"
+elif [[ $1 = '-tilera_output_dir' ]]
+then
+TILERAOUTPUTDIR="$2"
+shift
 elif [[ $1 = '-tilera_bme' ]]
 then
 TILERAFLAG=true
@@ -494,6 +502,9 @@ elif [[ $1 = '-pmc' ]]
 then
 PMCFLAG=true
 JAVAOPTS="$JAVAOPTS -pmc"
+elif [[ $1 = '-perfcount' ]]
+then
+PERFCOUNT=true
 elif [[ $1 = '-gcmem_local' ]]
 then
 GCMEMLOCALFLAG=true
@@ -987,7 +998,7 @@ make
 
 elif $TILERAFLAG
 then # TILERAFLAG
-TILERADIR="$CURDIR/tilera"
+TILERADIR="$CURDIR/${TILERAOUTPUTDIR}"
 if $TILERABMEFLAG
 then # TILERABMEFLAG
 TILERA_INDIR="BME"
@@ -1090,6 +1101,11 @@ then #MULTICOREGC version
 TILERACFLAGS="${TILERACFLAGS} -DPMC_GC -D${GCCORES}"
 fi
 
+if $PERFCOUNT
+then #MULTICOREGC version
+TILERACFLAGS="${TILERACFLAGS} -DPERFCOUNT"
+fi
+
 if $GCPROFILEFLAG
 then # GC_PROFILE version
 TILERACFLAGS="${TILERACFLAGS} -DGC_PROFILE"
@@ -1185,7 +1201,10 @@ then # GC_CACHE_ADAPT version
 TILERACFLAGS="${TILERACFLAGS} -DGC_CACHE_SAMPLING"
 fi
 
-if $MGCFLAG
+if $PMCFLAG
+then
+cp $ROBUSTROOT/Tilera/Runtime/PMC/$MAKEFILE ./Makefile
+elif $MGCFLAG
 then
 cp $ROBUSTROOT/Tilera/Runtime/MGC/$MAKEFILE ./Makefile
 else
@@ -1248,7 +1267,7 @@ cp ../Tilera/lib/* ./
 cp ../$tmpbuilddirectory/*.c ./
 cp ../$tmpbuilddirectory/*.h ./
 
-echo $TILERA_CFLAGS
+echo $TILERACFLAGS > ./tileracflags.txt
 
 make