From 95e91b44d2ef3535129c0a402c51bc56cfd74d06 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 15 Apr 2012 17:32:38 -0700 Subject: volk: created other templates for runtime + machines --- volk/tmpl/volk_machine_xxx.tmpl.c | 88 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 volk/tmpl/volk_machine_xxx.tmpl.c (limited to 'volk/tmpl/volk_machine_xxx.tmpl.c') diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c new file mode 100644 index 000000000..57e652e4c --- /dev/null +++ b/volk/tmpl/volk_machine_xxx.tmpl.c @@ -0,0 +1,88 @@ +/* + * Copyright 2011-2012 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 3, 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. + */ + +#set $this_machine = $machine_dict[$which] + +#for $arch in $this_machine.archs +#define LV_HAVE_$(arch.name.upper()) 1 +#end for + +#include +#include "volk_machines.h" +#include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#for $kern in $kernels +#include +#end for + +######################################################################## +#def make_arch_have_list($archs) +$(' | '.join(['(1 << LV_%s)'%a.name.upper() for a in $archs]))#slurp +#end def + +######################################################################## +#def make_tag_str_list($tags) +{$(', '.join(['"%s"'%a for a in $tags]))}#slurp +#end def + +######################################################################## +#def make_tag_have_list($deps) +{$(', '.join([' | '.join(['(1 << LV_%s)'%a.upper() for a in d]) for d in $deps]))}#slurp +#end def + +######################################################################## +#def make_tag_kern_list($name, $tags) +{$(', '.join(['%s_%s'%($name, a) for a in $tags]))}#slurp +#end def + +#ifdef LV_HAVE_ORC +struct volk_machine volk_machine_generic = { + $make_arch_have_list($this_machine.archs) | (1 << LV_ORC), + "$this_machine.name", + $this_machine.alignment, + #for $kern in $kernels + "$kern.name", + $make_tag_str_list($kern.taglist), + $make_tag_have_list($kern.tagdeps), + $make_tag_kern_list($kern.name, $kern.taglist), + $(len($kern.taglist)), + #end for +}; + +#else +struct volk_machine volk_machine_generic = { + $make_arch_have_list($this_machine.archs), + "$this_machine.name", + $this_machine.alignment, + #for $kern in $kernels + "$kern.name", + $make_tag_str_list($kern.taglist), + $make_tag_have_list($kern.tagdeps), + $make_tag_kern_list($kern.name, $kern.taglist), + $(len($kern.taglist)), + #end for +}; + +#endif -- cgit From 37f9a62fd45ece1e6a92769fbb1798403c86ba9b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 15 Apr 2012 19:11:52 -0700 Subject: volk: working build w/ cmakelists --- volk/tmpl/volk_machine_xxx.tmpl.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'volk/tmpl/volk_machine_xxx.tmpl.c') diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c index 57e652e4c..87204ee99 100644 --- a/volk/tmpl/volk_machine_xxx.tmpl.c +++ b/volk/tmpl/volk_machine_xxx.tmpl.c @@ -20,6 +20,7 @@ */ #set $this_machine = $machine_dict[$which] +#set $arch_names = map(lambda a: a.name, $this_machine.archs) #for $arch in $this_machine.archs #define LV_HAVE_$(arch.name.upper()) 1 @@ -58,30 +59,32 @@ $(' | '.join(['(1 << LV_%s)'%a.name.upper() for a in $archs]))#slurp #end def #ifdef LV_HAVE_ORC -struct volk_machine volk_machine_generic = { +struct volk_machine volk_machine_$(this_machine.name) = { $make_arch_have_list($this_machine.archs) | (1 << LV_ORC), "$this_machine.name", $this_machine.alignment, #for $kern in $kernels + #set $taglist, $tagdeps = $kern.get_tags($arch_names + ["orc"]) "$kern.name", - $make_tag_str_list($kern.taglist), - $make_tag_have_list($kern.tagdeps), - $make_tag_kern_list($kern.name, $kern.taglist), - $(len($kern.taglist)), + $make_tag_str_list($taglist), + $make_tag_have_list($tagdeps), + $make_tag_kern_list($kern.name, $taglist), + $(len($taglist)), #end for }; #else -struct volk_machine volk_machine_generic = { +struct volk_machine volk_machine_$(this_machine.name) = { $make_arch_have_list($this_machine.archs), "$this_machine.name", $this_machine.alignment, #for $kern in $kernels + #set $taglist, $tagdeps = $kern.get_tags($arch_names) "$kern.name", - $make_tag_str_list($kern.taglist), - $make_tag_have_list($kern.tagdeps), - $make_tag_kern_list($kern.name, $kern.taglist), - $(len($kern.taglist)), + $make_tag_str_list($taglist), + $make_tag_have_list($tagdeps), + $make_tag_kern_list($kern.name, $taglist), + $(len($taglist)), #end for }; -- cgit From 3af0f815ae3442dacdac78acf238b277f472c404 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 16 Apr 2012 00:29:26 -0700 Subject: volk: added compile utils and cleanup cmakelists --- volk/tmpl/volk_machine_xxx.tmpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'volk/tmpl/volk_machine_xxx.tmpl.c') diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c index 87204ee99..023eea502 100644 --- a/volk/tmpl/volk_machine_xxx.tmpl.c +++ b/volk/tmpl/volk_machine_xxx.tmpl.c @@ -20,7 +20,7 @@ */ #set $this_machine = $machine_dict[$which] -#set $arch_names = map(lambda a: a.name, $this_machine.archs) +#set $arch_names = $this_machine.arch_names #for $arch in $this_machine.archs #define LV_HAVE_$(arch.name.upper()) 1 -- cgit From 25a3690954d80819fe59e179e4675c5cdf81a347 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 16 Apr 2012 00:41:16 -0700 Subject: volk: make orc a normal arch with overrule --- volk/tmpl/volk_machine_xxx.tmpl.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'volk/tmpl/volk_machine_xxx.tmpl.c') diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c index 023eea502..1f6a77501 100644 --- a/volk/tmpl/volk_machine_xxx.tmpl.c +++ b/volk/tmpl/volk_machine_xxx.tmpl.c @@ -58,22 +58,6 @@ $(' | '.join(['(1 << LV_%s)'%a.name.upper() for a in $archs]))#slurp {$(', '.join(['%s_%s'%($name, a) for a in $tags]))}#slurp #end def -#ifdef LV_HAVE_ORC -struct volk_machine volk_machine_$(this_machine.name) = { - $make_arch_have_list($this_machine.archs) | (1 << LV_ORC), - "$this_machine.name", - $this_machine.alignment, - #for $kern in $kernels - #set $taglist, $tagdeps = $kern.get_tags($arch_names + ["orc"]) - "$kern.name", - $make_tag_str_list($taglist), - $make_tag_have_list($tagdeps), - $make_tag_kern_list($kern.name, $taglist), - $(len($taglist)), - #end for -}; - -#else struct volk_machine volk_machine_$(this_machine.name) = { $make_arch_have_list($this_machine.archs), "$this_machine.name", @@ -87,5 +71,3 @@ struct volk_machine volk_machine_$(this_machine.name) = { $(len($taglist)), #end for }; - -#endif -- cgit From bb61c325dabfc80bbd8404b2892575948b77496b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 19 Apr 2012 00:50:18 -0700 Subject: volk: code simplification, overrule macro and python opts --- volk/tmpl/volk_machine_xxx.tmpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'volk/tmpl/volk_machine_xxx.tmpl.c') diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c index 1f6a77501..e405bd693 100644 --- a/volk/tmpl/volk_machine_xxx.tmpl.c +++ b/volk/tmpl/volk_machine_xxx.tmpl.c @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ -#set $this_machine = $machine_dict[$which] +#set $this_machine = $machine_dict[$args[0]] #set $arch_names = $this_machine.arch_names #for $arch in $this_machine.archs -- cgit From e826097e09fdfb04d14bf87861646b88229db881 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 13 Jan 2013 13:51:46 -0800 Subject: gras: support changeset for 3.6.4 used volk from next branch cf5c930d89ac89ba5a0da4a616c88d3c37e018ae for grextras support (it uses the dispatcher) empty stubs for the gr_basic_block msg passing. This is going to be difficult to figure out. The alias stuff may or may not be related most qa pass, there seems to be some additional issues, will be working through them on futher commits Conflicts: gnuradio-core/CMakeLists.txt gnuradio-core/src/lib/runtime/CMakeLists.txt gnuradio-core/src/lib/runtime/gr_block.cc gnuradio-core/src/lib/runtime/gr_block.h gnuradio-core/src/lib/runtime/gr_hier_block2.h gnuradio-core/src/lib/runtime/gr_top_block.h gnuradio-core/src/python/gnuradio/gr/__init__.py gr-audio/examples/c++/CMakeLists.txt gr-fcd/examples/c++/CMakeLists.txt grc/python/Port.py --- volk/tmpl/volk_machine_xxx.tmpl.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'volk/tmpl/volk_machine_xxx.tmpl.c') diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c index e405bd693..68d7f3eba 100644 --- a/volk/tmpl/volk_machine_xxx.tmpl.c +++ b/volk/tmpl/volk_machine_xxx.tmpl.c @@ -44,18 +44,23 @@ $(' | '.join(['(1 << LV_%s)'%a.name.upper() for a in $archs]))#slurp #end def ######################################################################## -#def make_tag_str_list($tags) -{$(', '.join(['"%s"'%a for a in $tags]))}#slurp +#def make_impl_name_list($impls) +{$(', '.join(['"%s"'%i.name for i in $impls]))}#slurp #end def ######################################################################## -#def make_tag_have_list($deps) -{$(', '.join([' | '.join(['(1 << LV_%s)'%a.upper() for a in d]) for d in $deps]))}#slurp +#def make_impl_align_list($impls) +{$(', '.join(['true' if i.is_aligned else 'false' for i in $impls]))}#slurp #end def ######################################################################## -#def make_tag_kern_list($name, $tags) -{$(', '.join(['%s_%s'%($name, a) for a in $tags]))}#slurp +#def make_impl_deps_list($impls) +{$(', '.join([' | '.join(['(1 << LV_%s)'%d.upper() for d in i.deps]) for i in $impls]))}#slurp +#end def + +######################################################################## +#def make_impl_fcn_list($name, $impls) +{$(', '.join(['%s_%s'%($name, i.name) for i in $impls]))}#slurp #end def struct volk_machine volk_machine_$(this_machine.name) = { @@ -63,11 +68,12 @@ struct volk_machine volk_machine_$(this_machine.name) = { "$this_machine.name", $this_machine.alignment, #for $kern in $kernels - #set $taglist, $tagdeps = $kern.get_tags($arch_names) - "$kern.name", - $make_tag_str_list($taglist), - $make_tag_have_list($tagdeps), - $make_tag_kern_list($kern.name, $taglist), - $(len($taglist)), + #set $impls = $kern.get_impls($arch_names) + "$kern.name", ##//kernel name + $make_impl_name_list($impls), ##//list of kernel implementations by name + $make_impl_deps_list($impls), ##//list of arch dependencies per implementation + $make_impl_align_list($impls), ##//alignment required? for each implementation + $make_impl_fcn_list($kern.name, $impls), ##//pointer to each implementation + $(len($impls)), ##//number of implementations listed here #end for }; -- cgit