]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
MDC readout for sam3 in oct02, tested, working -- mm
authorhadaq <hadaq>
Thu, 24 Oct 2002 16:45:39 +0000 (16:45 +0000)
committerhadaq <hadaq>
Thu, 24 Oct 2002 16:45:39 +0000 (16:45 +0000)
hadaq/hwmdc.c
hadaq/hwsam.c
hadaq/hwsam.h
hadaq/indent.pro
hadaq/param.tcl
hadaq/sam_defs.h
hadaq/startacq
hadaq/stopacq

index 2e6ecbe8c46a48028b576a86048849688f1139bc..d29731faa10d8baba9e1063af3d061f8c0f80067 100644 (file)
@@ -1,4 +1,5 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwmdc.c,v 6.20 2002-10-09 12:42:17 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwmdc.c,v 6.21 2002-10-24 16:45:39 hadaq Exp $";
+
 
 #define _POSIX_C_SOURCE 199309L
 #include <unistd.h>
@@ -8,16 +9,14 @@ static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hada
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h> 
-#include <sys/time.h>
+#include <time.h>
 #include <syslog.h>
 
 #include <allParam.h>
 #include "subevt.h"
 #include "hwsam.h"
 
-#define NSAMS 12
-
-#define SAMMASK ((1 << NSAMS) - 1)
+#define NSAMS 18
 
 struct HardwareS {
        size_t maxSubEvtSize;
@@ -51,7 +50,7 @@ Hardware *newHardware(void)
        my->maxSubEvtSize = SubEvt_hdrSize() + (NSAMS * 2564 * sizeof(uint32_t));
 
        for (i = 0; i < NSAMS; i++) {
-               char buf[16];
+               char buf[12];
 
                my->sam[i] = malloc(sizeof(HwSam));
                sprintf(buf, "sam%d", i);
@@ -78,69 +77,72 @@ void deleteHardware(Hardware *my)
        free(my);
 }
 
+#define N_POLL_MAX 60/NSAMS
 void Hardware_waitForTrigger(Hardware *my, void *partEvt)
 {
        int i;
-       unsigned long anySamIsBusy;
-
-       for (i = 0; i < NSAMS; i++) {
-               if (HwSam_isEmpty(my->sam[i])) {
-                       HwSam_requestBuffer(my->sam[i]);
-               }
-       }
-
-       /* make shure that all SAMS can deliver at least one sub event */
-       anySamIsBusy = SAMMASK;
-       do {
-               for (i = 0; i < NSAMS; i++) {
-                       if ((anySamIsBusy & (1 << i)) && !HwSam_isBusy(my->sam[i])) {
-                               anySamIsBusy &= ~(1 << i);
-                       } else {
-#if 0
-                               struct timespec tS, *t = &tS;
-                               t->tv_sec = 0;
-                               t->tv_nsec = 020000000;
-                               nanosleep(t, NULL);
-#endif
-                       }
-               }
-       } while (anySamIsBusy);
-}
-
-void Hardware_readout(Hardware *my, void *partEvt)
-{
-       int i;
+       int nPoll = 0;
+       int nRequests;
+       int firstSam=-1;
        void *subEvt = SubEvt_data(partEvt);
        static uint32_t trigNr = 0;
        uint32_t trigTag;
 
-       /* init partial event, necessary for  SubEvt_next() */
+       for (i = 0; i < NSAMS; i++) {
+               HwSam_requestBuffer(my->sam[i]);
+       }
+
+       /* init partial event, necessary for SubEvt_next() */
        SubEvt_setDecoding(partEvt, SubEvtDecoding_SubEvts);
        SubEvt_setId(partEvt, 0);
 
-       /* read all sams, check for common trigger tag */
-       for (i = 0; i < NSAMS; i++) {
-
-               HwSam_readSubEvt(my->sam[i], subEvt);
-               if (i == 0) {
-                       trigTag = SubEvt_trigNr(subEvt) & 0xff;
-               } else {
-                       if (trigTag != (SubEvt_trigNr(subEvt) & 0xff)) {
-                               SubEvt_setId(subEvt, SubEvt_id(subEvt) | 0x80000000UL);
-                               SubEvt_setId(partEvt, SubEvt_id(partEvt) | 0x80000000UL);
-                               syslog(LOG_ERR, "(%s)Trigger tag mismatch: 0x%08x != 0x%08x",
-                                       my->sam[i]->name,trigTag, SubEvt_trigNr(subEvt));
+       /* make shure that all SAMS have delivered one sub event */
+       /* check for common trigger tag */
+       nRequests = NSAMS;
+       do {
+               for (i = 0; i < NSAMS; i++) {
+                 if (HwSam_isBufRequested(my->sam[i])) {
+                       if(!HwSam_isBusy(my->sam[i])) {
+                         --nRequests;
+                         if(HwSam_readSubEvt(my->sam[i], subEvt)==0) {
+                           if (firstSam<0) {
+                                 trigTag = SubEvt_trigNr(subEvt) & 0xff;
+                                 firstSam=i;
+                           } else {
+                                 if (trigTag != (SubEvt_trigNr(subEvt) & 0xff)) {
+                                       SubEvt_setId(subEvt, SubEvt_id(subEvt) | 0x80000000UL);
+                                       SubEvt_setId(partEvt, SubEvt_id(partEvt) | 0x80000000UL);
+                                       syslog(LOG_ERR, "(%s)Trigger tag mismatch: 0x%08x (%d) != 0x%08x",
+                                               my->sam[i]->name,trigTag,firstSam,SubEvt_trigNr(subEvt));
+                                 }
+                           }
+                           subEvt=(void*)(((uint32_t)subEvt + *(uint32_t*)subEvt + 4) & 0xfffffff8);
+                         }
                        }
+                 }
                }
-               subEvt = SubEvt_next(partEvt, subEvt);
-       }
+#if 1
+               if (nPoll >= N_POLL_MAX && firstSam < 0) {
+                       struct timespec tS, *t = &tS;
+                       t->tv_sec = 0;
+                       t->tv_nsec = 020000000;
+                       nanosleep(t, NULL);
+               }
+               ++nPoll;
+#endif
+       } while (nRequests);
 
-    SubEvt_setTrigNr(partEvt, trigNr << 8 | trigTag);
+       SubEvt_setTrigNr(partEvt, trigNr << 8 | trigTag);
        SubEvt_setSize(partEvt, (char *)subEvt - (char *)partEvt);
-    trigNr++;
+       trigNr++;
 
        assert(SubEvt_size(partEvt) <= my->maxSubEvtSize);
 #ifndef NDEBUG
        syslog(LOG_DEBUG, "partEvt: %s", SubEvt_2charP(partEvt));
 #endif
 }
+
+void Hardware_readout(Hardware *my, void *partEvt)
+{
+/* code moved to waitForTrigger */
+}
index baf0bfa7a43de5954f54861e6b4f01935ee38cbd..cb9520acf8d595010f43323c2508f6212096c8a0 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwsam.c,v 6.12 2002-10-09 12:42:18 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwsam.c,v 6.13 2002-10-24 16:45:40 hadaq Exp $";
 
 #include <assert.h>
 #include <string.h>
@@ -15,124 +15,155 @@ static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hada
 #include "subevt.h"
 #include "sam_defs.h"
 #include "hwsam.h"
+#define SAM_BUFOFFSET 8
+#define SAM_BUFSIZE 0x4000
 
-#define BUFSIZE 0x1000
-
-static int bankRequested(HwSam *my) {
-  return LVme_tstBitL(my->cram, CRR, 0);
-}
-
-static int bankConfirmed(HwSam *my) {
-  return LVme_tstBitL(my->regs, VMSR, 0);
-}
-
-static int endOfData(HwSam *my) {
-  int i;
-
-  i = BUFSIZE * bankRequested(my);
-  return i + LVme_getL(my->cram, i);
-}
-
-int conHwSam(HwSam * my, const char *name, const Param *param)
+int conHwSam(HwSam *my, const char *name, const Param *param)
 {
-  unsigned long cardBase;
+       unsigned long cardBase;
        int paramWasFound;
-  int i;
+       int i;
 
-  assert(my != NULL);
+       assert(my != NULL);
 
-  strcpy(my->name, name);
+       strcpy(my->name, name);
 
        Param_getInt(param, my->name, "cardbase", &paramWasFound, &cardBase);
        if (!paramWasFound) {
                syslog(LOG_WARNING,
-                       "Parameter %s(%s) not found, default = 0", my->name, "cardbase");
+                        "Parameter %s(%s) not found, default = 0", my->name, "cardbase");
                cardBase = 0;
        }
+       my->cram = malloc(sizeof(LVme));
+       if (0 > conLVme(my->cram, cardBase, 0x10000L, 0x09, 0x0, 4)) {
+               syslog(LOG_ERR, "HwSam on %p not found", cardBase);
+               return -1;
+       }
+       my->regs = malloc(sizeof(LVme));
+       if (0 > conLVme(my->regs, cardBase, 0x10000L, 0x09, 0x4, 4)) {
+               syslog(LOG_ERR, "HwSam on %p not found", cardBase);
+               return -1;
+       }
+       my->bankRequested = LVme_tstBitL(my->cram, CRR, 0); /* assumes that init is done by Sam */
+       if(my->bankRequested == 1) {
+               syslog(LOG_ERR, "HwSam readout bit = 1, should be 0, intialization bug");
+       }
+       my->currAddr = SAM_BUFSIZE;
 
-  my->cram = malloc(sizeof(LVme));
-  if (0 > conLVme(my->cram, cardBase, 0x10000L, 0x09, 0x0, 4)) {
-    syslog(LOG_ERR, "HwSam on %p not found", cardBase);
-    return -1;
-  }
-  my->regs = malloc(sizeof(LVme));
-  if (0 > conLVme(my->regs, cardBase + 0x01000000, 0x10000L, 0x09, 0x4, 4)) {
-    syslog(LOG_ERR, "HwSam on %p not found", cardBase);
-    return -1;
-  }
-  my->currAddr = BUFSIZE;
-
-  return 0;
+       return 0;
 }
 
-void desHwSam(HwSam * my)
+void desHwSam(HwSam *my)
 {
-  desLVme(my->regs);
-  desLVme(my->cram);
+       desLVme(my->regs);
+       desLVme(my->cram);
 }
 
-void HwSam_requestBuffer(HwSam *my) {
-  int i;
+void HwSam_requestBuffer(HwSam *my)
+{
+       int i;
 
 #ifndef NDEBUG
-  syslog(LOG_DEBUG, "requestBuffer in");
+       syslog(LOG_DEBUG, "requestBuffer in");
 #endif
-  i = bankRequested(my) == 1 ? 0 : 1;
-  do {
-    if (i == 1) {
-      LVme_setBitL(my->cram, CRR, 0);
-    } else {
-      LVme_clrBitL(my->cram, CRR, 0);
-    }
-  } while (LVme_tstBitL(my->cram, CRR, 0) != i);
-
-  my->currAddr = BUFSIZE * bankRequested(my) + 8;
+       i = my->bankRequested == 1 ? 0 : 1;
+       do {
+               if (i == 1) {
+                       LVme_setBitL(my->cram, CRR, 0);
+               } else {
+                       LVme_clrBitL(my->cram, CRR, 0);
+               }
+       } while (LVme_tstBitL(my->cram, CRR, 0) != i);
+
+       my->currAddr = SAM_BUFSIZE * i + SAM_BUFOFFSET;
+       my->bankRequested = i;
+       my->endOfData = 0;
 #ifndef NDEBUG
-  syslog(LOG_DEBUG, "requestBuffer out");
+       syslog(LOG_DEBUG, "requestBuffer out");
 #endif
 }
 
-int HwSam_isBusy(HwSam *my) {
-  return bankRequested(my) != bankConfirmed(my);
-}
-
-int HwSam_isEmpty(HwSam *my) {
-  return my->currAddr >= endOfData(my);
-}
-
-void *HwSam_readSubEvt(HwSam *my, void *subEvt) {
-  uint32_t *data = (uint32_t *)subEvt;
-  int firstAddr;
-  int size;
+/* 5 RC Headers + Subevent Header + some data */
+#define SAM_NODATASIZE 0
+#define RC_HEADERLENGTH 12
+int HwSam_readSubEvt(HwSam *my, void *subEvt)
+{
+       uint32_t * dataStart = (uint32_t *) subEvt;
+       uint32_t * data;
+       int lastAddr;
+       int currAddr = my->currAddr;
+       int size, rcSize;
+       int rcSubEvt; /* pointer to length in rc sub-sub-event header */
 
 #ifndef NDEBUG
-  syslog(LOG_DEBUG, "readSubEvt in");
-#endif
-  size = LVme_getL(my->cram, my->currAddr);
-#ifndef NDEBUG
-  syslog(LOG_DEBUG, "readSubEvt currAddr: 0x%08x", my->currAddr);
+       syslog(LOG_DEBUG, "readSubEvt in");
+       syslog(LOG_DEBUG, "currAddr: 0x%08x", currAddr);
 #endif
-
-  if (my->currAddr + size > endOfData(my)) {
-    syslog(LOG_CRIT,"subEvt throw away : %d, %d", size, endOfData(my) - my->currAddr);
-    /* create impossible subEvt */
-    SubEvt_setSize(subEvt, SubEvt_hdrSize());
-    SubEvt_setDecoding(subEvt, SubEvtDecoding_16bitData);
-    SubEvt_setId(subEvt, SubEvtId_mdc);
-    SubEvt_setTrigNr(subEvt, 0x00000001); /* impossible with 1:1 */
-    my->currAddr = endOfData(my);  /* lie you have read whole bank */
-  } else {
-    /* copy one sub evt from RC to memory */
-    for (firstAddr = my->currAddr; my->currAddr - firstAddr < size; my->currAddr += 4) {
-         *data++ = LVme_getL(my->cram, my->currAddr);
-    }
+       size = LVme_getL(my->cram, currAddr);
+       lastAddr = currAddr + size;
+       my->endOfData = lastAddr;
+
+       if (size > SAM_BUFSIZE - SAM_BUFOFFSET) {
+               syslog(LOG_CRIT, "subEvt throw away : %d, %d", size, SAM_BUFSIZE-SAM_BUFOFFSET);
+               /* damaged data, no repair possible, skip subevent*/
+               return -1;
+       }
+       if(size <= SAM_NODATASIZE) {
+       /* skip dataless subevent */
+               return 1;
+       }
 #ifndef NDEBUG
-    syslog(LOG_DEBUG, "readSubEvt subevt: %s", SubEvt_2charP(subEvt));
+       syslog(LOG_DEBUG, "readSubEvt subevt: %s", SubEvt_2charP(subEvt));
 #endif
-  }
+       /* copy one sub evt from Sam to memory */
+       data = dataStart;
+       /* copy remaining header */
+       *++data = LVme_getL(my->cram, currAddr+=4);
+       *++data = LVme_getL(my->cram, currAddr+=4);
+       *++data = LVme_getL(my->cram, currAddr+=4);
+
+       rcSubEvt = (currAddr+=4);
+       while (rcSubEvt < lastAddr) {
+               /*
+                 Skip rc subevent header if no data: tag, length, rc-id.
+                 This hack belongs into the RC code
+                 where tags should be compared to internal counters.
+                 If inconsistent, debug data can be inserted marked by the 
+                  upermost bit on.
+               */
+               int rcSize16;
+               rcSize = LVme_getL(my->cram, currAddr+4);
+               rcSize16 = rcSize & 0xffff;
+               rcSubEvt += rcSize16 * 4 + RC_HEADERLENGTH;
+
+/* if no data ... cut roc header */
+/*
+               if( rcSize16 == 0) {
+                       size -= RC_HEADERLENGTH;
+                       currAddr += RC_HEADERLENGTH;
+               } else {
+*/
+                       *++data = LVme_getL(my->cram, currAddr);
+                       *++data = rcSize;
+                       *++data = LVme_getL(my->cram, currAddr+=8);
+                       while((currAddr+=4) < rcSubEvt) {
+                         *++data = LVme_getL(my->cram, currAddr);
+                       }
+/*
+               }
+*/
+       }
+       *dataStart = size;
 
 #ifndef NDEBUG
-  syslog(LOG_DEBUG, "readSubEvt out");
+       syslog(LOG_DEBUG, "readSubEvt out");
 #endif
-  return 0;
+       return 0;
 }
+
+
+
+
+
+
+
index 876f03602faaba439869cca7f021780b95f39381..509f141a28612bf55da3b97a1c1f719a18045f5f 100644 (file)
@@ -2,24 +2,42 @@
 #define HwSam_H
 
 #include <lvme.h>
-
 #include <allParam.h>
+#include "sam_defs.h"
 
 typedef struct HwSamS {
-  char name[16];
+  char name[12];
   LVme *cram;
   LVme *regs;
-  int bufSize;
+  int bankRequested;
   int currAddr;
+  int endOfData;
 } HwSam;
 
-
 int conHwSam(HwSam *my, const char *name, const Param *param);
 void desHwSam(HwSam *my);
+int HwSam_readSubEvt(HwSam *my, void *subEvt);
+
+static int bankConfirmed(HwSam *my)
+{
+       return LVme_tstBitL(my->regs, VMSR, 0);
+}
+
+static int HwSam_isBusy(HwSam *my)
+{
+       return my->bankRequested != bankConfirmed(my);
+}
+
+static int HwSam_isEmpty(HwSam *my)
+{
+       return my->currAddr >= my->endOfData;
+}
+
+static int HwSam_isBufRequested(HwSam *my)
+{
+       return my->endOfData == 0;
+}
 
 void HwSam_requestBuffer(HwSam *my);
-int HwSam_isBusy(HwSam *my);
-int HwSam_isEmpty(HwSam *my);
-void *HwSam_nextSubEvt(HwSam *my, void *subEvt);
 
 #endif
index fb1498cd91eab0dc0f0f16ceaa5fa524cc964c38..662ea32f6ec635717dc1f96635b0d853edefff7c 100644 (file)
@@ -30,6 +30,7 @@
 -T HwV488
 -T HwV556
 -T HwDtu
+-T HwSam
 -T HwRace
 -T HwShip
 -T LVme
index 027c8cb940acd440f603b42ec51b222de3737363..8fcb80c615dbf20868918d46782458525cf1e3c3 100644 (file)
@@ -20,18 +20,27 @@ set readout(file) ./daq_readout
 set readout(stndln) 0
 set readout(priority) -2
 
-set sam0(cardbase) 0x1C000000
-set sam1(cardbase) 0x2C000000
-set sam2(cardbase) 0x3C000000
-set sam3(cardbase) 0x7C000000
-set sam4(cardbase) 0x8C000000
-set sam5(cardbase) 0x9C000000
-set sam6(cardbase) 0xaC000000
-set sam7(cardbase) 0xbC000000
-set sam8(cardbase) 0xcC000000
-set sam9(cardbase) 0xdC000000
-set sam10(cardbase) 0xeC000000
-set sam11(cardbase) 0xfC000000
+set sam0(cardbase) 0x01000000
+set sam1(cardbase) 0x01100000
+set sam2(cardbase) 0x02000000
+set sam3(cardbase) 0x02100000
+set sam4(cardbase) 0x03000000
+set sam5(cardbase) 0x03100000
+
+set sam6(cardbase) 0x04000000
+set sam7(cardbase) 0x04100000
+set sam8(cardbase) 0x05000000
+set sam9(cardbase) 0x05100000
+set sam10(cardbase) 0x06000000
+set sam11(cardbase) 0x06100000
+
+set sam12(cardbase) 0x07000000
+set sam13(cardbase) 0x07100000
+set sam14(cardbase) 0x08000000
+set sam15(cardbase) 0x08100000
+
+set sam16(cardbase) 0x09000000
+set sam17(cardbase) 0x09100000
 
 set soft(size) 1024
 
@@ -133,327 +142,18 @@ set race9(status_id) 103
 set conc(cardbase)  0x18000000
 set mu(cardbase)    0xd0000000
 
-set tdc0(cardbase)  0x22000000
-set tdc0(threshold00) 0
-set tdc0(threshold01) 0
-set tdc0(threshold02) 0
-set tdc0(threshold03) 0
-set tdc0(threshold04) 0
-set tdc0(threshold05) 0
-set tdc0(threshold06) 0
-set tdc0(threshold07) 0
-set tdc0(threshold08) 0
-set tdc0(threshold09) 0
-set tdc0(threshold10) 0
-set tdc0(threshold11) 0
-set tdc0(threshold12) 0
-set tdc0(threshold13) 0
-set tdc0(threshold14) 0
-set tdc0(threshold15) 0
-set tdc0(threshold16) 0
-set tdc0(threshold17) 0
-set tdc0(threshold18) 0
-set tdc0(threshold19) 0
-set tdc0(threshold20) 0
-set tdc0(threshold21) 0
-set tdc0(threshold22) 0
-set tdc0(threshold23) 0
-set tdc0(threshold24) 0
-set tdc0(threshold25) 0
-set tdc0(threshold26) 0
-set tdc0(threshold27) 0
-set tdc0(threshold28) 0
-set tdc0(threshold29) 0
-set tdc0(threshold30) 0
-set tdc0(threshold31) 0
-set tdc0(range) 254
-set tdc0(vset) 255
-set tdc0(voff) 0
-
-set tdc1(cardbase) 0x22020000
-set tdc1(threshold00) 0
-set tdc1(threshold01) 0
-set tdc1(threshold02) 0
-set tdc1(threshold03) 0
-set tdc1(threshold04) 0
-set tdc1(threshold05) 0
-set tdc1(threshold06) 0
-set tdc1(threshold07) 0
-set tdc1(threshold08) 0
-set tdc1(threshold09) 0
-set tdc1(threshold10) 0
-set tdc1(threshold11) 0
-set tdc1(threshold12) 0
-set tdc1(threshold13) 0
-set tdc1(threshold14) 0
-set tdc1(threshold15) 0
-set tdc1(threshold16) 0
-set tdc1(threshold17) 0
-set tdc1(threshold18) 0
-set tdc1(threshold19) 0
-set tdc1(threshold20) 0
-set tdc1(threshold21) 0
-set tdc1(threshold22) 0
-set tdc1(threshold23) 0
-set tdc1(threshold24) 0
-set tdc1(threshold25) 0
-set tdc1(threshold26) 0
-set tdc1(threshold27) 0
-set tdc1(threshold28) 0
-set tdc1(threshold29) 0
-set tdc1(threshold30) 0
-set tdc1(threshold31) 0
-set tdc1(range) 254
-set tdc1(vset) 255
-set tdc1(voff) 0
-
-set tdc2(cardbase) 0x22040000
-set tdc2(threshold00) 0
-set tdc2(threshold01) 0
-set tdc2(threshold02) 0
-set tdc2(threshold03) 0
-set tdc2(threshold04) 0
-set tdc2(threshold05) 0
-set tdc2(threshold06) 0
-set tdc2(threshold07) 0
-set tdc2(threshold08) 0
-set tdc2(threshold09) 0
-set tdc2(threshold10) 0
-set tdc2(threshold11) 0
-set tdc2(threshold12) 0
-set tdc2(threshold13) 0
-set tdc2(threshold14) 0
-set tdc2(threshold15) 0
-set tdc2(threshold16) 0
-set tdc2(threshold17) 0
-set tdc2(threshold18) 0
-set tdc2(threshold19) 0
-set tdc2(threshold20) 0
-set tdc2(threshold21) 0
-set tdc2(threshold22) 0
-set tdc2(threshold23) 0
-set tdc2(threshold24) 0
-set tdc2(threshold25) 0
-set tdc2(threshold26) 0
-set tdc2(threshold27) 0
-set tdc2(threshold28) 0
-set tdc2(threshold29) 0
-set tdc2(threshold30) 0
-set tdc2(threshold31) 0
-set tdc2(range) 255
-set tdc2(vset) 254
-set tdc2(voff) 0
-
-set tdc3(cardbase) 0x22060000
-set tdc3(threshold00) 0
-set tdc3(threshold01) 0
-set tdc3(threshold02) 0
-set tdc3(threshold03) 0
-set tdc3(threshold04) 0
-set tdc3(threshold05) 0
-set tdc3(threshold06) 0
-set tdc3(threshold07) 0
-set tdc3(threshold08) 0
-set tdc3(threshold09) 0
-set tdc3(threshold10) 0
-set tdc3(threshold11) 0
-set tdc3(threshold12) 0
-set tdc3(threshold13) 0
-set tdc3(threshold14) 0
-set tdc3(threshold15) 0
-set tdc3(threshold16) 0
-set tdc3(threshold17) 0
-set tdc3(threshold18) 0
-set tdc3(threshold19) 0
-set tdc3(threshold20) 0
-set tdc3(threshold21) 0
-set tdc3(threshold22) 0
-set tdc3(threshold23) 0
-set tdc3(threshold24) 0
-set tdc3(threshold25) 0
-set tdc3(threshold26) 0
-set tdc3(threshold27) 0
-set tdc3(threshold28) 0
-set tdc3(threshold29) 0
-set tdc3(threshold30) 0
-set tdc3(threshold31) 0
-set tdc3(vset) 148
-set tdc3(voff) 0
-set tdc3(fclr_win) 254
-set tdc3(clr_time) 0x8085
-
-set tdc4(cardbase) 0xdd000000
-set tdc4(threshold00) 0
-set tdc4(threshold01) 0
-set tdc4(threshold02) 0
-set tdc4(threshold03) 0
-set tdc4(threshold04) 0
-set tdc4(threshold05) 0
-set tdc4(threshold06) 0
-set tdc4(threshold07) 0
-set tdc4(threshold08) 0
-set tdc4(threshold09) 0
-set tdc4(threshold10) 0
-set tdc4(threshold11) 0
-set tdc4(threshold12) 0
-set tdc4(threshold13) 0
-set tdc4(threshold14) 0
-set tdc4(threshold15) 0
-set tdc4(threshold16) 0
-set tdc4(threshold17) 0
-set tdc4(threshold18) 0
-set tdc4(threshold19) 0
-set tdc4(threshold20) 0
-set tdc4(threshold21) 0
-set tdc4(threshold22) 0
-set tdc4(threshold23) 0
-set tdc4(threshold24) 0
-set tdc4(threshold25) 0
-set tdc4(threshold26) 0
-set tdc4(threshold27) 0
-set tdc4(threshold28) 0
-set tdc4(threshold29) 0
-set tdc4(threshold30) 0
-set tdc4(threshold31) 0
-set tdc4(vset) 148
-set tdc4(voff) 0
-set tdc4(fclr_win) 254
-set tdc4(clr_time) 0x8085
-
-set tdc5(cardbase) 0xdd020000
-set tdc5(threshold00) 0
-set tdc5(threshold01) 0
-set tdc5(threshold02) 0
-set tdc5(threshold03) 0
-set tdc5(threshold04) 0
-set tdc5(threshold05) 0
-set tdc5(threshold06) 0
-set tdc5(threshold07) 0
-set tdc5(threshold08) 0
-set tdc5(threshold09) 0
-set tdc5(threshold10) 0
-set tdc5(threshold11) 0
-set tdc5(threshold12) 0
-set tdc5(threshold13) 0
-set tdc5(threshold14) 0
-set tdc5(threshold15) 0
-set tdc5(threshold16) 0
-set tdc5(threshold17) 0
-set tdc5(threshold18) 0
-set tdc5(threshold19) 0
-set tdc5(threshold20) 0
-set tdc5(threshold21) 0
-set tdc5(threshold22) 0
-set tdc5(threshold23) 0
-set tdc5(threshold24) 0
-set tdc5(threshold25) 0
-set tdc5(threshold26) 0
-set tdc5(threshold27) 0
-set tdc5(threshold28) 0
-set tdc5(threshold29) 0
-set tdc5(threshold30) 0
-set tdc5(threshold31) 0
-set tdc5(vset) 148
-set tdc5(voff) 0
-set tdc5(fclr_win) 254
-set tdc5(clr_time) 0x8085
-
-set tdc6(cardbase) 0xdd040000
-set tdc6(threshold00) 0
-set tdc6(threshold01) 0
-set tdc6(threshold02) 0
-set tdc6(threshold03) 0
-set tdc6(threshold04) 0
-set tdc6(threshold05) 0
-set tdc6(threshold06) 0
-set tdc6(threshold07) 0
-set tdc6(threshold08) 0
-set tdc6(threshold09) 0
-set tdc6(threshold10) 0
-set tdc6(threshold11) 0
-set tdc6(threshold12) 0
-set tdc6(threshold13) 0
-set tdc6(threshold14) 0
-set tdc6(threshold15) 0
-set tdc6(threshold16) 0
-set tdc6(threshold17) 0
-set tdc6(threshold18) 0
-set tdc6(threshold19) 0
-set tdc6(threshold20) 0
-set tdc6(threshold21) 0
-set tdc6(threshold22) 0
-set tdc6(threshold23) 0
-set tdc6(threshold24) 0
-set tdc6(threshold25) 0
-set tdc6(threshold26) 0
-set tdc6(threshold27) 0
-set tdc6(threshold28) 0
-set tdc6(threshold29) 0
-set tdc6(threshold30) 0
-set tdc6(threshold31) 0
-set tdc6(vset) 148
-set tdc6(voff) 0
-set tdc6(fclr_win) 254
-set tdc6(clr_time) 0x8085
-
-set tdc7(cardbase) 0xdd060000
-set tdc7(threshold00) 0
-set tdc7(threshold01) 0
-set tdc7(threshold02) 0
-set tdc7(threshold03) 0
-set tdc7(threshold04) 0
-set tdc7(threshold05) 0
-set tdc7(threshold06) 0
-set tdc7(threshold07) 0
-set tdc7(threshold08) 0
-set tdc7(threshold09) 0
-set tdc7(threshold10) 0
-set tdc7(threshold11) 0
-set tdc7(threshold12) 0
-set tdc7(threshold13) 0
-set tdc7(threshold14) 0
-set tdc7(threshold15) 0
-set tdc7(threshold16) 0
-set tdc7(threshold17) 0
-set tdc7(threshold18) 0
-set tdc7(threshold19) 0
-set tdc7(threshold20) 0
-set tdc7(threshold21) 0
-set tdc7(threshold22) 0
-set tdc7(threshold23) 0
-set tdc7(threshold24) 0
-set tdc7(threshold25) 0
-set tdc7(threshold26) 0
-set tdc7(threshold27) 0
-set tdc7(threshold28) 0
-set tdc7(threshold29) 0
-set tdc7(threshold30) 0
-set tdc7(threshold31) 0
-set tdc7(vset) 148
-set tdc7(voff) 0
-set tdc7(fclr_win) 254
-set tdc7(clr_time) 0x8085
-
-set tdc8(cardbase) 0x200000
-set tdc8(id) 0x2005
-set tdc8(ctrl) 0x00ff
-set tdc8(thrl) 1
-set tdc8(thrh) 198
-set tdc8(range) 120;# 0 = 90ns, 224 = 770ns
-
-set tdc9(cardbase) 0x400000
-set tdc9(id) 0x2006
-set tdc9(ctrl) 0x00ff
-set tdc9(thrl) 1
-set tdc9(thrh) 198
-set tdc9(range) 120; #0 = 90 ns, 224 = 770ns
-
-set adc0(cardbase) 0x000000
-set adc0(id) 0x1007
-set adc0(ctrl) 0x00ff
-set adc0(thrl) 1
-set adc0(thrh) 198
-set adc0(delay) 0
-set adc0(range) 0
-
-set scaler0(cardbase) 0xa0000000
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
index b9f859b658f7effe5229208377c01bc24c2d2155..5ff20c89f3087dd79077c4a46b82dfadafb9b000 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef SAM_DEFS_H
 #define SAM_DEFS_H
 
-#define VMSR  0x0008
+#define VMSR  0x8004
 #define KSR   0x0004
 #define CRAM  0x0000
-#define CRR   0x1ffc
+#define CRR   0x8000
 
 #endif
index 1b518129b3e1be7f3ff8ec5bbd4ebf1b76876d12..fbd34de810b78d5a1d0454ca352f0f7e30ff89a6 100644 (file)
@@ -1,9 +1,4 @@
 :
-cd ../../slow
-echo "reseting mdc..."
-mdc_reset_sigbus
-mdc start
-cd -
 export DAQSLOW_PARAM_FILE=$HADES_BASE_DIR/mdc/hadaq/param.tcl
 
 ./daq_evtbuild -p -1 -v notice &
@@ -14,6 +9,4 @@ echo $! >readout.pid
 sleep 1
 export DAQSLOW_PARAM_FILE=$HADES_BASE_DIR/slow/mdc.tcl
 
-$HADES_BASE_DIR/bin/$SYSTYPE/dtuctrl start mdcctu 
-export DAQSLOW_PARAM_FILE=""
 exit 0
index b22857c1e039a26dc30675f539ba540b3f6e6100..22edc881f02be159d63256ca062c9af8c6b6775a 100644 (file)
@@ -1,14 +1,7 @@
 :
-export DAQSLOW_PARAM_FILE=$HADES_BASE_DIR/slow/mdc.tcl
-$HADES_BASE_DIR/bin/$SYSTYPE/dtuctrl stop mdcctu
-sleep 1
 kill $(cat readout.pid)
 rm readout.pid
 sleep 1
 kill $(cat evtbuild.pid)
 rm evtbuild.pid
-cd ../../slow
-mdc stop
-cd -
-export DAQSLOW_PARAM_FILE=""
 exit 0