From: muench Date: Thu, 11 May 2000 16:04:19 +0000 (+0000) Subject: Shower readout as in Giessen E-Test week 18 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a7888d90b2a7669fc42390e82d3c36a2017dedf6;p=daqdata.git Shower readout as in Giessen E-Test week 18 --- diff --git a/hadaq/hwship.c b/hadaq/hwship.c index da8e0ec..b5a3919 100644 --- a/hadaq/hwship.c +++ b/hadaq/hwship.c @@ -32,6 +32,7 @@ static int endOfData(HwShip *my) { } static void standbyMode(HwShip *my) { +#if 0 LVme_setW(my->lvme, ID_CTR_ACCESS_ON, 0); LVme_setW(my->lvme, ID_CTR_STANDBY_MODE, 0); LVme_setW(my->lvme, ID_CTR_SW_TO_LUT12, 0); @@ -54,9 +55,11 @@ static void standbyMode(HwShip *my) { LVme_setW(my->lvme, ADDON_ACCESS_ON, 0); LVme_setW(my->lvme, ADDON_STANDBY_MODE, 0); LVme_setW(my->lvme, ADDON_ACCESS_OFF, 0); +#endif } static void acquireMode(HwShip *my) { +#if 0 LVme_setW(my->lvme, ID_CTR_ACCESS_ON, 0); LVme_setW(my->lvme, ID_CTR_STANDBY_MODE, 0); LVme_setW(my->lvme, ID_CTR_SW_TO_LUT12, 0); @@ -81,6 +84,7 @@ static void acquireMode(HwShip *my) { LVme_setW(my->lvme, ADDON_SHOWER_MODE, 0); LVme_setW(my->lvme, ADDON_ACCESS_OFF, 0); LVme_setW(my->lvme, LVL2_ACCESS_ON, 0); +#endif } int conHwShip(HwShip * my, const char *name, const Param *param) @@ -99,6 +103,7 @@ int conHwShip(HwShip * my, const char *name, const Param *param) return -1; } my->trigNr = 0; + my->currAddr = 0xffffffff; /* behind end of memory */ standbyMode(my); acquireMode(my); @@ -114,7 +119,7 @@ void desHwShip(HwShip * my) void HwShip_requestBuffer(HwShip *my) { int i; -#if 1 +#if 0 if (my->oldBankConfirmed == bankConfirmed(my)) { msglog(LOG_ERR, "same bank twice: 0x%02x\n", my->oldBankConfirmed); } @@ -130,7 +135,8 @@ void HwShip_requestBuffer(HwShip *my) { nanosleep(t, NULL); #endif } - msglog(LOG_DEBUG, "data available\n"); + msglog(LOG_DEBUG, + "%d evts available\n", LVme_getW(my->lvme, LVL2_STAT_READ) >> 9 & 0x7f); i = bankRequested(my) == 1 ? 0 : 1; LVme_setW(my->lvme, LVL2_STAT_WRITE, (i << 1) | ZEROSUP); @@ -142,7 +148,14 @@ int HwShip_isBusy(HwShip *my) { } int HwShip_isEmpty(HwShip *my) { - return my->currAddr >= endOfData(my); + int retVal; + + if (my->currAddr == 0xffffffff) { + retVal = 1; + } else { + retVal = my->currAddr >= endOfData(my); + } + return retVal; } int HwShip_readSubEvt(HwShip *my, void *subEvt) { @@ -160,7 +173,7 @@ int HwShip_readSubEvt(HwShip *my, void *subEvt) { trigTag = SubEvt_trigNr(subEvt) & 0xff; -#if 1 +#if 0 if ((my->trigNr & 0xff) != trigTag) { msglog(LOG_ERR, "%s trigTag consistency: 0x%02x != 0x%02x offset: 0x%08x\n", my->name, my->trigNr, trigTag, my->currAddr); diff --git a/hadaq/hwship.h b/hadaq/hwship.h index 87b2374..f64826f 100644 --- a/hadaq/hwship.h +++ b/hadaq/hwship.h @@ -8,7 +8,7 @@ typedef struct HwShipS { char name[16]; LVme *lvme; - int currAddr; + unsigned currAddr; unsigned trigNr; UInt1 oldBankConfirmed; } HwShip; diff --git a/hadaq/hwshow.c b/hadaq/hwshow.c index 96963f1..65603fa 100644 --- a/hadaq/hwshow.c +++ b/hadaq/hwshow.c @@ -1,4 +1,4 @@ -static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwshow.c,v 6.3 2000-02-03 18:14:12 muench Stab $"; +static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwshow.c,v 6.4 2000-05-11 16:04:20 muench Exp $"; #define _POSIX_C_SOURCE 199309L #include @@ -13,7 +13,7 @@ static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/had #include "hwship.h" /* Set number of RCs here */ -#define NSHIPS 2 +#define NSHIPS 1 struct HardwareS { size_t maxSubEvtSize; diff --git a/hadaq/param.tcl b/hadaq/param.tcl index f28a9a4..6e28524 100644 --- a/hadaq/param.tcl +++ b/hadaq/param.tcl @@ -2,6 +2,8 @@ set soft(size) 1024 set dtu(cardbase) 0x44100000 +set ship0(cardbase) 0xC00000 +set ship1(cardbase) 0x800000 set race0(cardbase) 0x00000000 set race1(cardbase) 0x10000000 set tip0(cardbase) 0x10000000