commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8176 - in gnuradio/branches/developers/eb/gcell-wip:


From: eb
Subject: [Commit-gnuradio] r8176 - in gnuradio/branches/developers/eb/gcell-wip: config gcell/src/lib gcell/src/lib/spu gcell/src/lib/wrapper gcell/src/lib/wrapper/spu
Date: Wed, 9 Apr 2008 21:11:31 -0600 (MDT)

Author: eb
Date: 2008-04-09 21:11:30 -0600 (Wed, 09 Apr 2008)
New Revision: 8176

Added:
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/Makefile.am
   
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
   
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.h
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/spu/
Removed:
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs/
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/Makefile.am
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/spu/
Modified:
   gnuradio/branches/developers/eb/gcell-wip/config/grc_gcell.m4
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/Makefile.am
   gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/spu/Makefile.am
   
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/spu/gcs_fft_1d_r2.c
Log:
mv gcell/src/lib/procs gcell/src/lib/wrapper

Modified: gnuradio/branches/developers/eb/gcell-wip/config/grc_gcell.m4
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/config/grc_gcell.m4       
2008-04-10 02:41:46 UTC (rev 8175)
+++ gnuradio/branches/developers/eb/gcell-wip/config/grc_gcell.m4       
2008-04-10 03:11:30 UTC (rev 8176)
@@ -55,13 +55,13 @@
        gcell_INCLUDES="-I\${abs_top_srcdir}/gcell/src/include \
                 -I\${abs_top_srcdir}/gcell/src/lib/runtime \
                 -I\${abs_top_srcdir}/gcell/src/lib/general \
-                -I\${abs_top_srcdir}/gcell/src/lib/procs"
+                -I\${abs_top_srcdir}/gcell/src/lib/wrapper"
         gcell_LA="\${abs_top_builddir}/gcell/src/lib/libgcell.la"
        gcell_spu_INCLUDES="-I\${abs_top_srcdir}/gcell/src/include/spu \
                 -I\${abs_top_srcdir}/gcell/src/include \
                 -I\${abs_top_srcdir}/gcell/src/lib/runtime/spu \
                 -I\${abs_top_srcdir}/gcell/src/lib/general/spu \
-                -I\${abs_top_srcdir}/gcell/src/lib/procs/spu"
+                -I\${abs_top_srcdir}/gcell/src/lib/wrapper/spu"
        gcell_spu_LA="\${abs_top_builddir}/gcell/src/lib/spu/libgcell_spu.a"
        AC_SUBST(gcell_spu_INCLUDES)
        AC_SUBST(gcell_spu_LA)
@@ -76,7 +76,7 @@
         gcell/src/lib/Makefile \
         gcell/src/lib/spu/Makefile \
         gcell/src/lib/general/Makefile \
-        gcell/src/lib/procs/Makefile \
+        gcell/src/lib/wrapper/Makefile \
         gcell/src/lib/runtime/Makefile \
         gcell/src/apps/Makefile \
        gcell/src/apps/spu/Makefile \

Modified: gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/Makefile.am 
2008-04-10 02:41:46 UTC (rev 8175)
+++ gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/Makefile.am 
2008-04-10 03:11:30 UTC (rev 8176)
@@ -20,7 +20,7 @@
 
 include $(top_srcdir)/Makefile.common
 
-SUBDIRS = spu runtime general procs .
+SUBDIRS = spu runtime general wrapper .
 
 # generate libgcell.la from the convenience libraries in subdirs
 
@@ -34,13 +34,13 @@
 
 libgcell_la_LIBADD = \
        runtime/libruntime.la \
-       procs/libwrapper.la \
+       wrapper/libwrapper.la \
        -lspe2 \
        $(OMNITHREAD_LA)
 
 libgcell_qa_la_LIBADD = \
        runtime/libruntime-qa.la \
-       procs/libwrapper-qa.la \
+       wrapper/libwrapper-qa.la \
        $(CPPUNIT_LIBS)
 
 

Modified: 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/spu/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/spu/Makefile.am     
2008-04-10 02:41:46 UTC (rev 8175)
+++ gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/spu/Makefile.am     
2008-04-10 03:11:30 UTC (rev 8176)
@@ -69,15 +69,16 @@
 
 
 # ----------------------------------------------------------------
-# files in the lib/procs/spu directory
+# files in the lib/wrapper/spu directory
 
-procs_srcdir = $(srcdir)/../proc/spu
+wrapper_srcdir = $(srcdir)/../wrapper/spu
 
-procs_spu_sources =
+wrapper_spu_sources = \
+       $(wrapper_srcdir)/gcs_fft_1d_r2.c
 
