Changeset 2037 in Sophya for trunk/ArchTOIPipe


Ignore:
Timestamp:
May 31, 2002, 10:10:58 AM (23 years ago)
Author:
ansari
Message:

Amelioration NoOpProcessor et mesovh2.cc pour investigation pb kill sur magique - Reza 31/5/2002

Location:
trunk/ArchTOIPipe
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/cgt.cc

    r2000 r2037  
    1111
    1212#include "cgt.h"
     13#include <typeinfo>
    1314#include "toiseqbuff.h"
    1415#include "toisegment.h"
     
    108109  //  for(it = lesProcs.begin(); it != lesProcs.end(); it++) {
    109110  for(int i=0; i< lesProcs.size(); i++) {
    110     os << " >> Proc Id= " << i << " @ " << hex << lesProcs[i] << dec << endl;
     111    os << " >> Proc Id= " << i << " @ " << hex << lesProcs[i] << dec ;
     112    string ctyp = typeid(*lesProcs[i]).name();
     113    os << " Type= " << ctyp << endl;
    111114    if (prstat) lesProcs[i]->PrintStatus(os);
    112115  }
     
    115118void CGT::ListTOIs(::ostream& os, bool prstat)
    116119{
    117   os << " --- CGT::ListTOIs() , NbProcs=" << lesTuyaux.size();
     120  os << " --- CGT::ListTOIs() , NbTOIs=" << lesTuyaux.size();
    118121  if ( fgSegmented ) os << " Default TOI: TOISegmented " << endl;
    119122  else os << " Default TOI: TOISeqBuffered " << endl;
     
    121124    os << " >> TOI " << lesTuyaux[i].toi->getName() << " Connecting Procs (Id): "
    122125       << lesTuyaux[i].pr1id << " <---> " << lesTuyaux[i].pr2id << endl;
    123     if (prstat) lesTuyaux[i].toi->PrintStatus(os);   
     126    if (prstat > 1)  lesTuyaux[i].toi->PrintStatus(os);   
     127    else if (prstat == 1) 
     128      os << " PutCountWait= " << lesTuyaux[i].toi->getCountWaitPut()
     129         << " GetCountWait= " << lesTuyaux[i].toi->getCountWaitGet() << endl;
    124130  } 
    125131}
  • trunk/ArchTOIPipe/Processors/nooppr.cc

    r1994 r2037  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: nooppr.cc,v 1.10 2002-05-13 13:11:32 ansari Exp $
     5// $Id: nooppr.cc,v 1.11 2002-05-31 08:10:58 ansari Exp $
    66
    77#include <typeinfo>
     
    1616  if (wsz < 1) wsz = 1;
    1717  wsize = wsz;
     18  delay2 = false;
    1819  totnscount = 0;
    1920}
     
    2526  os << "\n ------------------------------------------------------ \n"
    2627     << " NoOpProcessor::PrintStatus() - WindowSize="
    27      << WSize() << endl;
     28     << WSize();
     29  if (delay2) os << " Delay in2 ---> out2 " << endl;
     30  else os << endl;
    2831  os << " Total number of processed samples= " << ProcessedSampleCount()
    2932     << endl;
     
    9194      }
    9295      if (fgin2 || fgout2) {
    93         vin2 = new double[wsize];
    94         vfg2 = new uint_8[wsize];
    95         for(i=0; i<wsize; i++) {
     96        int wsz2 = wsize;
     97        if (delay2) wsz2 *= 2;
     98        vin2 = new double[wsz2];
     99        vfg2 = new uint_8[wsz2];
     100        for(i=0; i<wsz2; i++) {
    96101          vin2[i] = defval; vfg2[i] = defflag;
    97102        }       
     
    100105      // Boucle sur les sampleNum
    101106      // 1er partie, on traite par paquets de wsize
     107      int kd2 = 0;
     108      int lastk2in = 0;
    102109      for(k=snb;k<=sne-wsize+1;k+=wsize) {
    103110        if (fgin)
    104111          getData(0, k, wsize, vin, vfg);
    105         if (fgin2)
    106           getData(1, k, wsize, vin2, vfg2);
    107         totnbblock++;
     112        if (fgin2) {
     113          kd2 = (delay2) ? (kd2+1)%2 : 0;
     114          getData(1, k, wsize, vin2+kd2*wsize, vfg2+kd2*wsize);
     115          lastk2in = k;
     116        }
    108117        if (fgout)
    109118          putData(0, k, wsize, vin, vfg);
    110         if (fgout2) 
    111           putData(1, k, wsize, vin2, vfg2);
     119        if (fgout2 && (!delay2 || totnbblock > 1)) { 
     120          int kd2o = (delay2) ? (kd2+1)%2 : 0;
     121          int nextk2o = (delay2) ? lastk2in-wsize : lastk2in;
     122          putData(1, nextk2o, wsize, vin2+kd2o*wsize, vfg2+kd2o*wsize);
     123        }
    112124        klast+=wsize;
    113125        totnscount+=wsize;
    114126        totnbblock++;
     127      }
     128      if (fgout2 && delay2) {
     129        int kd2o = (kd2+1)%2;
     130        putData(1, lastk2in, wsize, vin2+kd2o*wsize, vfg2+kd2o*wsize);
     131       
    115132      }
    116133    }
  • trunk/ArchTOIPipe/Processors/nooppr.h

    r2033 r2037  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: nooppr.h,v 1.7 2002-05-30 20:44:31 ansari Exp $
     7// $Id: nooppr.h,v 1.8 2002-05-31 08:10:58 ansari Exp $
    88
    99
     
    2424  inline int    WSize() const { return wsize; }
    2525  inline void   SetWSize(int wsz)  { if (wsz > 1)  wsize =  wsz; }
     26  inline void   SetDelay2(bool fg) { delay2 = fg; }
    2627  inline int_8  ProcessedSampleCount() const { return totnscount; }
    2728
     
    3940
    4041  bool acceptnoinput;
     42  bool delay2;
    4143  double defval;
    4244  long defflag;
  • trunk/ArchTOIPipe/TestPipes/mesovh2.cc

    r2033 r2037  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: mesovh2.cc,v 1.3 2002-05-30 20:44:31 ansari Exp $
     5// $Id: mesovh2.cc,v 1.4 2002-05-31 08:10:58 ansari Exp $
    66/*   mesure de performance de l'architecture
    77
     
    3232  else {
    3333    cout << "\n Usage : mesovh2 [-dbg] [-start snb] [-end sne] \n"
    34          << "         [-intoi name] [-wtoi sz] [-wnoop sz] \n"
     34         << "         [-intoi name] [-wtoi sz] [-wnoop sz] [-delay2] \n"
    3535         << "         [-bipro sz2] [-tripro sz2,sz3] [-quadpro sz2,sz3,sz4] \n"
    3636         << "         [-pentapro sz2,sz3,sz4,sz5] [-hexapro sz2,sz3,sz4,sz5,sz6] \n"
     
    4343         << "   -wtoi sz : sets TOISeqBuff/TOISegmented buffer size (def= 1024)\n"
    4444         << "   -wnoop sz : sets NoOpProcessor window size \n"
     45         << "   -delay2 : Delay NoOpProcessor in2 --> out2 \n"
    4546         << "   -bipro sz2: chain 2 processors sz2= NoOpProcessor 2 window size\n"
    4647         << "   -tripro -quadpro -pentapro -hexapro ... chain 3-6 processors \n"
     
    6869  int wtoi = 1024;
    6970  int wnoop = 0;
     71  bool fgdelay2 = false;
    7072  int keepfft = 0;
    7173  int nmax = 10;
     
    134136      intoi2 = arg[ia+1]; ia++;
    135137    }   
     138    else if (strcmp(arg[ia],"-delay2") == 0)  fgdelay2 = true;
    136139    else if (strcmp(arg[ia],"-dbg") == 0)  dbglev = 1;
    137140    else if (strcmp(arg[ia],"-dbg2") == 0)  dbglev = 2;
     
    170173      noop[k].SetWSize(proc_wsz[k]);
    171174      cout << "> NoOpProcessor noop[" << k << "]  created WSz=" << proc_wsz[k] << endl;
     175      if (fgdelay2) {
     176        cout << "  Setting noop[" << k << "].SetDelay2( true ) " << endl;
     177        noop[k].SetDelay2( true );
     178      }
    172179    }
    173180   
     
    200207    }
    201208   
     209    plombier.ListTOIs(cout, 1);
    202210
    203211    mgr->joinAll();
Note: See TracChangeset for help on using the changeset viewer.