commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: eb
Subject: [Commit-gnuradio] r7075 - in gnuradio/branches/developers/eb/gcell/src: include lib lib/spu spu-include
Date: Wed, 5 Dec 2007 13:37:55 -0700 (MST)

Author: eb
Date: 2007-12-05 13:37:55 -0700 (Wed, 05 Dec 2007)
New Revision: 7075

Added:
   gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue_data.h
   gnuradio/branches/developers/eb/gcell/src/spu-include/gc_jd_queue.h
Modified:
   gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue.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:
work-in-progress on cell job scheduler

Modified: gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue.h     
2007-12-05 07:30:39 UTC (rev 7074)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue.h     
2007-12-05 20:37:55 UTC (rev 7075)
@@ -22,37 +22,11 @@
 #ifndef INCLUDED_GC_JD_QUEUE_H
 #define INCLUDED_GC_JD_QUEUE_H
 
-#include "gc_types.h"
-#include "gc_job_desc.h"
+#include "gc_jd_queue_data.h"
 
 __GC_BEGIN_DECLS
 
 /*!
- * \brief (Lock free someday...) queue for job descriptors
- *
- * This is the main data structure shared between PPEs and SPEs.
- * It is used to enqueue work for SPEs.  SPEs or PPEs may enqueue
- * work.  SPE's dequeue from here.
- *
- * This is aligned to a cache line, and fills the cache line,
- * to avoid inadvertently losing reservations created with
- * the load-and-reserve instructions.
- *
- * FIXME make it lock free ;)  For now, use a spin lock.
- */
-
-typedef struct gc_jd_queue
-{
-  gc_eaddr_t   head;
-  gc_eaddr_t   tail;
-  uint32_t     mutex;          // libsync mutex (spin lock)
-
-  // pad out to a full cache line
-  uint8_t      _pad[128 - 2*sizeof(gc_eaddr_t) - sizeof(uint32_t)];    
-} _AL128 gc_jd_queue_t;
-
-
-/*!
  * \brief Initialize the queue to empty.
  */
 void 

