parsevect fixes

pull/1/head
ha7ilm 2014-11-30 10:37:16 +01:00
rodzic 4887b3ff91
commit cf98fce94b
3 zmienionych plików z 22 dodań i 13 usunięć

Wyświetl plik

@ -44,7 +44,7 @@ all: clean-vect
@echo Auto-detected optimization parameters: $(PARAMS_SIMD) @echo Auto-detected optimization parameters: $(PARAMS_SIMD)
@echo @echo
c99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) $(LIBSOURCES) $(PARAMS_LIBS) $(PARAMS_MISC) -fpic -shared -o libcsdr.so c99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) $(LIBSOURCES) $(PARAMS_LIBS) $(PARAMS_MISC) -fpic -shared -o libcsdr.so
-./parsevect dumpvect*.vect libcsdr.c -./parsevect dumpvect*.vect
c99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) csdr.c $(PARAMS_LIBS) -L. -lcsdr $(PARAMS_MISC) -o csdr c99 $(PARAMS_LOOPVECT) $(PARAMS_SIMD) csdr.c $(PARAMS_LIBS) -L. -lcsdr $(PARAMS_MISC) -o csdr
arm-cross: clean-vect arm-cross: clean-vect
#note: this doesn't work since having added FFTW #note: this doesn't work since having added FFTW
@ -52,7 +52,7 @@ arm-cross: clean-vect
clean-vect: clean-vect:
rm -f dumpvect*.vect rm -f dumpvect*.vect
clean: clean-vect clean: clean-vect
rm libcsdr.so csdr rm -f libcsdr.so csdr
install: install:
install -m 0755 libcsdr.so /usr/lib install -m 0755 libcsdr.so /usr/lib
install -m 0755 csdr /usr/bin install -m 0755 csdr /usr/bin

Wyświetl plik

@ -324,7 +324,7 @@ E.g. you can send `-0.05 0.02\n`
#### Testbench #### Testbench
`csdr` was tested with GNU Radio Companion flowgraphs. These flowgraphs are available under the directory `grc_tests`, and they require the `gr-ha5kfu` set of blocks for GNU Radio. `csdr` was tested with GNU Radio Companion flowgraphs. These flowgraphs are available under the directory `grc_tests`, and they require the <a href="https://github.com/simonyiszk/gr-ha5kfu">gr-ha5kfu</a> set of blocks for GNU Radio.
## [Licensing] (#licensing) ## [Licensing] (#licensing)

Wyświetl plik

@ -1,4 +1,5 @@
#!/usr/bin/python #!/usr/bin/python2
print "" # python2.7 is required to run parsevect instead of python3
""" """
This software is part of libcsdr, a set of simple DSP routines for This software is part of libcsdr, a set of simple DSP routines for
Software Defined Radio. Software Defined Radio.
@ -30,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
""" """
import sys import sys
import os
try: try:
vectfile=open(sys.argv[1],"r").readlines() vectfile=open(sys.argv[1],"r").readlines()
@ -58,17 +60,24 @@ Colors:
\033[1;0m""" \033[1;0m"""
checkline = lambda k: cfile[linenum-k] if "//@" in cfile[linenum-k] else corresponds checkline = lambda k: cfile[linenum-k] if "//@" in cfile[linenum-k] else corresponds
fallback=False
for row in vectfile: for row in vectfile:
if "LOOP VECTORIZED" in row or "not vectorized" in row: if "LOOP VECTORIZED" in row or "not vectorized" in row:
filename=row.split(":")[0] filename=row.split(":")[0]
loadcfile(filename) if not fallback and not os.path.isfile(filename):
linenum=int(row.split(":")[1]) print "parsevect: Log format mismatch (perhaps gcc version is older than 4.8.2). Comments and colors will not be matched to rows."
corresponds="//@" fallback = True
corresponds=checkline(1) if fallback:
corresponds=checkline(2) print row[:-1]
corresponds=corresponds.split("//@")[1][:-1] else:
yellow=corresponds.startswith("@") loadcfile(filename)
if yellow: corresponds=corresponds[1:] linenum=int(row.split(":")[1])
print row[:-1], "\033[1;33m" if yellow else "\033[1;31m" if "not " in row else "\033[1;32m", corresponds, "\033[1;0m" corresponds="//@"
corresponds=checkline(1)
corresponds=checkline(2)
corresponds=corresponds.split("//@")[1][:-1]
yellow=corresponds.startswith("@")
if yellow: corresponds=corresponds[1:]
print row[:-1], "\033[1;33m" if yellow else "\033[1;31m" if "not " in row else "\033[1;32m", corresponds, "\033[1;0m"