pow benchmark added
This commit is contained in:
parent
db78b5db8d
commit
5f2c8bc0fc
|
@ -6,7 +6,7 @@ Cclock,0.7
|
||||||
CPUclock,2
|
CPUclock,2
|
||||||
Mem,8GB
|
Mem,8GB
|
||||||
MODE,0
|
MODE,0
|
||||||
ALGO,RAMP
|
ALGO,GraphMinor
|
||||||
MSA,10
|
MSA,10
|
||||||
MAPII,10
|
MAPII,10
|
||||||
MAX_MAP,1000
|
MAX_MAP,1000
|
||||||
|
|
|
|
@ -1,11 +1,13 @@
|
||||||
FILE1 = pow.c
|
FILE1 = pow.c
|
||||||
|
|
||||||
all: pow
|
all: pow pow_arm
|
||||||
|
|
||||||
CC = cgracc
|
CC = cgracc
|
||||||
ARMCC = arm-linux-gnueabi-gcc
|
ARMCC = arm-linux-gnueabi-gcc
|
||||||
LIB = -lm
|
LIB = -lm
|
||||||
pow: ${FILE1} Makefile
|
pow: ${FILE1} Makefile
|
||||||
$(CC) -static -O3 ${FILE1} -o pow
|
$(CC) -static -O3 ${FILE1} -o pow
|
||||||
|
pow_arm: ${FILE1} Makefile
|
||||||
|
$(ARMCC) -static -O3 ${FILE1} -o pow_cpu
|
||||||
clean:
|
clean:
|
||||||
rm -rf pow CGRAExec m5out *.bc *.ll
|
rm -rf pow CGRAExec m5out *.bc *.ll out pow_cpu 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
|
|
@ -12,20 +12,26 @@
|
||||||
return ret;
|
return ret;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int power(int base, int pow){
|
/*int power(int base, int pow){
|
||||||
if(pow == 0) return 1;
|
if(pow == 0) return 1;
|
||||||
printf("Base = %d - Pow = %d\n", base, pow);
|
printf("Base = %d - Pow = %d\n", base, pow);
|
||||||
int ret = base;
|
int ret = base;
|
||||||
#pragma CGRA
|
#pragma CGRA
|
||||||
for(int i = 1; i < pow - 1; i++)
|
for(int i = 1; i < pow; i++)
|
||||||
ret *= base;
|
ret *= base;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int pow = atoi(argv[1]);
|
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);
|
//int ret = sum(pow);
|
||||||
|
|
||||||
printf("***** %d^%d = %d *****\n", 2, pow, ret);
|
printf("***** %d^%d = %d *****\n", 2, pow, ret);
|
||||||
|
|
Loading…
Reference in New Issue