diff --git a/benchmarks/pow/CGRA_config.csv b/benchmarks/pow/CGRA_config.csv index b10a69525..cc99ef065 100644 --- a/benchmarks/pow/CGRA_config.csv +++ b/benchmarks/pow/CGRA_config.csv @@ -6,7 +6,7 @@ Cclock,0.7 CPUclock,2 Mem,8GB MODE,0 -ALGO,RAMP +ALGO,GraphMinor MSA,10 MAPII,10 MAX_MAP,1000 diff --git a/benchmarks/pow/Makefile b/benchmarks/pow/Makefile index 748d2a029..b3c3adeb6 100644 --- a/benchmarks/pow/Makefile +++ b/benchmarks/pow/Makefile @@ -1,11 +1,13 @@ FILE1 = pow.c -all: pow +all: pow pow_arm CC = cgracc ARMCC = arm-linux-gnueabi-gcc LIB = -lm pow: ${FILE1} Makefile $(CC) -static -O3 ${FILE1} -o pow +pow_arm: ${FILE1} Makefile + $(ARMCC) -static -O3 ${FILE1} -o pow_cpu clean: - rm -rf pow CGRAExec m5out *.bc *.ll + rm -rf pow CGRAExec m5out *.bc *.ll out pow_cpu CPU diff --git a/benchmarks/pow/out_cpu b/benchmarks/pow/out_cpu new file mode 100644 index 000000000..a3255726a --- /dev/null +++ b/benchmarks/pow/out_cpu @@ -0,0 +1,14 @@ +Global frequency set at 1000000000000 ticks per second +gem5 Simulator System. http://gem5.org +gem5 is copyrighted software; use the --copyright option for details. + +gem5 version 20.1.0.4 +gem5 compiled Sep 23 2021 18:19:24 +gem5 started Sep 23 2021 18:31:43 +gem5 executing on en4181851l, pid 3135753 +command line: ../../gem5/build/ARM/gem5.opt -d CPU/ ../../gem5/configs/example/se.py -c pow_cpu -o 5 + +**** REAL SIMULATION **** +Base = 2 - Pow = 5 +***** 2^5 = 32 ***** +Exiting @ tick 6420000 because exiting with last active thread context diff --git a/benchmarks/pow/pow.c b/benchmarks/pow/pow.c index 2d1ae63ba..ec9813a01 100644 --- a/benchmarks/pow/pow.c +++ b/benchmarks/pow/pow.c @@ -12,20 +12,26 @@ return ret; }*/ -int power(int base, int pow){ +/*int power(int base, int pow){ if(pow == 0) return 1; printf("Base = %d - Pow = %d\n", base, pow); int ret = base; #pragma CGRA - for(int i = 1; i < pow - 1; i++) + for(int i = 1; i < pow; i++) ret *= base; return ret; -} +}*/ int main(int argc, char *argv[]) { int pow = atoi(argv[1]); - int ret = power(2, pow); + int base = 2; + if(pow == 0) return 1; + printf("Base = %d - Pow = %d\n", base, pow); + int ret = base; + #pragma CGRA + for(int i = 1; i < pow; i++) + ret *= base; //int ret = sum(pow); printf("***** %d^%d = %d *****\n", 2, pow, ret);