diff --git a/README.md b/README.md index be637d19a12ba5ad894bd09cfa316e8c05d1872c..ead606c1b3737fe834ea456cb08ae24470c5ddbd 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,19 @@ If you're super eager to play with the software, check the [setup](DEVELOPERS.md Enjoy! +## Firmware compatibility + +This software version has been tested and validated for the following firmware +releases: + +* Back-end: `v5.0.3-hog-4b25950-dirty-10gbe-ldaq` +* OptoHybrid: `v5.0.3-hog-a827078-temp-limit-65` + +Using older firmware releases is not recommended since the software is +continuously adapted to the new firmware behavior and improved using newly +available firmware features. Conversely, using newer firmware releases can lead +to incompatibilities due to changing firmware behavior. Use with care. + ## What this repository contains * The `cmsgemos` source code diff --git a/gemhardware/src/monitor.cpp b/gemhardware/src/monitor.cpp index 93b7ef224e3e224ba2e758e159f4cc944019eaa6..6c7d38ff4a992bb324c100c564f36cde34bc6ac4 100644 --- a/gemhardware/src/monitor.cpp +++ b/gemhardware/src/monitor.cpp @@ -188,32 +188,41 @@ std::map<std::string, uint32_t> gem::hardware::monitor::getmonOHSysmon::operator std::map<std::string, uint32_t> sysMon; - const std::array<std::string, 6> alarms = { - "OVERTEMP", - "CNT_OVERTEMP", - "VCCAUX_ALARM", - "CNT_VCCAUX_ALARM", - "VCCINT_ALARM", - "CNT_VCCINT_ALARM" + // Maps the monitorable names to the register names + const std::map<std::string, std::string> alarms = { + { "FPGA_CORE_TEMP_ALARM", "OVERTEMP" }, + { "FPGA_CORE_TEMP_ALARM_CNT", "CNT_OVERTEMP" }, + { "FPGA_VCCINT_ALARM", "VCCINT_ALARM" }, + { "FPGA_VCCINT_ALARM_CNT", "CNT_VCCINT_ALARM" }, + { "FPGA_VCCAUX_ALARM", "VCCAUX_ALARM" }, + { "FPGA_VCCAUX_ALARM_CNT", "CNT_VCCAUX_ALARM" }, }; for (std::size_t ohN = 0; ohN < amc::OH_PER_AMC; ++ohN) { - const std::string keyName = "OH" + std::to_string(ohN); - if (!((ohMask >> ohN) & 0x1)) { + const std::string keyName = "OH" + std::to_string(ohN) + "."; + const std::string regBase = "BEFE.GEM.OH.OH" + std::to_string(ohN) + ".FPGA.ADC.CTRL."; + + if ((ohMask >> ohN) & 0x1) { for (auto const& alarm : alarms) - sysMon[keyName + "." + alarm] = -1; + sysMon[keyName + alarm.first] = utils::readReg(regBase + alarm.second); - sysMon[keyName + ".FPGA_CORE_TEMP"] = -1; - continue; - } + // Formula to convert the ADC values to temperature taken from Virtex-6 FPGA System Monitor - UG370 (v1.2) + utils::writeReg(regBase + "ADR_IN", 0); + sysMon[keyName + "FPGA_CORE_TEMP"] = 10 * ((float((utils::readReg(regBase + "DATA_OUT") >> 6) & 0x3ff) * 503.975 / 1024) - 273.15); - const std::string regBase = "BEFE.GEM.OH." + keyName + ".FPGA.ADC.CTRL."; + // Formula to convert the ADC values to voltages taken from Virtex-6 FPGA System Monitor - UG370 (v1.2) + utils::writeReg(regBase + "ADR_IN", 1); + sysMon[keyName + "FPGA_VCCINT"] = 3000 * (float((utils::readReg(regBase + "DATA_OUT") >> 6) & 0x3ff) / 1024); + utils::writeReg(regBase + "ADR_IN", 2); + sysMon[keyName + "FPGA_VCCAUX"] = 3000 * (float((utils::readReg(regBase + "DATA_OUT") >> 6) & 0x3ff) / 1024); + } else { + for (auto const& alarm : alarms) + sysMon[keyName + alarm.first] = -1; - for (auto const& alarm : alarms) { - sysMon[keyName + "." + alarm] = utils::readReg(regBase + alarm); + sysMon[keyName + "FPGA_CORE_TEMP"] = -1; + sysMon[keyName + "FPGA_VCCINT"] = -1; + sysMon[keyName + "FPGA_VCCAUX"] = -1; } - // Formula to convert the ADC values to temperature taken from Virtex-6 FPGA System Monitor - UG370 (v1.2) - sysMon[keyName + ".FPGA_CORE_TEMP"] = 10 * ((float((utils::readReg(regBase + "DATA_OUT") >> 6) & 0x3ff) * 503.975 / 1024) - 273.15); } return sysMon; @@ -452,8 +461,8 @@ std::map<std::string, uint32_t> gem::hardware::monitor::getmonSEU::operator()(co const std::string keyPrefix = "OH" + std::to_string(ohN) + "."; const std::string regPrefix = "BEFE.GEM.OH.OH" + std::to_string(ohN) + "."; if (((ohMask >> ohN) & 0x1)) { - seuMon[keyPrefix + "FPGA.CNT_SEU_CRITICAL"] = utils::readReg(regPrefix + "FPGA.CONTROL.SEM.CNT_SEM_CRITICAL"); - seuMon[keyPrefix + "FPGA.CNT_SEU_CORRECTION"] = utils::readReg(regPrefix + "FPGA.CONTROL.SEM.CNT_SEM_CORRECTION"); + seuMon[keyPrefix + "FPGA.SEU_CRITICAL_CNT"] = utils::readReg(regPrefix + "FPGA.CONTROL.SEM.CNT_SEM_CRITICAL"); + seuMon[keyPrefix + "FPGA.SEU_CORRECTION_CNT"] = utils::readReg(regPrefix + "FPGA.CONTROL.SEM.CNT_SEM_CORRECTION"); seuMon[keyPrefix + "FPGA.TMR_TTC_ERR_CNT"] = utils::readReg(regPrefix + "FPGA.CONTROL.TMR.TTC_TMR_ERR_CNT"); seuMon[keyPrefix + "FPGA.TMR_IPB_SWITCH_ERR_CNT"] = utils::readReg(regPrefix + "FPGA.CONTROL.TMR.IPB_SWITCH_TMR_ERR_CNT"); seuMon[keyPrefix + "FPGA.TMR_IPB_SLAVE_ERR_CNT"] = utils::readReg(regPrefix + "FPGA.CONTROL.TMR.IPB_SLAVE_TMR_ERR_CNT"); @@ -465,8 +474,8 @@ std::map<std::string, uint32_t> gem::hardware::monitor::getmonSEU::operator()(co seuMon[keyPrefix + "FPGA.TMR_GBT_SERDES_ERR_CNT"] = utils::readReg(regPrefix + "FPGA.GBT.TMR.GBT_SERDES_TMR_ERR_CNT"); seuMon[keyPrefix + "FPGA.TMR_GBT_IPB_SLAVE_ERR_CNT"] = utils::readReg(regPrefix + "FPGA.GBT.TMR.IPB_SLAVE_TMR_ERR_CNT"); } else { - seuMon[keyPrefix + "FPGA.CNT_SEU_CRITICAL"] = 0xdeaddead; - seuMon[keyPrefix + "FPGA.CNT_SEU_CORRECTION"] = 0xdeaddead; + seuMon[keyPrefix + "FPGA.SEU_CRITICAL_CNT"] = 0xdeaddead; + seuMon[keyPrefix + "FPGA.SEU_CORRECTION_CNT"] = 0xdeaddead; seuMon[keyPrefix + "FPGA.TMR_TTC_ERR_CNT"] = 0xdeaddead; seuMon[keyPrefix + "FPGA.TMR_IPB_SWITCH_ERR_CNT"] = 0xdeaddead; seuMon[keyPrefix + "FPGA.TMR_IPB_SLAVE_ERR_CNT"] = 0xdeaddead; diff --git a/gemmonitor/html/json/monitorables.json b/gemmonitor/html/json/monitorables.json index 70af0bb9e6e0070c0905ccaf629719b8b0df6ed7..629d544cc09cee0dc49567e96e7ef67dafef2957 100644 --- a/gemmonitor/html/json/monitorables.json +++ b/gemmonitor/html/json/monitorables.json @@ -342,12 +342,12 @@ "register-name": "BEFE.GEM.DAQ.OH${OH}.STATUS.VFAT_TOO_MANY", "label": "ErrorIfNotZero" }, - "OH${OH}.FPGA.CNT_SEU_CRITICAL": { + "OH${OH}.FPGA.SEU_CRITICAL_CNT": { "description": "Counts of uncorrectable single event upsets", "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.CONTROL.SEM.CNT_SEM_CRITICAL", "label": "ShouldBeZeroVal" }, - "OH${OH}.FPGA.CNT_SEU_CORRECTION": { + "OH${OH}.FPGA.SEU_CORRECTION_CNT": { "description": "Counts of corrected single event upsets", "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.CONTROL.SEM.CNT_SEM_CORRECTION", "label": "NormalValue" @@ -450,15 +450,15 @@ "register-name": "", "label": "NormalValue" }, - "OH${OH}.OVERTEMP": { - "description": "OptoHybrid FPGA over temperature signal", + "OH${OH}.FPGA_CORE_TEMP_ALARM": { + "description": "OptoHybrid FPGA core temperature alarm", "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.OVERTEMP", "label": "ErrorIfNotZero" }, - "OH${OH}.CNT_OVERTEMP": { - "description": "OptoHybrid FPGA overtemperature counter", + "OH${OH}.FPGA_CORE_TEMP_ALARM_CNT": { + "description": "OptoHybrid FPGA core temperature alarm counter", "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.CNT_OVERTEMP", - "label": "ShouldBeZero" + "label": "ShouldBeZeroVal" }, "OH${OH}.V1P0_FPGA_CORE": { "description": "Voltage measured on the 1.0V line to the FPGA core (mV)", @@ -490,26 +490,36 @@ "register-name": "", "label": "NormalValue" }, - "OH${OH}.VCCAUX_ALARM": { - "description": "OptoHybrid FPGA VCCAUX alarm", - "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.VCCAUX_ALARM", - "label": "ErrorIfNotZero" - }, - "OH${OH}.CNT_VCCAUX_ALARM": { - "description": "OptoHybrid FPGA VCCAUX alarm counter", - "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.CNT_VCCAUX_ALARM", - "label": "ShouldBeZeroVal" + "OH${OH}.FPGA_VCCINT": { + "description": "OptoHybrid FPGA VCCINT (mV)", + "register-name": "", + "label": "NormalValue" }, - "OH${OH}.VCCINT_ALARM": { + "OH${OH}.FPGA_VCCINT_ALARM": { "description": "OptoHybrid FPGA VCCINT alarm", "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.VCCINT_ALARM", "label": "ErrorIfNotZero" }, - "OH${OH}.CNT_VCCINT_ALARM": { + "OH${OH}.FPGA_VCCINT_ALARM_CNT": { "description": "OptoHybrid FPGA VCCINT alarm counter", "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.CNT_VCCINT_ALARM", "label": "ShouldBeZeroVal" }, + "OH${OH}.FPGA_VCCAUX": { + "description": "OptoHybrid FPGA VCCAUX (mV)", + "register-name": "", + "label": "NormalValue" + }, + "OH${OH}.FPGA_VCCAUX_ALARM": { + "description": "OptoHybrid FPGA VCCAUX alarm", + "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.VCCAUX_ALARM", + "label": "ErrorIfNotZero" + }, + "OH${OH}.FPGA_VCCAUX_ALARM_CNT": { + "description": "OptoHybrid FPGA VCCAUX alarm counter", + "register-name": "BEFE.GEM.OH.OH${OH}.FPGA.ADC.CTRL.CNT_VCCAUX_ALARM", + "label": "ShouldBeZeroVal" + }, "OH${OH}.I1P2_VFAT_A": { "description": "Current drawn on the VFAT analog 1.2V line (mA)", "register-name": "",