diff --git a/README.md b/README.md index 59f8726873..26a7b136aa 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This section describes how to set up the compilation environment in GNU/Linux or GNU/Linux ---------- - * Tested distributions: Ubuntu 14.04 LTS and above, Debian 8.0 "jessie" and above, Linaro 15.03 + * Tested distributions: Ubuntu 14.04 LTS and [above](http://packages.ubuntu.com/search?keywords=gnss-sdr), Debian 8.0 "jessie" and [above](https://packages.debian.org/search?searchon=names&keywords=gnss-sdr), Linaro 15.03 * Known to work but not continually tested: Arch Linux, Fedora, and openSUSE * Supported microprocessor architectures: * i386: Intel x86 instruction set (32-bit microprocessors). @@ -46,7 +46,8 @@ $ sudo apt-get install build-essential cmake git libboost-dev libboost-date-time libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev \ libboost-serialization-dev libboost-program-options-dev libboost-test-dev \ liblog4cpp5-dev libuhd-dev gnuradio-dev gr-osmosdr libblas-dev liblapack-dev \ - libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libgtest-dev + libarmadillo-dev libgflags-dev libgoogle-glog-dev libgnutls-openssl-dev libgtest-dev \ + python-mako python-six ~~~~~~ Alternatively, and starting from Ubuntu 16.04 LTS, you can install all the required dependencies by adding the line diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf index 88a66f3eed..a5cfb31c57 100644 --- a/conf/gnss-sdr.conf +++ b/conf/gnss-sdr.conf @@ -29,7 +29,7 @@ GNSS-SDR.SUPL_CI=0x31b0 SignalSource.implementation=File_Signal_Source ;#filename: path to file with the captured GNSS signal samples to be processed -SignalSource.filename=/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE +SignalSource.filename=/Users/carlesfernandez/Documents/workspace/code2/trunk/data/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ;/datalogger/signals/CTTC/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN/2013_04_04_GNSS_SIGNAL_at_CTTC_SPAIN.dat ; <- PUT YOUR FILE HERE ;#item_type: Type and resolution for each of the signal samples. SignalSource.item_type=ishort diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 1c455b99e5..1f69938eb5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -75,16 +75,17 @@ SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" # Python include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B VOLK_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND) -VOLK_PYTHON_CHECK_MODULE("Cheetah >= 2.0.0" Cheetah "Cheetah.Version >= '2.0.0'" CHEETAH_FOUND) +VOLK_PYTHON_CHECK_MODULE("mako >= 0.9.1" mako "mako.__version__ >= '0.9.1'" MAKO_FOUND) VOLK_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) + if(NOT PYTHON_MIN_VER_FOUND) message(FATAL_ERROR "Python 2.7 or greater required to build VOLK_GNSSSDR") endif() -# Cheetah -if(NOT CHEETAH_FOUND) - message(FATAL_ERROR "Cheetah templates required to build VOLK_GNSSSDR") +# Mako +if(NOT MAKO_FOUND) + message(FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR") endif() # Six if(NOT SIX_FOUND) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md index 5471f26a8e..f555314bed 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/README.md @@ -17,7 +17,7 @@ However, you can install and use VOLK_GNSSSDR kernels as you use VOLK's, indepen First, make sure that the required dependencies are installed in you machine: ~~~~~~ -$ sudo apt-get install git subversion cmake python-cheetah libboost-dev libbbost-filesystem +$ sudo apt-get install git subversion cmake python-mako python-six libboost-dev libbbost-filesystem ~~~~~~ In order to build and install the library, go to the base folder of the source code and do: diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_tmpl_utils.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_tmpl_utils.py index af3147ee37..2002839470 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_tmpl_utils.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_tmpl_utils.py @@ -27,22 +27,7 @@ import volk_gnsssdr_arch_defs import volk_gnsssdr_machine_defs import volk_gnsssdr_kernel_defs -from Cheetah import Template - -def __escape_pre_processor(code): - out = list() - for line in code.splitlines(): - m = re.match('^(\s*)#(\s*)(\w+)(.*)$', line) - if m: - p0, p1, fcn, stuff = m.groups() - conly = fcn in ('include', 'define', 'ifdef', 'ifndef', 'endif', 'elif', 'pragma') - both = fcn in ('if', 'else') - istmpl = '$' in stuff - if 'defined' in stuff: istmpl = False - if conly or (both and not istmpl): - line = '%s\\#%s%s%s'%(p0, p1, fcn, stuff) - out.append(line) - return '\n'.join(out) +from mako.template import Template def __parse_tmpl(_tmpl, **kwargs): defs = { @@ -53,13 +38,12 @@ def __parse_tmpl(_tmpl, **kwargs): 'kernels': volk_gnsssdr_kernel_defs.kernels, } defs.update(kwargs) - _tmpl = __escape_pre_processor(_tmpl) _tmpl = """ - /* this file was generated by volk_gnsssdr template utils, do not edit! */ +/* this file was generated by volk_gnsssdr template utils, do not edit! */ - """ + _tmpl - return str(Template.Template(_tmpl, defs)) +""" + _tmpl + return str(Template(_tmpl).render(**defs)) def main(): parser = optparse.OptionParser() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c index c595e356d8..95f5f057c5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.c @@ -110,93 +110,91 @@ bool volk_gnsssdr_is_aligned(const void *ptr) #define LV_HAVE_GENERIC #define LV_HAVE_DISPATCHER -#for $kern in $kernels +%for kern in kernels: -#if $kern.has_dispatcher -#include //pulls in the dispatcher -#end if +%if kern.has_dispatcher: +#include //pulls in the dispatcher +%endif -static inline void __$(kern.name)_d($kern.arglist_full) +static inline void __${kern.name}_d(${kern.arglist_full}) { - #if $kern.has_dispatcher - $(kern.name)_dispatcher($kern.arglist_names); + %if kern.has_dispatcher: + ${kern.name}_dispatcher(${kern.arglist_names}); return; - #end if - - if (volk_gnsssdr_is_aligned( - #set $num_open_parens = 0 - #for $arg_type, $arg_name in $kern.args - #if '*' in $arg_type - VOLK_OR_PTR($arg_name, - #set $num_open_parens += 1 - #end if - #end for - 0$(')'*$num_open_parens) + %endif + + if (volk_gnsssdr_is_aligned(<% num_open_parens = 0 %> + %for arg_type, arg_name in kern.args: + %if '*' in arg_type: + VOLK_OR_PTR(${arg_name},<% num_open_parens += 1 %> + %endif + %endfor + 0<% end_open_parens = ')'*num_open_parens %>${end_open_parens} )){ - $(kern.name)_a($kern.arglist_names); + ${kern.name}_a(${kern.arglist_names}); } else{ - $(kern.name)_u($kern.arglist_names); + ${kern.name}_u(${kern.arglist_names}); } } -static inline void __init_$(kern.name)(void) +static inline void __init_${kern.name}(void) { - const char *name = get_machine()->$(kern.name)_name; - const char **impl_names = get_machine()->$(kern.name)_impl_names; - const int *impl_deps = get_machine()->$(kern.name)_impl_deps; - const bool *alignment = get_machine()->$(kern.name)_impl_alignment; - const size_t n_impls = get_machine()->$(kern.name)_n_impls; + const char *name = get_machine()->${kern.name}_name; + const char **impl_names = get_machine()->${kern.name}_impl_names; + const int *impl_deps = get_machine()->${kern.name}_impl_deps; + const bool *alignment = get_machine()->${kern.name}_impl_alignment; + const size_t n_impls = get_machine()->${kern.name}_n_impls; const size_t index_a = volk_gnsssdr_rank_archs(name, impl_names, impl_deps, alignment, n_impls, true/*aligned*/); const size_t index_u = volk_gnsssdr_rank_archs(name, impl_names, impl_deps, alignment, n_impls, false/*unaligned*/); - $(kern.name)_a = get_machine()->$(kern.name)_impls[index_a]; - $(kern.name)_u = get_machine()->$(kern.name)_impls[index_u]; + ${kern.name}_a = get_machine()->${kern.name}_impls[index_a]; + ${kern.name}_u = get_machine()->${kern.name}_impls[index_u]; - assert($(kern.name)_a); - assert($(kern.name)_u); + assert(${kern.name}_a); + assert(${kern.name}_u); - $(kern.name) = &__$(kern.name)_d; + ${kern.name} = &__${kern.name}_d; } -static inline void __$(kern.name)_a($kern.arglist_full) +static inline void __${kern.name}_a(${kern.arglist_full}) { - __init_$(kern.name)(); - $(kern.name)_a($kern.arglist_names); + __init_${kern.name}(); + ${kern.name}_a(${kern.arglist_names}); } -static inline void __$(kern.name)_u($kern.arglist_full) +static inline void __${kern.name}_u(${kern.arglist_full}) { - __init_$(kern.name)(); - $(kern.name)_u($kern.arglist_names); + __init_${kern.name}(); + ${kern.name}_u(${kern.arglist_names}); } -static inline void __$(kern.name)($kern.arglist_full) +static inline void __${kern.name}(${kern.arglist_full}) { - __init_$(kern.name)(); - $(kern.name)($kern.arglist_names); + __init_${kern.name}(); + ${kern.name}(${kern.arglist_names}); } -$kern.pname $(kern.name)_a = &__$(kern.name)_a; -$kern.pname $(kern.name)_u = &__$(kern.name)_u; -$kern.pname $(kern.name) = &__$(kern.name); +${kern.pname} ${kern.name}_a = &__${kern.name}_a; +${kern.pname} ${kern.name}_u = &__${kern.name}_u; +${kern.pname} ${kern.name} = &__${kern.name}; -void $(kern.name)_manual($kern.arglist_full, const char* impl_name) +void ${kern.name}_manual(${kern.arglist_full}, const char* impl_name) { const int index = volk_gnsssdr_get_index( - get_machine()->$(kern.name)_impl_names, - get_machine()->$(kern.name)_n_impls, + get_machine()->${kern.name}_impl_names, + get_machine()->${kern.name}_n_impls, impl_name ); - get_machine()->$(kern.name)_impls[index]( - $kern.arglist_names + get_machine()->${kern.name}_impls[index]( + ${kern.arglist_names} ); } -volk_gnsssdr_func_desc_t $(kern.name)_get_func_desc(void) { - const char **impl_names = get_machine()->$(kern.name)_impl_names; - const int *impl_deps = get_machine()->$(kern.name)_impl_deps; - const bool *alignment = get_machine()->$(kern.name)_impl_alignment; - const size_t n_impls = get_machine()->$(kern.name)_n_impls; +volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void) { + const char **impl_names = get_machine()->${kern.name}_impl_names; + const int *impl_deps = get_machine()->${kern.name}_impl_deps; + const bool *alignment = get_machine()->${kern.name}_impl_alignment; + const size_t n_impls = get_machine()->${kern.name}_n_impls; volk_gnsssdr_func_desc_t desc = { impl_names, impl_deps, @@ -206,4 +204,4 @@ volk_gnsssdr_func_desc_t $(kern.name)_get_func_desc(void) { return desc; } -#end for +%endfor diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h index 283f56d521..0586dd640c 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr.tmpl.h @@ -68,23 +68,23 @@ VOLK_API size_t volk_gnsssdr_get_alignment(void); */ VOLK_API bool volk_gnsssdr_is_aligned(const void *ptr); -#for $kern in $kernels +%for kern in kernels: //! A function pointer to the dispatcher implementation -extern VOLK_API $kern.pname $kern.name; +extern VOLK_API ${kern.pname} ${kern.name}; //! A function pointer to the fastest aligned implementation -extern VOLK_API $kern.pname $(kern.name)_a; +extern VOLK_API ${kern.pname} ${kern.name}_a; //! A function pointer to the fastest unaligned implementation -extern VOLK_API $kern.pname $(kern.name)_u; +extern VOLK_API ${kern.pname} ${kern.name}_u; //! Call into a specific implementation given by name -extern VOLK_API void $(kern.name)_manual($kern.arglist_full, const char* impl_name); +extern VOLK_API void ${kern.name}_manual(${kern.arglist_full}, const char* impl_name); //! Get description paramaters for this kernel -extern VOLK_API volk_gnsssdr_func_desc_t $(kern.name)_get_func_desc(void); -#end for +extern VOLK_API volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void); +%endfor __VOLK_DECL_END diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h index 2736826ed7..ed55d0b58f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_config_fixed.tmpl.h @@ -19,10 +19,10 @@ #ifndef INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H #define INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED_H -#for $i, $arch in enumerate($archs) -#ifndef LV_$(arch.name.upper()) -#define LV_$(arch.name.upper()) $i -#endif -#end for +%for i, arch in enumerate(archs): +//#ifndef LV_${arch.name.upper()} +#define LV_${arch.name.upper()} ${i} +//#endif +%endfor #endif /*INCLUDED_VOLK_GNSSSDR_CONFIG_FIXED*/ diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index ae08e89ee3..d77bf49ad2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -147,15 +147,14 @@ static int has_neon(void){ #endif } -#for $arch in $archs -static int i_can_has_$arch.name (void) { - #for $check, $params in $arch.checks - if ($(check)($(', '.join($params))) == 0) return 0; - #end for +%for arch in archs: +static int i_can_has_${arch.name} (void) { + %for check, params in arch.checks: + if (${check}(<% joined_params = ', '.join(params)%>${joined_params}) == 0) return 0; + %endfor return 1; } - -#end for +%endfor #if defined(HAVE_FENV_H) #if defined(FE_TONEAREST) @@ -182,17 +181,17 @@ static int i_can_has_$arch.name (void) { #endif void volk_gnsssdr_cpu_init() { - #for $arch in $archs - volk_gnsssdr_cpu.has_$arch.name = &i_can_has_$arch.name; - #end for + %for arch in archs: + volk_gnsssdr_cpu.has_${arch.name} = &i_can_has_${arch.name}; + %endfor set_float_rounding(); } unsigned int volk_gnsssdr_get_lvarch() { unsigned int retval = 0; volk_gnsssdr_cpu_init(); - #for $arch in $archs - retval += volk_gnsssdr_cpu.has_$(arch.name)() << LV_$(arch.name.upper()); - #end for + %for arch in archs: + retval += volk_gnsssdr_cpu.has_${arch.name}() << LV_${arch.name.upper()}; + %endfor return retval; } diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h index e39d65e90f..20dbac2cc2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.h @@ -24,9 +24,9 @@ __VOLK_DECL_BEGIN struct VOLK_CPU { - #for $arch in $archs - int (*has_$arch.name) (); - #end for + %for arch in archs: + int (*has_${arch.name}) (); + %endfor }; extern struct VOLK_CPU volk_gnsssdr_cpu; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c index 88b942153c..c6182cb505 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machine_xxx.tmpl.c @@ -16,12 +16,12 @@ * along with GNSS-SDR. If not, see . */ -#set $this_machine = $machine_dict[$args[0]] -#set $arch_names = $this_machine.arch_names +<% this_machine = machine_dict[args[0]] %> +<% arch_names = this_machine.arch_names %> -#for $arch in $this_machine.archs -#define LV_HAVE_$(arch.name.upper()) 1 -#end for +%for arch in this_machine.archs: +#define LV_HAVE_${arch.name.upper()} 1 +%endfor #include #include "volk_gnsssdr_machines.h" @@ -31,46 +31,28 @@ #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_impl_name_list($impls) -{$(', '.join(['"%s"'%i.name for i in $impls]))}#slurp -#end def - -######################################################################## -#def make_impl_align_list($impls) -{$(', '.join(['true' if i.is_aligned else 'false' for i in $impls]))}#slurp -#end def - -######################################################################## -#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_gnsssdr_machine volk_gnsssdr_machine_$(this_machine.name) = { - $make_arch_have_list($this_machine.archs), - "$this_machine.name", - $this_machine.alignment, - #for $kern in $kernels - #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 +%for kern in kernels: +#include +%endfor + +struct volk_gnsssdr_machine volk_gnsssdr_machine_${this_machine.name} = { +<% make_arch_have_list = (' | '.join(['(1 << LV_%s)'%a.name.upper() for a in this_machine.archs])) %> ${make_arch_have_list}, +<% this_machine_name = "\""+this_machine.name+"\"" %> ${this_machine_name}, + ${this_machine.alignment}, +##//list all kernels + %for kern in kernels: +<% impls = kern.get_impls(arch_names) %> +##//kernel name +<% kern_name = "\""+kern.name+"\"" %> ${kern_name}, +##//list of kernel implementations by name +<% make_impl_name_list = "{"+', '.join(['"%s"'%i.name for i in impls])+"}" %> ${make_impl_name_list}, +##//list of arch dependencies per implementation +<% make_impl_deps_list = "{"+', '.join([' | '.join(['(1 << LV_%s)'%d.upper() for d in i.deps]) for i in impls])+"}" %> ${make_impl_deps_list}, +##//alignment required? for each implementation +<% make_impl_align_list = "{"+', '.join(['true' if i.is_aligned else 'false' for i in impls])+"}" %> ${make_impl_align_list}, +##//pointer to each implementation +<% make_impl_fcn_list = "{"+', '.join(['%s_%s'%(kern.name, i.name) for i in impls])+"}" %> ${make_impl_fcn_list}, +##//number of implementations listed here +<% len_impls = len(impls) %> ${len_impls}, + %endfor }; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c index 3eded37eb8..1485a34e0f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.c @@ -21,11 +21,11 @@ #include "volk_gnsssdr_machines.h" struct volk_gnsssdr_machine *volk_gnsssdr_machines[] = { -#for $machine in $machines -#ifdef LV_MACHINE_$(machine.name.upper()) -&volk_gnsssdr_machine_$(machine.name), +%for machine in machines: +#ifdef LV_MACHINE_${machine.name.upper()} +&volk_gnsssdr_machine_${machine.name}, #endif -#end for +%endfor }; unsigned int n_volk_gnsssdr_machines = sizeof(volk_gnsssdr_machines)/sizeof(*volk_gnsssdr_machines); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h index edcf803bbe..10e955e250 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_machines.tmpl.h @@ -31,21 +31,21 @@ struct volk_gnsssdr_machine { const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format) const char *name; const size_t alignment; //the maximum byte alignment required for functions in this library - #for $kern in $kernels - const char *$(kern.name)_name; - const char *$(kern.name)_impl_names[$(len($archs))]; - const int $(kern.name)_impl_deps[$(len($archs))]; - const bool $(kern.name)_impl_alignment[$(len($archs))]; - const $(kern.pname) $(kern.name)_impls[$(len($archs))]; - const size_t $(kern.name)_n_impls; - #end for + %for kern in kernels: + const char *${kern.name}_name; + const char *${kern.name}_impl_names[<%len_archs=len(archs)%>${len_archs}]; + const int ${kern.name}_impl_deps[${len_archs}]; + const bool ${kern.name}_impl_alignment[${len_archs}]; + const ${kern.pname} ${kern.name}_impls[${len_archs}]; + const size_t ${kern.name}_n_impls; + %endfor }; -#for $machine in $machines -#ifdef LV_MACHINE_$(machine.name.upper()) -extern struct volk_gnsssdr_machine volk_gnsssdr_machine_$(machine.name); +%for machine in machines: +#ifdef LV_MACHINE_${machine.name.upper()} +extern struct volk_gnsssdr_machine volk_gnsssdr_machine_${machine.name}; #endif -#end for +%endfor __VOLK_DECL_END diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h index 1ef398c7c2..def7e24c3a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_typedefs.tmpl.h @@ -22,8 +22,8 @@ #include #include -#for $kern in $kernels -typedef void (*$(kern.pname))($kern.arglist_types); -#end for +%for kern in kernels: +typedef void (*${kern.pname})(${kern.arglist_types}); +%endfor #endif /*INCLUDED_VOLK_GNSSSDR_TYPEDEFS*/ diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc index 7455ccabbb..7dd79593a7 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc @@ -377,7 +377,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ //remnant code phase [chips] d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast(d_fs_in)); + current_synchro_data.Flag_valid_symbol_output = true; // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### + + + if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES) { // fill buffer with prompt correlator output values @@ -395,6 +399,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ if (d_carrier_lock_test < d_carrier_lock_threshold or d_CN0_SNV_dB_Hz < MINIMUM_VALID_CN0) { d_carrier_lock_fail_counter++; + //current_synchro_data.Flag_valid_symbol_output = false; + d_acc_carrier_phase_rad = 0.0; + std::cout << "----------------------------Cycle slip! Threshold: " << d_carrier_lock_threshold << " detector: " << d_carrier_lock_test << " CN0: " << d_CN0_SNV_dB_Hz << " Sat: " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl; + } else { @@ -424,7 +432,7 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; + //current_synchro_data.Flag_valid_symbol_output = true; current_synchro_data.correlation_length_ms = 1; } else