Skip to content

Instantly share code, notes, and snippets.

@dhanu-mamidi dhanu-mamidi/build.sh
Last active Jun 16, 2017

Embed
What would you like to do?
Eigenvalue decomposition of a Matrix
#!/bin/bash
set -e
ESDK=${EPIPHANY_HOME}
ELIBS="-L ${ESDK}/tools/host/lib"
EINCS="-I ${ESDK}/tools/host/include"
ELDF=${ESDK}/bsps/current/fast.ldf
SCRIPT=$(readlink -f "$0")
EXEPATH=$(dirname "$SCRIPT")
cd $EXEPATH
if [ -z "${CROSS_COMPILE+xxx}" ]; then
case $(uname -p) in
arm*)
# Use native arm compiler (no cross prefix)
CROSS_COMPILE=
;;
*)
# Use cross compiler
CROSS_COMPILE="arm-linux-gnueabihf-"
;;
esac
fi
# Build HOST side application
${CROSS_COMPILE}gcc -std=c99 src/test.c -o Debug/test.elf ${EINCS} ${ELIBS} -le-hal -le-loader -lpthread -lm
# Build DEVICE side program
e-gcc -T ${ELDF} src/e_task1.c -o Debug/e_task1.elf -le-lib -lm
# Build DEVICE side program
e-gcc -T ${ELDF} src/e_task2.c -o Debug/e_task2.elf -le-lib -lm
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "e-lib.h"
#define CORES 16
int main(void)
{
float *a1,*c1,*j1,*r1;
int i;
float t;
unsigned *d1;
a1 = (float *) 0x2000;//Address of a01 matrix (transfered here by host)
c1 = (float *) 0x3000;//angle
j1 = (float *) 0x4000;//getmat result
r1 = (float *) 0x6000;//Result
d1 = (unsigned *) 0x7000;//Done
//Clear outputs
(*(c1))=0x0;
(*(j1))=0x0;
(*(r1))=0x0;
//getmat calling
//c1 = getmat(a1[0],a1[3],a1[1],j1);
t = 0.5*atan((2*a1[1])/(a1[3]-a1[0]));
float o= cos(t);
float p= sin(t);
float X[4]= {0,0,0,0};
X[0] = o;
X[1] = p;
X[2] =p*(-1.000000);
X[3] = o;
for(int i=0; i<4; i++)
{
*(j1+i)=X[i];
}
*c1 = t;
*r1 = (j1[0]*j1[0]*a1[0])+(j1[0]*j1[2]*a1[2])+(j1[0]*j1[2]*a1[1])+(j1[2]*j1[2]*a1[3]);
*(r1+1)= (j1[0]*j1[1]*a1[0])+(j1[1]*j1[2]*a1[2])+(j1[0]*j1[3]*a1[1])+(j1[2]*j1[3]*a1[3]);
*(r1+2)= (j1[0]*j1[1]*a1[0])+(j1[0]*j1[3]*a1[2])+(j1[1]*j1[2]*a1[1])+(j1[2]*j1[3]*a1[3]);
*(r1+3)= (j1[1]*j1[1]*a1[0])+(j1[1]*j1[3]*a1[2])+(j1[1]*j1[3]*a1[1])+(j1[3]*j1[3]*a1[3]);
//multiplication
//multiply(a1,j1,r1);
//Raising "done" flag
(*(d1)) = 0x00000001;
//Put core in idle state
__asm__ __volatile__("idle");
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "e-lib.h"
#define CORES 16
int main(void)
{
float *a2,*c2,*c2_1;
int i;
float *x2,*y2,*z2;
unsigned *d2;
a2 = (float *) 0x2000;//Address of a matrix (transfered here by host)
c2 = (float *) 0x3000;//angle
c2_1 = (float *) 0x4000;//angle
x2 = (float *) 0x5000;//formmat result
y2 = (float *) 0x6000;//formmat result
z2 = (float *) 0x1000;//multip result
d2 = (unsigned *) 0x7000;//Done
//Clear Outputs
(*(x2))=0x0;
(*(y2))=0x0;
(*(z2))=0x0;
//formmat calling
//formmat(c2,x2);
//formmat(c2_1,y2);
float o = cos(*c2);
float p = sin(*c2);
float X[4]= {0,0,0,0};
X[0] = o;
X[1] = p;
X[2] =-p;
X[3] = o;
for(int i=0; i<4; i++)
{
*(x2+i)= X[i];
}
float q = cos(*c2_1);
float w = sin(*c2_1);
float Y[4]= {0,0,0,0};
Y[0] = q;
Y[1] = w;
Y[2] =-w;
Y[3] = q;
for(int i=0; i<4; i++)
{
*(y2+i)= Y[i];
}
//multiply calling
// multiply(x2,a2,y2,z2);
*z2= (x2[0]*a2[0]*y2[0])+(x2[2]*a2[2]*y2[0])+(x2[0]*a2[1]*y2[2])+(x2[2]*a2[3]*y2[2]);
*(z2+1)= (x2[1]*a2[0]*y2[1])+(x2[3]*a2[2]*y2[1])+(x2[1]*a2[1]*y2[3])+(x2[3]*a2[3]*y2[3]);
*(z2+2)= (x2[1]*a2[0]*y2[0])+(x2[3]*a2[2]*y2[0])+(x2[1]*a2[1]*y2[2])+(x2[3]*a2[3]*y2[2]);
*(z2+3)= (x2[1]*a2[0]*y2[1])+(x2[3]*a2[2]*y2[1])+(x2[1]*a2[1]*y2[3])+(x2[3]*a2[3]*y2[3]);
//Raising "done" flag
(*(d2)) = 0x00000001;
//Put core in idle state
__asm__ __volatile__("idle");
}
#include <stdlib.h>
#include <stdio.h>
#include <e-hal.h>
#include <math.h>
#define CORES 16
#include <stdlib.h>
#include <stdint.h>
/*
struct myStruct
{
void *address;
};
void *dec_hex(long int num) // Function Definition
{
long int k=0,rem[50],i=0,length=0;
while(num>0)
{
rem[i]=num%16;
num=num/16;
i++;
length++;
}
//printf("%ld\n",length);
char ch[length],c[length];
char string[length];
char *str = malloc( sizeof(char) * ( length + 3 ) );
char s[]="0x";
for(i=0;i<length;i++)
{
ch[i]='0';
//printf("%c",ch[i]);
}
//printf("\nHexadecimal number : ");
for(i=length-1;i>=0;i--)
{
switch(rem[i])
{
case 10:
ch[i]='A';
break;
case 11:
ch[i]='B';
break;
case 12:
ch[i]='C';
break;
case 13:
ch[i]='D';
break;
case 14:
ch[i]='E';
break;
case 15:
ch[i]='F';
break;
default :
ch[i]=rem[i]+'0';
}
}
//ch[length]='\0';
for( i=length-1;i>=0;i--)
{
c[k]=ch[i];
k++;
//printf("%c",ch[i]);
}
//strcpy(str,"0x");
str[0]='0';
str[1]='x';
str[2]='\0';
strncpy(string,c,length);
strcat(s,string);
string[length]='\0';
//strncat(str,string,length);
//strcpy(s,str);
//printf("%s%s",str,string);
//printf("%s",s);
unsigned long ul;
struct myStruct sa;
sscanf(s, "%lx", &ul);
sa.address = (void*) (uintptr_t) ul;
//printf("ADDRESS:%p",((int *) sa.address));
// printf("value: %lx\n", id);
return sa.address;
//return 0;
printf("\n");
}
//================================================*/
void order(int n,int a[n])
{
int order_4[]={1,4,2,3};
int order[n];
int i,c;
for ( c = 3 ; c < n ; c = c+2 )
{
if ( c == 3 )
for( i = 0; i<4; i ++){
order[i] = order_4[i];
}
else
{
int temp = order[c-2];
order[c-2] = c+1;
order[c-1] = temp;
order[c] = c;
}
}
for(int i=0;i<n;i++)
{
a[i]=order[i];
}
}
void eigen_values_rotation(float A0[8][8], int n, float out[8][8]){
double A[8][8];
int arr[n];
order( n,arr );
/*for(int i=0;i<n;i++)
{
// printf("%d",arr[i]);
}*/
int i = 0,j,j_;
int k;
for(i=0;i<n;i++)
{
k = arr[i];
for(j=0;j<n;j++){
A[j][i] = A0[j][k-1];
}
}
i = 0;
for(i=0;i<n;i++){
k = arr[i];
for(j=0;j<n;j++){
out[i][j] = A[k-1][j];
}
}
}
int main(int argc, char *argv[])
{
float a[8][8] = {{1 ,1/2.0 ,1/3.0 ,1/4.0 ,1/5.0 ,1/6.0 ,1/7.0 ,1/8.0},
{1/2.0 ,1/3.0 ,1/4.0 ,1/5.0 ,1/6.0 ,1/7.0 ,1/8.0 ,1},
{1/3.0 ,1/4.0 ,1/5.0 ,1/6.0 ,1/7.0 ,1/8.0 ,1 ,1/2.0},
{1/4.0 ,1/5.0 ,1/6.0 ,1/7.0 ,1/8.0 ,1 ,1/2.0 ,1/3.0},
{1/5.0 ,1/6.0 ,1/7.0 ,1/8.0 ,1 ,1/2.0 ,1/3.0 ,1/4.0},
{1/6.0 ,1/7.0 ,1/8.0 ,1 ,1/2.0 ,1/3.0 ,1/4.0 ,1/5.0},
{1/7.0 ,1/8.0 ,1 ,1/2.0 ,1/3.0 ,1/4.0 ,1/5.0 ,1/6.0},
{1/8.0 ,1 ,1/2.0 ,1/3.0 ,1/4.0 ,1/5.0 ,1/6.0 ,1/7.0}
};
unsigned clr = 0;
float buf0,buf1,buf2,buf3;
float out[8][8];
/*for(int i=0; i<2;i++)
{
for(int j=0;j<2;j++)
{
printf("%f ", a03[i][j]);
}
}
}*/
float a0f[8][8],f,f_[4];
float c1,c2,c2_1;
float j1[4],r1[4]={0,0,0,0};
float x2[4],y2[4],z2[4]={0,0,0,0};
float p01[4],p02[4],p03[4],p04[4],p05[4],p06[4],p07[4],p08[4],p09[4],p10[4],p11[4],p12[4],p13[4],p14[4],p15[4],p16[4]={0,0,0,0};
int done[CORES],all_done,all_done_1;
e_platform_t platform;
e_epiphany_t dev;
//Initalize Epiphany devicei
e_init(NULL);
e_reset_system(); //reset Epiphany
e_get_platform_info(&platform);
e_open(&dev, 0, 0, platform.rows, platform.cols); //open all cores
//Load program to cores
// e_load_group("test_ep.elf", &dev, 0, 0, platform.rows, platform.cols, E_FALSE);
for(int q=0;q<20;q++)
{
printf("initialise pass\n");
float a01[4]={0,0,0,0};
a01[0] = a[0][0];
a01[1] = a[0][1];
a01[2] = a[1][0];
a01[3] = a[1][1];
float a02[4]={0,0,0,0};
a02[0] = a[0][2];
a02[1] = a[0][3];
a02[2] = a[1][2];
a02[3] = a[1][3];
float a03[4]={0,0,0,0};
a03[0] = a[0][4];
a03[1] = a[0][5];
a03[2] = a[1][4];
a03[3] = a[1][5];
float a04[4]={0,0,0,0};
a04[0] = a[0][6];
a04[1] = a[0][7];
a04[2] = a[1][6];
a04[3] = a[1][7];
float a05[4]={0,0,0,0};
a05[0] = a[2][0];
a05[1] = a[2][1];
a05[2] = a[3][0];
a05[3] = a[3][1];
float a06[4]={0,0,0,0};
a06[0] = a[2][2];
a06[1] = a[2][3];
a06[2] = a[3][2];
a06[3] = a[3][3];
float a07[4]={0,0,0,0};
a07[0] = a[2][4];
a07[1] = a[2][5];
a07[2] = a[3][4];
a07[3] = a[3][5];
float a08[4]={0,0,0,0};
a08[0] = a[2][6];
a08[1] = a[2][7];
a08[2] = a[3][6];
a08[3] = a[3][7];
float a09[4]={0,0,0,0};
a09[0] = a[4][0];
a09[0] = a[4][1];
a09[2] = a[5][0];
a09[3] = a[5][1];
float a10[4]={0,0,0,0};
a10[0] = a[4][2];
a10[1] = a[4][3];
a10[2] = a[5][2];
a10[3] = a[5][3];
float a11[4]={0,0,0,0};
a11[0] = a[4][4];
a11[1] = a[4][5];
a11[2] = a[5][4];
a11[3] = a[5][5];
float a12[4]={0,0,0,0};
a12[0] = a[4][6];
a12[1] = a[4][7];
a12[2] = a[5][6];
a12[3] = a[5][7];
float a13[4]={0,0,0,0};
a13[0] = a[6][0];
a13[1] = a[6][1];
a13[2] = a[7][0];
a13[3] = a[7][1];
float a14[4]={0,0,0,0};
a14[0] = a[6][2];
a14[1] = a[6][3];
a14[2] = a[7][2];
a14[3] = a[7][3];
float a15[4]={0,0,0,0};
a15[0] = a[6][4];
a15[1] = a[6][5];
a15[2] = a[7][4];
a15[3] = a[7][5];
float a16[4]={0,0,0,0};
a16[0] = a[6][6];
a16[1] = a[6][7];
a16[2] = a[7][6];
a16[3] = a[7][7];
/*
void* a_[4];
long int v = 8192;
int k_=0;
for(int i=0;i<4;i++)
{
void *addr;
addr = dec_hex(v);
a_[k_]=addr;
k_++;
v=v+4;
}*/
e_load("e_task1.elf", &dev, 0, 0, E_FALSE);
e_load("e_task1.elf", &dev, 1, 1, E_FALSE);
e_load("e_task1.elf", &dev, 2, 2, E_FALSE);
e_load("e_task1.elf", &dev, 3, 3, E_FALSE);
e_load("e_task2.elf", &dev, 0, 1, E_FALSE);
e_load("e_task2.elf", &dev, 0, 2, E_FALSE);
e_load("e_task2.elf", &dev, 0, 3, E_FALSE);
e_load("e_task2.elf", &dev, 1, 0, E_FALSE);
e_load("e_task2.elf", &dev, 1, 2, E_FALSE);
e_load("e_task2.elf", &dev, 1, 3, E_FALSE);
e_load("e_task2.elf", &dev, 2, 0, E_FALSE);
e_load("e_task2.elf", &dev, 2, 1, E_FALSE);
e_load("e_task2.elf", &dev, 2, 3, E_FALSE);
e_load("e_task2.elf", &dev, 3, 0, E_FALSE);
e_load("e_task2.elf", &dev, 3, 1, E_FALSE);
e_load("e_task2.elf", &dev, 3, 2, E_FALSE);
//1. Copy data (N/CORE points) from host to Epiphany local memory
//2. Clear the "done" flag for every core
e_write(&dev, 0, 0, 0x2000, &a01, 4*sizeof(float));
e_write(&dev, 1, 1, 0X2000, &a06, 4*sizeof(float));
e_write(&dev, 2, 2, 0X2000, &a11, 4*sizeof(float));
e_write(&dev, 3, 3, 0X2000, &a16, 4*sizeof(float));
e_write(&dev, 0, 1, 0X2000, &a02, 4*sizeof(float));
e_write(&dev, 0, 2, 0X2000, &a03, 4*sizeof(float));
e_write(&dev, 0, 3, 0X2000, &a04, 4*sizeof(float));
e_write(&dev, 1, 0, 0X2000, &a05, 4*sizeof(float));
e_write(&dev, 1, 2, 0X2000, &a07, 4*sizeof(float));
e_write(&dev, 1, 3, 0X2000, &a08, 4*sizeof(float));
e_write(&dev, 2, 0, 0X2000, &a09, 4*sizeof(float));
e_write(&dev, 2, 1, 0X2000, &a10, 4*sizeof(float));
e_write(&dev, 2, 3, 0X2000, &a12, 4*sizeof(float));
e_write(&dev, 3, 0, 0X2000, &a13, 4*sizeof(float));
e_write(&dev, 3, 1, 0X2000, &a14, 4*sizeof(float));
e_write(&dev, 3, 2, 0X2000, &a15, 4*sizeof(float));
e_write(&dev, 0, 0, 0x7000, &clr, sizeof(clr));
e_write(&dev, 1, 1, 0x7000, &clr, sizeof(clr));
e_write(&dev, 2, 2, 0x7000, &clr, sizeof(clr));
e_write(&dev, 3, 3, 0x7000, &clr, sizeof(clr));
e_write(&dev, 0, 1, 0x7000, &clr, sizeof(clr));
e_write(&dev, 0, 2, 0x7000, &clr, sizeof(clr));
e_write(&dev, 0, 3, 0x7000, &clr, sizeof(clr));
e_write(&dev, 1, 0, 0x7000, &clr, sizeof(clr));
e_write(&dev, 1, 2, 0x7000, &clr, sizeof(clr));
e_write(&dev, 1, 3, 0x7000, &clr, sizeof(clr));
e_write(&dev, 2, 0, 0x7000, &clr, sizeof(clr));
e_write(&dev, 2, 1, 0x7000, &clr, sizeof(clr));
e_write(&dev, 2, 3, 0x7000, &clr, sizeof(clr));
e_write(&dev, 3, 0, 0x7000, &clr, sizeof(clr));
e_write(&dev, 3, 1, 0x7000, &clr, sizeof(clr));
e_write(&dev, 3, 2, 0x7000, &clr, sizeof(clr));
printf("e_write pass\n");
// start cores
e_start(&dev,0,0);
e_start(&dev,1,1);
e_start(&dev,2,2);
e_start(&dev,3,3);
printf("load of e_task1 pass\n");
//Check if all cores are done
while(1){
all_done=0;
e_read(&dev, 0, 0, 0x7000, &done[0*platform.cols+0], sizeof(float));
all_done+=done[0*platform.cols+0];
e_read(&dev, 1, 1, 0x7000, &done[1*platform.cols+1], sizeof(float));
all_done+=done[1*platform.cols+1];
e_read(&dev, 2, 2, 0x7000, &done[2*platform.cols+2], sizeof(float));
all_done+=done[2*platform.cols+2];
e_read(&dev, 3, 3, 0x7000, &done[3*platform.cols+3], sizeof(float));
all_done+=done[3*platform.cols+3];
printf("etask1: %d\n",all_done);
if(all_done==4){
break;
}
}
printf("e_task1 pass\n");
e_read(&dev, 0, 0, 0X6000, &p01, 4*sizeof(float));
e_read(&dev, 1, 1, 0X6000, &p06, 4*sizeof(float));
e_read(&dev, 2, 2, 0X6000, &p11, 4*sizeof(float));
e_read(&dev, 3, 3, 0X6000, &p16, 4*sizeof(float));
e_read(&dev,0,0, 0x3000, &buf0, sizeof(float));
e_read(&dev,1,1, 0x3000, &buf1, sizeof(float));
e_read(&dev,2,2, 0x3000, &buf2, sizeof(float));
e_read(&dev,3,3, 0x3000, &buf3, sizeof(float));
e_write(&dev, 0, 1, 0X3000, &buf0, sizeof(float));
e_write(&dev, 0, 1, 0X4000, &buf1, sizeof(float));
e_write(&dev, 0, 2, 0X3000, &buf0, sizeof(float));
e_write(&dev, 0, 2, 0X4000, &buf2, sizeof(float));
e_write(&dev, 0, 3, 0X3000, &buf0, sizeof(float));
e_write(&dev, 0, 3, 0X4000, &buf3, sizeof(float));
e_write(&dev, 1, 0, 0X3000, &buf1, sizeof(float));
e_write(&dev, 1, 0, 0X4000, &buf0, sizeof(float));
e_write(&dev, 1, 2, 0X3000, &buf1, sizeof(float));
e_write(&dev, 1, 2, 0X4000, &buf2, sizeof(float));
e_write(&dev, 1, 3, 0X3000, &buf1, sizeof(float));
e_write(&dev, 1, 3, 0X4000, &buf3, sizeof(float));
e_write(&dev, 2, 0, 0X3000, &buf2, sizeof(float));
e_write(&dev, 2, 0, 0X4000, &buf0, sizeof(float));
e_write(&dev, 2, 1, 0X3000, &buf2, sizeof(float));
e_write(&dev, 2, 1, 0X4000, &buf1, sizeof(float));
e_write(&dev, 2, 3, 0X3000, &buf2, sizeof(float));
e_write(&dev, 2, 3, 0X4000, &buf3, sizeof(float));
e_write(&dev, 3, 0, 0X3000, &buf3, sizeof(float));
e_write(&dev, 3, 0, 0X4000, &buf0, sizeof(float));
e_write(&dev, 3, 1, 0X3000, &buf3, sizeof(float));
e_write(&dev, 3, 1, 0X4000, &buf1, sizeof(float));
e_write(&dev, 3, 2, 0X3000, &buf3, sizeof(float));
e_write(&dev, 3, 2, 0X4000, &buf2, sizeof(float));
printf("read and write of float values pass\n");
e_start(&dev,0,1);
e_start(&dev,0,2);
e_start(&dev,0,3);
e_start(&dev,1,0);
e_start(&dev,1,2);
e_start(&dev,1,3);
e_start(&dev,2,0);
e_start(&dev,2,1);
e_start(&dev,2,3);
e_start(&dev,3,0);
e_start(&dev,3,1);
e_start(&dev,3,2);
printf("load of e_task2 pass\n");
int spi=0;
while(1){
all_done_1=0;
e_read(&dev, 0, 1, 0x7000, &done[0*platform.cols+1], sizeof(float));
all_done_1+=done[0*platform.cols+1];
e_read(&dev, 0, 2, 0x7000, &done[0*platform.cols+2], sizeof(float));
all_done_1+=done[0*platform.cols+2];
e_read(&dev, 0, 3, 0x7000, &done[0*platform.cols+3], sizeof(float));
all_done_1+=done[0*platform.cols+3];
e_read(&dev, 1, 0, 0x7000, &done[1*platform.cols+0], sizeof(float));
all_done_1+=done[1*platform.cols+0];
e_read(&dev, 1, 2, 0x7000, &done[1*platform.cols+2], sizeof(float));
all_done_1+=done[1*platform.cols+2];
e_read(&dev, 1, 3, 0x7000, &done[1*platform.cols+3], sizeof(float));
all_done_1+=done[1*platform.cols+3];
e_read(&dev, 2, 0, 0x7000, &done[2*platform.cols+0], sizeof(float));
all_done_1+=done[2*platform.cols+0];
e_read(&dev, 2, 1, 0x7000, &done[2*platform.cols+1], sizeof(float));
all_done_1+=done[2*platform.cols+1];
e_read(&dev, 2, 3, 0x7000, &done[2*platform.cols+3], sizeof(float));
all_done_1+=done[2*platform.cols+3];
e_read(&dev, 3, 0, 0x7000, &done[3*platform.cols+0], sizeof(float));
all_done_1+=done[3*platform.cols+0];
e_read(&dev, 3, 1, 0x7000, &done[3*platform.cols+1], sizeof(float));
all_done_1+=done[3*platform.cols+1];
e_read(&dev, 3, 2, 0x7000, &done[3*platform.cols+2], sizeof(float));
all_done_1+=done[3*platform.cols+2];
printf("AALLL DONEEEE!!!:%d Q: %d\n",all_done_1,q);
if(all_done_1==12){
break;
}
}
printf("e_task2 pass\n");
e_read(&dev, 0, 1, 0X1000, &p02, 4*sizeof(float));
e_read(&dev, 0, 2, 0X1000, &p03, 4*sizeof(float));
e_read(&dev, 0, 3, 0X1000, &p04, 4*sizeof(float));
e_read(&dev, 1, 0, 0X1000, &p05, 4*sizeof(float));
e_read(&dev, 1, 2, 0X1000, &p07, 4*sizeof(float));
e_read(&dev, 1, 3, 0X1000, &p08, 4*sizeof(float));
e_read(&dev, 2, 0, 0X1000, &p09, 4*sizeof(float));
e_read(&dev, 2, 1, 0X1000, &p10, 4*sizeof(float));
e_read(&dev, 2, 3, 0X1000, &p12, 4*sizeof(float));
e_read(&dev, 3, 0, 0X1000, &p13, 4*sizeof(float));
e_read(&dev, 3, 1, 0X1000, &p14, 4*sizeof(float));
e_read(&dev, 3, 2, 0X1000, &p15, 4*sizeof(float));
//e_read(&dev, 2, 3, 0X5000, &f_, 4*sizeof(float));
//for(int i=0;i<4;i++)
//printf("matrix= %f\n",f_[i]);
//e_read(&dev, 1, 0, 0X7000, &f, sizeof(float));
//printf("buff= %f\n",f);
printf("e_read of final results pass\n");
a[0][0] = p01[0] ;
a[0][1] = p01[1] ;
a[1][0] = p01[2] ;
a[1][1] = p01[3] ;
a[0][2] = p02[0] ;
a[0][3] = p02[1] ;
a[1][2] = p02[2] ;
a[1][3] = p02[3] ;
a[0][4] = p03[0] ;
a[0][5] = p03[1] ;
a[1][4] = p03[2] ;
a[1][5] = p03[3] ;
a[0][6] = p04[0] ;
a[0][7] = p04[1] ;
a[1][6] = p04[2] ;
a[1][7] = p04[3] ;
a[2][0] = p05[0] ;
a[2][1] = p05[1] ;
a[3][0] = p05[2] ;
a[3][1] = p05[3] ;
a[2][2] = p06[0] ;
a[2][3] = p06[1] ;
a[3][2] = p06[2] ;
a[3][3] = p06[3] ;
a[2][4] = p07[0] ;
a[2][5] = p07[1] ;
a[3][4] = p07[2] ;
a[3][5] = p07[3] ;
a[2][6] = p08[0] ;
a[2][7] = p08[1] ;
a[3][6] = p08[2] ;
a[3][7] = p08[3] ;
a[4][0] = p09[0] ;
a[4][1] = p09[1] ;
a[5][0] = p09[2] ;
a[5][1] = p09[3] ;
a[4][2] = p10[0] ;
a[4][3] = p10[1] ;
a[5][2] = p10[2] ;
a[5][3] = p10[3] ;
a[4][4] = p11[0] ;
a[4][5] = p11[1] ;
a[5][4] = p11[2] ;
a[5][5] = p11[3] ;
a[4][6] = p12[0] ;
a[4][7] = p12[1] ;
a[5][6] = p12[2] ;
a[5][7] = p12[3] ;
a[6][0] = p13[0] ;
a[6][1] = p13[1] ;
a[7][0] = p13[2] ;
a[7][1] = p13[3] ;
a[6][2] = p14[0] ;
a[6][3] = p14[1] ;
a[7][2] = p14[2] ;
a[7][3] = p14[3] ;
a[6][4] = p15[0] ;
a[6][5] = p15[1] ;
a[7][4] = p15[2] ;
a[7][5] = p15[3] ;
a[6][6] = p16[0] ;
a[6][7] = p16[1] ;
a[7][6] = p16[2] ;
a[7][7] = p16[3] ;
printf("bulding matrix pass\n");
eigen_values_rotation(a,8,out);
for(int i=0;i<8;i++)
{
for(int j=0;j<8;j++)
{
a[i][j]=out[i][j];
}
}
for(int i1=0; i1<8; i1++)
{
for(int j1=0; j1<8; j1++)
{
printf("%f \t",a[i1][j1]);
}
printf("\n\n");
}
//Close down Epiphany device
e_reset_system();
}
e_close(&dev);
e_finalize();
}
#!/bin/bash
set -e
cd Debug
./test.elf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.