commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7922 - in gnuradio/branches/developers/eb/gcell-wip/s


From: eb
Subject: [Commit-gnuradio] r7922 - in gnuradio/branches/developers/eb/gcell-wip/src: apps apps/spu lib lib/spu
Date: Tue, 4 Mar 2008 12:10:41 -0700 (MST)

Author: eb
Date: 2008-03-04 12:10:41 -0700 (Tue, 04 Mar 2008)
New Revision: 7922

Added:
   gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_benchmark.c
   gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/gcell_qa.c
Removed:
   gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_qa.c
Modified:
   gnuradio/branches/developers/eb/gcell-wip/src/apps/Makefile.am
   gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/
   gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/Makefile.am
   gnuradio/branches/developers/eb/gcell-wip/src/lib/Makefile.am
   gnuradio/branches/developers/eb/gcell-wip/src/lib/gc_job_manager_impl.cc
   gnuradio/branches/developers/eb/gcell-wip/src/lib/qa_job_manager.cc
   gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/Makefile.am
Log:
gcell work-in-progress

Modified: gnuradio/branches/developers/eb/gcell-wip/src/apps/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/apps/Makefile.am      
2008-03-04 15:51:02 UTC (rev 7921)
+++ gnuradio/branches/developers/eb/gcell-wip/src/apps/Makefile.am      
2008-03-04 19:10:41 UTC (rev 7922)
@@ -33,16 +33,15 @@
        benchmark_dma \
        benchmark_nop
 
-STDLIBS = \
-       $(top_builddir)/src/lib/libgcell-qa.la \
-       $(top_builddir)/src/lib/libgcell.la
+LIBGCELL    = $(top_builddir)/src/lib/libgcell.la
+LIBGCELL_QA = $(top_builddir)/src/lib/libgcell-qa.la
 
-LDADD = $(STDLIBS)
 
 test_all_SOURCES = test_all.cc
+test_all_LDADD = $(LIBGCELL_QA) $(LIBGCELL)
 
 benchmark_dma_SOURCES = benchmark_dma.cc
-benchmark_dma_LDADD = spu/gcell_qa $(STDLIBS) -lmblock
+benchmark_dma_LDADD = spu/benchmark_procs $(LIBGCELL) -lmblock
 
 benchmark_nop_SOURCES = benchmark_nop.cc
-benchmark_nop_LDADD = spu/gcell_qa $(STDLIBS) -lmblock
+benchmark_nop_LDADD = spu/benchmark_procs $(LIBGCELL) -lmblock


Property changes on: gnuradio/branches/developers/eb/gcell-wip/src/apps/spu
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
*.a
*.la
*.lo
.deps
.libs
test_spu
gcell_spu_main
gcell_qa


   + Makefile
Makefile.in
*.a
*.la
*.lo
.deps
.libs
test_spu
gcell_spu_main
gcell_qa
gcell_benchmark


Modified: gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/Makefile.am  
2008-03-04 15:51:02 UTC (rev 7921)
+++ gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/Makefile.am  
2008-03-04 19:10:41 UTC (rev 7922)
@@ -23,10 +23,13 @@
 
 AM_CPPFLAGS = $(SPU_DEFINES_AND_INCLUDES) $(IBM_SPU_SYNC_INCLUDES)
 
+LIBGCELL_SPU = ../../lib/spu/libgcell_spu.a
+
 # SPU executables
 
+LDADD = $(LIBGCELL_SPU)
 
-LDADD = ../../lib/spu/libgcell_spu.a
+noinst_PROGRAMS = \
+       gcell_benchmark
 
-noinst_PROGRAMS = \
-       gcell_qa
+

Added: gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_benchmark.c
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_benchmark.c    
                        (rev 0)
