commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8153 - in gnuradio/branches/developers/ngoergen/spe_f


From: ngoergen
Subject: [Commit-gnuradio] r8153 - in gnuradio/branches/developers/ngoergen/spe_fir_fff: . spu
Date: Wed, 2 Apr 2008 08:54:47 -0600 (MDT)

Author: ngoergen
Date: 2008-04-02 08:54:47 -0600 (Wed, 02 Apr 2008)
New Revision: 8153

Added:
   gnuradio/branches/developers/ngoergen/spe_fir_fff/Makefile.am
   gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_ccc.cc
   gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_fff.cc
   gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/Makefile.am
   gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.c
   gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.c
Removed:
   gnuradio/branches/developers/ngoergen/spe_fir_fff/Makefile
   gnuradio/branches/developers/ngoergen/spe_fir_fff/gr_spu_dma_lock.h
   gnuradio/branches/developers/ngoergen/spe_fir_fff/multi_fir_ccc_ppe.c
   gnuradio/branches/developers/ngoergen/spe_fir_fff/multi_fir_fff_ppe.c
   gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.cc
   gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.cc
   gnuradio/branches/developers/ngoergen/spe_fir_fff/spu_fir_fff_params.h
Modified:
   gnuradio/branches/developers/ngoergen/spe_fir_fff/qa_spu_fir_fff.cc
Log:
spe_fir: ready to merge into gcell

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/Makefile

Added: gnuradio/branches/developers/ngoergen/spe_fir_fff/Makefile.am
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/Makefile.am               
                (rev 0)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/Makefile.am       
