Compare commits
5 commits
master
...
feature/cy
Author | SHA1 | Date | |
---|---|---|---|
|
f55c4c35c3 | ||
|
6aa55f8195 | ||
|
7fde9c81b5 | ||
|
c8fcb2fe88 | ||
|
a0b836e61c |
3 changed files with 28 additions and 14 deletions
21
Makefile
21
Makefile
|
@ -29,7 +29,7 @@
|
||||||
LIBSOURCES = fft_fftw.c libcsdr_wrapper.c
|
LIBSOURCES = fft_fftw.c libcsdr_wrapper.c
|
||||||
#SOURCES = csdr.c $(LIBSOURCES)
|
#SOURCES = csdr.c $(LIBSOURCES)
|
||||||
cpufeature = $(if $(findstring $(1),$(shell cat /proc/cpuinfo)),$(2))
|
cpufeature = $(if $(findstring $(1),$(shell cat /proc/cpuinfo)),$(2))
|
||||||
PARAMS_SSE = $(call cpufeature,sse,-msse) $(call cpufeature,sse2,-msse2) $(call cpufeature,sse3,-msse3) $(call cpufeature,sse4a,-msse4a) $(call cpufeature,sse4_1,-msse4.1) $(call cpufeature,sse4_2,-msse4.2 -msse4) -mfpmath=sse
|
PARAMS_SSE = $(call cpufeature,sse,-msse) $(call cpufeature,sse2,-msse2) $(call cpufeature,sse3,-msse3) $(call cpufeature,sse4,-msse4) $(call cpufeature,sse4_1,-msse4.1) $(call cpufeature,sse4_2,-msse4.2) -mfpmath=sse
|
||||||
PARAMS_NEON = -mfloat-abi=hard -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad -funsafe-math-optimizations -Wformat=0 -DNEON_OPTS
|
PARAMS_NEON = -mfloat-abi=hard -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad -funsafe-math-optimizations -Wformat=0 -DNEON_OPTS
|
||||||
#tnx Jan Szumiec for the Raspberry Pi support
|
#tnx Jan Szumiec for the Raspberry Pi support
|
||||||
PARAMS_RASPI = -mfloat-abi=hard -mcpu=arm1176jzf-s -mfpu=vfp -funsafe-math-optimizations -Wformat=0
|
PARAMS_RASPI = -mfloat-abi=hard -mcpu=arm1176jzf-s -mfpu=vfp -funsafe-math-optimizations -Wformat=0
|
||||||
|
@ -42,6 +42,8 @@ PARAMS_MISC = -Wno-unused-result
|
||||||
#DEBUG_ON = 0 #debug is always on by now (anyway it could be compiled with `make DEBUG_ON=1`)
|
#DEBUG_ON = 0 #debug is always on by now (anyway it could be compiled with `make DEBUG_ON=1`)
|
||||||
#PARAMS_DEBUG = $(if $(DEBUG_ON),-g,)
|
#PARAMS_DEBUG = $(if $(DEBUG_ON),-g,)
|
||||||
FFTW_PACKAGE = fftw-3.3.3
|
FFTW_PACKAGE = fftw-3.3.3
|
||||||
|
SO_EXT = $(if $(findstring CYGWIN,$(shell uname -a)),dll,so)
|
||||||
|
SO_PATH = $(if $(findstring CYGWIN,$(shell uname -a)),/bin,/usr/lib)
|
||||||
|
|
||||||
.PHONY: clean-vect clean
|
.PHONY: clean-vect clean
|
||||||
all: csdr nmux
|
all: csdr nmux
|
||||||
|
@ -50,7 +52,7 @@ libcsdr.so: fft_fftw.c fft_rpi.c libcsdr_wrapper.c libcsdr.c libcsdr_gpl.c fastd
|
||||||
@echo Auto-detected optimization parameters: $(PARAMS_SIMD)
|
@echo Auto-detected optimization parameters: $(PARAMS_SIMD)
|
||||||
@echo
|
@echo
|
||||||
rm -f dumpvect*.vect
|
rm -f dumpvect*.vect
|
||||||
gcc -std=gnu99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) $(LIBSOURCES) $(PARAMS_LIBS) $(PARAMS_MISC) -fpic -shared -o libcsdr.so
|
gcc -std=gnu99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) $(LIBSOURCES) $(PARAMS_LIBS) $(PARAMS_MISC) -fpic -shared -o libcsdr.$(SO_EXT)
|
||||||
-./parsevect dumpvect*.vect
|
-./parsevect dumpvect*.vect
|
||||||
csdr: csdr.c libcsdr.so
|
csdr: csdr.c libcsdr.so
|
||||||
gcc -std=gnu99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) csdr.c $(PARAMS_LIBS) -L. -lcsdr $(PARAMS_MISC) -o csdr
|
gcc -std=gnu99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) csdr.c $(PARAMS_LIBS) -L. -lcsdr $(PARAMS_MISC) -o csdr
|
||||||
|
@ -64,19 +66,18 @@ arm-cross: clean-vect
|
||||||
clean-vect:
|
clean-vect:
|
||||||
rm -f dumpvect*.vect
|
rm -f dumpvect*.vect
|
||||||
clean: clean-vect
|
clean: clean-vect
|
||||||
rm -f libcsdr.so csdr ddcd nmux
|
rm -f libcsdr.$(SO_EXT) csdr nmux
|
||||||
install: all
|
install:
|
||||||
install -m 0755 libcsdr.so /usr/lib
|
install -m 0755 libcsdr.$(SO_EXT) $(SO_PATH)
|
||||||
install -m 0755 csdr /usr/bin
|
install -m 0755 csdr /usr/bin
|
||||||
install -m 0755 csdr-fm /usr/bin
|
install -m 0755 csdr-fm /usr/bin
|
||||||
install -m 0755 nmux /usr/bin
|
install -m 0755 nmux /usr/bin
|
||||||
#-install -m 0755 ddcd /usr/bin
|
-ldconfig
|
||||||
ldconfig
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm /usr/lib/libcsdr.so /usr/bin/csdr /usr/bin/csdr-fm
|
rm $(SO_PATH)/libcsdr.$(SO_EXT) /usr/bin/csdr /usr/bin/csdr-fm
|
||||||
ldconfig
|
-ldconfig
|
||||||
disasm:
|
disasm:
|
||||||
objdump -S libcsdr.so > libcsdr.disasm
|
objdump -S libcsdr.$(SO_EXT) > libcsdr.disasm
|
||||||
emcc-clean:
|
emcc-clean:
|
||||||
-rm sdr.js/sdr.js
|
-rm sdr.js/sdr.js
|
||||||
-rm sdr.js/sdrjs-compiled.js
|
-rm sdr.js/sdrjs-compiled.js
|
||||||
|
|
8
csdr.c
8
csdr.c
|
@ -340,9 +340,11 @@ int main(int argc, char *argv[])
|
||||||
if(argc<=1) return badsyntax(0);
|
if(argc<=1) return badsyntax(0);
|
||||||
if(!strcmp(argv[1],"--help")) return badsyntax(0);
|
if(!strcmp(argv[1],"--help")) return badsyntax(0);
|
||||||
|
|
||||||
|
#ifndef CSDR_NOLINUX
|
||||||
fcntl(STDIN_FILENO, F_SETPIPE_SZ, 65536*32);
|
fcntl(STDIN_FILENO, F_SETPIPE_SZ, 65536*32);
|
||||||
fcntl(STDOUT_FILENO, F_SETPIPE_SZ, 65536*32);
|
fcntl(STDOUT_FILENO, F_SETPIPE_SZ, 65536*32);
|
||||||
//fprintf(stderr, "csdr: F_SETPIPE_SZ\n");
|
//fprintf(stderr, "csdr: F_SETPIPE_SZ\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!strcmp(argv[1],"setbuf"))
|
if(!strcmp(argv[1],"setbuf"))
|
||||||
{
|
{
|
||||||
|
@ -1602,6 +1604,9 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TIME_TAKEN(start,end) ((end.tv_sec-start.tv_sec)+(end.tv_nsec-start.tv_nsec)/1e9)
|
||||||
|
|
||||||
|
#ifndef CSDR_NOLINUX
|
||||||
if(!strcmp(argv[1],"fft_benchmark"))
|
if(!strcmp(argv[1],"fft_benchmark"))
|
||||||
{
|
{
|
||||||
if(argc<=3) return badsyntax("need required parameters (fft_size, fft_cycles)");
|
if(argc<=3) return badsyntax("need required parameters (fft_size, fft_cycles)");
|
||||||
|
@ -1640,6 +1645,7 @@ int main(int argc, char *argv[])
|
||||||
fprintf(stderr,"fft_benchmark: %d transforms of %d processed in %g seconds, %g seconds each.\n",fft_cycles,fft_size,time_taken_fft,time_taken_fft/fft_cycles);
|
fprintf(stderr,"fft_benchmark: %d transforms of %d processed in %g seconds, %g seconds each.\n",fft_cycles,fft_size,time_taken_fft,time_taken_fft/fft_cycles);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!strcmp(argv[1],"bandpass_fir_fft_cc")) //this command does not exist as a separate function
|
if(!strcmp(argv[1],"bandpass_fir_fft_cc")) //this command does not exist as a separate function
|
||||||
{
|
{
|
||||||
|
@ -1877,6 +1883,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CSDR_NOLINUX
|
||||||
if(!strcmp(argv[1],"through"))
|
if(!strcmp(argv[1],"through"))
|
||||||
{
|
{
|
||||||
struct timespec start_time, end_time;
|
struct timespec start_time, end_time;
|
||||||
|
@ -1914,6 +1921,7 @@ int main(int argc, char *argv[])
|
||||||
TRY_YIELD;
|
TRY_YIELD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!strcmp(argv[1],"dsb_fc"))
|
if(!strcmp(argv[1],"dsb_fc"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#pragma once
|
#pragma once
|
||||||
#define MIN_M(x,y) (((x)>(y))?(y):(x))
|
#define MIN_M(x,y) (((x)>(y))?(y):(x))
|
||||||
|
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
#define CSDR_NOLINUX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
_____ _
|
_____ _
|
||||||
/ ____| | |
|
/ ____| | |
|
||||||
|
|
Loading…
Reference in a new issue