├── LICENSE ├── build.mk ├── build_core.mk ├── cache ├── Makefile ├── build.mk ├── build.mk_localsim ├── build_core.mk ├── build_fpga.mk ├── cache_config_fpga.vhd ├── cache_config_sim.vhd ├── cache_pkg.vhd ├── cmd_go ├── cmd_go_dhry ├── cmd_go_ic1_dc1 ├── dcache.vhd ├── dcache_adapter.vhd ├── dcache_ccl.vhm ├── dcache_mcl.vhm ├── dcache_ram.vhd ├── dcache_tb.vhd ├── icache.vhd ├── icache_adapter.vhd ├── icache_ccl.vhm ├── icache_mcl.vhm ├── icache_modereg.vhm ├── icache_modereg_wsbu.vhm ├── icache_ram.vhd ├── icache_tb.vhd └── tests │ ├── dctest13h_we_replace │ ├── Makefile │ ├── README │ ├── cmd_go │ └── dcache_tb.vhd │ ├── dctest39h_writepath_accvari8 │ ├── Makefile │ ├── README │ ├── cmd_tb2expected │ ├── cpu01.acc_ex │ └── dcache_tb.vhd │ ├── dctest40h_tas_variation │ ├── Makefile │ ├── README │ └── dcache_tb.vhd │ ├── fpga_smp │ ├── README │ ├── smptest03 │ │ ├── Makefile │ │ ├── README │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── bare.c │ │ │ ├── bare.h │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ │ └── test03_cpu1.c │ │ ├── te03c1.xxd │ │ └── test03.c │ ├── smptest04 │ │ ├── Makefile │ │ ├── get_lock_cpu0.s │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── bare.c │ │ │ ├── bare.h │ │ │ ├── get_lock_cpu0.s │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ │ └── test04_cpu1.c │ │ ├── te04c1.xxd │ │ └── test04.c │ ├── smptest07 │ │ ├── Makefile │ │ ├── sm07c0i.xxd │ │ ├── sm07c1a.xxd │ │ ├── sm07c1i.xxd │ │ ├── smp_test07.c │ │ ├── sub_cpu0_getvbr │ │ │ ├── cmd01_c_to_s │ │ │ ├── cmd02_s_to_o │ │ │ ├── get_vbr.s │ │ │ ├── get_vbr_proto.c │ │ │ └── get_vbr_proto.s │ │ ├── sub_cpu0_int │ │ │ ├── cmd01_c_to_sproto │ │ │ ├── cmd02_sproto_to_s │ │ │ ├── cpu0_int.s │ │ │ ├── cpu0_int_proto.c │ │ │ └── cpu0_int_proto.s │ │ ├── sub_cpu1_int │ │ │ ├── cmd01_c_to_sproto │ │ │ ├── cmd02_sproto_to_s │ │ │ ├── cmd03_s_to_xxd │ │ │ ├── cpu1_int.s │ │ │ ├── cpu1_int_proto.c │ │ │ └── cpu1_int_proto.s │ │ └── sub_cpu1_main │ │ │ ├── Makefile │ │ │ ├── cmd02_exe_to_xxd │ │ │ ├── cmd991_c_to_s_to_checks │ │ │ ├── cpu1_main.c │ │ │ └── cpu1_main.s │ ├── smptest08 │ │ ├── Makefile │ │ ├── cmd_asm │ │ ├── sm08c1.xxd │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ └── cpu1.c │ │ └── test08.c │ ├── smptest09 │ │ ├── Makefile │ │ ├── README │ │ ├── get_lock_cpu0.s │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── bare.c │ │ │ ├── bare.h │ │ │ ├── get_lock_cpu0.s │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ │ └── test09_cpu1.c │ │ ├── te09c1.xxd │ │ └── test09.c │ ├── smptest11 │ │ ├── Makefile │ │ ├── make_rand │ │ │ └── randgen.c │ │ ├── random.num.gz │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ └── cpu1.c │ │ ├── te11c1.bin │ │ ├── test11.c │ │ └── test11_x86 │ │ │ ├── cmd_go │ │ │ ├── random.num.gz │ │ │ └── test11_x86.c │ ├── smptest12 │ │ ├── Makefile │ │ ├── README │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ ├── cpu1.c │ │ │ ├── cpu1.xxd │ │ │ ├── cpu1_restart_asm.c │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ └── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ ├── te12c1.bin │ │ └── test12.c │ ├── smptest13 │ │ ├── Makefile │ │ ├── cmd_asm │ │ ├── execution_results │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ ├── cpu1.c │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ └── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ ├── te13c1.bin │ │ ├── test.dat.gz │ │ └── test13.c │ ├── smptest14 │ │ ├── Makefile │ │ ├── get_lock_cpu0.s │ │ ├── get_lock_cpu0_stub.c │ │ ├── get_lock_cpu0_stub.s │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── bare.c │ │ │ ├── bare.h │ │ │ ├── get_lock_cpu0_stub.c │ │ │ ├── get_lock_cpu0_stub.s │ │ │ ├── glcpu0.s │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ │ └── test14_cpu1.c │ │ ├── te14c1.xxd │ │ └── test14.c │ ├── smptest15 │ │ ├── Makefile │ │ ├── get_lock_cpu0.s │ │ ├── get_lock_cpu0_stub.c │ │ ├── get_lock_cpu0_stub.s │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── bare.c │ │ │ ├── bare.h │ │ │ ├── get_lock_cpu0.s │ │ │ ├── get_lock_cpu0_stub.c │ │ │ ├── get_lock_cpu0_stub.s │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ │ └── test15_cpu1.c │ │ ├── te15c1.xxd │ │ └── test15.c │ ├── smptest16 │ │ ├── Makefile │ │ ├── fpga_result │ │ │ └── 1021_1515 │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ └── cpu1.c │ │ ├── te16c1.bin │ │ ├── test16.c │ │ └── testspec │ ├── smptest17 │ │ ├── Makefile │ │ ├── fpga_result │ │ │ └── 1022_1648 │ │ ├── sub_cpu1_int │ │ │ ├── cmd01_c_to_sproto │ │ │ ├── cmd02_sproto_to_s │ │ │ ├── cmd03_s_to_bin │ │ │ ├── cpu1_int.s │ │ │ ├── cpu1_int_proto.c │ │ │ └── cpu1_int_proto.s │ │ ├── sub_cpu1_main │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ ├── cmd_map │ │ │ └── cpu1.c │ │ ├── te17c1.bin │ │ ├── te17ih.bin │ │ └── test17.c │ ├── smptest18 │ │ ├── Makefile │ │ ├── dma.h │ │ ├── expected_value │ │ ├── fpga_result │ │ │ ├── CM0 │ │ │ │ └── 1026_1317_loop30ok │ │ │ └── CM3 │ │ │ │ └── 1026_1310_lp2000ok │ │ ├── make_rand │ │ │ └── randomgen.c │ │ ├── random.num.gz │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── cmd_asm │ │ │ └── cpu1.c │ │ ├── te18c1.bin │ │ └── test18.c │ ├── smptest19 │ │ ├── Makefile │ │ ├── dma.h │ │ ├── expected.dma │ │ ├── expectedx86 │ │ │ └── test_macos.c │ │ ├── get_lock_cpu0.s │ │ ├── get_lock_cpu0_stub.c │ │ ├── get_lock_cpu0_stub.s │ │ ├── sub_cpu1 │ │ │ ├── Makefile │ │ │ ├── bare.c │ │ │ ├── bare.h │ │ │ ├── get_lock_cpu0.s │ │ │ ├── get_lock_cpu0_stub.c │ │ │ ├── get_lock_cpu0_stub.s │ │ │ ├── include │ │ │ │ ├── ctype.h │ │ │ │ ├── endian.h │ │ │ │ ├── errno.h │ │ │ │ ├── setjmp.h │ │ │ │ ├── stdio.h │ │ │ │ ├── stdlib.h │ │ │ │ ├── string.h │ │ │ │ └── syscalls.h │ │ │ ├── lib │ │ │ │ ├── Makefile │ │ │ │ ├── bcopy.c │ │ │ │ ├── bzero.c │ │ │ │ ├── conio.c │ │ │ │ ├── ctype.c │ │ │ │ ├── libsyscall.S │ │ │ │ ├── memcmp.c │ │ │ │ ├── memcpy.c │ │ │ │ ├── memmove.c │ │ │ │ ├── memscan.c │ │ │ │ ├── memset.c │ │ │ │ ├── read_write.c │ │ │ │ ├── setjmp.S │ │ │ │ ├── strcat.c │ │ │ │ ├── strchr.c │ │ │ │ ├── strcmp.c │ │ │ │ ├── strcpy.c │ │ │ │ ├── string.c │ │ │ │ ├── strlen.c │ │ │ │ ├── strncat.c │ │ │ │ ├── strncmp.c │ │ │ │ ├── strncpy.c │ │ │ │ ├── strnlen.c │ │ │ │ ├── strpbrk.c │ │ │ │ ├── strspn.c │ │ │ │ ├── strstr.c │ │ │ │ ├── strtok.c │ │ │ │ ├── strtol.c │ │ │ │ ├── strtoul.c │ │ │ │ └── vsprintf.c │ │ │ └── test04_cpu1.c │ │ ├── te19c1.xxd │ │ └── test19.c │ ├── smptest20 │ │ ├── Makefile │ │ ├── sm20c0i.xxd │ │ ├── sm20c1a.xxd │ │ ├── sm20c1i.xxd │ │ ├── smp_test20.c │ │ ├── sub_cpu0_getvbr │ │ │ ├── cmd01_c_to_s │ │ │ ├── cmd02_s_to_o │ │ │ ├── get_vbr.s │ │ │ ├── get_vbr_proto.c │ │ │ └── get_vbr_proto.s │ │ ├── sub_cpu0_int │ │ │ ├── cmd01_c_to_sproto │ │ │ ├── cmd02_sproto_to_s │ │ │ ├── cmd03_s_to_xxd │ │ │ ├── cpu0_int.s │ │ │ ├── cpu0_int_proto.c │ │ │ └── cpu0_int_proto.s │ │ ├── sub_cpu1_int │ │ │ ├── cmd01_c_to_sproto │ │ │ ├── cmd02_sproto_to_s │ │ │ ├── cmd03_s_to_xxd │ │ │ ├── cpu1_int.s │ │ │ ├── cpu1_int_proto.c │ │ │ └── cpu1_int_proto.s │ │ └── sub_cpu1_main │ │ │ ├── Makefile │ │ │ ├── cmd02_exe_to_xxd │ │ │ ├── cmd991_c_to_s_to_checks │ │ │ ├── cpu1_main.c │ │ │ └── cpu1_main.s │ └── smptest21 │ │ ├── Makefile │ │ ├── cmd03_s_to_bin │ │ ├── sub_cpu1_int │ │ ├── cmd01_c_to_sproto │ │ ├── cmd02_sproto_to_s │ │ ├── cpu1_int.s │ │ ├── cpu1_int_proto.c │ │ └── cpu1_int_proto.s │ │ ├── sub_cpu1_main │ │ ├── Makefile │ │ ├── cmd_asm │ │ ├── cmd_map │ │ └── cpu1.c │ │ ├── te21c1.bin │ │ ├── te21ih.bin │ │ └── test21.c │ ├── fpga_sp │ ├── 03_14KB │ │ ├── 03_14kbyte.c │ │ └── Makefile │ ├── 04_7KB │ │ ├── 04_7kbyte.c │ │ └── Makefile │ └── 09_dflushtest │ │ ├── Makefile │ │ └── cac_test09.c │ ├── ictest000 │ ├── Makefile_for_ic │ ├── README │ └── cmd_go_IC │ └── ictest02h │ ├── Makefile_for_ic │ ├── README │ ├── cmd_go │ ├── icache_tb.vhd │ └── spec.txt ├── core ├── components_pkg.vhd ├── cpu.vhd ├── cpu_asic.vhd ├── cpu_config.vhd ├── datapath.vhm ├── datapath_pkg.vhd ├── mult.vhm ├── mult_pkg.vhd ├── register_file.vhd ├── register_file_flops.vhd └── register_file_two_bank.vhd ├── cpu2j0_pkg.vhd ├── decode ├── decode.vhd ├── decode_body.vhd ├── decode_core.vhm ├── decode_pkg.vhd ├── decode_table.vhd ├── decode_table_direct.vhd ├── decode_table_direct_config.vhd ├── decode_table_rom.vhd ├── decode_table_rom_config.vhd ├── decode_table_simple.vhd ├── decode_table_simple_config.vhd └── gen │ ├── README.md │ ├── SH-2 Instruction Set.ods │ ├── project.clj │ └── src │ └── cpugen │ ├── core.clj │ ├── genc.clj │ ├── genvhdl.clj │ ├── interface.clj │ ├── logic.clj │ ├── main.clj │ ├── parser.clj │ ├── rom.clj │ ├── util.clj │ ├── vcd.clj │ ├── vhdlmicrocode.clj │ └── vmagic.clj ├── sim ├── Makefile ├── Makefile_cpu_sim_pkg ├── README.txt ├── bridge_pkg.vhd ├── bus_monitor.vhd ├── cpu_ctb.c ├── cpu_pure_tb.vhd ├── cpu_signals.h ├── cpu_tb.vhd ├── cpusim_miniaic2.vhd ├── data_bus_pkg.vhd ├── debug.c ├── debug.h ├── debug_plan.c ├── debug_plan.h ├── debug_skt.c ├── debug_skt.h ├── decode_signals.h ├── decodeop.c ├── delays.c ├── delays.cfg ├── delays.h ├── mem │ ├── asymmetric_ram.vhd │ └── cpu_sram.vhd ├── monitor_pkg.vhd ├── pinst.c ├── ram.img ├── recv_buf.c ├── recv_buf.h ├── sh2instr.c ├── sh2instr.h ├── sim │ ├── bitvec.c │ ├── bitvec.h │ ├── mem_bus.c │ ├── mem_bus.h │ ├── packet_gen.c │ ├── sim_macros.h │ ├── simulator.c │ ├── simulator.h │ ├── uart.c │ ├── uart.h │ ├── uartlite.c │ ├── uartlite.h │ ├── uthash.h │ ├── utlist.h │ └── vpibridge.c ├── tests │ ├── Makefile │ ├── README.txt │ ├── interrupts.S │ ├── rte.S │ ├── sh32.x │ └── sim_instr.h └── timeout_cnt.vhm ├── testrom ├── Makefile ├── entry.c ├── gdb.c ├── gdb.h ├── main.c ├── sh2.c ├── sh2.h ├── startup │ ├── sh.x │ └── sh32.x ├── syscalls.h ├── tests │ ├── testalu.s │ ├── testbra.s │ ├── testdiv.s │ ├── testdmuls.s │ ├── testdmulu.s │ ├── testmacl.s │ ├── testmacw.s │ ├── testmov.s │ ├── testmov2.s │ ├── testmov3.s │ ├── testmul.s │ ├── testmulconf.s │ ├── testmull.s │ ├── testmuls.s │ ├── testmulu.s │ └── testshift.s ├── uart16550.c └── uartlite.c └── tests ├── Makefile ├── TESTS ├── arith_tap.vhd ├── bshift_tap.vhd ├── divider_tap.vhd ├── logic_tap.vhd ├── manip_tap.vhd ├── mult_tap.vhd └── register_tap.vhd /build.mk: -------------------------------------------------------------------------------- 1 | include $(dir $(lastword $(MAKEFILE_LIST)))build_core.mk 2 | 3 | $(VHDLS) += core/cpu_config.vhd 4 | $(VHDLS) += core/register_file_flops.vhd 5 | $(VHDLS) += core/register_file_two_bank.vhd 6 | $(VHDLS) += decode/decode_table_simple.vhd 7 | $(VHDLS) += decode/decode_table_simple_config.vhd 8 | $(VHDLS) += decode/decode_table_direct.vhd 9 | $(VHDLS) += decode/decode_table_direct_config.vhd 10 | $(VHDLS) += decode/decode_table_rom.vhd 11 | $(VHDLS) += decode/decode_table_rom_config.vhd 12 | -------------------------------------------------------------------------------- /build_core.mk: -------------------------------------------------------------------------------- 1 | $(VHDLS) += cpu2j0_pkg.vhd 2 | $(VHDLS) += core/components_pkg.vhd 3 | $(VHDLS) += core/cpu.vhd 4 | $(VHDLS) += core/mult_pkg.vhd 5 | $(VHDLS) += core/mult.vhd 6 | $(VHDLS) += core/datapath_pkg.vhd 7 | $(VHDLS) += core/datapath.vhd 8 | $(VHDLS) += core/register_file.vhd 9 | 10 | $(VHDLS) += decode/decode_pkg.vhd 11 | $(VHDLS) += decode/decode.vhd 12 | $(VHDLS) += decode/decode_body.vhd 13 | $(VHDLS) += decode/decode_table.vhd 14 | $(VHDLS) += decode/decode_core.vhd 15 | -------------------------------------------------------------------------------- /cache/build.mk: -------------------------------------------------------------------------------- 1 | include $(dir $(lastword $(MAKEFILE_LIST)))build_core.mk 2 | 3 | $(VHDLS) += cache_config_sim.vhd 4 | $(VHDLS) += cache_config_fpga.vhd 5 | 6 | -------------------------------------------------------------------------------- /cache/build.mk_localsim: -------------------------------------------------------------------------------- 1 | include $(dir $(lastword $(MAKEFILE_LIST)))build_core.mk 2 | 3 | $(VHDLS) += cache_config_sim.vhd 4 | $(VHDLS) += cache_config_fpga.vhd 5 | $(VHDLS) += ../dma/bus_mux_typeb.vhd 6 | $(VHDLS) += ../dma/dma_pkg.vhd 7 | 8 | -------------------------------------------------------------------------------- /cache/build_core.mk: -------------------------------------------------------------------------------- 1 | $(VHDLS) += cache_pkg.vhd 2 | $(VHDLS) += dcache.vhd 3 | $(VHDLS) += dcache_ccl.vhd 4 | $(VHDLS) += dcache_mcl.vhd 5 | $(VHDLS) += dcache_ram.vhd 6 | $(VHDLS) += dcache_adapter.vhd 7 | $(VHDLS) += icache_modereg.vhd 8 | $(VHDLS) += icache_modereg_wsbu.vhd 9 | $(VHDLS) += icache.vhd 10 | $(VHDLS) += icache_ccl.vhd 11 | $(VHDLS) += icache_mcl.vhd 12 | $(VHDLS) += icache_ram.vhd 13 | $(VHDLS) += icache_adapter.vhd 14 | -------------------------------------------------------------------------------- /cache/build_fpga.mk: -------------------------------------------------------------------------------- 1 | include $(dir $(lastword $(MAKEFILE_LIST)))build_core.mk 2 | 3 | $(VHDLS) += cache_config_fpga.vhd 4 | -------------------------------------------------------------------------------- /cache/cmd_go_ic1_dc1: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | # run i-cache simulation 4 | echo '-----------------------------------------------' 5 | echo '(1) run i-cache simulation (it will take 20 sec)' 6 | echo '(2) run d-cache simulation (it will take 320 sec)' 7 | echo '' 8 | echo 'first, run i-cache simulation' 9 | echo '-----------------------------------------------' 10 | make clean 11 | sleep 1 12 | /bin/rm icache_tb.ghw >& /dev/null 13 | ./tests/ictest000/cmd_go_IC 14 | 15 | sleep 5 16 | 17 | # run d-cache simulation 18 | echo '-----------------------------------------------' 19 | echo 'run d-cache simulation (it will take 320 sec)' 20 | echo '-----------------------------------------------' 21 | make clean 22 | sleep 1 23 | /bin/rm dcache_tb.ghw >& /dev/null 24 | ./cmd_go_dhry 25 | 26 | 27 | -------------------------------------------------------------------------------- /cache/tests/dctest13h_we_replace/Makefile: -------------------------------------------------------------------------------- 1 | VHDS := 2 | VHDS += ../cpu/cpu2j0_pkg.vhd 3 | VHDS += ../../targets/data_bus_pkg.vhd 4 | 5 | VHDLS := VHDS 6 | include build.mk 7 | 8 | VHDS += dcache_tb.vhd 9 | # VHDS += cache_pkg_tb.vhd 10 | 11 | VHDL_TESTS := 12 | 13 | VHDL_TOPS := dcache_tb 14 | VHDL_TOPS += $(VHDL_TESTS) 15 | 16 | all: $(VHDL_TOPS) 17 | 18 | work-obj93.cf: $(VHDS) 19 | 20 | dcache_tb.ghw: $(VHDL_TOPS) 21 | ./dcache_tb --wave=$@ --stop-time=4000ns 22 | 23 | %.vhm: %.vhmh 24 | LD_LIBRARY_PATH='' gcc -x c-header -E -P -w -nostdinc -I. $< -o $@ 25 | 26 | TOOLS_DIR := $(firstword $(wildcard ../mcu_lib/tools) $(wildcard ../../tools)) 27 | include $(TOOLS_DIR)/ghdl.mk 28 | 29 | clean: 30 | rm -f *.cf *.o $(VHDL_TOPS) *_tap *.ghw 31 | rm -f dcache.vhd 32 | 33 | .PHONY: all clean 34 | -------------------------------------------------------------------------------- /cache/tests/dctest13h_we_replace/README: -------------------------------------------------------------------------------- 1 | created 2015-02-18 for single dcache (no coherency). 2 | -------------------------------------------------------------------------------- /cache/tests/dctest39h_writepath_accvari8/README: -------------------------------------------------------------------------------- 1 | pass judge method 2 | diff cpu01.acc tests/dctest39h_writepath_accvari8/cpu01.acc_ex 3 | -------------------------------------------------------------------------------- /cache/tests/dctest39h_writepath_accvari8/cmd_tb2expected: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | cat dcache_tb.vhd | \ 4 | grep '^ acc_vect.*x.[13]' | \ 5 | sed -e 's/^.*x//' | \ 6 | tr '";' ' ' | \ 7 | sed -e 's/..........$/ &/' \ 8 | -e 's/..................$/ 0&/' \ 9 | -e 's/^.../& /' \ 10 | -e 's/^../& /' | \ 11 | awk ' \ 12 | { \ 13 | if($1 == "1") { print $4, $5, $2, "0"; } \ 14 | else { print $4, $5, $2, "1"; } \ 15 | }' | \ 16 | sed -e '$d' > tmp.1 17 | -------------------------------------------------------------------------------- /cache/tests/dctest40h_tas_variation/README: -------------------------------------------------------------------------------- 1 | basic pattern = cache on, ddr 1 wait 2 | 3 | sim time = 4000ns 4 | 5 | pass judge method 6 | (1) cpu r/w value (command ./cmd_go_dhry) 7 | verifying 8 | 40 cpu0.acc access 9 | 20 bus.acc access 10 | cpu r/w verify ok 11 | bus-cpu store verify ok 12 | bus-W snoop-W match ok 13 | 14 | (2) lock signal output -- wave check 15 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test03 9 | 10 | all: $(BINS) 11 | 12 | test03: test03.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = te03c1 9 | OBJS = test03_cpu1.o bare.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x169d0000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | clean: 30 | -rm -f $(EXEC) *.elf *.gdb *.o 31 | make -C lib clean 32 | 33 | $(OBJS): 34 | 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/bare.c: -------------------------------------------------------------------------------- 1 | #include "bare.h" 2 | 3 | void fflush(int fd) { 4 | } 5 | 6 | void exit(int code) { 7 | } 8 | 9 | #define READ_MEM(A) (*(volatile unsigned int*)(A)) 10 | 11 | #define sys_SYS_BASE 0xabcd0200 12 | #define Sys_RTCSecM 0x20 /* RealTime Clock Second MSW */ 13 | #define Sys_RTCSecL 0x24 /* RealTime Clock Second LSW */ 14 | #define Sys_RTCnsec 0x28 /* Real Time Clock nSec */ 15 | #define SEC_HI READ_MEM(sys_SYS_BASE + Sys_RTCSecM) 16 | #define SEC_LO READ_MEM(sys_SYS_BASE + Sys_RTCSecL) 17 | 18 | long time(long *t) { 19 | return SEC_LO; 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/bare.h: -------------------------------------------------------------------------------- 1 | #ifndef BARE_H 2 | #define BARE_H 3 | 4 | void fflush(int fd); 5 | 6 | void exit(int code); 7 | 8 | long time(long *t); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest03/sub_cpu1/test03_cpu1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* test03_cpu1.c */ 5 | 6 | int main( ) 7 | { 8 | volatile int *ptr_array_a32; 9 | int i, sum, poll_count = 0; 10 | 11 | ptr_array_a32 = (int *)(0x14010000); 12 | 13 | while (*(ptr_array_a32 + 0) == 0) { 14 | } 15 | sum = 0; 16 | for (i = 0; i < 100; i ++) { 17 | sum += *(ptr_array_a32 + 2 + i); 18 | *(ptr_array_a32 + 102 + i) = sum; 19 | } 20 | *(ptr_array_a32 + 1) = 1; 21 | while(1) { 22 | } 23 | return(0); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test04 9 | 10 | all: $(BINS) 11 | 12 | test04: test04.o get_lock_cpu0.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | get_lock_cpu0_stub.s : get_lock_cpu0_stub.c 16 | sh2-uclinux-gcc $(CFLAGS) -O -S get_lock_cpu0_stub.c 17 | 18 | get_lock_cpu0.o : get_lock_cpu0.s 19 | sh2-uclinux-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 20 | 21 | clean: 22 | rm -f $(BINS) *.o *.gdb 23 | 24 | .PHONY: clean all 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = te04c1 9 | OBJS = test04_cpu1.o get_lock_cpu0.o bare.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | get_lock_cpu0.o: get_lock_cpu0.s 30 | sh2-elf-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 31 | 32 | clean: 33 | -rm -f $(EXEC) *.elf *.gdb *.o 34 | make -C lib clean 35 | 36 | $(OBJS): 37 | 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/bare.c: -------------------------------------------------------------------------------- 1 | #include "bare.h" 2 | 3 | void fflush(int fd) { 4 | } 5 | 6 | void exit(int code) { 7 | } 8 | 9 | #define READ_MEM(A) (*(volatile unsigned int*)(A)) 10 | 11 | #define sys_SYS_BASE 0xabcd0200 12 | #define Sys_RTCSecM 0x20 /* RealTime Clock Second MSW */ 13 | #define Sys_RTCSecL 0x24 /* RealTime Clock Second LSW */ 14 | #define Sys_RTCnsec 0x28 /* Real Time Clock nSec */ 15 | #define SEC_HI READ_MEM(sys_SYS_BASE + Sys_RTCSecM) 16 | #define SEC_LO READ_MEM(sys_SYS_BASE + Sys_RTCSecL) 17 | 18 | long time(long *t) { 19 | return SEC_LO; 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/bare.h: -------------------------------------------------------------------------------- 1 | #ifndef BARE_H 2 | #define BARE_H 3 | 4 | void fflush(int fd); 5 | 6 | void exit(int code); 7 | 8 | long time(long *t); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest04/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | 9 | BINS := smp_test07 10 | 11 | all: $(BINS) 12 | 13 | smp_test07: smp_test07.o get_vbr.o 14 | $(CC) $^ $(LDFLAGS) -o $@ 15 | 16 | clean: 17 | rm -f $(BINS) *.o *.gdb 18 | 19 | .PHONY: clean all 20 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu0_getvbr/cmd01_c_to_s: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S get_vbr_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu0_getvbr/cmd02_s_to_o: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c get_vbr.s 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu0_getvbr/get_vbr.s: -------------------------------------------------------------------------------- 1 | .file "get_vbr_proto.c" 2 | .text 3 | .text 4 | .align 1 5 | .global get_vbr 6 | .type get_vbr, @function 7 | get_vbr: 8 | mov.l r14,@-r15 9 | mov r15,r14 10 | 11 | /* mov #13,r1 */ 12 | /* -- manual modification start */ 13 | stc vbr,r1 14 | /* -- manual modification end */ 15 | 16 | mov r1,r0 17 | mov r14,r15 18 | mov.l @r15+,r14 19 | rts 20 | nop 21 | .size get_vbr, .-get_vbr 22 | .ident "GCC: (Sourcery G++ Lite 2011.03-36 for SEI by OZH) 4.5.2" 23 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu0_getvbr/get_vbr_proto.c: -------------------------------------------------------------------------------- 1 | /* file create method */ 2 | /* get_vbr_proto.c -> get_vbr_proto.s */ 3 | /* manually modify get_vbr_proto.s -> get_vbr.s */ 4 | /* get_vbr.s -> get_vbr.o */ 5 | 6 | int get_vbr ( ) 7 | { 8 | return(13); 9 | } 10 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu0_getvbr/get_vbr_proto.s: -------------------------------------------------------------------------------- 1 | .file "get_vbr_proto.c" 2 | .text 3 | .text 4 | .align 1 5 | .global get_vbr 6 | .type get_vbr, @function 7 | get_vbr: 8 | mov.l r14,@-r15 9 | mov r15,r14 10 | mov #13,r1 11 | mov r1,r0 12 | mov r14,r15 13 | mov.l @r15+,r14 14 | rts 15 | nop 16 | .size get_vbr, .-get_vbr 17 | .ident "GCC: (Sourcery G++ Lite 2011.03-36 for SEI by OZH) 4.5.2" 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu0_int/cmd01_c_to_sproto: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu0_int_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu1_int/cmd01_c_to_sproto: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1_int_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu1_int/cmd03_s_to_xxd: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c cpu1_int.s 4 | sh2-uclinux-gcc cpu1_int.o \ 5 | -Wl,-elf2flt -o cpu1_int 6 | cat cpu1_int | \ 7 | xxd > sm07c1i.xxd 8 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu1_main/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1_main 9 | 10 | all: $(BINS) 11 | 12 | cpu1_main: cpu1_main.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu1_main/cmd02_exe_to_xxd: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | cat cpu1_main | xxd > sm07c1a.xxd 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest07/sub_cpu1_main/cmd991_c_to_s_to_checks: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1_main.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest08/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test08 9 | 10 | all: $(BINS) 11 | 12 | test08: test08.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest08/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S test08.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest08/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1 9 | 10 | all: $(BINS) 11 | 12 | cpu1: cpu1.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest08/sub_cpu1/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S cpu1.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test09 9 | 10 | all: $(BINS) 11 | 12 | test09: test09.o get_lock_cpu0.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | get_lock_cpu0_stub.s : get_lock_cpu0_stub.c 16 | sh2-uclinux-gcc $(CFLAGS) -O -S get_lock_cpu0_stub.c 17 | 18 | get_lock_cpu0.o : get_lock_cpu0.s 19 | sh2-uclinux-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 20 | 21 | clean: 22 | rm -f $(BINS) *.o *.gdb 23 | 24 | .PHONY: clean all 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/README: -------------------------------------------------------------------------------- 1 | makefile done not generate sm09c1.xxd. 2 | 3 | create te09c1.xxd by command line 4 | cat te09c1 | xxd > te09c1.xxd 5 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = te09c1 9 | OBJS = test09_cpu1.o get_lock_cpu0.o bare.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | get_lock_cpu0.o: get_lock_cpu0.s 30 | sh2-elf-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 31 | 32 | clean: 33 | -rm -f $(EXEC) *.elf *.gdb *.o 34 | make -C lib clean 35 | 36 | $(OBJS): 37 | 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/bare.c: -------------------------------------------------------------------------------- 1 | #include "bare.h" 2 | 3 | void fflush(int fd) { 4 | } 5 | 6 | void exit(int code) { 7 | } 8 | 9 | #define READ_MEM(A) (*(volatile unsigned int*)(A)) 10 | 11 | #define sys_SYS_BASE 0xabcd0200 12 | #define Sys_RTCSecM 0x20 /* RealTime Clock Second MSW */ 13 | #define Sys_RTCSecL 0x24 /* RealTime Clock Second LSW */ 14 | #define Sys_RTCnsec 0x28 /* Real Time Clock nSec */ 15 | #define SEC_HI READ_MEM(sys_SYS_BASE + Sys_RTCSecM) 16 | #define SEC_LO READ_MEM(sys_SYS_BASE + Sys_RTCSecL) 17 | 18 | long time(long *t) { 19 | return SEC_LO; 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/bare.h: -------------------------------------------------------------------------------- 1 | #ifndef BARE_H 2 | #define BARE_H 3 | 4 | void fflush(int fd); 5 | 6 | void exit(int code); 7 | 8 | long time(long *t); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest09/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test11 9 | 10 | all: $(BINS) 11 | 12 | test11: test11.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/make_rand/randgen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main( ) 7 | { 8 | int i; 9 | int count = 0; 10 | unsigned int udt; 11 | unsigned int udt2; 12 | 13 | srand((unsigned)time(NULL)); 14 | rand( ); 15 | rand( ); 16 | rand( ); 17 | rand( ); 18 | rand( ); 19 | 20 | for(i = 0; (i < 10000000) && (count <= 6000); i++) { 21 | udt = rand( ); 22 | udt2 = udt & 0xfff; 23 | if(udt2 < 2560) { 24 | printf("%3d %d\n", count, udt2); 25 | count ++; 26 | } 27 | } 28 | 29 | exit(0); 30 | } 31 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/random.num.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest11/random.num.gz -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1 9 | 10 | all: $(BINS) 11 | 12 | cpu1: cpu1.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/sub_cpu1/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S cpu1.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/te11c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest11/te11c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/test11_x86/cmd_go: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | echo '300' > random2.num 4 | cat random.num >> random2.num 5 | cat random2.num | ./test11_x86 6 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest11/test11_x86/random.num.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest11/test11_x86/random.num.gz -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test12 9 | 10 | all: $(BINS) 11 | 12 | test12: test12.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/README: -------------------------------------------------------------------------------- 1 | to stop test12 2 | writemem 8104 1 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = cpu1 9 | OBJS = cpu1.o cpu1_restart_asm.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | clean: 30 | -rm -f $(EXEC) *.elf *.gdb *.o 31 | make -C lib clean 32 | 33 | $(OBJS): 34 | 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-elf-gcc -Iinclude -DTIME -DHZ=60 -DNO_PROTOTYPES=1 -S cpu1.c 4 | sh2-elf-gcc -Iinclude -DTIME -DHZ=60 -DNO_PROTOTYPES=1 -S cpu1_restart_asm.c 5 | 6 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/cpu1_restart_asm.c: -------------------------------------------------------------------------------- 1 | int cpu1_restart_asm ( ) 2 | { 3 | int *ptr_1; 4 | 5 | /* this c will be replaced by hand coded asm */ 6 | 7 | ptr_1 = (int *)0x77c; 8 | 9 | while (1) { 10 | ptr_1 += 7; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest12/te12c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest12/te12c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test13 9 | 10 | all: $(BINS) 11 | 12 | test13: test13.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S test13.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/execution_results: -------------------------------------------------------------------------------- 1 | loop count = 1000 2 | cache mode = 3 (dcon, icon) 3 | 4 | smptest13 1.79 sec 5 | single cpu 2.93 sec 0901_cpubasic/06_cpu0_mgsort_fpg 6 | 7 | two cpu speed up = 163% 8 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | CFLAGS+=-O2 7 | 8 | EXEC = cpu1 9 | OBJS = cpu1.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | clean: 30 | -rm -f $(EXEC) *.elf *.gdb *.o 31 | make -C lib clean 32 | 33 | $(OBJS): 34 | 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-elf-gcc -O2 -Iinclude -DTIME -DHZ=60 -DNO_PROTOTYPES=1 -S cpu1.c 4 | 5 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/te13c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest13/te13c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest13/test.dat.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest13/test.dat.gz -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test14 9 | 10 | all: $(BINS) 11 | 12 | test14: test14.o get_lock_cpu0.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | get_lock_cpu0_stub.s : get_lock_cpu0_stub.c 16 | sh2-uclinux-gcc $(CFLAGS) -O -S get_lock_cpu0_stub.c 17 | 18 | get_lock_cpu0.o : get_lock_cpu0.s 19 | sh2-uclinux-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 20 | 21 | clean: 22 | rm -f $(BINS) *.o *.gdb 23 | 24 | .PHONY: clean all 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/get_lock_cpu0_stub.c: -------------------------------------------------------------------------------- 1 | /* get_lock_cpu0_stub.c (smp test 04) */ 2 | /* 2015-04-21 O. NISHII */ 3 | 4 | #define CPU1_SP_INIT 0x14004ffc 5 | #define ADRS_LOCK_VAR 0x14010020 6 | 7 | int get_lock_cpu0_stub( ) 8 | { 9 | volatile char *ptr_lock; 10 | volatile int *ptr_data; 11 | 12 | ptr_lock = (char *)ADRS_LOCK_VAR; 13 | ptr_data = (int *)CPU1_SP_INIT; 14 | 15 | *ptr_data = ((int) (*ptr_lock)) + 9; 16 | while( (*ptr_data) == 0) { 17 | (*(ptr_data + 11)) ++; 18 | } 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = te14c1 9 | OBJS = test14_cpu1.o get_lock_cpu0.o bare.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | get_lock_cpu0.o: get_lock_cpu0.s 30 | sh2-elf-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 31 | 32 | clean: 33 | -rm -f $(EXEC) *.elf *.gdb *.o 34 | make -C lib clean 35 | 36 | $(OBJS): 37 | 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/bare.c: -------------------------------------------------------------------------------- 1 | #include "bare.h" 2 | 3 | void fflush(int fd) { 4 | } 5 | 6 | void exit(int code) { 7 | } 8 | 9 | #define READ_MEM(A) (*(volatile unsigned int*)(A)) 10 | 11 | #define sys_SYS_BASE 0xabcd0200 12 | #define Sys_RTCSecM 0x20 /* RealTime Clock Second MSW */ 13 | #define Sys_RTCSecL 0x24 /* RealTime Clock Second LSW */ 14 | #define Sys_RTCnsec 0x28 /* Real Time Clock nSec */ 15 | #define SEC_HI READ_MEM(sys_SYS_BASE + Sys_RTCSecM) 16 | #define SEC_LO READ_MEM(sys_SYS_BASE + Sys_RTCSecL) 17 | 18 | long time(long *t) { 19 | return SEC_LO; 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/bare.h: -------------------------------------------------------------------------------- 1 | #ifndef BARE_H 2 | #define BARE_H 3 | 4 | void fflush(int fd); 5 | 6 | void exit(int code); 7 | 8 | long time(long *t); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/get_lock_cpu0_stub.c: -------------------------------------------------------------------------------- 1 | /* get_lock_cpu0_stub.c (smp test 04) */ 2 | /* 2015-04-21 O. NISHII */ 3 | 4 | #define CPU1_SP_INIT 0x14004ffc 5 | #define ADRS_LOCK_VAR 0x14010020 6 | 7 | int get_lock_cpu0_stub( ) 8 | { 9 | volatile char *ptr_lock; 10 | volatile int *ptr_data; 11 | 12 | ptr_lock = (char *)ADRS_LOCK_VAR; 13 | ptr_data = (int *)CPU1_SP_INIT; 14 | 15 | *ptr_data = ((int) (*ptr_lock)) + 9; 16 | while( (*ptr_data) == 0) { 17 | (*(ptr_data + 11)) ++; 18 | } 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest14/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test15 9 | 10 | all: $(BINS) 11 | 12 | test15: test15.o get_lock_cpu0.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | get_lock_cpu0_stub.s : get_lock_cpu0_stub.c 16 | sh2-uclinux-gcc $(CFLAGS) -O -S get_lock_cpu0_stub.c 17 | 18 | get_lock_cpu0.o : get_lock_cpu0.s 19 | sh2-uclinux-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 20 | 21 | clean: 22 | rm -f $(BINS) *.o *.gdb 23 | 24 | .PHONY: clean all 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/get_lock_cpu0_stub.c: -------------------------------------------------------------------------------- 1 | /* get_lock_cpu0_stub.c (smp test 04) */ 2 | /* 2015-04-21 O. NISHII */ 3 | 4 | #define CPU1_SP_INIT 0x14004ffc 5 | #define ADRS_LOCK_VAR 0x14010020 6 | 7 | int get_lock_cpu0_stub( ) 8 | { 9 | volatile char *ptr_lock; 10 | volatile int *ptr_data; 11 | 12 | ptr_lock = (char *)ADRS_LOCK_VAR; 13 | ptr_data = (int *)CPU1_SP_INIT; 14 | 15 | *ptr_data = ((int) (*ptr_lock)) + 9; 16 | while( (*ptr_data) == 0) { 17 | (*(ptr_data + 11)) ++; 18 | } 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = te15c1 9 | OBJS = test15_cpu1.o get_lock_cpu0.o bare.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | get_lock_cpu0.o: get_lock_cpu0.s 30 | sh2-elf-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 31 | 32 | clean: 33 | -rm -f $(EXEC) *.elf *.gdb *.o 34 | make -C lib clean 35 | 36 | $(OBJS): 37 | 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/bare.c: -------------------------------------------------------------------------------- 1 | #include "bare.h" 2 | 3 | void fflush(int fd) { 4 | } 5 | 6 | void exit(int code) { 7 | } 8 | 9 | #define READ_MEM(A) (*(volatile unsigned int*)(A)) 10 | 11 | #define sys_SYS_BASE 0xabcd0200 12 | #define Sys_RTCSecM 0x20 /* RealTime Clock Second MSW */ 13 | #define Sys_RTCSecL 0x24 /* RealTime Clock Second LSW */ 14 | #define Sys_RTCnsec 0x28 /* Real Time Clock nSec */ 15 | #define SEC_HI READ_MEM(sys_SYS_BASE + Sys_RTCSecM) 16 | #define SEC_LO READ_MEM(sys_SYS_BASE + Sys_RTCSecL) 17 | 18 | long time(long *t) { 19 | return SEC_LO; 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/bare.h: -------------------------------------------------------------------------------- 1 | #ifndef BARE_H 2 | #define BARE_H 3 | 4 | void fflush(int fd); 5 | 6 | void exit(int code); 7 | 8 | long time(long *t); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/get_lock_cpu0_stub.c: -------------------------------------------------------------------------------- 1 | /* get_lock_cpu0_stub.c (smp test 04) */ 2 | /* 2015-04-21 O. NISHII */ 3 | 4 | #define CPU1_SP_INIT 0x14004ffc 5 | #define ADRS_LOCK_VAR 0x14010020 6 | 7 | int get_lock_cpu0_stub( ) 8 | { 9 | volatile char *ptr_lock; 10 | volatile int *ptr_data; 11 | 12 | ptr_lock = (char *)ADRS_LOCK_VAR; 13 | ptr_data = (int *)CPU1_SP_INIT; 14 | 15 | *ptr_data = ((int) (*ptr_lock)) + 9; 16 | while( (*ptr_data) == 0) { 17 | (*(ptr_data + 11)) ++; 18 | } 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest15/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest16/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test16 9 | 10 | all: $(BINS) 11 | 12 | test16: test16.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest16/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1 9 | 10 | all: $(BINS) 11 | 12 | cpu1: cpu1.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest16/sub_cpu1/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest16/te16c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest16/te16c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test17 9 | 10 | all: $(BINS) 11 | 12 | test17: test17.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/sub_cpu1_int/cmd01_c_to_sproto: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1_int_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/sub_cpu1_int/cmd03_s_to_bin: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c cpu1_int.s 4 | sh2-uclinux-gcc cpu1_int.o \ 5 | -Wl,-elf2flt -o cpu1_int 6 | cp -p cpu1_int \ 7 | te17ih.bin 8 | cat cpu1_int | \ 9 | xxd > cpu1_int.xxd 10 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/sub_cpu1_int/cpu1_int_proto.s: -------------------------------------------------------------------------------- 1 | .file "cpu1_int_proto.c" 2 | .text 3 | .text 4 | .align 1 5 | .global main 6 | .type main, @function 7 | main: 8 | mov.l r14,@-r15 9 | add #-4,r15 10 | mov r15,r14 11 | mov r14,r1 12 | add #-60,r1 13 | mov.l .L2,r2 14 | mov.l r2,@(60,r1) 15 | mov r14,r1 16 | add #-60,r1 17 | mov.l @(60,r1),r1 18 | mov.l @r1,r1 19 | mov r1,r2 20 | add #1,r2 21 | mov r14,r1 22 | add #-60,r1 23 | mov.l @(60,r1),r1 24 | mov.l r2,@r1 25 | mov #0,r1 26 | mov r1,r0 27 | add #4,r14 28 | mov r14,r15 29 | mov.l @r15+,r14 30 | rts 31 | nop 32 | .L3: 33 | .align 2 34 | .L2: 35 | .long 33044 36 | .size main, .-main 37 | .ident "GCC: (Sourcery G++ Lite 2011.03-36 for SEI by OZH) 4.5.2" 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/sub_cpu1_main/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1 9 | 10 | all: $(BINS) 11 | 12 | cpu1: cpu1.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/sub_cpu1_main/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S cpu1.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/sub_cpu1_main/cmd_map: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc cpu1.o -Wl,-elf2flt,-M -o cpu1 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/te17c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest17/te17c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest17/te17ih.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest17/te17ih.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test18 9 | 10 | all: $(BINS) 11 | 12 | test18: test18.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/expected_value: -------------------------------------------------------------------------------- 1 | loop count = 2000 2 | sumdma 11f80000 3 | sumcpu 9e2a140 4 | 5 | loop count = 300 6 | sumdma 11f80000 7 | sumcpu a23b04e 8 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/make_rand/randomgen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main( ) 7 | { 8 | int i; 9 | int count = 0; 10 | unsigned int udt; 11 | unsigned int udt2; 12 | 13 | srand((unsigned)time(NULL)); 14 | rand( ); 15 | rand( ); 16 | rand( ); 17 | rand( ); 18 | rand( ); 19 | 20 | for(i = 0; (i < 10000000) && (count <= 6000); i++) { 21 | udt = rand( ); 22 | udt2 = udt & 0xfff; 23 | if(udt2 < 2560) { 24 | printf("%3d %d\n", count, udt2); 25 | count ++; 26 | } 27 | } 28 | 29 | exit(0); 30 | } 31 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/random.num.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest18/random.num.gz -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1 9 | 10 | all: $(BINS) 11 | 12 | cpu1: cpu1.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/sub_cpu1/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S cpu1.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest18/te18c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest18/te18c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test19 9 | 10 | all: $(BINS) 11 | 12 | test19: test19.o get_lock_cpu0.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | get_lock_cpu0_stub.s : get_lock_cpu0_stub.c 16 | sh2-uclinux-gcc $(CFLAGS) -O -S get_lock_cpu0_stub.c 17 | 18 | get_lock_cpu0.o : get_lock_cpu0.s 19 | sh2-uclinux-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 20 | 21 | clean: 22 | rm -f $(BINS) *.o *.gdb 23 | 24 | .PHONY: clean all 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/expected.dma: -------------------------------------------------------------------------------- 1 | sum dma = 41e0000 (hex ) 2 | 3 | (2^26 + 2^21 - 2^17) 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/get_lock_cpu0_stub.c: -------------------------------------------------------------------------------- 1 | /* get_lock_cpu0_stub.c (smp test 04) */ 2 | /* 2015-04-21 O. NISHII */ 3 | 4 | #define CPU1_SP_INIT 0x14004ffc 5 | #define ADRS_LOCK_VAR 0x14010020 6 | 7 | int get_lock_cpu0_stub( ) 8 | { 9 | volatile char *ptr_lock; 10 | volatile int *ptr_data; 11 | 12 | ptr_lock = (char *)ADRS_LOCK_VAR; 13 | ptr_data = (int *)CPU1_SP_INIT; 14 | 15 | *ptr_data = ((int) (*ptr_lock)) + 9; 16 | while( (*ptr_data) == 0) { 17 | (*(ptr_data + 11)) ++; 18 | } 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = sh2-elf 2 | CC = $(ARCH)-gcc 3 | LD = $(ARCH)-ld 4 | CFLAGS+=-Iinclude 5 | CFLAGS+=-DTIME -DHZ=60 6 | #CFLAGS+=-O2 7 | 8 | EXEC = te04c1 9 | OBJS = test04_cpu1.o get_lock_cpu0.o bare.o 10 | 11 | CFLAGS += -DNO_PROTOTYPES=1 12 | 13 | LIBGCC := $(shell $(CC) -print-libgcc-file-name) 14 | LIBGCC += $(shell $(CC) -print-file-name=libgcc-Os-4-200.a) 15 | LDFLAGS = -e _main -Ttext=0x14001000 ./lib/libc.a $(LIBGCC) 16 | 17 | all: $(EXEC) 18 | 19 | $(EXEC): $(OBJS) lib/libc.a 20 | $(LD) $^ $(LDFLAGS) -o $@ 21 | # $(CC) $(LDFLAGS) -o $@ $^ 22 | 23 | romfs: 24 | $(ROMFSINST) /bin/$(EXEC) 25 | 26 | lib/libc.a: 27 | make -C lib 28 | 29 | get_lock_cpu0.o: get_lock_cpu0.s 30 | sh2-elf-gcc $(CFLAGS) -c -o get_lock_cpu0.o get_lock_cpu0.s 31 | 32 | clean: 33 | -rm -f $(EXEC) *.elf *.gdb *.o 34 | make -C lib clean 35 | 36 | $(OBJS): 37 | 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/bare.c: -------------------------------------------------------------------------------- 1 | #include "bare.h" 2 | 3 | void fflush(int fd) { 4 | } 5 | 6 | void exit(int code) { 7 | } 8 | 9 | #define READ_MEM(A) (*(volatile unsigned int*)(A)) 10 | 11 | #define sys_SYS_BASE 0xabcd0200 12 | #define Sys_RTCSecM 0x20 /* RealTime Clock Second MSW */ 13 | #define Sys_RTCSecL 0x24 /* RealTime Clock Second LSW */ 14 | #define Sys_RTCnsec 0x28 /* Real Time Clock nSec */ 15 | #define SEC_HI READ_MEM(sys_SYS_BASE + Sys_RTCSecM) 16 | #define SEC_LO READ_MEM(sys_SYS_BASE + Sys_RTCSecL) 17 | 18 | long time(long *t) { 19 | return SEC_LO; 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/bare.h: -------------------------------------------------------------------------------- 1 | #ifndef BARE_H 2 | #define BARE_H 3 | 4 | void fflush(int fd); 5 | 6 | void exit(int code); 7 | 8 | long time(long *t); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/get_lock_cpu0_stub.c: -------------------------------------------------------------------------------- 1 | /* get_lock_cpu0_stub.c (smp test 04) */ 2 | /* 2015-04-21 O. NISHII */ 3 | 4 | #define CPU1_SP_INIT 0x14004ffc 5 | #define ADRS_LOCK_VAR 0x14010020 6 | 7 | int get_lock_cpu0_stub( ) 8 | { 9 | volatile char *ptr_lock; 10 | volatile int *ptr_data; 11 | 12 | ptr_lock = (char *)ADRS_LOCK_VAR; 13 | ptr_data = (int *)CPU1_SP_INIT; 14 | 15 | *ptr_data = ((int) (*ptr_lock)) + 9; 16 | while( (*ptr_data) == 0) { 17 | (*(ptr_data + 11)) ++; 18 | } 19 | return(0); 20 | } 21 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef _ERRNO_H 2 | #define _ERRNO_H 3 | 4 | extern int errno; 5 | 6 | #define ENOSYS 1 /* No syscall */ 7 | #define ENOENT 2 /* No entry */ 8 | #define ESRCH 3 /* No process */ 9 | #define EAGAIN 4 /* (busy) Try again */ 10 | #define EINTR 5 /* Interrupted system call */ 11 | #define EINVAL 6 /* Invalid argument */ 12 | 13 | #endif /* _ERRNO_H */ 14 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/include/setjmp.h: -------------------------------------------------------------------------------- 1 | #ifndef _SETJMP_H_ 2 | #define _SETJMP_H_ 3 | 4 | typedef struct __jmpbuf { 5 | unsigned int __j0; /* 0 */ 6 | unsigned int __j1; 7 | unsigned int sp; /* 8 */ 8 | unsigned int pc; /* 12 */ 9 | unsigned int __j3; 10 | unsigned int d2; /* 20 */ 11 | unsigned int d3; 12 | unsigned int d4; 13 | unsigned int d5; 14 | unsigned int d6; 15 | unsigned int d7; 16 | unsigned int a2; 17 | unsigned int a3; 18 | unsigned int a4; 19 | unsigned int a5; 20 | unsigned int fp; 21 | } __jmp_buf[1]; 22 | 23 | typedef __jmp_buf jmp_buf; 24 | 25 | int setjmp(jmp_buf jp); 26 | int longjmp(jmp_buf jp, int ret); 27 | 28 | #endif /* _332_SETJMP_H_ */ 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/include/stdlib.h: -------------------------------------------------------------------------------- 1 | extern unsigned int sleep(unsigned int); 2 | extern void usleep(unsigned int); 3 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/include/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = vsprintf.o setjmp.o conio.o libsyscall.o read_write.o\ 2 | strtoul.o strtol.o strcpy.o strncpy.o strcat.o strncat.o \ 3 | strcmp.o strncmp.o strchr.o strlen.o strnlen.o strspn.o \ 4 | strpbrk.o strtok.o memset.o bcopy.o memcpy.o memmove.o \ 5 | memcmp.o memscan.o strstr.o ctype.o bzero.o 6 | 7 | ARCH = sh2-elf 8 | CC = $(ARCH)-gcc 9 | AR = $(ARCH)-ar 10 | RANLIB = $(ARCH)-ranlib 11 | 12 | CFLAGS = -fno-builtin -I../include -O2 13 | 14 | all: libc.a 15 | 16 | libc.a: $(OBJS) 17 | $(AR) -cur libc.a $(OBJS) 18 | $(RANLIB) libc.a 19 | 20 | .S.o: 21 | $(CC) $(CFLAGS) -c $< 22 | 23 | clean: 24 | @rm -f *.[oa] contab.* *.bdmmb *.map *.log *.s19 core *~ 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/bcopy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_BCOPY 17 | char * bcopy(const char * src, char * dest, int count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count--) 22 | *tmp++ = *src++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/bzero.c: -------------------------------------------------------------------------------- 1 | void bzero(void *p, int n) 2 | { 3 | char *c = p; 4 | 5 | while (n) c[n--] = 0; 6 | } 7 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/libsyscall.S: -------------------------------------------------------------------------------- 1 | .section .text 2 | .align 2 3 | 4 | .global __trap34 5 | __trap34: 6 | trapa #34 7 | tst r1,r1 ! r1 is errno 8 | bt ret 9 | mov.l perrno,r2 10 | mov.l r1,@r2 11 | ret: 12 | rts 13 | nop 14 | 15 | .align 2 16 | perrno: 17 | .long _errno 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCMP 17 | int memcmp(const void * cs,const void * ct,unsigned long count) 18 | { 19 | const unsigned char *su1, *su2; 20 | signed char res = 0; 21 | 22 | for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 23 | if ((res = *su1 - *su2) != 0) 24 | break; 25 | return res; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/memcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMCPY 17 | void * memcpy(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp = (char *) dest, *s = (char *) src; 20 | 21 | while (count--) 22 | *tmp++ = *s++; 23 | 24 | return dest; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/memmove.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMMOVE 17 | void * memmove(void * dest,const void *src,unsigned long count) 18 | { 19 | char *tmp, *s; 20 | 21 | if (dest <= src) { 22 | tmp = (char *) dest; 23 | s = (char *) src; 24 | while (count--) 25 | *tmp++ = *s++; 26 | } 27 | else { 28 | tmp = (char *) dest + count; 29 | s = (char *) src + count; 30 | while (count--) 31 | *--tmp = *--s; 32 | } 33 | 34 | return dest; 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/memscan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | /* 17 | * find the first occurrence of byte 'c', or 1 past the area if none 18 | */ 19 | #ifndef __HAVE_ARCH_MEMSCAN 20 | void * memscan(void * addr, int c, unsigned long size) 21 | { 22 | unsigned char * p = (unsigned char *) addr; 23 | 24 | while (size) { 25 | if (*p == c) 26 | return (void *) p; 27 | p++; 28 | size--; 29 | } 30 | return (void *) p; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/memset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_MEMSET 17 | void * memset(void * s,char c,unsigned long count) 18 | { 19 | char *xs = (char *) s; 20 | 21 | while (count--) 22 | *xs++ = c; 23 | 24 | return s; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/setjmp.S: -------------------------------------------------------------------------------- 1 | .globl setjmp 2 | .balign 4 3 | setjmp: 4 | add #(9*4),r4 5 | sts.l pr,@-r4 6 | mov.l r15,@-r4 7 | mov.l r14,@-r4 8 | mov.l r13,@-r4 9 | mov.l r12,@-r4 10 | mov.l r11,@-r4 11 | mov.l r10,@-r4 12 | mov.l r9,@-r4 13 | mov.l r8,@-r4 14 | rts 15 | mov #0,r0 16 | 17 | .globl longjmp 18 | .balign 4 19 | longjmp: 20 | mov.l @r4+,r8 21 | mov.l @r4+,r9 22 | mov.l @r4+,r10 23 | mov.l @r4+,r11 24 | mov.l @r4+,r12 25 | mov.l @r4+,r13 26 | mov.l @r4+,r14 27 | mov.l @r4+,r15 28 | lds.l @r4+,pr 29 | mov r5,r0 30 | tst r0,r0 31 | bf 1f 32 | mov #1,r0 ! in case val==0 33 | 1: rts 34 | nop 35 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCAT 17 | char * strcat(char * dest, const char * src) 18 | { 19 | char *tmp = dest; 20 | 21 | while (*dest) 22 | dest++; 23 | while ((*dest++ = *src++) != '\0'); 24 | 25 | return tmp; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCHR 17 | char * strchr(const char * s, int c) 18 | { 19 | for(; *s != (char) c; ++s) 20 | if (*s == '\0') 21 | return NULL; 22 | return (char *) s; 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCMP 17 | int strcmp(const char * cs,const char * ct) 18 | { 19 | register signed char __res; 20 | 21 | while (1) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | } 25 | 26 | return __res; 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRCPY 17 | char * strcpy(char * dest,const char *src) 18 | { 19 | char *tmp = dest; 20 | 21 | while ((*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | return tmp; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRLEN 17 | unsigned long strlen(const char * s) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCAT 17 | char * strncat(char *dest, const char *src, unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | if (count) { 22 | while (*dest) 23 | dest++; 24 | while ((*dest++ = *src++)) { 25 | if (--count == 0) 26 | break; 27 | } 28 | } 29 | 30 | return tmp; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCMP 17 | int strncmp(const char * cs,const char * ct,unsigned long count) 18 | { 19 | register signed char __res = 0; 20 | 21 | while (count) { 22 | if ((__res = *cs - *ct++) != 0 || !*cs++) 23 | break; 24 | count--; 25 | } 26 | 27 | return __res; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNCPY 17 | char * strncpy(char * dest,const char *src,unsigned long count) 18 | { 19 | char *tmp = dest; 20 | 21 | while (count-- && (*dest++ = *src++) != '\0') 22 | /* nothing */; 23 | 24 | return tmp; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRNLEN 17 | unsigned long strnlen(const char * s, unsigned long count) 18 | { 19 | const char *sc; 20 | 21 | for (sc = s; count-- && *sc != '\0'; ++sc) 22 | /* nothing */; 23 | return sc - s; 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strpbrk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRPBRK 17 | char * strpbrk(const char * cs,const char * ct) 18 | { 19 | const char *sc1,*sc2; 20 | 21 | for( sc1 = cs; *sc1 != '\0'; ++sc1) { 22 | for( sc2 = ct; *sc2 != '\0'; ++sc2) { 23 | if (*sc1 == *sc2) 24 | return (char *) sc1; 25 | } 26 | } 27 | return NULL; 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strspn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSPN 17 | unsigned long strspn(const char *s, const char *accept) 18 | { 19 | const char *p; 20 | const char *a; 21 | unsigned long count = 0; 22 | 23 | for (p = s; *p != '\0'; ++p) { 24 | for (a = accept; *a != '\0'; ++a) { 25 | if (*p == *a) 26 | break; 27 | } 28 | if (*a == '\0') 29 | return count; 30 | ++count; 31 | } 32 | 33 | return count; 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | #ifndef __HAVE_ARCH_STRSTR 17 | char * strstr(const char * s1,const char * s2) 18 | { 19 | int l1, l2; 20 | 21 | l2 = strlen(s2); 22 | if (!l2) 23 | return (char *) s1; 24 | l1 = strlen(s1); 25 | while (l1 >= l2) { 26 | l1--; 27 | if (!memcmp(s1,s2,l2)) 28 | return (char *) s1; 29 | s1++; 30 | } 31 | return NULL; 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest19/sub_cpu1/lib/strtok.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991, 1992 Linus Torvalds 3 | */ 4 | 5 | /* 6 | * D. Jeff Dionne, 1995. 7 | */ 8 | 9 | /* Additional hole filled: strtol 10 | * M. Schlifer, NOV 1995. 11 | */ 12 | 13 | #include 14 | #include 15 | 16 | char * ___strtok = NULL; 17 | 18 | #ifndef __HAVE_ARCH_STRTOK 19 | char * strtok(char * s,const char * ct) 20 | { 21 | char *sbegin, *send; 22 | 23 | sbegin = s ? s : ___strtok; 24 | if (!sbegin) { 25 | return NULL; 26 | } 27 | sbegin += strspn(sbegin,ct); 28 | if (*sbegin == '\0') { 29 | ___strtok = NULL; 30 | return( NULL ); 31 | } 32 | send = strpbrk( sbegin, ct); 33 | if (send && *send != '\0') 34 | *send++ = '\0'; 35 | ___strtok = send; 36 | return (sbegin); 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | 9 | BINS := smp_test20 10 | 11 | all: $(BINS) 12 | 13 | smp_test20: smp_test20.o get_vbr.o 14 | $(CC) $^ $(LDFLAGS) -o $@ 15 | 16 | clean: 17 | rm -f $(BINS) *.o *.gdb 18 | 19 | .PHONY: clean all 20 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_getvbr/cmd01_c_to_s: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S get_vbr_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_getvbr/cmd02_s_to_o: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c get_vbr.s 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_getvbr/get_vbr.s: -------------------------------------------------------------------------------- 1 | .file "get_vbr_proto.c" 2 | .text 3 | .text 4 | .align 1 5 | .global get_vbr 6 | .type get_vbr, @function 7 | get_vbr: 8 | mov.l r14,@-r15 9 | mov r15,r14 10 | 11 | /* mov #13,r1 */ 12 | /* -- manual modification start */ 13 | stc vbr,r1 14 | /* -- manual modification end */ 15 | 16 | mov r1,r0 17 | mov r14,r15 18 | mov.l @r15+,r14 19 | rts 20 | nop 21 | .size get_vbr, .-get_vbr 22 | .ident "GCC: (Sourcery G++ Lite 2011.03-36 for SEI by OZH) 4.5.2" 23 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_getvbr/get_vbr_proto.c: -------------------------------------------------------------------------------- 1 | /* file create method */ 2 | /* get_vbr_proto.c -> get_vbr_proto.s */ 3 | /* manually modify get_vbr_proto.s -> get_vbr.s */ 4 | /* get_vbr.s -> get_vbr.o */ 5 | 6 | int get_vbr ( ) 7 | { 8 | return(13); 9 | } 10 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_getvbr/get_vbr_proto.s: -------------------------------------------------------------------------------- 1 | .file "get_vbr_proto.c" 2 | .text 3 | .text 4 | .align 1 5 | .global get_vbr 6 | .type get_vbr, @function 7 | get_vbr: 8 | mov.l r14,@-r15 9 | mov r15,r14 10 | mov #13,r1 11 | mov r1,r0 12 | mov r14,r15 13 | mov.l @r15+,r14 14 | rts 15 | nop 16 | .size get_vbr, .-get_vbr 17 | .ident "GCC: (Sourcery G++ Lite 2011.03-36 for SEI by OZH) 4.5.2" 18 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_int/cmd01_c_to_sproto: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu0_int_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu0_int/cmd03_s_to_xxd: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c cpu0_int.s 4 | sh2-uclinux-gcc cpu0_int.o \ 5 | -Wl,-elf2flt -o cpu0_int 6 | cat cpu0_int | \ 7 | xxd > sm20c0i.xxd 8 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu1_int/cmd01_c_to_sproto: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1_int_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu1_int/cmd03_s_to_xxd: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c cpu1_int.s 4 | sh2-uclinux-gcc cpu1_int.o \ 5 | -Wl,-elf2flt -o cpu1_int 6 | cat cpu1_int | \ 7 | xxd > sm20c1i.xxd 8 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu1_main/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1_main 9 | 10 | all: $(BINS) 11 | 12 | cpu1_main: cpu1_main.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu1_main/cmd02_exe_to_xxd: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | cat cpu1_main | xxd > sm20c1a.xxd 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest20/sub_cpu1_main/cmd991_c_to_s_to_checks: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1_main.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := test21 9 | 10 | all: $(BINS) 11 | 12 | test21: test21.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/cmd03_s_to_bin: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -c cpu1_int.s 4 | sh2-uclinux-gcc cpu1_int.o \ 5 | -Wl,-elf2flt -o cpu1_int 6 | cp -p cpu1_int \ 7 | te21ih.bin 8 | cat cpu1_int | \ 9 | xxd > cpu1_int.xxd 10 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/sub_cpu1_int/cmd01_c_to_sproto: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -Wall -Werror -Wno-error=unused-value -S cpu1_int_proto.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/sub_cpu1_int/cpu1_int_proto.s: -------------------------------------------------------------------------------- 1 | .file "cpu1_int_proto.c" 2 | .text 3 | .text 4 | .align 1 5 | .global main 6 | .type main, @function 7 | main: 8 | mov.l r14,@-r15 9 | add #-4,r15 10 | mov r15,r14 11 | mov r14,r1 12 | add #-60,r1 13 | mov.l .L2,r2 14 | mov.l r2,@(60,r1) 15 | mov r14,r1 16 | add #-60,r1 17 | mov.l @(60,r1),r1 18 | mov.l @r1,r1 19 | mov r1,r2 20 | add #1,r2 21 | mov r14,r1 22 | add #-60,r1 23 | mov.l @(60,r1),r1 24 | mov.l r2,@r1 25 | mov #0,r1 26 | mov r1,r0 27 | add #4,r14 28 | mov r14,r15 29 | mov.l @r15+,r14 30 | rts 31 | nop 32 | .L3: 33 | .align 2 34 | .L2: 35 | .long 33044 36 | .size main, .-main 37 | .ident "GCC: (Sourcery G++ Lite 2011.03-36 for SEI by OZH) 4.5.2" 38 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/sub_cpu1_main/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-O2 -Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu1 9 | 10 | all: $(BINS) 11 | 12 | cpu1: cpu1.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/sub_cpu1_main/cmd_asm: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc -O2 -Wall -Werror -Wno-error=unused-value -S cpu1.c 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/sub_cpu1_main/cmd_map: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | sh2-uclinux-gcc cpu1.o -Wl,-elf2flt,-M -o cpu1 4 | -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/te21c1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest21/te21c1.bin -------------------------------------------------------------------------------- /cache/tests/fpga_smp/smptest21/te21ih.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/cache/tests/fpga_smp/smptest21/te21ih.bin -------------------------------------------------------------------------------- /cache/tests/fpga_sp/03_14KB/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := 03_14kbyte 9 | 10 | all: $(BINS) 11 | 12 | 03_14kbyte: 03_14kbyte.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_sp/04_7KB/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cpu_test 9 | 10 | all: $(BINS) 11 | 12 | 04_7kbyte: 04_7kbyte.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/fpga_sp/09_dflushtest/Makefile: -------------------------------------------------------------------------------- 1 | CC=sh2-uclinux-gcc 2 | AR=sh2-uclinux-ar 3 | RANLIB=sh2-uclinux-ranlib 4 | 5 | CFLAGS=-Wall -Werror -Wno-error=unused-value 6 | LDFLAGS=-Wl,-elf2flt 7 | 8 | BINS := cac_test09 9 | 10 | all: $(BINS) 11 | 12 | cac_test09: cac_test09.o 13 | $(CC) $^ $(LDFLAGS) -o $@ 14 | 15 | clean: 16 | rm -f $(BINS) *.o *.gdb 17 | 18 | .PHONY: clean all 19 | -------------------------------------------------------------------------------- /cache/tests/ictest000/Makefile_for_ic: -------------------------------------------------------------------------------- 1 | TOOLS_DIR := ../../tools 2 | include $(TOOLS_DIR)/mk_utils.mk 3 | 4 | VHDS := 5 | VHDS += ../cpu/cpu2j0_pkg.vhd 6 | VHDS += ../../targets/data_bus_pkg.vhd 7 | 8 | VHDS += icache_tb.vhd 9 | # VHDS += cache_pkg_tb.vhd 10 | 11 | VHDS += $(call include_vhdl,../../lib/memory_tech_lib) 12 | VHDS += $(call include_vhdl,../../lib/memory_tech_lib/tech/sim) 13 | 14 | VHDLS := VHDS 15 | include build.mk 16 | 17 | VHDL_TESTS := 18 | 19 | VHDL_TOPS := icache_tb 20 | VHDL_TOPS += $(VHDL_TESTS) 21 | 22 | all: $(VHDL_TOPS) 23 | 24 | work-obj93.cf: $(VHDS) 25 | 26 | icache_tb.ghw: $(VHDL_TOPS) 27 | ./icache_tb --wave=$@ --stop-time=18000ns 28 | 29 | %.vhm: %.vhmh 30 | LD_LIBRARY_PATH='' gcc -x c-header -E -P -w -nostdinc -I. $< -o $@ 31 | 32 | include $(TOOLS_DIR)/ghdl.mk 33 | 34 | clean: 35 | rm -f *.cf *.o $(VHDL_TOPS) *_tap *.ghw 36 | 37 | .PHONY: all clean 38 | -------------------------------------------------------------------------------- /cache/tests/ictest000/README: -------------------------------------------------------------------------------- 1 | use icache_tb.vhd of seirepo same directory of logic file 2 | -------------------------------------------------------------------------------- /cache/tests/ictest000/cmd_go_IC: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | /bin/rm test.acc > & /dev/null 4 | 5 | make -f tests/ictest000/Makefile_for_ic icache_tb.ghw 6 | 7 | echo 'verifying' 8 | wc -l test.acc | tr '\012' ' ' 9 | echo 'access' 10 | 11 | cat test.acc | \ 12 | cut -c4-7 > tmp.1 13 | cat test.acc | \ 14 | cut -c9-12 > tmp.2 15 | 16 | if (-z tmp.1) then 17 | echo 'veryfy ng (test.acc empty)' 18 | else 19 | diff tmp.1 tmp.2 > tmp.3 20 | if (-z tmp.3) then 21 | echo 'verify ok' 22 | else 23 | echo 'veryfy ng' 24 | endif 25 | endif 26 | 27 | -------------------------------------------------------------------------------- /cache/tests/ictest02h/Makefile_for_ic: -------------------------------------------------------------------------------- 1 | TOOLS_DIR := ../../tools 2 | include $(TOOLS_DIR)/mk_utils.mk 3 | 4 | VHDS := 5 | VHDS += ../cpu/cpu2j0_pkg.vhd 6 | VHDS += ../../targets/data_bus_pkg.vhd 7 | 8 | VHDS += icache_tb.vhd 9 | # VHDS += cache_pkg_tb.vhd 10 | 11 | VHDS += $(call include_vhdl,../../lib/memory_tech_lib) 12 | VHDS += $(call include_vhdl,../../lib/memory_tech_lib/tech/sim) 13 | 14 | VHDLS := VHDS 15 | include build.mk 16 | 17 | VHDL_TESTS := 18 | 19 | VHDL_TOPS := icache_tb 20 | VHDL_TOPS += $(VHDL_TESTS) 21 | 22 | all: $(VHDL_TOPS) 23 | 24 | work-obj93.cf: $(VHDS) 25 | 26 | icache_tb.ghw: $(VHDL_TOPS) 27 | ./icache_tb --wave=$@ --stop-time=8000ns 28 | 29 | %.vhm: %.vhmh 30 | LD_LIBRARY_PATH='' gcc -x c-header -E -P -w -nostdinc -I. $< -o $@ 31 | 32 | include $(TOOLS_DIR)/ghdl.mk 33 | 34 | clean: 35 | rm -f *.cf *.o $(VHDL_TOPS) *_tap *.ghw 36 | 37 | .PHONY: all clean 38 | -------------------------------------------------------------------------------- /cache/tests/ictest02h/README: -------------------------------------------------------------------------------- 1 | how to run icache sim 2 | 3 | make -f tests/ictest02h/Makefile icache_tb.ghw 4 | 5 | display example 6 | --------------------------------------------------- 7 | verifying 8 | 210 test.acc access 9 | verify ok 10 | 6.114u 0.227s 0:06.36 99.5% 0+0k 0+2io 0pf+0w 11 | --------------------------------------------------- 12 | -------------------------------------------------------------------------------- /cache/tests/ictest02h/cmd_go: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | 3 | /bin/rm test.acc > & /dev/null 4 | 5 | make -f tests/ictest02h/Makefile_for_ic icache_tb.ghw 6 | 7 | echo 'verifying' 8 | wc -l test.acc | tr '\012' ' ' 9 | echo 'access' 10 | 11 | cat test.acc | \ 12 | cut -c4-7 > tmp.1 13 | cat test.acc | \ 14 | cut -c9-12 > tmp.2 15 | 16 | if (-z tmp.1) then 17 | echo 'veryfy ng (test.acc empty)' 18 | else 19 | diff tmp.1 tmp.2 > tmp.3 20 | if (-z tmp.3) then 21 | echo 'verify ok' 22 | else 23 | echo 'veryfy ng' 24 | endif 25 | endif 26 | 27 | -------------------------------------------------------------------------------- /cache/tests/ictest02h/spec.txt: -------------------------------------------------------------------------------- 1 | hit test 2 | miss test 3 | miss - miss test 4 | line fill data hit test 5 | -------------------------------------------------------------------------------- /core/cpu_asic.vhd: -------------------------------------------------------------------------------- 1 | configuration cpu_asic of cpu is 2 | for stru 3 | for u_decode : decode 4 | use configuration work.cpu_decode_direct; 5 | end for; 6 | for u_datapath : datapath 7 | use entity work.datapath(stru); 8 | for stru 9 | for u_regfile : register_file 10 | use entity work.register_file(flops); 11 | end for; 12 | end for; 13 | end for; 14 | end for; 15 | end configuration; 16 | -------------------------------------------------------------------------------- /decode/decode_table_direct_config.vhd: -------------------------------------------------------------------------------- 1 | configuration cpu_decode_direct of decode is 2 | for arch 3 | for core : decode_core 4 | use entity work.decode_core(arch) 5 | generic map ( 6 | decode_type => DIRECT, 7 | reset_vector => DEC_CORE_RESET); 8 | end for; 9 | for table : decode_table 10 | use entity work.decode_table(direct_logic); 11 | end for; 12 | end for; 13 | end configuration; 14 | -------------------------------------------------------------------------------- /decode/decode_table_rom_config.vhd: -------------------------------------------------------------------------------- 1 | configuration cpu_decode_rom of decode is 2 | for arch 3 | for core : decode_core 4 | use entity work.decode_core(arch) 5 | generic map ( 6 | decode_type => ROM, 7 | reset_vector => DEC_CORE_ROM_RESET); 8 | end for; 9 | for table : decode_table 10 | use entity work.decode_table(rom); 11 | end for; 12 | end for; 13 | end configuration; 14 | -------------------------------------------------------------------------------- /decode/decode_table_simple_config.vhd: -------------------------------------------------------------------------------- 1 | configuration cpu_decode_simple of decode is 2 | for arch 3 | for core : decode_core 4 | use entity work.decode_core(arch) 5 | generic map ( 6 | decode_type => SIMPLE, 7 | reset_vector => DEC_CORE_RESET); 8 | end for; 9 | for table : decode_table 10 | use entity work.decode_table(simple_logic); 11 | end for; 12 | end for; 13 | end configuration; 14 | -------------------------------------------------------------------------------- /decode/gen/SH-2 Instruction Set.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/decode/gen/SH-2 Instruction Set.ods -------------------------------------------------------------------------------- /decode/gen/project.clj: -------------------------------------------------------------------------------- 1 | (defproject cpugen "0.1.0-SNAPSHOT" 2 | :description "Code generator for producing parts of the CPU" 3 | :license {} 4 | :dependencies [[org.clojure/clojure "1.5.1"] 5 | [org.clojure/data.csv "0.1.2"] 6 | [org.clojure/core.match "0.2.0-alpha12"] 7 | [org.clojure/math.combinatorics "0.0.4"] 8 | [org.clojure/tools.cli "0.2.2"] 9 | [org.apache.odftoolkit/simple-odf "0.7-incubating"] 10 | [watchtower "0.1.1"]] 11 | :java-source-paths ["vmagic/src/main/java" 12 | "logic"] 13 | :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"] 14 | :main cpugen.main) 15 | -------------------------------------------------------------------------------- /sim/Makefile_cpu_sim_pkg: -------------------------------------------------------------------------------- 1 | VHDS := $(wildcard vhd/*) 2 | 3 | VHDL_TOPS := cpu_pure_tb 4 | VHDL_LIBS := work 5 | 6 | all: $(VHDL_TOPS) 7 | 8 | cpu.ghw: cpu_pure_tb 9 | ./cpu_pure_tb --stop-time=213604ns --wave=cpu.ghw 10 | 11 | work-obj93.cf: $(VHDS) 12 | 13 | include tools/ghdl.mk 14 | 15 | clean: 16 | -rm -f *.o 17 | -rm -f $(VHDL_TOPS) 18 | 19 | .PHONY: all clean 20 | -------------------------------------------------------------------------------- /sim/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains the C-VHDL connector. 2 | 3 | 4 | To simulate the cpu running the test rom run 5 | 6 | $ make 7 | $ ./cpu_ctb --stop-time=180us 8 | 9 | If you want to save the save file, add the option --wave=wave.ghw 10 | 11 | 12 | The cpu_ctb can adjust the read and write ACK delay for specific 13 | memory addresses. See delays.cfg for an example delay config file with 14 | explanation. 15 | 16 | Run cpu_ctb with the -d option to use a delay config file 17 | 18 | $ ./cpu_ctb -d delays.cfg --stop-time=180us 19 | -------------------------------------------------------------------------------- /sim/pinst.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "sh2instr.h" 5 | 6 | /* 7 | The binary built from this file can be a gtkwave Translate Filter 8 | Process to translate opcodes to instruction names. Right-click on 9 | the opcode line in gtkwave, go to Data Format > Translate Filter 10 | Process. Be sure to also set data format to decimal and not hex 11 | because this uses atoi to parse. 12 | */ 13 | 14 | char buf[256]; 15 | 16 | int 17 | main(int argc, char *argv[]) 18 | { 19 | unsigned short i; 20 | 21 | while(fgets(buf, sizeof(buf), stdin)) { 22 | i = atoi(buf); 23 | op_name(buf, sizeof(buf), i); 24 | printf("%s\n", buf); 25 | fflush(stdout); 26 | } 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /sim/ram.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/j-core/jcore-cpu/4afb52450226becd4d68afbfa091f1a547555a3e/sim/ram.img -------------------------------------------------------------------------------- /sim/sh2instr.h: -------------------------------------------------------------------------------- 1 | #ifndef SH2_INSTR 2 | #define SH2_INSTR 3 | 4 | #include 5 | #include 6 | 7 | void print_instr(uint16_t instr); 8 | int op_name(char *str, size_t size, uint16_t instr); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sim/sim/bitvec.h: -------------------------------------------------------------------------------- 1 | #ifndef BITVEC_H 2 | #define BITVEC_H 3 | 4 | #include 5 | 6 | /* BITVEC_MAX_BITS controls the maximum number of bits in a bit 7 | vector. */ 8 | #ifndef BITVEC_SIZE 9 | #define BITVEC_SIZE 4 10 | #endif 11 | 12 | struct bv { 13 | unsigned int n; 14 | int max_i; 15 | uint32_t vals[BITVEC_SIZE]; 16 | }; 17 | 18 | int bv_init(struct bv *bv, unsigned int n); 19 | 20 | void bv_set(struct bv *bv, unsigned int i, int v); 21 | int bv_get(struct bv *bv, unsigned int i); 22 | void bv_clear(struct bv *bv); 23 | 24 | int bv_and_reduce(struct bv *a, struct bv *b); 25 | void bv_print(struct bv *bv); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /sim/sim/uartlite.h: -------------------------------------------------------------------------------- 1 | #ifndef UARTLITE_H 2 | #define UARTLITE_H 3 | 4 | #include "mem_bus.h" 5 | 6 | #define LINE_BUF_SIZE 1024 7 | 8 | struct uartlite { 9 | struct simulator *sim; 10 | struct mem_bus *bus; 11 | struct mem_range range; 12 | 13 | int line_len; 14 | uint8_t line_buf[LINE_BUF_SIZE + 1]; 15 | 16 | int prefix_len; 17 | char *prefix; 18 | int read_fd; 19 | int write_fd; 20 | 21 | int debug; 22 | }; 23 | 24 | int uartlite_init(struct uartlite *uart, struct mem_bus *bus, uint32_t base_addr, 25 | int read_fd, int write_fd, char *prefix, int debug); 26 | int uartlite_pty_init(struct uartlite *uart, struct mem_bus *bus, uint32_t base_addr, 27 | char *name_buf, size_t buflen, int debug); 28 | int uartlite_free(struct uartlite *uart); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /sim/tests/Makefile: -------------------------------------------------------------------------------- 1 | CC = sh2-elf-gcc 2 | LD = sh2-elf-ld 3 | AR = sh2-elf-ar 4 | OBJCOPY = sh2-elf-objcopy 5 | RANLIB = sh2-elf-ranlib 6 | LIBGCC = `sh2-elf-gcc -print-file-name=libgcc.a` 7 | CFLAGS = -m2 -g -Os -Wall -Iinclude 8 | LDFLAGS = -T sh32.x -Map main.map 9 | 10 | all: interrupts.img rte.img 11 | 12 | interrupts.elf: interrupts.o 13 | rte.elf: rte.o 14 | 15 | %.o: %.S 16 | $(CC) $(CFLAGS) -c $< -o $@ 17 | 18 | %.elf: 19 | $(LD) $(LDFLAGS) $^ $(LIBGCC) -o $@ 20 | 21 | %.img: %.elf 22 | $(OBJCOPY) -v -S -O binary --srec-forceS3 $< $@ 23 | 24 | clean: 25 | rm -f *.o *.elf *.img *.map 26 | 27 | .PHONY: clean 28 | -------------------------------------------------------------------------------- /sim/tests/sim_instr.h: -------------------------------------------------------------------------------- 1 | #ifndef SIM_INSTR_H 2 | #define SIM_INSTR_H 3 | 4 | #define SIM_INSTR_MAGIC 0x3321AACC 5 | 6 | #define CMD_BAD_INSTR 1 7 | #define CMD_ENABLE_EVENT_TRIGGER 2 8 | #define CMD_ENABLE_TEST_RESULT 3 9 | #define CMD_ENABLE_DUMP_STACK 4 10 | 11 | #define EVENT_TRIGGER_ADDRESS 0xBCDE0000 12 | #define TEST_RESULT_ADDRESS 0xBCDE0010 13 | #define DUMP_STACK_ADDRESS 0xBCDE0020 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /testrom/syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __GDBSTUB_UNISTD_H__ 2 | #define __GDBSTUB_UNISTD_H__ 3 | 4 | #define __NR_open 1 5 | #define __NR_close 2 6 | #define __NR_read 3 7 | #define __NR_write 4 8 | #define __NR_lseek 5 9 | 10 | #define __NR_syscalls 5 11 | 12 | #endif /* __GDBSTUB_UNISTD_H__ */ 13 | -------------------------------------------------------------------------------- /tests/TESTS: -------------------------------------------------------------------------------- 1 | register_tap 2 | mult_tap 3 | divider_tap 4 | bshift_tap 5 | arith_tap 6 | logic_tap 7 | manip_tap 8 | --------------------------------------------------------------------------------