2008-04-02 14:54:47 UTC (rev 8153)
@@ -0,0 +1,55 @@
+#
+# Copyright 2007,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
+
+SUBDIRS = spu .
+
+AM_CPPFLAGS = $(DEFINES) $(OMNITHREAD_INCLUDES) $(MBLOCK_INCLUDES) \
+       $(GCELL_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
+
+
+GCELL_QA_LA = $(top_builddir)/gcell/src/lib/libgcell-qa.la
+
+TESTS = test_all
+
+
+bin_PROGRAMS = \
+       test_all \
+       benchmark_dma \
+       benchmark_nop \
+       fir_ccc \
+       fir_fff
+
+
+test_all_SOURCES = test_all.cc
+test_all_LDADD = $(GCELL_QA_LA) $(GCELL_LA)
+
+benchmark_dma_SOURCES = benchmark_dma.cc
+benchmark_dma_LDADD = spu/benchmark_procs $(GCELL_LA) $(MBLOCK_LA)
+
+benchmark_nop_SOURCES = benchmark_nop.cc
+benchmark_nop_LDADD = spu/benchmark_procs $(GCELL_LA) $(MBLOCK_LA)
+
+fir_ccc_SOURCES = fir_ccc.cc
+fir_ccc_LDADD = spu/fir_ccc_spu $(GCELL_LA)
+
+fir_fff_SOURCES = fir_fff.cc
+fir_fff_LDADD = spu/fir_fff_spu $(GCELL_LA)
\ No newline at end of file

Added: gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_ccc.cc
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_ccc.cc                
                (rev 0)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_ccc.cc        
2008-04-02 14:54:47 UTC (rev 8153)
@@ -0,0 +1,147 @@
+/* -*- 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 GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "gc_job_manager.h"
+#include <iostream>
+#include <inttypes.h>
+#include <complex>
+typedef std::complex<float> complex;
+
+extern spe_program_handle_t fir_ccc_spu;
+
+static gc_proc_id_t sp_fir_spu = GCP_UNKNOWN_PROC;
+
+static void init_jd(gc_job_desc* jd, float* in_vec, float* sum_vec, int n_taps,
+    float* out_vec, int n_samples)
+{
+
+  jd->proc_id = sp_fir_spu;
+  jd->input.nargs = 0;
+  jd->output.nargs = 0;
+  jd->eaa.nargs = 5;
+
+  jd->eaa.arg[0].ea_addr = ptr_to_ea(in_vec);
+  jd->eaa.arg[0].direction = GCJD_DMA_GET;
+  jd->eaa.arg[0].get_size = sizeof(complex) * n_samples;
+
+  jd->eaa.arg[1].ea_addr = ptr_to_ea(sum_vec);
+  jd->eaa.arg[1].direction = GCJD_DMA_GET;
+  jd->eaa.arg[1].get_size = sizeof(complex) * n_samples;
+
+  jd->eaa.arg[2].ea_addr = ptr_to_ea(&n_taps);
+  jd->eaa.arg[2].direction = GCJD_DMA_GET;
+  jd->eaa.arg[2].get_size = sizeof(uint32_t);
+
+  jd->eaa.arg[3].ea_addr = ptr_to_ea(&n_samples);
+  jd->eaa.arg[3].direction = GCJD_DMA_GET;
+  jd->eaa.arg[3].get_size = sizeof(uint32_t);
+
+  jd->eaa.arg[4].ea_addr = ptr_to_ea(out_vec);
+  jd->eaa.arg[4].direction = GCJD_DMA_PUT;
+  jd->eaa.arg[4].put_size = sizeof(complex) * n_samples;
+
+}
+
+static void fir_ccc(const complex &input, complex* output, const complex &taps,
+    int n_taps, int n_samples)
+{
+
+  float* in_vec = (float *) &input;
+  float* taps_vec = (float *) &taps;
+  float* out_vec = (float *) output;
+
+  gc_jm_options opts;
+  opts.nspes = 1;
+  opts.gang_schedule = false;
+  opts.program_handle = &fir_ccc_spu;
+
+  gc_job_manager * mgr = gc_make_job_manager(&opts);
+
+  if ((sp_fir_spu = mgr->lookup_proc("fir_ccc_spu")) == GCP_UNKNOWN_PROC) {
+    fprintf(stderr, "lookup_proc: failed to find \"fir_ccc_spu\"\n");
+    return;
+  }
+
+  gc_job_desc* jd;
+  jd = mgr->alloc_job_desc();
+  init_jd(jd, in_vec, taps_vec, n_taps, out_vec, n_samples);
+
+  if (!mgr->submit_job(jd)) {
+    printf("submit_job failed, status = %d\n", jd->status);
+  }
+
+  std::cout << jd->status << '\n';
+
+  if (!mgr->wait_job(jd)) {
+    printf("wait_job failed, status = %d\n", jd->status);
+  }
+
+  mgr->free_job_desc(jd);
+
+  return;
+
+}
+
+int main()
+{
+  const int len = 32;
+  const int n_taps = 16;
+  static complex in_vec[len]
+  __attribute__  ((aligned(16)))=
+  { complex(1, 2), complex(3, 4), complex(-5, 6), complex(-7, -8), complex(9, 
-10),
+    complex(-11.11, -12.22), complex(13.33, 14.44), complex(15.55, 16.66),
+    complex(2.32,54.23), 
complex(1.534,-23.24),complex(12.4354,24.65),complex(43.432,25.453),
+    
complex(234.645,-123.23),complex(-23.23,12.65),complex(1.54,2.32),complex(-54.23,5.43),
+    complex(1, 2), complex(3, 4), complex(-5, 6), complex(-7, -8), complex(9, 
-10),
+    complex(-11.11, -12.22), complex(13.33, 14.44), complex(15.55, 16.66),
+    complex(2.32,54.23), 
complex(1.534,-23.24),complex(12.4354,24.65),complex(43.432,25.453),
+    
complex(234.645,-123.23),complex(-23.23,12.65),complex(1.54,2.32),complex(-54.23,5.43)};
+  
+  static complex taps_vec[n_taps]__attribute__((aligned(16))) =
+  { complex(-12.32,13.2), complex(2.32, 12.3), complex(2.43,5.4),
+    complex(2.32, -23.6563), complex(-4.5434, -34.323), complex(0, 0), 
complex(0, 0), complex(0, 0), complex(0, 0),complex(0, 0), complex(0, 0)};
+
+  std::cout << "input" << '\n';
+  for(int i = 0; i < len; ++i) {
+    std::cout << in_vec[i] << ' ';
+  }
+
+  std::cout << "\ntaps" << '\n';
+  for(int i = 0; i < n_taps; ++i) {
+    std::cout << taps_vec[i] << ' ';
+  }
+
+  std::cout << "\ncalling" << '\n';
+  static complex out_vec[len]__attribute__((aligned(16)));
+
+  fir_ccc(*in_vec, out_vec, *taps_vec, n_taps, len);
+
+  std::cout << "call done" << '\n';
+
+  for(int i = 0; i < len; ++i) {
+    std::cout << out_vec[i] << ' ';
+  }
+  std::cout << '\n';
+
+  return 1;
+}
+

Added: gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_fff.cc
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_fff.cc                
                (rev 0)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/fir_fff.cc        
2008-04-02 14:54:47 UTC (rev 8153)
@@ -0,0 +1,142 @@
+/* -*- 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 GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "gc_job_manager.h"
+#include <iostream>
+#include <inttypes.h>
+
+extern spe_program_handle_t fir_fff_spu;
+
+static gc_proc_id_t sp_fir_spu = GCP_UNKNOWN_PROC;
+
+static void init_jd(gc_job_desc* jd, float* in_vec, float* sum_vec, int n_taps,
+    float* out_vec, int n_samples)
+{
+
+  jd->proc_id = sp_fir_spu;
+  jd->input.nargs = 0;
+  jd->output.nargs = 0;
+  jd->eaa.nargs = 5;
+
+  jd->eaa.arg[0].ea_addr = ptr_to_ea(in_vec);
+  jd->eaa.arg[0].direction = GCJD_DMA_GET;
+  jd->eaa.arg[0].get_size = sizeof(float) * n_samples;
+
+  jd->eaa.arg[1].ea_addr = ptr_to_ea(sum_vec);
+  jd->eaa.arg[1].direction = GCJD_DMA_GET;
+  jd->eaa.arg[1].get_size = sizeof(float) * n_samples;
+
+  jd->eaa.arg[2].ea_addr = ptr_to_ea(&n_taps);
+  jd->eaa.arg[2].direction = GCJD_DMA_GET;
+  jd->eaa.arg[2].get_size = sizeof(uint32_t);
+
+  jd->eaa.arg[3].ea_addr = ptr_to_ea(&n_samples);
+  jd->eaa.arg[3].direction = GCJD_DMA_GET;
+  jd->eaa.arg[3].get_size = sizeof(uint32_t);
+
+  jd->eaa.arg[4].ea_addr = ptr_to_ea(out_vec);
+  jd->eaa.arg[4].direction = GCJD_DMA_PUT;
+  jd->eaa.arg[4].put_size = sizeof(float) * n_samples;
+
+}
+
+static void fir_fff(const float &input, float* output, const float &taps,
+    int n_taps, int n_samples)
+{
+
+  float* in_vec = (float *) &input;
+  float* taps_vec = (float *) &taps;
+  float* out_vec = (float *) output;
+
+  gc_jm_options opts;
+  opts.nspes = 1;
+  opts.gang_schedule = false;
+  opts.program_handle = &fir_fff_spu;
+
+  gc_job_manager * mgr = gc_make_job_manager(&opts);
+
+  if ((sp_fir_spu = mgr->lookup_proc("fir_fff_spu")) == GCP_UNKNOWN_PROC) {
+    fprintf(stderr, "lookup_proc: failed to find \"fir_fff_spu\"\n");
+    return;
+  }
+
+  gc_job_desc* jd;
+  jd = mgr->alloc_job_desc();
+  init_jd(jd, in_vec, taps_vec, n_taps, out_vec, n_samples);
+
+  if (!mgr->submit_job(jd)) {
+    printf("submit_job failed, status = %d\n", jd->status);
+  }
+
+  std::cout << jd->status << '\n';
+
+  if (!mgr->wait_job(jd)) {
+    printf("wait_job failed, status = %d\n", jd->status);
+  }
+
+  mgr->free_job_desc(jd);
+
+  return;
+
+}
+
+int main()
+{
+  const int len = 32;
+  const int n_taps = 16;
+  static float in_vec[len]
+  __attribute__  ((aligned(16)))=
+  { 1, 2, 3, 4, -5, 6, -7, -8,
+    9, -10, -11.11, -12.22, 13.33, 14.44, 15.55, 16.66,
+    2.32, 54.23, 1.534, -23.24, 12.4354, 24.65, 43.432, 25.453,
+    234.645, -123.23, -23.23, 12.65, 1.54, 2.32, -54.23, 5.43};
+      //        gr_complex(1,  2),  gr_complex(3,  4), gr_complex(-5,  6), 
gr_complex(-7,  -8), gr_complex(9,  -10), 
+      //                gr_complex(-11.11,  -12.22), gr_complex(13.33,  
14.44), gr_complex(15.55,  16.66),
+      //                gr_complex(2.32,54.23), 
gr_complex(1.534,-23.24),gr_complex(12.4354,24.65),gr_complex(43.432,25.453),
+      //                
gr_complex(234.645,-123.23),gr_complex(-23.23,12.65),gr_complex(1.54,2.32),gr_complex(-54.23,5.43)};
+      static float taps_vec[n_taps]__attribute__((aligned(16))) =
+      { -12.32, 13.2, 2.32, 12.3, 2.43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+      std::cout << "input" << '\n';
+      for(int i = 0; i < len; ++i) {
+        std::cout << in_vec[i] << ' ';
+      }
+
+      std::cout << "\ntaps" << '\n';
+      for(int i = 0; i < n_taps; ++i) {
+        std::cout << taps_vec[i] << ' ';
+      }
+
+      std::cout << "\ncalling" << '\n';
+      static float out_vec[len]__attribute__((aligned(16)));
+
+      fir_fff(*in_vec, out_vec, *taps_vec, n_taps, len);
+
+      std::cout << "call done" << '\n';
+
+      for(int i = 0; i < len; ++i) {
+        std::cout << out_vec[i] << ' ';
+      }
+      std::cout << '\n';
+
+      return 1;
+    }

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/gr_spu_dma_lock.h

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/multi_fir_ccc_ppe.c

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/multi_fir_fff_ppe.c

Modified: gnuradio/branches/developers/ngoergen/spe_fir_fff/qa_spu_fir_fff.cc
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/qa_spu_fir_fff.cc 
2008-04-02 14:47:29 UTC (rev 8152)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/qa_spu_fir_fff.cc 
2008-04-02 14:54:47 UTC (rev 8153)
@@ -21,7 +21,7 @@
  */
 
 /*
-filter([2.43,12.3,2.32,13.2,-12.32],[1],[1,2,3,4,-5,6,-7,-8,9,-10,-11.11,-12.22,13.33,14.44,15.55,16.66,2.32,54.23,1.534,-23.24,12.4354,24.65,43.432,25.453,234.645,-123.23,-23.23,12.65,1.54,2.32,-54.23,5.43]).'(5:end)
+octave:1> 
filter([2.43,12.3,2.32,13.2,-12.32],[1],[1,2,3,4,-5,6,-7,-8,9,-10,-11.11,-12.22,13.33,14.44,15.55,16.66,2.32,54.23,1.534,-23.24,12.4354,24.65,43.432,25.453,234.645,-123.23,-23.23,12.65,1.54,2.32,-54.23,5.43]).'(5:end)
 ans =
 
      58.090

Added: gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/Makefile.am
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/Makefile.am           
                (rev 0)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/Makefile.am   
2008-04-02 14:54:47 UTC (rev 8153)
@@ -0,0 +1,44 @@
+#
+# 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.spu
+
+AM_CPPFLAGS = $(GCELL_SPU_INCLUDES) -g
+
+# SPU executables
+
+noinst_PROGRAMS = \
+       benchmark_procs \
+       fir_ccc_spu \
+       fir_fff_spu
+
+benchmark_procs_SOURCES = benchmark_procs.c
+benchmark_procs_LDADD = $(GCELL_SPU_LA)
+benchmark_procs_DEPENDENCIES = $(GCELL_SPU_LA)
+
+fir_ccc_spu_SOURCES = fir_ccc_spu.c
+fir_ccc_spu_LDADD = $(GCELL_SPU_LA) ./fir_ccc_spu.o ./spu_fir_ccc_as.o
+fir_ccc_spu_DEPENDENCIES = $(GCELL_SPU_LA) ./fir_ccc_spu.o ./spu_fir_ccc_as.o
+
+       
+fir_fff_spu_SOURCES = fir_fff_spu.c
+fir_fff_spu_LDADD = $(GCELL_SPU_LA) ./fir_fff_spu.o ./spu_fir_fff_as.o
+fir_fff_spu_DEPENDENCIES = $(GCELL_SPU_LA) ./fir_fff_spu.o ./spu_fir_fff_as.o
\ No newline at end of file

Copied: gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.c 
(from rev 8152, 
gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.cc)
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.c         
                (rev 0)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.c 
2008-04-02 14:54:47 UTC (rev 8153)
@@ -0,0 +1,63 @@
+/* -*- 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 GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <gc_declare_proc.h>
+#include <spu_intrinsics.h>
+#include <stdint.h>
+#include "spu_fir_ccc_as.h"
+#include <stdio.h>
+#include <spu_mfcio.h>
+
+#define _UNUSED __attribute__((unused))
+
+static void fir_ccc_spu(const gc_job_direct_args_t *input _UNUSED,
+    gc_job_direct_args_t *output _UNUSED, const gc_job_ea_args_t *eaa)
+{
+
+  uintptr_t source_addr_u = (uintptr_t) eaa->arg[0].ls_addr;
+  const qword source_addr = si_from_uint(source_addr_u);
+
+  uintptr_t taps_addr_u = (uintptr_t) eaa->arg[1].ls_addr;
+  const qword taps_addr = si_from_uint(taps_addr_u);
+
+  uint32_t * n_taps_ptr = (uint32_t*)eaa->arg[2].ls_addr;
+  uint32_t n_taps = *n_taps_ptr;
+
+  uint32_t * n_samples_ptr = (uint32_t*)eaa->arg[3].ls_addr;
+  uint32_t n_samples = *n_samples_ptr;
+
+  uintptr_t target_addr_u = (uintptr_t) eaa->arg[4].ls_addr;
+  qword target_addr = si_from_uint(target_addr_u);
+
+  printf("nsamples: %d ntaps: %d\n", n_samples, n_taps);
+
+  spu_write_decrementer(~0);
+  int start = spu_read_decrementer();
+
+  spu_fir_ccc(source_addr, taps_addr, target_addr, (qword) {0,0,0,0}, 0, 
n_samples, n_taps);
+
+  printf("time: %d\n", start - spu_read_decrementer());
+
+  return;
+}
+
+GC_DECLARE_PROC(fir_ccc_spu, "fir_ccc_spu");

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_ccc_spu.cc

Copied: gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.c 
(from rev 8152, 
gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.cc)
===================================================================
--- gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.c         
                (rev 0)
+++ gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.c 
2008-04-02 14:54:47 UTC (rev 8153)
@@ -0,0 +1,63 @@
+/* -*- 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 GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <gc_declare_proc.h>
+#include <spu_intrinsics.h>
+#include <stdint.h>
+#include "spu_fir_fff_as.h"
+#include <stdio.h>
+#include <spu_mfcio.h>
+
+#define _UNUSED __attribute__((unused))
+
+static void fir_fff_spu(const gc_job_direct_args_t *input _UNUSED,
+    gc_job_direct_args_t *output _UNUSED, const gc_job_ea_args_t *eaa)
+{
+
+  uintptr_t source_addr_u = (uintptr_t) eaa->arg[0].ls_addr;
+  const qword source_addr = si_from_uint(source_addr_u);
+
+  uintptr_t taps_addr_u = (uintptr_t) eaa->arg[1].ls_addr;
+  const qword taps_addr = si_from_uint(taps_addr_u);
+
+  uint32_t * n_taps_ptr = (uint32_t*)eaa->arg[2].ls_addr;
+  uint32_t n_taps = *n_taps_ptr;
+
+  uint32_t * n_samples_ptr = (uint32_t*)eaa->arg[3].ls_addr;
+  uint32_t n_samples = *n_samples_ptr;
+
+  uintptr_t target_addr_u = (uintptr_t) eaa->arg[4].ls_addr;
+  qword target_addr = si_from_uint(target_addr_u);
+
+  printf("nsamples: %d ntaps: %d\n", n_samples, n_taps);
+
+  spu_write_decrementer(~0);
+  int start = spu_read_decrementer();
+
+  spu_fir_fff(source_addr, taps_addr, target_addr, (qword) {0,0,0,0}, 0, 
n_samples, n_taps);
+
+  printf("time: %d\n", start - spu_read_decrementer());
+
+  return;
+}
+
+GC_DECLARE_PROC(fir_fff_spu, "fir_fff_spu");

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/spu/fir_fff_spu.cc

Deleted: gnuradio/branches/developers/ngoergen/spe_fir_fff/spu_fir_fff_params.h





reply via email to

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