+++ gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_benchmark.c    
2008-03-04 19:10:41 UTC (rev 7922)
@@ -0,0 +1,75 @@
+/* -*- 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.
+ */
+
+#include <gc_delay.h>
+#include <gc_declare_proc.h>
+#include <string.h>
+
+#define _UNUSED __attribute__((unused))
+
+
+static void
+benchmark_udelay(const gc_job_direct_args_t *input,
+                gc_job_direct_args_t *output _UNUSED,
+                const gc_job_ea_args_t *eaa _UNUSED)
+{
+  gc_udelay(input->arg[0].u32);
+}
+
+GC_DECLARE_PROC(benchmark_udelay, "benchmark_udelay");
+
+
+
+static void
+benchmark_put_zeros(const gc_job_direct_args_t *input _UNUSED,
+                   gc_job_direct_args_t *output _UNUSED,
+                   const gc_job_ea_args_t *eaa)
+{
+  for (unsigned int i = 0; i < eaa->nargs; i++){
+    if (eaa->arg[i].direction == GCJD_DMA_PUT)
+      memset(eaa->arg[i].ls_addr, 0, eaa->arg[i].put_size);
+  }
+}
+
+GC_DECLARE_PROC(benchmark_put_zeros, "benchmark_put_zeros");
+
+
+static void
+benchmark_copy(const gc_job_direct_args_t *input _UNUSED,
+              gc_job_direct_args_t *output,
+              const gc_job_ea_args_t *eaa)
+{
+  if (eaa->nargs != 2
+      || eaa->arg[0].direction != GCJD_DMA_PUT
+      || eaa->arg[1].direction != GCJD_DMA_GET){
+    output->arg[0].s32 = -1;
+    return;
+  }
+
+  output->arg[0].s32 = 0;
+  unsigned n = eaa->arg[0].put_size;
+  if (eaa->arg[1].get_size < n)
+    n = eaa->arg[1].get_size;
+  
+  memcpy(eaa->arg[0].ls_addr, eaa->arg[1].ls_addr, n);
+}
+
+GC_DECLARE_PROC(benchmark_copy, "benchmark_copy");


Property changes on: 
gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_benchmark.c
___________________________________________________________________
Name: svn:eol-style
   + native

Deleted: gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_qa.c

Modified: gnuradio/branches/developers/eb/gcell-wip/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/lib/Makefile.am       
2008-03-04 15:51:02 UTC (rev 7921)
+++ gnuradio/branches/developers/eb/gcell-wip/src/lib/Makefile.am       
2008-03-04 19:10:41 UTC (rev 7922)
@@ -44,6 +44,20 @@
        qa_jd_stack.cc \
        qa_job_manager.cc
 
+# This kruft is required to link the SPU QA executable into the PPE shared lib 
w/o warnings
+gcell_qa.lo: spu/gcell_qa
+       ppu-embedspu -m32 -fpic gcell_qa spu/gcell_qa .libs/gcell_qa.o
+       rm -f gcell_qa.lo
+       echo "# gcell_qa.lo - a libtool object file" >> gcell_qa.lo
+       echo "# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 
2005/12/18 22:14:06)" >> gcell_qa.lo
+       echo "#" >> gcell_qa.lo
+       echo "# Please DO NOT delete this file!" >> gcell_qa.lo
+       echo "# It is necessary for linking the library." >> gcell_qa.lo
+       echo "" >> gcell_qa.lo
+       echo "pic_object='.libs/gcell_qa.o'" >> gcell_qa.lo
+       echo "non_pic_object=none" >> gcell_qa.lo
+
 libgcell_qa_la_LIBADD = \
+       gcell_qa.lo \
        libgcell.la \
        $(CPPUNIT_LIBS)