-procs_spu_headers =
+wrapper_spu_headers =
 
-procs_spu_noinst_headers =
+wrapper_spu_noinst_headers =
 
 # ----------------------------------------------------------------
 # build the library from the files in the three directories
@@ -85,17 +86,17 @@
 libgcell_spu_a_SOURCES = \
        $(runtime_spu_sources) \
        $(general_spu_sources) \
-       $(procs_spu_sources)
+       $(wrapper_spu_sources)
 
 gcellspuinclude_HEADERS = \
        $(runtime_spu_headers) \
        $(general_spu_headers) \
-       $(procs_spu_headers)
+       $(wrapper_spu_headers)
 
 noinst_HEADERS = \
        $(runtime_spu_noinst_headers) \
        $(general_spu_noinst_headers) \
-       $(procs_spu_noinst_headers)
+       $(wrapper_spu_noinst_headers)
 
 # ----------------------------------------------------------------
 # SPU executable containing QA code

Copied: gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper (from 
rev 8159, gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs)

Deleted: 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/Makefile.am

Copied: 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/Makefile.am 
(from rev 8175, 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs/Makefile.am)
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/Makefile.am 
                        (rev 0)
+++ gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/Makefile.am 
2008-04-10 03:11:30 UTC (rev 8176)
@@ -0,0 +1,36 @@
+#
+# Copyright 2008 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 this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+AM_CPPFLAGS = $(DEFINES) $(GCELL_INCLUDES) $(WITH_INCLUDES)
+
+
+noinst_LTLIBRARIES = libwrapper.la libwrapper-qa.la
+
+libwrapper_la_SOURCES = \
+       gcp_fft_1d_r2.cc
+
+libwrapper_qa_la_SOURCES =
+
+gcellinclude_HEADERS = \
+       gcp_fft_1d_r2.h
+
+noinst_HEADERS =

Copied: 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
 (from rev 8175, 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs/gcp_fft_1d_r2.cc)
===================================================================
--- 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
                            (rev 0)
+++ 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.cc
    2008-04-10 03:11:30 UTC (rev 8176)
@@ -0,0 +1,111 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <gcp_fft_1d_r2.h>
+#include <stdint.h>
+#include <stdexcept>
+#include <math.h>
+
+static void
+init_jd(gc_job_desc *jd,
+       gc_proc_id_t proc_id,
+       unsigned log2_fft_length,
+       std::complex<float> *out,
+       const std::complex<float> *in,
+       const std::complex<float> *W)
+{
+  jd->proc_id = proc_id;
+  jd->input.nargs = 1;
+  jd->output.nargs = 0;
+  jd->eaa.nargs = 3;
+
+  jd->input.arg[0].u32 = log2_fft_length;
+  unsigned int fft_length = 1 << log2_fft_length;
+
+  jd->eaa.arg[0].ea_addr = ptr_to_ea(out);
+  jd->eaa.arg[0].direction = GCJD_DMA_PUT;
+  jd->eaa.arg[0].put_size = sizeof(std::complex<float>) * fft_length;
+
+  jd->eaa.arg[1].ea_addr = ptr_to_ea(const_cast<std::complex<float>*>(in));
+  jd->eaa.arg[1].direction = GCJD_DMA_GET;
+  jd->eaa.arg[1].get_size = sizeof(std::complex<float>) * fft_length;
+
+  jd->eaa.arg[2].ea_addr = ptr_to_ea(const_cast<std::complex<float>*>(W));
+  jd->eaa.arg[2].direction = GCJD_DMA_GET;
+  jd->eaa.arg[2].get_size = sizeof(std::complex<float>) * fft_length / 4;
+}
+
+
+gc_job_desc *
+gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
+                    unsigned int log2_fft_length,
+                    std::complex<float> *out,
+                    const std::complex<float> *in,
+                    const std::complex<float> *W)
+{
+  unsigned int fft_length = 1 << log2_fft_length;
+  if (fft_length > 8192)
+    throw std::invalid_argument("fft_length > 8192");
+
+  if ((intptr_t)out & 0xf)
+    throw gc_bad_align("out");
+  if ((intptr_t)in & 0xf)
+    throw gc_bad_align("in");
+  if ((intptr_t)W & 0xf)
+    throw gc_bad_align("W");
+
+  gc_proc_id_t fft_id = mgr->lookup_proc("fft_1d_r2");
+  gc_job_desc *jd = mgr->alloc_job_desc();
+  init_jd(jd, fft_id, log2_fft_length, out, in, W);
+  if (!mgr->submit_job(jd)){
+    gc_job_status_t s = jd->status;
+    mgr->free_job_desc(jd);
+    throw gc_bad_submit("fft_1d_r2", s);
+  }
+  return jd;
+}
+
+void
+gcp_fft_1d_r2_forward_twiddle(unsigned int log2_fft_length, 
std::complex<float> *W)
+{
+  unsigned int n = 1 << log2_fft_length;
+
+  W[0].real() = 1.0;
+  W[0].imag() = 0.0;
+  for (unsigned i=1; i < n/4; i++){
+    W[i].real() =  cos(i * 2*M_PI/n);
+    W[n/4 - i].imag() = -W[i].real();
+  }
+}
+
+
+void
+gcp_fft_1d_r2_reverse_twiddle(unsigned int log2_fft_length, 
std::complex<float> *W)
+{
+  // reverse factors are the conjugate of the forward factors
+  gcp_fft_1d_r2_forward_twiddle(log2_fft_length, W);
+
+  unsigned int n = 1 << log2_fft_length;
+  for (unsigned i=0; i < n/4; i++)
+    W[i] = conj(W[i]);
+}

