commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: eb
Subject: [Commit-gnuradio] r6974 - in gnuradio/branches/developers/eb/gcell: . src/include src/lib
Date: Fri, 16 Nov 2007 18:09:03 -0700 (MST)

Author: eb
Date: 2007-11-16 18:08:56 -0700 (Fri, 16 Nov 2007)
New Revision: 6974

Added:
   gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h
   gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc_private.h
Removed:
   gnuradio/branches/developers/eb/gcell/src/include/gc_job.h
   gnuradio/branches/developers/eb/gcell/src/include/gc_job_private.h
Modified:
   gnuradio/branches/developers/eb/gcell/bootstrap
   gnuradio/branches/developers/eb/gcell/configure.ac
   gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h
   gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc
Log:
work-in-progress on cell job manager

Modified: gnuradio/branches/developers/eb/gcell/bootstrap
===================================================================
--- gnuradio/branches/developers/eb/gcell/bootstrap     2007-11-17 01:07:30 UTC 
(rev 6973)
+++ gnuradio/branches/developers/eb/gcell/bootstrap     2007-11-17 01:08:56 UTC 
(rev 6974)
@@ -26,4 +26,4 @@
 autoconf
 autoheader
 libtoolize --automake
-automake --add-missing
+automake --add-missing -Wno-portability

Modified: gnuradio/branches/developers/eb/gcell/configure.ac
===================================================================
--- gnuradio/branches/developers/eb/gcell/configure.ac  2007-11-17 01:07:30 UTC 
(rev 6973)
+++ gnuradio/branches/developers/eb/gcell/configure.ac  2007-11-17 01:08:56 UTC 
(rev 6974)
@@ -20,7 +20,7 @@
 AC_INIT
 AC_PREREQ(2.57)
 AM_CONFIG_HEADER(config.h)
-AC_CONFIG_SRCDIR([src/include/gc_job.h])
+AC_CONFIG_SRCDIR([src/include/gc_job_desc.h])
 
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST

Deleted: gnuradio/branches/developers/eb/gcell/src/include/gc_job.h