Modified: 
gnuradio/branches/developers/eb/gcell-wip/src/lib/gc_job_manager_impl.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/lib/gc_job_manager_impl.cc    
2008-03-04 15:51:02 UTC (rev 7921)
+++ gnuradio/branches/developers/eb/gcell-wip/src/lib/gc_job_manager_impl.cc    
2008-03-04 19:10:41 UTC (rev 7922)
@@ -139,7 +139,7 @@
     d_options.max_client_threads = DEFAULT_MAX_CLIENT_THREADS;
 
   if (d_options.program_handle == 0){
-    fprintf(stderr, "gc_job_manager: options->program_handle must be 
non-zero");
+    fprintf(stderr, "gc_job_manager: options->program_handle must be 
non-zero\n");
     throw std::runtime_error("gc_job_manager: options->program_handle must be 
non-zero");
   }
 

Modified: gnuradio/branches/developers/eb/gcell-wip/src/lib/qa_job_manager.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/lib/qa_job_manager.cc 
2008-03-04 15:51:02 UTC (rev 7921)
+++ gnuradio/branches/developers/eb/gcell-wip/src/lib/qa_job_manager.cc 
2008-03-04 19:10:41 UTC (rev 7922)
@@ -29,6 +29,8 @@
 
 #include <malloc.h>
 
+extern spe_program_handle_t gcell_qa;  // handle to embedded SPU executable w/ 
QA routines
+
 #if 0
 static void
 gc_msleep(unsigned long millisecs)
@@ -172,7 +174,9 @@
 qa_job_manager::t1_body()
 {
   gc_job_manager *mgr;
-  mgr = gc_make_job_manager();
+  gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
+  mgr = gc_make_job_manager(&opts);
   delete mgr;
 }
 
@@ -181,6 +185,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 100;
   opts.gang_schedule = false;
   mgr = gc_make_job_manager(&opts);
@@ -196,6 +201,7 @@
 
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 100;
   opts.gang_schedule = true;
   CPPUNIT_ASSERT_THROW(mgr = gc_make_job_manager(&opts), std::out_of_range);
@@ -215,6 +221,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   opts.gang_schedule = true;
   mgr = gc_make_job_manager(&opts);
@@ -256,6 +263,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 0;      // use them all
   opts.gang_schedule = true;
   mgr = gc_make_job_manager(&opts);
@@ -293,6 +301,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;      
   mgr = gc_make_job_manager(&opts);
   gc_proc_id_t gcp_qa_nop = mgr->lookup_proc("qa_nop");
@@ -371,6 +380,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
 
@@ -401,6 +411,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
   gc_job_desc *jd = mgr->alloc_job_desc();
@@ -434,6 +445,7 @@
   static const int M = 201;
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
   gc_job_desc *jd = mgr->alloc_job_desc();
@@ -545,10 +557,12 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
-  int starting_val = 13;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
 
+  int starting_val = 13;
+
   for (int offset = 0; offset <= 128; offset++){
     for (int len = 0; len <= 128; len++){
       test_put_seq(mgr, offset, len, starting_val++);
@@ -573,6 +587,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
   gc_job_desc *jd = mgr->alloc_job_desc();
@@ -608,6 +623,7 @@
   static const int M = 201;
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
   gc_job_desc *jd = mgr->alloc_job_desc();
@@ -656,6 +672,7 @@
 {
   gc_job_manager *mgr;
   gc_jm_options opts;
+  opts.program_handle = &gcell_qa;
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
 
@@ -668,6 +685,13 @@
   gc_job_desc *jd = mgr->alloc_job_desc();
   gc_proc_id_t gcp_qa_copy = mgr->lookup_proc("qa_copy");
 
+#if 0
+  printf("gcq_qa_copy = %d\n", gcp_qa_copy);
+  std::vector<std::string> procs = mgr->proc_names();
+  for (unsigned int i = 0; i < procs.size(); ++i)
+    std::cout << procs[i] << std::endl;
+#endif
+
   init_jd(jd, gcp_qa_copy);
   jd->eaa.nargs = 2;
   jd->eaa.arg[0].ea_addr = ptr_to_ea(&short_buf[nshorts]);

Modified: gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/Makefile.am   
2008-03-04 15:51:02 UTC (rev 7921)
+++ gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/Makefile.am   
2008-03-04 19:10:41 UTC (rev 7922)
@@ -32,3 +32,11 @@
        gc_spu_jd_queue.c \
        spu_buffers.c \
        gc_main.c
+
+
+noinst_PROGRAMS = \
+       gcell_qa
+
+
+# SPU executable containing QA code
+gcell_qa_LDADD = libgcell_spu.a

Copied: gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/gcell_qa.c (from 
rev 7921, gnuradio/branches/developers/eb/gcell-wip/src/apps/spu/gcell_qa.c)
===================================================================
--- gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/gcell_qa.c            
                (rev 0)
+++ gnuradio/branches/developers/eb/gcell-wip/src/lib/spu/gcell_qa.c    
2008-03-04 19:10:41 UTC (rev 7922)
@@ -0,0 +1,109 @@
+/* -*- 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.
+ */
+
+#include <gc_delay.h>
+#include <gc_declare_proc.h>
+#include <string.h>
+
+
+#define _UNUSED __attribute__((unused))
+
+// FIXME move these out of here; only for QA usage
+
+static void
+qa_nop(const gc_job_direct_args_t *input _UNUSED,
+       gc_job_direct_args_t *output _UNUSED,
+       const gc_job_ea_args_t *eaa _UNUSED)
+{
+}
+
+GC_DECLARE_PROC(qa_nop, "qa_nop");
+
+static int
+sum_shorts(short *p, int nshorts)
+{
+  int total = 0;
+  for (int i = 0; i < nshorts; i++)
+    total += p[i];
+
+  return total;
+}
+
+static void
+qa_sum_shorts(const gc_job_direct_args_t *input _UNUSED,
+             gc_job_direct_args_t *output,
+             const gc_job_ea_args_t *eaa)
+{
+  for (unsigned int i = 0; i < eaa->nargs; i++){
+    short *p = eaa->arg[i].ls_addr;
+    int n = eaa->arg[i].get_size / sizeof(short);
+    output->arg[i].s32 = sum_shorts(p, n);
+    //printf("qa_sum_shorts(%p, %d) = %d\n",  p, n, output->arg[i].s32);
+  }
+}
+
+GC_DECLARE_PROC(qa_sum_shorts, "qa_sum_shorts");
+
+static void
+write_seq(unsigned char *p, int nbytes, int counter)
+{
+  for (int i = 0; i < nbytes; i++)
+    p[i] = counter++;
+}
+
+static void
+qa_put_seq(const gc_job_direct_args_t *input,
+          gc_job_direct_args_t *output _UNUSED,
+          const gc_job_ea_args_t *eaa)
+{
+  int counter = input->arg[0].s32;
+
+  for (unsigned int i = 0; i < eaa->nargs; i++){
+    unsigned char *p = eaa->arg[i].ls_addr;
+    int n = eaa->arg[i].put_size;
+    write_seq(p, n, counter);
+    counter += n;
+  }
+}
+
+GC_DECLARE_PROC(qa_put_seq, "qa_put_seq");
+
+static void
+qa_copy(const gc_job_direct_args_t *input _UNUSED,
+       gc_job_direct_args_t *output,
+       const gc_job_ea_args_t *eaa)
+{
+  if (eaa->nargs != 2
+      || eaa->arg[0].direction != GCJD_DMA_PUT
+      || eaa->arg[1].direction != GCJD_DMA_GET){
+    output->arg[0].s32 = -1;
+    return;
+  }
+
+  output->arg[0].s32 = 0;
+  unsigned n = eaa->arg[0].put_size;
+  if (eaa->arg[1].get_size < n)
+    n = eaa->arg[1].get_size;
+  
+  memcpy(eaa->arg[0].ls_addr, eaa->arg[1].ls_addr, n);
+}
+
+GC_DECLARE_PROC(qa_copy, "qa_copy");





reply via email to

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