Added: gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue_data.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue_data.h        
                        (rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue_data.h        
2007-12-05 20:37:55 UTC (rev 7075)
@@ -0,0 +1,51 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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_GC_JD_QUEUE_DATA_H
+#define INCLUDED_GC_JD_QUEUE_DATA_H
+
+#include "gc_types.h"
+#include "gc_job_desc.h"
+
+__GC_BEGIN_DECLS
+
+/*!
+ * \brief (Lock free someday...) queue for job descriptors
+ *
+ * This is the main data structure shared between PPEs and SPEs.
+ * It is used to enqueue work for SPEs.  SPEs or PPEs may enqueue
+ * work.  SPE's dequeue from here.
+ *
+ * FIXME make it lock free ;)  For now, use a spin lock.
+ */
+typedef struct gc_jd_queue
+{
+  gc_eaddr_t   head _AL16;
+  gc_eaddr_t   tail _AL16;
+  uint32_t     mutex;          // libsync mutex (spin lock)
+} gc_jd_queue_t;
+
+
+__GC_END_DECLS
+
+#endif /* INCLUDED_GC_JD_QUEUE_DATA_H */
+
+


Property changes on: 
gnuradio/branches/developers/eb/gcell/src/include/gc_jd_queue_data.h
___________________________________________________________________
Name: svn:eol-style
   + native

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        
2007-12-05 07:30:39 UTC (rev 7074)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc        
2007-12-05 20:37:55 UTC (rev 7075)
@@ -520,17 +520,17 @@
       for (int i = 0; i < n; i++){
        switch(MBOX_MSG_OP(msg[i])){
        case OP_JOB_DONE:
-         printf("job_done (0x%08x) from spe[%d]\n", msg[i], spe_num);
+         printf("job_done (0x%08x) from spu[%d]\n", msg[i], spe_num);
          break;
 
        case OP_PING_REPLY:
-         printf("ping_reply (0x%08x) from spe[%d]\n", msg[i], spe_num);
+         printf("ping_reply (0x%08x) from spu[%d]\n", msg[i], spe_num);
          break;
 
        case OP_EXIT:
        case OP_PING:
        default:
-         printf("Unexpected msg (0x%08x) from spe[%d]\n", msg[i], spe_num);
+         printf("Unexpected msg (0x%08x) from spu[%d]\n", msg[i], spe_num);
          break;
        }
       }
@@ -551,35 +551,35 @@
     else {
       switch (si.stop_reason){
       case SPE_EXIT:
-       printf("spe[%d] SPE_EXIT w/ exit_code = %d\n",
+       printf("eh: spu[%d] SPE_EXIT w/ exit_code = %d\n",
               spe_num, si.result.spe_exit_code);
        break;
       case SPE_STOP_AND_SIGNAL:
-       printf("spe[%d] SPE_STOP_AND_SIGNAL w/ spe_signal_code = 0x%x\n",
+       printf("eh: spu[%d] SPE_STOP_AND_SIGNAL w/ spe_signal_code = 0x%x\n",
               spe_num, si.result.spe_signal_code);
        break;
       case SPE_RUNTIME_ERROR:
-       printf("spe[%d] SPE_RUNTIME_ERROR w/ spe_runtime_error = 0x%x\n",
+       printf("eh: spu[%d] SPE_RUNTIME_ERROR w/ spe_runtime_error = 0x%x\n",
               spe_num, si.result.spe_runtime_error);
        break;
       case SPE_RUNTIME_EXCEPTION:
-       printf("spe[%d] SPE_RUNTIME_EXCEPTION w/ spe_runtime_exception = 
0x%x\n",
+       printf("eh: spu[%d] SPE_RUNTIME_EXCEPTION w/ spe_runtime_exception = 
0x%x\n",
               spe_num, si.result.spe_runtime_exception);
        break;
       case SPE_RUNTIME_FATAL:
-       printf("spe[%d] SPE_RUNTIME_FATAL w/ spe_runtime_fatal = 0x%x\n",
+       printf("eh: spu[%d] SPE_RUNTIME_FATAL w/ spe_runtime_fatal = 0x%x\n",
               spe_num, si.result.spe_runtime_fatal);
        break;
       case SPE_CALLBACK_ERROR:
-       printf("spe[%d] SPE_CALLBACK_ERROR w/ spe_callback_error = 0x%x\n",
+       printf("eh: spu[%d] SPE_CALLBACK_ERROR w/ spe_callback_error = 0x%x\n",
               spe_num, si.result.spe_callback_error);
        break;
       case SPE_ISOLATION_ERROR:
-       printf("spe[%d] SPE_ISOLATION_ERROR w/ spe_isolation_error = 0x%x\n",
+       printf("eh: spu[%d] SPE_ISOLATION_ERROR w/ spe_isolation_error = 
0x%x\n",
               spe_num, si.result.spe_isolation_error);
        break;
       default:
-       printf("spe[%d] UNKNOWN STOP REASON (%d) w/ spu_status = 0x%x\n",
+       printf("eh: spu[%d] UNKNOWN STOP REASON (%d) w/ spu_status = 0x%x\n",
               spe_num, si.stop_reason, si.spu_status);
        break;
       }

Modified: gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c        
2007-12-05 07:30:39 UTC (rev 7074)
+++ gnuradio/branches/developers/eb/gcell/src/lib/spu/test_spu.c        
2007-12-05 20:37:55 UTC (rev 7075)
@@ -21,21 +21,31 @@
 
 #include <stdio.h>
 #include <spu_intrinsics.h>
+#include <spu_mfcio.h>
 #include "gc_spu_args.h"
 #include "gc_mbox.h"
 
+gc_spu_args_t  spu_args;
+
 int main(unsigned long long spe_id,
         unsigned long long argp,
         unsigned long long envp)
 {
-  printf("Hello Cell (0x%llx, 0x%llx, 0x%llx)\n",
-        spe_id, argp, envp);
+  int tag = 0;
 
+  // start the dma to get the args
+  mfc_get(&spu_args, argp, sizeof(spu_args), tag, 0, 0);
+
+  mfc_write_tag_mask(1 << tag);                // the tag we're interested in
+  mfc_read_tag_status_all();           // wait for DMA to complete
+
+  printf("spu[%d] queue = 0x%llx\n", spu_args.spu_idx, spu_args.queue);
+
   while (1){
     int cnt = spu_readchcnt(SPU_RdInMbox);
     if (unlikely(cnt > 0)){
       int msg = spu_readch(SPU_RdInMbox);
-      printf("mbox_msg: 0x%08x\n", msg);
+      printf("spu[%d] mbox_msg: 0x%08x\n", spu_args.spu_idx, msg);
       if (MBOX_MSG_OP(msg) == OP_EXIT)
        return 0;
     }

Added: gnuradio/branches/developers/eb/gcell/src/spu-include/gc_jd_queue.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/spu-include/gc_jd_queue.h         
                (rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/spu-include/gc_jd_queue.h 
2007-12-05 20:37:55 UTC (rev 7075)
@@ -0,0 +1,48 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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_SPU_GC_JD_QUEUE_H
+#define INCLUDED_SPU_GC_JD_QUEUE_H
+
+#include "gc_jd_queue_data.h"
+
+/*
+ * Declarations for SPU side of job queue interface
+ */
+
+__GC_BEGIN_DECLS
+
+/*!
+ * \brief Remove and return item at head of queue.
+ *
+ * \param[in]  q is EA address of queue structure.
+ * \param[out] item_ea is EA address of item at head of queue.
+ * \param[out] item is local store copy of item at head of queue.
+ * \returns false if the queue is empty, otherwise returns true
+ *   and sets \p item_ea and DMA's job descriptor into \p item
+ */
+bool 
+gc_jd_queue_dequeue(gc_eaddr_t q, gc_eaddr_t *item_ea, gc_job_desc_t *item);
+
+__GC_END_DECLS
+
+
+#endif /* INCLUDED_SPU_GC_JD_QUEUE_H */


Property changes on: 
gnuradio/branches/developers/eb/gcell/src/spu-include/gc_jd_queue.h
___________________________________________________________________
Name: svn:eol-style
   + native





reply via email to

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