Copied: 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.h 
(from rev 8175, 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs/gcp_fft_1d_r2.h)
===================================================================
--- 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.h 
                            (rev 0)
+++ 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/gcp_fft_1d_r2.h 
    2008-04-10 03:11:30 UTC (rev 8176)
@@ -0,0 +1,64 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_GCP_FFT_1D_R2_H
+#define INCLUDED_GCP_FFT_1D_R2_H
+
+#include <gc_job_manager.h>
+#include <complex>
+
+/*!
+ * \brief Submit a job that computes the forward or reverse FFT.
+ *
+ * \param mgr is the job manager instance
+ * \param log2_fft_length is the log2 of the fft_length (4 <= x <= 13).
+ * \param out is the fft_length output from FFT (must be 16-byte aligned).
+ * \param in is the fft_length input to FFT (must be 16-byte aligned).
+ * \param W is fft_length/4 twiddle factor input to FFT (must be 16-byte 
aligned).
+ *
+ * Returns a job descriptor which should be passed to wait_job*.
+ * Throws an exception in the event of a problem.
+ */
+gc_job_desc *
+gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
+                    unsigned int log2_fft_length,
+                    std::complex<float> *out,
+                    const std::complex<float> *in,
+                    const std::complex<float> *W);
+
+/*!
+ * \brief Compute twiddle factors for forward transform.
+ *
+ * \param log2_fft_length is the log2 of the fft_length.
+ * \param W is fft_length/4 twiddle factor output (must be 16-byte aligned).
+ */
+void
+gcp_fft_1d_r2_forward_twiddle(unsigned int log2_fft_length, 
std::complex<float> *W);
+
+/*!
+ * \brief Compute twiddle factors for reverse transform.
+ *
+ * \param log2_fft_length is the log2 of the fft_length.
+ * \param W is fft_length/4 twiddle factor output (must be 16-byte aligned).
+ */
+void
+gcp_fft_1d_r2_reverse_twiddle(unsigned int log2_fft_length, 
std::complex<float> *W);
+
+#endif /* INCLUDED_GCP_FFT_1D_R2_H */

Copied: gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/spu 
(from rev 8175, 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs/spu)

Modified: 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/spu/gcs_fft_1d_r2.c
===================================================================
--- 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/procs/spu/gcs_fft_1d_r2.c
   2008-04-10 02:41:46 UTC (rev 8175)
+++ 
gnuradio/branches/developers/eb/gcell-wip/gcell/src/lib/wrapper/spu/gcs_fft_1d_r2.c
 2008-04-10 03:11:30 UTC (rev 8176)
@@ -24,12 +24,12 @@
 
 static void
 gcs_fft_1d_r2(const gc_job_direct_args_t *input,
-             gc_job_direct_args_t *output,
+             gc_job_direct_args_t *output __attribute__((unused)),
              const gc_job_ea_args_t *eaa)
 {
-  vector float *out = (vector float *) eaa_arg[0].ls_addr;
-  vector float *in = (vector float *) eaa_arg[1].ls_addr;
-  vector float *W = (vector float *) eaa_arg[2].ls_addr;
+  vector float *out = (vector float *) eaa->arg[0].ls_addr;
+  vector float *in = (vector float *) eaa->arg[1].ls_addr;
+  vector float *W = (vector float *) eaa->arg[2].ls_addr;
   int log2_fft_length = input->arg[0].u32;
 
   fft_1d_r2(out, in, W, log2_fft_length);





reply via email to

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