commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7755 - in gnuradio/branches/developers/eb/gcell/src:


From: eb
Subject: [Commit-gnuradio] r7755 - in gnuradio/branches/developers/eb/gcell/src: include lib lib/spu
Date: Wed, 20 Feb 2008 13:43:18 -0700 (MST)

Author: eb
Date: 2008-02-20 13:43:17 -0700 (Wed, 20 Feb 2008)
New Revision: 7755

Modified:
   gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h
   gnuradio/branches/developers/eb/gcell/src/include/gc_mbox.h
   gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.h
   gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
   gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.h
   gnuradio/branches/developers/eb/gcell/src/lib/qa_job_manager.cc
   gnuradio/branches/developers/eb/gcell/src/lib/spu/gcell_spu_main.c
Log:
Added method to return maximum size of EA args.


Modified: gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h     
2008-02-20 19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h     
2008-02-20 20:43:17 UTC (rev 7755)
@@ -77,7 +77,7 @@
 /*
  * We support two classes of arguments,
  *   "direct", which are contained in the gc_job_desc_args and
- *   "indirect", which are copied in/out according to info in gc_job_desc_args
+ *   "EA", which are copied in/out according to info in gc_job_desc_args
  */
 
 /*!

Modified: gnuradio/branches/developers/eb/gcell/src/include/gc_mbox.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_mbox.h 2008-02-20 
19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_mbox.h 2008-02-20 
20:43:17 UTC (rev 7755)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2008 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -39,12 +39,14 @@
 
 // PPE to SPE (sent via SPE Read Inbound Mailbox)
 
-#define OP_EXIT                0x0     // exit now
+#define OP_EXIT                        0x0     // exit now
+#define        OP_GET_SPU_BUFSIZE      0x1 
 
 // SPE to PPE (sent via SPE Write Outbound Interrupt Mailbox)
 
-#define OP_JOBS_DONE   0x1     // arg is 0 or 1, indicating which
-                               //  gc_completion_info_t contains the info
+#define OP_JOBS_DONE           0x2     // arg is 0 or 1, indicating which
+                                       //   gc_completion_info_t contains the 
info
+#define        OP_SPU_BUFSIZE          0x3     // arg is max number of bytes
 
 
 #endif /* INCLUDED_GC_MBOX_H */

Modified: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.h      
2008-02-20 19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.h      
2008-02-20 20:43:17 UTC (rev 7755)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2008 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -137,6 +137,14 @@
            gc_job_desc *jd[], bool done[], gc_wait_mode mode) = 0;
 
 
+  /*!
+   * Return the maximum number of bytes of EA arguments that may be
+   * copied to or from the SPE in a single job.  The limit applies
+   * independently to the "get" and "put" args.  
+   * \sa gc_job_desc_t, gc_job_ea_args_t
+   */
+  virtual int ea_args_maxsize() = 0;
+
   virtual void set_debug(int debug);
   virtual int debug();
 };

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-20 19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc        
2008-02-20 20:43:17 UTC (rev 7755)
@@ -114,7 +114,7 @@
   : d_debug(0), d_spu_args(0),
     d_eh_cond(&d_eh_mutex), d_eh_thread(0), d_eh_state(EHS_INIT),
     d_shutdown_requested(false),
