Commit 17e99f2f authored by Marc's avatar Marc
Browse files

updated software and results, included bitfile

parent eec6bbae
......@@ -10,17 +10,21 @@ systest hello:
simd_%:
$(MAKE) -C module_tests $@
mat_mu% binomi%:
mat_mu% polyn%:
$(MAKE) -C matrix_multiplication $@
cifar%:
$(MAKE) -C cifar $@
gray% filt%:
$(MAKE) -C image_manipulation $@
.PHONY: clean
clean:
$(MAKE) -C leon3_tests $@
$(MAKE) -C module_tests $@
$(MAKE) -C matrix_multiplication $@
$(MAKE) -C image_manipulation $@
$(MAKE) -C leon3_tests clean
$(MAKE) -C module_tests clean
$(MAKE) -C matrix_multiplication clean
$(MAKE) -C image_manipulation clean
......
XCC=sparc-gaisler-elf-gcc #$(XINC)
XCFLAGS=-O2 -g -msoft-float -mcpu=v8 -fno-inline
cifar_10:
cp cifar_10.srec $(CURRENT_DIR)/test.srec
cifar_10_simd:
cp cifar_10_simd.srec $(CURRENT_DIR)/test.srec
clean:
rm -f *.exe *.o *.dump hello.srec
This diff is collapsed.
XCC=sparc-gaisler-elf-gcc #$(XINC)
XCFLAGS=-O2 -g -msoft-float -mcpu=v8 -fno-inline
XCFLAGS0=-O0 -g -msoft-float -mcpu=v8
%:
$(XCC) $(XCFLAGS) -D N=$(par1) -c $@.c
Makefile:
echo "?"
.PHONY: variables.h
variables.h:
echo "#define N $(SIZE)" > $@
ifeq ($(P_IN),1)
echo "#define P_INPUT 1" >> $@
endif
ifeq ($(P_OUT),1)
echo "#define P_OUTPUT 1" >> $@
endif
%: variables.h
$(XCC) $(XCFLAGS) -c $@.c
$(XCC) $(XCFLAGS) $@.o -o $@.exe
sparc-gaisler-elf-objcopy -O srec --gap-fill 0 $@.exe $@.srec
cp $@.srec $(CURRENT_DIR)/test.srec
......
#include <stdio.h>
#include <stdlib.h>
#include "arrays.h"
#include "variables.h"
#ifndef N
#define N 256
......
#include <stdio.h>
#include "variables.h"
#include <stdlib.h>
#include "arrays.h"
......
#include <stdio.h>
#include "variables.h"
#include <stdlib.h>
#include "arrays.h"
......
#include <stdio.h>
#include "variables.h"
#include <stdlib.h>
#include "arrays.h"
......
#include <stdio.h>
#include "variables.h"
#include <stdlib.h>
#include "arrays.h"
......
#include <stdio.h>
#include "variables.h"
#include <stdlib.h>
#include "arrays.h"
......
#define N 4
#define P_INPUT 1
#define P_OUTPUT 1
XCC=sparc-gaisler-elf-gcc #$(XINC)
XCFLAGS=-O2 -g -msoft-float -mcpu=v8 -fno-inline
%:
$(XCC) $(XCFLAGS) -D N=$(par1) -c $@.c
Makefile:
echo "?"
.PHONY: variables.h
variables.h:
echo "#define N $(SIZE)" > $@
ifeq ($(P_IN),1)
echo "#define P_INPUT 1" >> $@
endif
ifeq ($(P_OUT),1)
echo "#define P_OUTPUT 1" >> $@
endif
%: variables.h
$(XCC) $(XCFLAGS) -c $@.c
$(XCC) $(XCFLAGS) $@.o -o $@.exe
sparc-gaisler-elf-objcopy -O srec --gap-fill 0 $@.exe $@.srec
cp $@.srec $(CURRENT_DIR)/test.srec
......
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "variables.h"
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#ifndef N
#define N 4
#endif
void print(char c, unsigned char src[N][N]) {
printf("%c:\n", c);
for (int i = 0; i<N; i++){
......@@ -31,7 +28,8 @@ void product(unsigned char A[N][N], unsigned char B[N][N], unsigned char C[N][N]
for(int i=0; i<N; i++)
for(int j=0; j<N; j++){
for(int k=0; k<N; k++){
sum += A[i][k] * B[j][k];
aux = min((int) A[i][k] * (int) B[j][k], 255);
sum = min(aux+sum, 255);
}
C[i][j] = sum;
sum = 0;
......
......@@ -2,10 +2,7 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#ifndef N
#define N 4
#endif
#include "variables.h"
int computeCell(int a, int b){
......
......@@ -2,6 +2,7 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include "variables.h"
#ifndef N
#define N 8
......@@ -54,9 +55,9 @@ int main()
unsigned char A[N][N], B[N][N], C[N][N];
srand(N);
init(A,B);
puts("TEST BEGIN");
// puts("TEST BEGIN");
product(A,B,C);
puts("TEST END");
// puts("TEST END");
#ifdef P_INPUT
print('A',A);
print('B',B);
......
......@@ -2,6 +2,8 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include "variables.h"
#define N 32
int computeCell(int a, int b){
......
......@@ -2,6 +2,7 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include "variables.h"
#define N 4
int computeCell(int a, int b);
......
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "variables.h"
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
......
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "variables.h"
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
......
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "variables.h"
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment