moduleid for eiger m3 and g2, but set only for g2

This commit is contained in:
2021-09-01 17:06:34 +02:00
parent 25d03f949e
commit a51deda2a4
22 changed files with 180 additions and 95 deletions

View File

@ -40,3 +40,4 @@ install(TARGETS gotthard2DetectorServer_virtual
)
configure_file(config_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/config_gotthard2.txt COPYONLY)
configure_file(detid_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/detid_gotthard2.txt COPYONLY)

View File

@ -33,6 +33,7 @@ $(PROGS): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
mv $(PROGS) $(DESTDIR)
cp config_gotthard2.txt $(DESTDIR)
cp detid_gotthard2.txt $s(DESTDIR)
rm $(main_src)*.o
clean:

View File

@ -127,7 +127,6 @@
#define MOD_ID_OFST (0)
#define MOD_ID_MSK (0x0000FFFF << MOD_ID_OFST)
#define MOD_MAX_VAL (0xFFFF)
/* ASIC registers --------------------------------------------------*/

View File

@ -287,16 +287,19 @@ u_int32_t getDetectorNumber() {
return bus_r(MCB_SERIAL_NO_REG);
}
int getModuleId() { return ((bus_r(MOD_ID_REG) & MOD_ID_MSK) >> MOD_ID_OFST); }
int getModuleId(int *ret, char *mess) {
return getModuleIdInFile(ret, mess, ID_FILE);
}
void setModuleId(int arg) {
LOG(logINFOBLUE, ("Setting Module Id to 0x%x\n", arg));
void setModuleId(int *ret, char *mess, int arg) {
*ret = setModuleIdInFile(mess, arg, ID_FILE);
if (*ret == FAIL) {
return;
}
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) & ~MOD_ID_MSK);
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) | ((arg << MOD_ID_OFST) & MOD_ID_MSK));
}
int getMaxModuleId() { return MOD_MAX_VAL; }
u_int64_t getDetectorMAC() {
#ifdef VIRTUAL
return 0;
@ -419,7 +422,10 @@ void setupDetector() {
sharedMemory_setStatus(IDLE);
setupUDPCommParameters();
#endif
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
if (initError == FAIL) {
return;
}
// pll defines
ALTERA_PLL_C10_SetDefines(REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL,
PLL_RESET_REG, PLL_RESET_READOUT_MSK,

View File

@ -3,6 +3,7 @@
#define REQRD_FRMWRE_VRSN (0x210527)
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
#define ID_FILE "detid_gotthard2.txt"
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)