commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4369 - gnuradio/branches/developers/michaelld/t29/gr-


From: michaelld
Subject: [Commit-gnuradio] r4369 - gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib
Date: Sun, 4 Feb 2007 12:59:02 -0700 (MST)

Author: michaelld
Date: 2007-02-04 12:59:02 -0700 (Sun, 04 Feb 2007)
New Revision: 4369

Added:
   
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_trellis.py
Removed:
   
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_common.py
Modified:
   gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/Makefile.am
   gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_all.py
Log:
Hopeful fix for ticket:29 .



Modified: 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/Makefile.am   
2007-02-04 19:07:10 UTC (rev 4368)
+++ gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/Makefile.am   
2007-02-04 19:59:02 UTC (rev 4369)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005,2006 Free Software Foundation, Inc.
+# Copyright 2004,2005,2006,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,8 +21,6 @@
 
 include $(top_srcdir)/Makefile.common
 
-include Makefile.gen
-
 # Install this stuff so that it ends up as the gnuradio.trellis module
 # This usually ends up at:
 #   ${prefix}/lib/python${python_version}/site-packages/gnuradio
@@ -34,25 +32,55 @@
 
 SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(STD_DEFINES_AND_INCLUDES)
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
+# ----------------------------------------------------------------
+# these scripts generate trellis codes from template files
 
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)                   
+CODE_GENERATOR =                               \
+       generate_all.py                         \
+       generate_trellis.py                     \
+       trellis_encoder_XX.cc.t                 \
+       trellis_encoder_XX.h.t                  \
+       trellis_encoder_XX.i.t                  \
+       trellis_metrics_X.cc.t                  \
+       trellis_metrics_X.h.t                   \
+       trellis_metrics_X.i.t                   \
+       trellis_viterbi_combined_X.cc.t         \
+       trellis_viterbi_combined_X.h.t          \
+       trellis_viterbi_combined_X.i.t          \
+       trellis_viterbi_X.cc.t                  \
+       trellis_viterbi_X.h.t                   \
+       trellis_viterbi_X.i.t
 
+include Makefile.gen
 
-LOCAL_IFILES =                                 \
+$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): $(CODE_GENERATOR)
+       PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) \
+               $(PYTHON) $(srcdir)/generate_all.py
+
+BUILT_SOURCES = \
+       $(GENERATED_H)          \
+       $(GENERATED_I)          \
+       $(GENERATED_CC)         \
+       trellis.cc              \
+       trellis.py              
+
+ALL_IFILES =                   \
+       $(LOCAL_IFILES)         \
+       $(NON_LOCAL_IFILES)     
+
+NON_LOCAL_IFILES =             \
+       $(GNURADIO_I)   
+
+LOCAL_IFILES =                         \
        $(top_srcdir)/gr-trellis/src/lib/trellis.i                      
 
-
 # These files are built by SWIG.  The first is the C++ glue.
 # The second is the python wrapper that loads the _trellis shared library
 # and knows how to call our extensions.
 
-BUILT_SOURCES =                        \
-       trellis.cc                      \
-       trellis.py                              
+#BUILT_SOURCES =                       \
+#      trellis.cc                      \
+#      trellis.py                              
 
 # This gets trellis.py installed in the right place
 ourpython_PYTHON =                     \
@@ -81,7 +109,7 @@
 _trellis_la_LIBADD =                   \
        $(PYTHON_LDFLAGS)               \
        $(GNURADIO_CORE_LIBS)           \
-       -lstdc++                        
+       -lstdc++
 
 trellis.cc trellis.py: $(ALL_IFILES) $(grinclude_HEADERS)
        $(SWIG) $(SWIGPYTHONARGS) -module trellis -o trellis.cc $(LOCAL_IFILES)
@@ -97,10 +125,9 @@
         trellis_permutation.h          \
         trellis_siso_type.h            \
        trellis_siso_f.h                \
-       trellis_siso_combined_f.h               \
-       $(GENERATED_H)                  
+       trellis_siso_combined_f.h       \
+       $(GENERATED_H)
 
-
 # These swig headers get installed in ${prefix}/include/gnuradio/swig
 swiginclude_HEADERS =                  \
        $(LOCAL_IFILES)                 \
@@ -112,10 +139,8 @@
        trellis_siso_combined_f.i       \
        trellis_generated.i
 
+CLEANFILES = $(BUILT_SOURCES) *.pyc
 
-
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
-
 # Don't distribute output of swig
 dist-hook:
        @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done

Modified: 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_all.py
===================================================================
--- 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_all.py   
    2007-02-04 19:07:10 UTC (rev 4368)
+++ 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_all.py   
    2007-02-04 19:59:02 UTC (rev 4369)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2006,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,12 +22,11 @@
 
 from build_utils import output_glue
 
-import generate_common
+import generate_trellis
 
 def generate_all ():
-    generate_common.generate ()
+    generate_trellis.generate ()
     output_glue ('trellis')
 
-
 if __name__ == '__main__':
     generate_all ()

Deleted: 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_common.py

Added: 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_trellis.py
===================================================================
--- 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_trellis.py
                           (rev 0)
+++ 
gnuradio/branches/developers/michaelld/t29/gr-trellis/src/lib/generate_trellis.py
   2007-02-04 19:59:02 UTC (rev 4369)
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+#
+# Copyright 2006,2007 Free Software Foundation, Inc.
+# 
+# This file is part of GNU Radio
+# 
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+# 
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+# 
+
+from build_utils import expand_template, standard_dict
+from build_utils_codes import *
+import re
+
+# regular blocks
+
+other_roots = [
+    'trellis_encoder_XX',
+    'trellis_metrics_X',
+    'trellis_viterbi_X',
+    'trellis_viterbi_combined_X',
+    ]
+
+other_signatures = (
+    ['bb','bs','bi','ss','si','ii'],
+    ['s','i','f','c'],
+    ['b','s','i'],
+    ['b','s','i'],
+    )
+
+
+def expand_h_cc_i (root, sig):
+    # root looks like 'gr_vector_sink_X'
+    name = re.sub ('X+', sig, root)
+    d = standard_dict (name, sig)
+    expand_template (d, root + '.h.t')
+    expand_template (d, root + '.cc.t')
+    expand_template (d, root + '.i.t')
+
+
+def generate ():
+    i=0
+    for r in other_roots :
+        for s in other_signatures[i]:
+            expand_h_cc_i (r, s)
+        i=i+1
+
+
+if __name__ == '__main__':
+    generate ()





reply via email to

[Prev in Thread] Current Thread [Next in Thread]