Skip to content

Commit

Permalink
parsevect fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ha7ilm committed Nov 30, 2014
1 parent 4887b3f commit cf98fce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ all: clean-vect
@echo Auto-detected optimization parameters: $(PARAMS_SIMD)
@echo
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
arm-cross: clean-vect
#note: this doesn't work since having added FFTW
arm-linux-gnueabihf-gcc -std=c99 -O3 -fshort-double -ffast-math -dumpbase dumpvect-arm -fdump-tree-vect-details -mfloat-abi=softfp -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mvectorize-with-neon-quad -Wno-unused-result -Wformat=0 $(SOURCES) -lm -o ./csdr
clean-vect:
rm -f dumpvect*.vect
clean: clean-vect
rm libcsdr.so csdr
rm -f libcsdr.so csdr
install:
install -m 0755 libcsdr.so /usr/lib
install -m 0755 csdr /usr/bin
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ E.g. you can send `-0.05 0.02\n`

#### 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)

Expand Down
29 changes: 19 additions & 10 deletions parsevect
Original file line number Diff line number Diff line change
@@ -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
Software Defined Radio.
Expand Down Expand Up @@ -30,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

import sys
import os

try:
vectfile=open(sys.argv[1],"r").readlines()
Expand Down Expand Up @@ -58,17 +60,24 @@ Colors:
\033[1;0m"""

checkline = lambda k: cfile[linenum-k] if "//@" in cfile[linenum-k] else corresponds
fallback=False

for row in vectfile:
if "LOOP VECTORIZED" in row or "not vectorized" in row:
filename=row.split(":")[0]
loadcfile(filename)
linenum=int(row.split(":")[1])
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"
if not fallback and not os.path.isfile(filename):
print "parsevect: Log format mismatch (perhaps gcc version is older than 4.8.2). Comments and colors will not be matched to rows."
fallback = True
if fallback:
print row[:-1]
else:
loadcfile(filename)
linenum=int(row.split(":")[1])
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"

0 comments on commit cf98fce

Please sign in to comment.