Copied: gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h (from 
rev 6902, gnuradio/branches/developers/eb/gcell/src/include/gc_job.h)
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h             
                (rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc.h     
2007-11-17 01:08:56 UTC (rev 6974)
@@ -0,0 +1,141 @@
+/* -*- 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_JOB_DESC_H
+#define INCLUDED_GC_JOB_DESC_H
+
+/*!
+ * This file contains the structures that are used to describe how to
+ * call "jobs" that execute on the SPEs.  A "job" is a task, or piece of
+ * work that you want to run on an SPE.
+ *
+ * There is code running in the SPE that knows how to interpret
+ * these job descriptions. Thus, in most cases, the overhead
+ * of invoking these is very low.
+ *
+ * The whole "job idea" is SPE centric.  At first pass,
+ * the PPE will be constructing jobs and enqueing them.
+ * However, there is nothing in the implementation that
+ * prohibits SPEs from creating their own jobs in the
+ * future.  Also, there is nothing prohibiting SPE-to-SPE
+ * DMA's.
+ *
+ * SPE's dequeue and "pull" jobs to themselves, do the work, then
+ * notify the entity that submitted the job.
+ */
+
+#include "gc_types.h"
+#include "gc_job_desc_private.h"
+
+/*
+ * This is C, not C++ code...
+ *
+ * ...and is used by both PPE and SPE code
+ */
+__GC_BEGIN_DECLS
+
+
+//! opaque ID that specifies which code to invoke on the SPE
+typedef uint32_t gc_method_t;
+
+//! final job status
+typedef enum {
+  JS_OK,
+  JS_UNKNOWN_METHOD,       // didn't recognize the method ID
+  JS_BAD_SIGNATURE,        // arg counts and/or types are wrong
+  JS_BAD_ALIGNMENT,        // indirect arg EA not 16-byte aligned
+  JS_BAD_LENGTH,           // indirect arg length not a multiple of 16 bytes 
long
+} gc_job_status_t;
+
+#define MAX_ARGS_DIRECT                8
+#define MAX_ARGS_INDIRECT      8
+
+/*
+ * 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
+ */
+
+/*!
+ * \brief Tag type of "direct" argument
+ */
+typedef enum {
+  GCT_S32,
+  GCT_U32,
+  GCT_S64,
+  GCT_U64,
+  GCT_FLOAT,
+  GCT_DOUBLE,
+  GCT_FLT_CMPLX,
+  GCT_DBL_CMPLX,
+  GCT_EADDR,
+} gc_tag_t;
+
+
+/*!
+ * \brief union for passing "direct" argument
+ */
+typedef union gc_arg_union
+{
+  int32_t       s32;
+  uint32_t      u32;
+  int64_t       s64;
+  uint64_t      u64;
+  float                 f;
+  double        d;
+  //float complex       fc;    //  64-bits (C99)
+  //double complex dc;    // 128-bits (C99)
+  gc_eaddr_t    ea;    //  64-bits
+} _AL16 gc_arg_union_t;
+
+
+/*!
+ * \brief input or output arguments
+ */
+typedef struct gc_job_args
+{
+  uint32_t      n_by_val;                         // # of "value" args
+  uint32_t      n_by_ref;                         // # of "indirct" args 
(DMA'd in/out)
+  uint32_t      _pad[2];                          // (padding)
+  gc_tag_t      dir_tag[MAX_ARGS_DIRECT] _AL16;   // type of "direct" 
argument[i]
+  gc_arg_union_t dir_val[MAX_ARGS_DIRECT] _AL16;   // "direct" argument values
+  uint32_t      ind_len[MAX_ARGS_INDIRECT] _AL16; // length in bytes of 
"indirect" arg[i]
+  gc_eaddr_t    ind_ea[MAX_ARGS_INDIRECT] _AL16;  // address of "indirect" 
arg[i]
+} _AL16 gc_job_args_t;
+
+
+/*!
+ * \brief "job description" that is DMA'd to/from the SPE.
+ */
+typedef struct gc_job_desc
+{
+  gc_job_desc_private_t  sys;  // internals
+  gc_method_t      method;     // specifies what to run (details to follow)
+  gc_job_status_t   status;    // what happened (output)
+  gc_job_args_t            input;      // input args (to SPE)
+  gc_job_args_t            output;     // output args (from SPE)
+
+} _AL128 gc_job_desc_t;
+
+
+__GC_END_DECLS
+
+#endif /* INCLUDED_GC_JOB_DESC_H */

Copied: gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc_private.h 
(from rev 6902, 
gnuradio/branches/developers/eb/gcell/src/include/gc_job_private.h)
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc_private.h     
                        (rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_job_desc_private.h     
2007-11-17 01:08:56 UTC (rev 6974)
@@ -0,0 +1,42 @@
+/* -*- 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_JOB_DESC_PRIVATE_H
+#define INCLUDED_GC_JOB_DESC_PRIVATE_H
+
+// #include <libsync.h>
+
+/*!
+ * \brief Implementation details we'd like to hide from the user.
+ */
+typedef struct gc_job_desc_private
+{
+  gc_eaddr_t   link;           // used to implement job queue
+
+  // FIXME:
+  // notifier_method
+  // notifier_arg
+  // location (where we're running)
+  
+} gc_job_desc_private_t;
+
+#endif /* INCLUDED_GC_JOB_PRIVATE_H */
+

Modified: gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h  
2007-11-17 01:07:30 UTC (rev 6973)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h  
2007-11-17 01:08:56 UTC (rev 6974)
@@ -22,13 +22,106 @@
 #ifndef INCLUDED_GC_JOB_MANAGER_H
 #define INCLUDED_GC_JOB_MANAGER_H
 
-#include "gc_job.h"
+#include "gc_job_desc.h"
 
+class gc_job_manager;
+
+/*
+ * \brief Create an instance of the job manager
+ */
+gc_job_manager *
+gc_make_job_manager(int nspes = -1);
+
+
+
+/*!
+ * \brief Abstract class that manages SPE jobs.
+ *
+ * There is typically a single instance derived from this class.
+ * It is safe to call its methods from any thread.
+ */
 class gc_job_manager
 {
 public:
-  gc_job_manager();
-  ~gc_job_manager();
+  /*!
+   * \param nspes number of SPEs job manager should use.
+   * If nspes == -1, all available SPEs will be allocated.
+   */
+   */
+  gc_job_manager(int nspes = -1);
+  virtual ~gc_job_manager();
+
+  /*!
+   * Stop accepting new jobs.  Wait for existing jobs to complete.
+   * Return all managed SPE's to the system.
+   */
+  virtual bool shutdown() = 0;
+
+  /*!
+   * \brief Return number of SPE's currently allocated to job manager.
+   */
+  virtual int nspes() const = 0;
+
+  /*!
+   * \brief Set the number of spes allocated to the job manager to \p nspes.
+   *
+   * \param nspes number of SPEs job manager should use.
+   *
+   * If nspes == -1, all available SPEs will be allocated.
+   * This method blocks until the number of managed spes has been adjusted.
+   */
+  virtual bool set_nspes(int nspes) = 0;
+
+  /*!
+   * \brief Return a pointer to a properly aligned job descriptor.
+   * Throws if none are available.
+   */
+  virtual gc_job_desc *alloc_job_desc() = 0;
+
+  /*
+   *! Return a job descriptor previously allocated with alloc_job_desc()
+   *
+   * \param[in] jd pointer to job descriptor to free.
+   */
+  virtual void free_job_desc(gc_job_desc *jd) = 0;
+
+  /*!
+   * \brief Submit a job for asynchronous processing on an SPE.
+   *
+   * \param[in] jd pointer to job description
+   *
+   * The caller must not read or write the job description
+   * or any of the memory associated with any indirect arguments
+   * until after a successful call to wait_*.
+   *
+   * \returns true iff the job was successfully enqueued.
+   * If submit_job returns false, check jd->status for additional info.
+   */
+  virtual bool submit_job(gc_job_desc *jd) = 0;
+
+  /*!
+   * \brief Wait for specified job to complete.
+   */
+  virtual bool wait_job(gc_job_desc *jd) = 0;
+
+#if 0
+  /*!
+   * \brief Wait for any job to complete.
+   * \param[in] jobs vector of jobs
+   *
+   * FIXME need to return info about which jobs completed.
+   */
+  int wait_any_jobs(const std::vector<gc_job_desc *> &jobs);
+
+  /*!
+   * \brief Wait for alls jobs to complete.
+   * \param[in] jobs vector of jobs
+   *
+   * FIXME need to return info about which jobs completed.
+   */
+  int wait_all_jobs(const std::vector<gc_job_desc *> &jobs);
+#endif
+
 };
 
 

Deleted: gnuradio/branches/developers/eb/gcell/src/include/gc_job_private.h

Modified: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc     
2007-11-17 01:07:30 UTC (rev 6973)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc     
2007-11-17 01:08:56 UTC (rev 6974)
@@ -26,9 +26,11 @@
 
 gc_job_manager::gc_job_manager()
 {
+  // nop
 }
 
 gc_job_manager::~gc_job_manager()
 {
+  // nop
 }
 





reply via email to

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