gotthard 2 server test bus

This commit is contained in:
maliakal_d 2019-10-01 17:34:52 +02:00
parent b3ff825ce8
commit 0f99dd141e
4 changed files with 12 additions and 11 deletions

View File

@ -1,15 +1,16 @@
#pragma once
/* Definitions for FPGA*/
#define REG_OFFSET (4)
#define BASE_CONTROL (0x000)
#define BASE_ACQUISITION (0x200)
#define BASE_UDP_RAM (0x1000)
/* Module Control Board Serial Number register */
#define MCB_SERIAL_NO_REG (0x00 + BASE_CONTROL)
#define MCB_SERIAL_NO_REG (0x000 * REG_OFFSET + BASE_CONTROL)
/* FPGA Version register */
#define FPGA_VERSION_REG (0x04 + BASE_CONTROL)
#define FPGA_VERSION_REG (0x001 * REG_OFFSET + BASE_CONTROL)
#define FPGA_COMPILATION_DATE_OFST (0)
#define FPGA_COMPILATION_DATE_MSK (0x00FFFFFF << FPGA_COMPILATION_DATE_OFST)
@ -17,7 +18,7 @@
#define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST)
/* API Version register */
#define API_VERSION_REG (0x08 + BASE_CONTROL)
#define API_VERSION_REG (0x002 * REG_OFFSET + BASE_CONTROL)
#define API_VERSION_OFST (0)
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
@ -25,20 +26,22 @@
#define API_VERSION_DETECTOR_TYPE_MSK (0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) //Not used in software
/* Fix pattern register */
#define FIX_PATT_REG (0x0D + BASE_CONTROL)
#define FIX_PATT_REG (0x003 * REG_OFFSET + BASE_CONTROL)
#define FIX_PATT_VAL (0xACDC2019)
/* Status register */
#define STATUS_REG (0x12 + BASE_CONTROL)
#define STATUS_REG (0x004 * REG_OFFSET + BASE_CONTROL)
#ifdef VIRTUAL
#define RUN_BUSY_OFST (0)
#define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST)
#endif
/* Look at me register */
#define LOOK_AT_ME_REG (0x16 + BASE_CONTROL)
/* Look at me read only register */
#define LOOK_AT_ME_REG (0x005 * REG_OFFSET + BASE_CONTROL)
/** DTA Offset Register */
#define DTA_OFFSET_REG (0x104 * REG_OFFSET + BASE_CONTROL)
/* Pattern Control FPGA registers TODO --------------------------------------------------*/

View File

@ -73,7 +73,7 @@ void basictests() {
return;
}
// does check only if flag is 0 (by default), set by command line
if ((!debugflag) && ((testFpga() == FAIL))) {
if ((!debugflag) && ((testFpga() == FAIL) || (testBus() == FAIL))) {
sprintf(firmware_message,
"Could not pass basic tests of FPGA and bus. Dangerous to continue. (Firmware version:0x%llx) \n", getDetectorId(DETECTOR_FIRMWARE_VERSION));
FILE_LOG(logERROR, ("%s\n\n", firmware_message));
@ -193,7 +193,7 @@ int testBus() {
FILE_LOG(logINFO, ("Testing Bus:\n"));
int ret = OK;
u_int32_t addr = LOOK_AT_ME_REG;
u_int32_t addr = DTA_OFFSET_REG;
int times = 1000 * 1000;
int i = 0;

View File

@ -37,8 +37,6 @@ void basictests();
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
int checkType();
int testFpga();
#endif
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD)
int testBus();
#endif