commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7577 - in gnuradio/branches/developers/eb/gcell: . sr


From: eb
Subject: [Commit-gnuradio] r7577 - in gnuradio/branches/developers/eb/gcell: . src/apps src/include src/lib src/lib/spu
Date: Tue, 5 Feb 2008 14:44:47 -0700 (MST)

Author: eb
Date: 2008-02-05 14:44:46 -0700 (Tue, 05 Feb 2008)
New Revision: 7577

Modified:
   gnuradio/branches/developers/eb/gcell/Makefile.common
   gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc
   gnuradio/branches/developers/eb/gcell/src/include/gc_spu_args.h
   gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
   gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c
Log:
better...

Modified: gnuradio/branches/developers/eb/gcell/Makefile.common
===================================================================
--- gnuradio/branches/developers/eb/gcell/Makefile.common       2008-02-05 
21:30:19 UTC (rev 7576)
+++ gnuradio/branches/developers/eb/gcell/Makefile.common       2008-02-05 
21:44:46 UTC (rev 7577)
@@ -19,6 +19,8 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
+AM_CXXFLAGS = @autoconf_default_CXXFLAGS@
+
 IBM_PPU_SYNC_INCLUDES = -I$(top_srcdir)/src/ibm/sync/ppu_source
 IBM_SPU_SYNC_INCLUDES = -I$(top_srcdir)/src/ibm/sync/spu_source
 

Modified: gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc     
2008-02-05 21:30:19 UTC (rev 7576)
+++ gnuradio/branches/developers/eb/gcell/src/apps/benchmark_nop.cc     
2008-02-05 21:44:46 UTC (rev 7577)
@@ -40,7 +40,7 @@
 run_test(unsigned int nspes, unsigned int usecs)
 {
   static const int NJDS = 32;
-  static const int njobs = static_cast<int>(1e6);
+  static const int njobs = static_cast<int>(500e3);
   int nsubmitted = 0;
   int ncompleted = 0;
   gc_job_desc *all_jds[NJDS];
@@ -51,7 +51,7 @@
   
   gc_jm_options opts;
   opts.nspes = nspes;
-  // opts.gang_schedule = true;
+  opts.gang_schedule = true;
   gc_job_manager *mgr = gc_make_job_manager(&opts);
 
   // allocate and init all job descriptors

Modified: gnuradio/branches/developers/eb/gcell/src/include/gc_spu_args.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_spu_args.h     
2008-02-05 21:30:19 UTC (rev 7576)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_spu_args.h     
2008-02-05 21:44:46 UTC (rev 7577)
@@ -28,7 +28,7 @@
 typedef struct gc_spu_args {
   gc_eaddr_t   queue;          // address of job queue
   uint32_t     spu_idx;        // which spu we are: [0,nspus-1]
-  uint32_t     _pad;
+  uint32_t     nspus;          // number of spus we're using
 } _AL16 gc_spu_args_t;
 
 #endif /* INCLUDED_GC_SPU_ARGS_H */

Modified: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc        
2008-02-05 21:30:19 UTC (rev 7576)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc        
2008-02-05 21:44:46 UTC (rev 7577)
@@ -232,6 +232,7 @@
     d_worker[i].spu_args = &d_spu_args[i];
     d_worker[i].spu_args->queue = ptr_to_ea(d_queue);
     d_worker[i].spu_args->spu_idx = i;
+    d_worker[i].spu_args->nspus = d_options.nspes;
     d_worker[i].state = WS_INIT;
 
     int r = spe_program_load(d_worker[i].spe_ctx, spe_image);

Modified: gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c        
2008-02-05 21:30:19 UTC (rev 7576)
+++ gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c        
2008-02-05 21:44:46 UTC (rev 7577)
@@ -36,19 +36,45 @@
 //#define BACKOFF_CAP ((1 << 12) - 1)  // 4095 cycles, about 1.3 us
 //#define BACKOFF_CAP ((1 << 16) - 1)  // 65535 cycles, about 20.4 us
 #define BACKOFF_CAP ((1 << 18) - 1)    // 262143 cycles, about 81.9 us
+
 static unsigned int backoff;           // current backoff value in clock cycles
+static unsigned int _backoff_start;
+static unsigned int _backoff_shift;
+static unsigned int _backoff_addend;
 
+void
+backoff_init(void)
+{
+  // if lots of spus backoff quicker
+  if (spu_args.nspus > 8){
+    _backoff_shift = 2;
+    _backoff_addend = 0x3;
+  }
+  else {
+    _backoff_shift = 1;
+    _backoff_addend = 0x1;
+  }
+
+  // give them 4 different starting points
+  int s = 1 << (spu_args.spu_idx & 0x3);
+  _backoff_start = (s + s - 1) & BACKOFF_CAP;
+
+  backoff = _backoff_start;
+}
+
 void 
 backoff_reset(void)
 {
-  backoff = ((1 << (spu_args.spu_idx & 0x7)) + 1) & BACKOFF_CAP;
+  backoff = _backoff_start;
 }
 
 void
 backoff_delay(void)
 {
   gc_cdelay(backoff);
-  backoff = ((backoff << 1) + 1) & BACKOFF_CAP;        // capped exponential 
backoff
+
+  // capped exponential backoff
+  backoff = ((backoff << _backoff_shift) + _backoff_addend) & BACKOFF_CAP;
 }
 
 void
@@ -129,35 +155,8 @@
 
   // printf("spu[%d] queue = 0x%llx\n", spu_args.spu_idx, spu_args.queue);
 
-  backoff_reset();             // initialize our backoff counter
+  backoff_init();              // initialize backoff parameters
 
-#if 0
-  // check calibration on our two delay methods using DECREMENTER
-  spu_writech(SPU_WrDec, 0xffffffff);
-  int start, stop;
-  start = spu_readch(SPU_RdDec);
-  gc_udelay(1);
-  stop = spu_readch(SPU_RdDec);
-  printf("gc_udelay(1) -> %d decrementer counts\n", start - stop);
-  start = spu_readch(SPU_RdDec);
-  gc_udelay(100);
-  stop = spu_readch(SPU_RdDec);
-  printf("gc_udelay(100) -> %d decrementer counts\n", start - stop);
-  start = spu_readch(SPU_RdDec);
-  gc_udelay(200);
-  stop = spu_readch(SPU_RdDec);
-  printf("gc_udelay(200) -> %d decrementer counts\n", start - stop);
-
-  start = spu_readch(SPU_RdDec);
-  gc_cdelay(320000);
-  stop = spu_readch(SPU_RdDec);
-  printf("gc_cdelay(320000) -> %d decrementer counts\n", start - stop);
-  start = spu_readch(SPU_RdDec);
-  gc_cdelay(640000);
-  stop = spu_readch(SPU_RdDec);
-  printf("gc_cdelay(640000) -> %d decrementer counts\n", start - stop);
-#endif  
-
   main_loop();
   return 0;
 }





reply via email to

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