URL
https://opencores.org/ocsvn/mips789/mips789/trunk
Subversion Repositories mips789
Compare Revisions
- This comparison shows the changes necessary to convert path
/mips789/tags/arelease/bench/sort
- from Rev 36 to Rev 51
- ↔ Reverse comparison
Rev 36 → Rev 51
/clean.bat
0,0 → 1,10
del *.bak |
del *.map |
del *.o |
del *.exe |
del *.axf |
del *.txt |
del *.bin |
del sim_ram.v |
del *.mif |
del transcript |
/sort.c
0,0 → 1,74
/****************************************************************** |
* * |
* Author: Liwei * |
* * |
* This file is part of the "mips789" project. * |
* Downloaded from: * |
* http://www.opencores.org/pdownloads.cgi/list/mips789 * |
* * |
* If you encountered any problem, please contact me via * |
* Email:mcupro@opencores.org or mcupro@163.com * |
* * |
******************************************************************/ |
|
#include "..\..\clib\dvc_lib.h" |
#include "..\..\clib\stringlib.h" |
|
#define SORT_U16 |
|
|
#ifdef SORT_U8 |
#define DATA_TYPE unsigned char |
#define DATA_MAX 0xff |
#else |
#ifdef SORT_U16 |
#define DATA_TYPE unsigned short |
#define DATA_MAX 0xffff |
#else |
#define DATA_TYPE unsigned int |
#define DATA_MAX 0xffffffff |
#endif |
#endif |
void sort(DATA_TYPE*a,int num) |
{ |
int i,j ; |
|
DATA_TYPE tmp ; |
|
for(i=0;i<num;i++) |
{ |
for(j=i+1;j<num;j++) |
{ |
if(a[i]<a[j]) |
{ |
tmp=a[i]; |
a[i]=a[j]; |
a[j]=tmp ; |
} |
} |
} |
} |
|
DATA_TYPE array[16]={123,234,122,111,222,122,332,111,11,99,11,12,43,23,43,45}; |
|
|
|
char str[100]; |
void main2() |
{ |
int i ; |
//initial_array(array,16); |
for(;;) |
{ |
|
sort(array,16); |
for(i=0;i<16;++i) |
{ |
sprintf(str," %x",array[i]); |
uart0_putstr(str); |
} |
uart0_putstr(" \n"); |
} |
} |
|
|
/sort.GIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
sort.GIF
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: sort.bat
===================================================================
--- sort.bat (nonexistent)
+++ sort.bat (revision 51)
@@ -0,0 +1,20 @@
+path;
+path=..\..\gccmips_elf
+del *.axf
+del *.txt
+as -o boot.o ..\plasmaboot.asm
+gcc -O2 -O -Wall -c -s ..\..\clib\dvc_lib.c
+gcc -O2 -O -Wall -c -s ..\..\clib\stringlib.c
+gcc -O2 -O -Wall -c -s sort.c
+
+ld.exe -Ttext 0 -eentry -Map test.map -s -N -o test.axf boot.o dvc_lib.o stringlib.o sort.o
+
+objdump.exe --disassemble test.axf > list.txt
+
+convert_sp
+gensim
+genmif
+
+#ser_dld 9600 COM1 N
+copy *.mif ..\..\quartus2\*.mif
+#copy *.v ..\MODELSIM\*.v