mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 22:07:12 +02:00
Xilinx ctb (#884)
* updated registers, arm64 * compiler set to aarch64 for xilinx server * updated RegisterDefs.h * merge into generate branch and resolving conflicts and adding the xilinx changes to callerspecial and commands.yaml * compiles and can print firmware version (using a different csp0 address) * fixing other servers (gotthard, jungfrau, moench, mythen3) that it returns in case of mapping failure, xilinxctb: added that it checks type, prints proper fw version, checks kernel date, added armprocessor define to use in common places, added specifiers to supress overflow and truncation warnings * added detector ip and mac adddress to the printout * fixed tests and recompiled servers
This commit is contained in:
@ -208,6 +208,7 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
|
||||
defs::G2_LOWCAP_HIGHGAIN, defs::G2_LOWCAP_LOWGAIN,
|
||||
defs::G4_HIGHGAIN, defs::G4_LOWGAIN};
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
throw RuntimeError("Settings not implemented for this detector");
|
||||
default:
|
||||
throw RuntimeError("Unknown detector type");
|
||||
@ -652,6 +653,7 @@ std::vector<defs::dacIndex> Detector::getTemperatureList() const {
|
||||
std::vector<defs::dacIndex> retval;
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP};
|
||||
case defs::JUNGFRAU:
|
||||
case defs::MOENCH:
|
||||
@ -743,6 +745,7 @@ std::vector<defs::dacIndex> Detector::getDacList() const {
|
||||
defs::VBP_COLBUF, defs::VIPRE, defs::VIN_CM, defs::VB_SDA,
|
||||
defs::VCASC_SFP, defs::VOUT_CM, defs::VIPRE_CDS, defs::IBIAS_SFP};
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD:
|
||||
for (int i = 0; i != 18; ++i) {
|
||||
retval.push_back(static_cast<defs::dacIndex>(i));
|
||||
}
|
||||
@ -905,7 +908,8 @@ void Detector::stopDetector(Positions pos) {
|
||||
case defs::EIGER:
|
||||
case defs::JUNGFRAU:
|
||||
case defs::MOENCH:
|
||||
case defs::CHIPTESTBOARD: {
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD: {
|
||||
auto res = getNextFrameNumber(pos);
|
||||
if (!res.equal()) {
|
||||
uint64_t maxVal = 0;
|
||||
@ -2079,7 +2083,9 @@ Result<int> Detector::getSYNCClock(Positions pos) const {
|
||||
}
|
||||
|
||||
std::vector<defs::dacIndex> Detector::getPowerList() const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD) {
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD &&
|
||||
dettype != defs::XILINX_CHIPTESTBOARD) {
|
||||
throw RuntimeError("Power list not implemented for this detector");
|
||||
}
|
||||
return std::vector<defs::dacIndex>{defs::V_POWER_A, defs::V_POWER_B,
|
||||
@ -2088,7 +2094,9 @@ std::vector<defs::dacIndex> Detector::getPowerList() const {
|
||||
}
|
||||
|
||||
std::vector<defs::dacIndex> Detector::getSlowADCList() const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD) {
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD &&
|
||||
dettype != defs::XILINX_CHIPTESTBOARD) {
|
||||
throw RuntimeError("Slow ADC list not implemented for this detector");
|
||||
}
|
||||
return std::vector<defs::dacIndex>{
|
||||
@ -2277,7 +2285,8 @@ void Detector::setLEDEnable(bool enable, Positions pos) {
|
||||
}
|
||||
|
||||
void Detector::setDacNames(const std::vector<std::string> names) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named dacs only for CTB");
|
||||
pimpl->setCtbDacNames(names);
|
||||
}
|
||||
@ -2285,7 +2294,7 @@ void Detector::setDacNames(const std::vector<std::string> names) {
|
||||
std::vector<std::string> Detector::getDacNames() const {
|
||||
std::vector<std::string> names;
|
||||
auto type = getDetectorType().squash();
|
||||
if (type == defs::CHIPTESTBOARD)
|
||||
if (type == defs::CHIPTESTBOARD || type == defs::XILINX_CHIPTESTBOARD)
|
||||
return pimpl->getCtbDacNames();
|
||||
|
||||
for (const auto &index : getDacList())
|
||||
@ -2295,7 +2304,7 @@ std::vector<std::string> Detector::getDacNames() const {
|
||||
|
||||
defs::dacIndex Detector::getDacIndex(const std::string &name) const {
|
||||
auto type = getDetectorType().squash();
|
||||
if (type == defs::CHIPTESTBOARD) {
|
||||
if (type == defs::CHIPTESTBOARD || type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto names = getDacNames();
|
||||
auto it = std::find(names.begin(), names.end(), name);
|
||||
if (it == names.end())
|
||||
@ -2306,32 +2315,36 @@ defs::dacIndex Detector::getDacIndex(const std::string &name) const {
|
||||
}
|
||||
|
||||
void Detector::setDacName(const defs::dacIndex i, const std::string &name) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named dacs only for CTB");
|
||||
pimpl->setCtbDacName(i, name);
|
||||
}
|
||||
|
||||
std::string Detector::getDacName(const defs::dacIndex i) const {
|
||||
auto type = getDetectorType().squash();
|
||||
if (type == defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype == defs::CHIPTESTBOARD || dettype == defs::XILINX_CHIPTESTBOARD)
|
||||
return pimpl->getCtbDacName(i);
|
||||
return ToString(i);
|
||||
}
|
||||
|
||||
void Detector::setAdcNames(const std::vector<std::string> names) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named adcs only for CTB");
|
||||
pimpl->setCtbAdcNames(names);
|
||||
}
|
||||
|
||||
std::vector<std::string> Detector::getAdcNames() const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named adcs only for CTB");
|
||||
return pimpl->getCtbAdcNames();
|
||||
}
|
||||
|
||||
int Detector::getAdcIndex(const std::string &name) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named adcs only for CTB");
|
||||
auto names = getAdcNames();
|
||||
auto it = std::find(names.begin(), names.end(), name);
|
||||
@ -2341,31 +2354,36 @@ int Detector::getAdcIndex(const std::string &name) const {
|
||||
}
|
||||
|
||||
void Detector::setAdcName(const int index, const std::string &name) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named adcs only for CTB");
|
||||
pimpl->setCtbAdcName(index, name);
|
||||
}
|
||||
|
||||
std::string Detector::getAdcName(const int i) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named adcs only for CTB");
|
||||
return pimpl->getCtbAdcName(i);
|
||||
}
|
||||
|
||||
void Detector::setSignalNames(const std::vector<std::string> names) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named signals only for CTB");
|
||||
pimpl->setCtbSignalNames(names);
|
||||
}
|
||||
|
||||
std::vector<std::string> Detector::getSignalNames() const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named signals only for CTB");
|
||||
return pimpl->getCtbSignalNames();
|
||||
}
|
||||
|
||||
int Detector::getSignalIndex(const std::string &name) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named signals only for CTB");
|
||||
auto names = getSignalNames();
|
||||
auto it = std::find(names.begin(), names.end(), name);
|
||||
@ -2375,31 +2393,37 @@ int Detector::getSignalIndex(const std::string &name) const {
|
||||
}
|
||||
|
||||
void Detector::setSignalName(const int index, const std::string &name) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named signals only for CTB");
|
||||
pimpl->setCtbSignalName(index, name);
|
||||
}
|
||||
|
||||
std::string Detector::getSignalName(const int i) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named signals only for CTB");
|
||||
return pimpl->getCtbSignalName(i);
|
||||
}
|
||||
|
||||
void Detector::setPowerNames(const std::vector<std::string> names) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD &&
|
||||
dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named powers only for CTB");
|
||||
pimpl->setCtbPowerNames(names);
|
||||
}
|
||||
|
||||
std::vector<std::string> Detector::getPowerNames() const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named powers only for CTB");
|
||||
return pimpl->getCtbPowerNames();
|
||||
}
|
||||
|
||||
defs::dacIndex Detector::getPowerIndex(const std::string &name) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named powers only for CTB");
|
||||
auto names = getPowerNames();
|
||||
auto it = std::find(names.begin(), names.end(), name);
|
||||
@ -2410,31 +2434,36 @@ defs::dacIndex Detector::getPowerIndex(const std::string &name) const {
|
||||
|
||||
void Detector::setPowerName(const defs::dacIndex index,
|
||||
const std::string &name) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named powers only for CTB");
|
||||
pimpl->setCtbPowerName(index, name);
|
||||
}
|
||||
|
||||
std::string Detector::getPowerName(const defs::dacIndex i) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named powers only for CTB");
|
||||
return pimpl->getCtbPowerName(i);
|
||||
}
|
||||
|
||||
void Detector::setSlowADCNames(const std::vector<std::string> names) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named SlowADCs only for CTB");
|
||||
pimpl->setCtbSlowADCNames(names);
|
||||
}
|
||||
|
||||
std::vector<std::string> Detector::getSlowADCNames() const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named SlowADCs only for CTB");
|
||||
return pimpl->getCtbSlowADCNames();
|
||||
}
|
||||
|
||||
defs::dacIndex Detector::getSlowADCIndex(const std::string &name) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named SlowADCs only for CTB");
|
||||
auto names = getSlowADCNames();
|
||||
auto it = std::find(names.begin(), names.end(), name);
|
||||
@ -2445,13 +2474,15 @@ defs::dacIndex Detector::getSlowADCIndex(const std::string &name) const {
|
||||
|
||||
void Detector::setSlowADCName(const defs::dacIndex index,
|
||||
const std::string &name) {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named SlowADCs only for CTB");
|
||||
pimpl->setCtbSlowADCName(index, name);
|
||||
}
|
||||
|
||||
std::string Detector::getSlowADCName(const defs::dacIndex i) const {
|
||||
if (getDetectorType().squash() != defs::CHIPTESTBOARD)
|
||||
auto dettype = getDetectorType().squash();
|
||||
if (dettype != defs::CHIPTESTBOARD && dettype != defs::XILINX_CHIPTESTBOARD)
|
||||
throw RuntimeError("Named SlowADCs only for CTB");
|
||||
return pimpl->getCtbSlowADCName(i);
|
||||
}
|
||||
|
Reference in New Issue
Block a user