-    d_client_thread(0)
+    d_client_thread(0), d_ea_args_maxsize(0)
 {
   if (!s_key_initialized){
     int r = pthread_key_create(&s_client_key, client_key_destructor);
@@ -724,6 +724,14 @@
 }
 
 void
+gc_job_manager_impl::set_ea_args_maxsize(int maxsize)
+{
+  omni_mutex_lock      l(d_eh_mutex);
+  d_ea_args_maxsize = maxsize;
+  d_eh_cond.broadcast();
+}
+
+void
 gc_job_manager_impl::print_event(spe_event_unit_t *evt)
 {
   printf("evt: spe = %d events = (0x%x)", evt->data.u32, evt->events);
@@ -875,6 +883,10 @@
          notify_clients_jobs_are_done(spe_num, MBOX_MSG_ARG(msg[i]));
          break;
 
+       case OP_SPU_BUFSIZE:
+         set_ea_args_maxsize(MBOX_MSG_ARG(msg[i]));
+         break;
+
        case OP_EXIT:
        default:
          printf("eh: Unexpected msg (0x%08x) from spu[%d]\n", msg[i], spe_num);
@@ -958,6 +970,9 @@
 
   set_eh_state(EHS_RUNNING);
 
+  // ask the first spe for its max bufsize
+  send_spe(0, MK_MBOX_MSG(OP_GET_SPU_BUFSIZE, 0));
+
   while (1){
     switch(d_eh_state){
 
@@ -1083,7 +1098,17 @@
   cti->d_free = 1;
 }
 
+int
+gc_job_manager_impl::ea_args_maxsize()
+{
+  omni_mutex_lock      l(d_eh_mutex);
 
+  while (d_ea_args_maxsize == 0)       // wait for it to be initialized
+    d_eh_cond.wait();
+
+  return d_ea_args_maxsize;
+}
+
 void
 gc_job_manager_impl::set_debug(int debug)
 {
@@ -1096,6 +1121,7 @@
 {
   return d_debug;
 }
+
 ////////////////////////////////////////////////////////////////////////
 
 worker_ctx::~worker_ctx()

Modified: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.h 
2008-02-20 19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.h 
2008-02-20 20:43:17 UTC (rev 7755)
@@ -133,12 +133,16 @@
   gc_jd_queue_t                *d_queue;               // job queue
   boost::shared_ptr<void> _d_queue_boost;      // hack for automatic storage 
mgmt
 
+  int                   d_ea_args_maxsize;
 
+
   gc_client_thread_info *alloc_cti();
   void free_cti(gc_client_thread_info *cti);
 
   void create_event_handler();
   void set_eh_state(evt_handler_state s);
+  void set_ea_args_maxsize(int maxsize);
+
   void notify_clients_jobs_are_done(unsigned int spe_num,
                                    unsigned int completion_info_idx);
 
@@ -232,6 +236,8 @@
 
   virtual void set_debug(int debug);
   virtual int debug();
+
+  virtual int ea_args_maxsize();
 };
 
 #endif /* INCLUDED_GC_JOB_MANAGER_IMPL_H */

Modified: gnuradio/branches/developers/eb/gcell/src/lib/qa_job_manager.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/qa_job_manager.cc     
2008-02-20 19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/lib/qa_job_manager.cc     
2008-02-20 20:43:17 UTC (rev 7755)
@@ -320,7 +320,6 @@
 
 static const int NS = 32768;
 static short short_buf[NS] _AL128;     // for known alignment
-static const int MAX_SPU_BUF = 32768;  // FIXME really comes from spu
 
 //
 // test all "get" alignments and sizes
@@ -333,19 +332,20 @@
   opts.nspes = 1;
   mgr = gc_make_job_manager(&opts);
 
+  int ea_args_maxsize = mgr->ea_args_maxsize();
 
   for (int i = 0; i < NS; i++) // init buffer with known qty
     short_buf[i] = 0x1234 + i;
   
-  for (int offset = 0; offset <= 256; offset++){
-    for (int len = 0; len <= 256; len++){
+  for (int offset = 0; offset <= 128; offset++){
+    for (int len = 0; len <= 128; len++){
       test_sum_shorts(mgr, &short_buf[offset], len);
     }
   }
 
-  // confirm maximum length (FIXME max really defined on spu)
-  for (int offset = 0; offset < 128; offset++){
-    test_sum_shorts(mgr, &short_buf[offset], MAX_SPU_BUF/sizeof(short));
+  // confirm maximum length
+  for (int offset = 0; offset <= 64; offset++){
+    test_sum_shorts(mgr, &short_buf[offset], ea_args_maxsize/sizeof(short));
   }
 
   delete mgr;

Modified: gnuradio/branches/developers/eb/gcell/src/lib/spu/gcell_spu_main.c
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/spu/gcell_spu_main.c  
2008-02-20 19:22:19 UTC (rev 7754)
+++ gnuradio/branches/developers/eb/gcell/src/lib/spu/gcell_spu_main.c  
2008-02-20 20:43:17 UTC (rev 7755)
@@ -375,6 +375,9 @@
        flush_completion_info();
        return;
       }
+      if (MBOX_MSG_OP(msg) == OP_GET_SPU_BUFSIZE){
+       spu_writech(SPU_WrOutIntrMbox, MK_MBOX_MSG(OP_SPU_BUFSIZE, 
GC_SPU_BUFSIZE_BASE));
+      }
     }
 
     // If we've got job completion info for the PPE and we can send a





reply via email to

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