From: jzhou Date: Wed, 4 Feb 2009 20:01:18 +0000 (+0000) Subject: add c version for FilterBank version and fix original Bamboo version to reduce some... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=99d49282c47c1cd30bb74222516207c689c390f9;p=IRC.git add c version for FilterBank version and fix original Bamboo version to reduce some overhead --- diff --git a/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java b/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java index 47de0210..a1dc9e49 100644 --- a/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java +++ b/Robust/src/Benchmarks/Scheduling/FilterBank/FilterBank.java @@ -7,15 +7,20 @@ task t1(StartupObject s{initialstate}) { int N_col=128; int i,j; - float r[] = new float[N_sim]; + /*float r[] = new float[N_sim]; for (i=0;i=0)); k++) { - this.vH[j]+=this.H[k]*this.r[j-k]; + for (j=0; j< Nsim; j++) { + for (k=0; ((k=0)); k++) { + vH[j]+=H[k]*r[j-k]; } } //Down Samplin - for (j=0; j < this.N_sim/this.N_samp; j++) { - this.vDn[j]=this.vH[j*this.N_samp]; + for (j=0; j < Nsim/Nsamp; j++) { + vDn[j]=vH[j*Nsamp]; } //Up Sampling - for (j=0; j < this.N_sim; j++) { - this.vUp[j]=0; - } - for (j=0; j < this.N_sim/this.N_samp; j++) { - this.vUp[j*this.N_samp]=this.vDn[j]; + for (j=0; j < Nsim/Nsamp; j++) { + vUp[j*Nsamp]=vDn[j]; } //convolving F - for (j=0; j< this.N_sim; j++) { - this.vF[j]=0; - for (k=0; ((k=0)); k++) { - this.vF[j]+=this.F[k]*this.vUp[j-k]; + for (j=0; j< Nsim; j++) { + for (k=0; ((k=0)); k++) { + tvF[j]+=F[k]*vUp[j-k]; } } } diff --git a/Robust/src/Benchmarks/Scheduling/FilterBank/c/Makefile b/Robust/src/Benchmarks/Scheduling/FilterBank/c/Makefile new file mode 100644 index 00000000..6d2e8824 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/FilterBank/c/Makefile @@ -0,0 +1,20 @@ +TOPDIR=/home/jzhou/starsearch +include $(TOPDIR)/Makefile.include + +RGCCFLAGS += -O2 +RGCCFLAGS += -DRAW + +USE_SLGCC=1 + +SIM-CYCLES = 10000 + +ATTRIBUTES += HWIC + +TILES = 00 + +OBJECT_FILES_00 = filterbank.o +#OBJECT_FILES = JGFSeriesBench.o + +# this is for a multi-tile test +include $(COMMONDIR)/Makefile.all +#include $(COMMONDIR)/Makefile.single diff --git a/Robust/src/Benchmarks/Scheduling/FilterBank/c/filterbank.c b/Robust/src/Benchmarks/Scheduling/FilterBank/c/filterbank.c new file mode 100644 index 00000000..7bce76fd --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/FilterBank/c/filterbank.c @@ -0,0 +1,134 @@ +#include +#ifdef RAW +#include +#else +#include +#include +#include +#endif + +//const int N_sim=2*1024; +const int N_sim=1200;//2048; +const int N_samp=8; +//const int N_ch=N_samp; +const int N_ch=16;//8; +const int N_col=128;//32; + +void begin(void); +void FBCore(int N_samp,int N_ch, int N_col,float r[N_sim],float y[N_sim], float H[N_ch][N_col],float F[N_ch][N_col]); + +static int numiters = 1; + +#ifndef RAW +int main(int argc, char **argv) +{ + int option; + + while ((option = getopt(argc, argv, "i:")) != -1) + { + switch(option) + { + case 'i': + numiters = atoi(optarg); + } + } + + begin(); + return 0; +} +#endif + +void begin(void){ + + float r[N_sim]; + float y[N_sim]; + float H[N_ch][N_col]; + float F[N_ch][N_col]; + + + int i,j; + + for (i=0;i 0) { + FBCore(N_samp,N_ch,N_col,r,y,H,F); + for (i=0;i=0)); k++) + Vect_H[j]+=H[i][k]*r[j-k]; + } + + //Down Sampling + for (j=0; j < N_sim/N_samp; j++) + Vect_Dn[j]=Vect_H[j*N_samp]; + + //Up Sampling + /*for (j=0; j < N_sim;j++) + Vect_Up[j]=0; + for (j=0; j < N_sim/N_samp;j++) + Vect_Up[j*N_samp]=Vect_Dn[j];*/ + + //convolving F + for (j=0; j< N_sim; j++) + { + Vect_F[j]=0; + /*for (k=0; ((k=0)); k++) + Vect_F[j]+=F[i][k]*Vect_Up[j-k];*/ + } + + //adding the results to the y matrix + + for (j=0; j < N_sim; j++) + y[j]+=Vect_F[j]; +#ifdef RAW + raw_test_pass(raw_get_cycle()); +#endif + } +}