moench: first version

This commit is contained in:
2020-03-02 18:34:10 +01:00
parent d7319968a7
commit 6bbcf6173d
27 changed files with 1452 additions and 1350 deletions

View File

@ -395,10 +395,10 @@ std::string CmdProxy::Adcphase(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Jungfrau][Ctb][Gotthard] Phase "
os << "[n_value] [(optional)deg]\n\t[Jungfrau][Ctb][Moench][Moench][Gotthard] Phase "
"shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. If deg "
"used, then shift in degrees. Changing Speed also resets "
"adcphase to recommended defaults.\n\t[Ctb] Absolute phase "
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute phase "
"shift. If deg used, then shift in degrees. Changing adcclk also "
"resets adcphase and sets it to previous values.\n\t[Gotthard] "
"Relative phase shift"
@ -588,8 +588,10 @@ std::string CmdProxy::Dac(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[dac index] [dac or mv value] [(optional unit) mv] "
"\n\t[Ctb][Jungfrau] Dac."
"\n\t[Ctb] Dac."
<< '\n';
} else if (det->getDetectorType().squash(defs::GENERIC) != defs::CHIPTESTBOARD) {
throw sls::RuntimeError("Dac command can only be used for chip test board. Use daclist to get list of dac commands for current detector.");
} else if (action == defs::GET_ACTION) {
bool mv = false;
if (args.size() == 2) {
@ -707,6 +709,11 @@ std::vector<std::string> CmdProxy::DacCommands() {
"vth1", "vicin", "vcas", "vpreamp", "vpl", "vipre",
"viinsh", "vph", "vtrim", "vdcsh"};
break;
case defs::MOENCH:
return std::vector<std::string>{"vbp_colbuf", "vipre", "vin_cm",
"vb_sda", "vcasc_sfp", "vout_cm",
"vipre_cds", "ibias_sfp"};
break;
case defs::CHIPTESTBOARD:
return std::vector<std::string>{
"dac 0", "dac 1", "dac 2", "dac 3", "dac 4", "dac 5",
@ -1316,26 +1323,29 @@ std::string CmdProxy::Counters(int action) {
return os.str();
}
/* CTB Specific */
/* CTB / Moench Specific */
std::string CmdProxy::Samples(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_samples]\n\t[CTB] Number of samples (both analog and "
"digitial) expected."
"digitial) expected.\n\t[Moench] Number of samples (analog only)"
<< '\n';
} else if (action == defs::GET_ACTION) {
if (!args.empty()) {
WrongNumberOfParameters(0);
}
auto a = det->getNumberOfAnalogSamples({det_id});
auto d = det->getNumberOfDigitalSamples({det_id});
int as = a.squash(-1);
int ds = d.squash(-1);
if (as == -1 || ds == -1 || as != ds) { // check if a == d?
throw sls::RuntimeError(
// get also digital samples for ctb and compare with analog
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
auto d = det->getNumberOfDigitalSamples({det_id});
int as = a.squash(-1);
int ds = d.squash(-1);
if (as == -1 || ds == -1 || as != ds) { // check if a == d?
throw sls::RuntimeError(
"Different samples. Use asamples or dsamples.");
}
}
os << OutString(a) << '\n';
} else if (action == defs::PUT_ACTION) {
@ -1343,7 +1353,10 @@ std::string CmdProxy::Samples(int action) {
WrongNumberOfParameters(1);
}
det->setNumberOfAnalogSamples(std::stoi(args[0]), {det_id});
det->setNumberOfDigitalSamples(std::stoi(args[0]), {det_id});
// set also digital samples for ctb
if (det->getDetectorType().squash() == defs::CHIPTESTBOARD) {
det->setNumberOfDigitalSamples(std::stoi(args[0]), {det_id});
}
os << args.front() << '\n';
} else {
throw sls::RuntimeError("Unknown action");
@ -1351,6 +1364,8 @@ std::string CmdProxy::Samples(int action) {
return os.str();
}
/* CTB Specific */
std::string CmdProxy::Dbitphase(int action) {
std::ostringstream os;
os << cmd << ' ';
@ -1499,7 +1514,7 @@ std::string CmdProxy::Pattern(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[fname]\n\t[Mythen3][Ctb] Loads binary pattern file with only pattern "
os << "[fname]\n\t[Mythen3][Moench][Ctb][Moench] Loads binary pattern file with only pattern "
"words"
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -1520,7 +1535,7 @@ std::string CmdProxy::PatternWord(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[step or address] [64 bit mask]\n\t[Ctb][Mythen3] 64 bit pattern at "
os << "[step or address] [64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit pattern at "
"address of pattern memory."
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -1546,17 +1561,17 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patlimits") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of complete "
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of complete "
"pattern."
<< '\n';
} else if (cmd == "patloop0") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 0."
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of loop 0."
<< '\n';
} else if (cmd == "patloop1") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 1."
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of loop 1."
<< '\n';
} else if (cmd == "patloop2") {
os << "[start addr] [stop addr] \n\t[Ctb][Mythen3] Limits of loop 2."
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits of loop 2."
<< '\n';
} else {
throw sls::RuntimeError(
@ -1601,11 +1616,11 @@ std::string CmdProxy::PatternLoopCycles(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patnloop0") {
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 0." << '\n';
os << "[n_cycles] \n\t[Ctb][Moench][Mythen3] Number of cycles of loop 0." << '\n';
} else if (cmd == "patnloop1") {
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 1." << '\n';
os << "[n_cycles] \n\t[Ctb][Moench][Mythen3] Number of cycles of loop 1." << '\n';
} else if (cmd == "patnloop2") {
os << "[n_cycles] \n\t[Ctb][Mythen3] Number of cycles of loop 2." << '\n';
os << "[n_cycles] \n\t[Ctb][Moench][Mythen3] Number of cycles of loop 2." << '\n';
} else {
throw sls::RuntimeError(
"Unknown command, use list to list all commands");
@ -1646,11 +1661,11 @@ std::string CmdProxy::PatternWaitAddress(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patwait0") {
os << "[addr] \n\t[Ctb][Mythen3] Wait 0 address." << '\n';
os << "[addr] \n\t[Ctb][Moench][Mythen3] Wait 0 address." << '\n';
} else if (cmd == "patwait1") {
os << "[addr] \n\t[Ctb][Mythen3] Wait 1 address." << '\n';
os << "[addr] \n\t[Ctb][Moench][Mythen3] Wait 1 address." << '\n';
} else if (cmd == "patwait2") {
os << "[addr] \n\t[Ctb][Mythen3] Wait 2 address." << '\n';
os << "[addr] \n\t[Ctb][Moench][Mythen3] Wait 2 address." << '\n';
} else {
throw sls::RuntimeError(
"Unknown command, use list to list all commands");
@ -1691,11 +1706,11 @@ std::string CmdProxy::PatternWaitTime(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
if (cmd == "patwaittime0") {
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 0 time in clock cycles." << '\n';
os << "[n_clk] \n\t[Ctb][Moench][Mythen3] Wait 0 time in clock cycles." << '\n';
} else if (cmd == "patwaittime1") {
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 1 time in clock cycles." << '\n';
os << "[n_clk] \n\t[Ctb][Moench][Mythen3] Wait 1 time in clock cycles." << '\n';
} else if (cmd == "patwaittime2") {
os << "[n_clk] \n\t[Ctb][Mythen3] Wait 2 time in clock cycles." << '\n';
os << "[n_clk] \n\t[Ctb][Moench][Mythen3] Wait 2 time in clock cycles." << '\n';
} else {
throw sls::RuntimeError(
"Unknown command, use list to list all commands");
@ -1811,7 +1826,7 @@ std::string CmdProxy::ProgramFpga(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[fname.pof | fname.rbf]\n\t[Jungfrau][Ctb] Programs FPGA from pof file."
os << "[fname.pof | fname.rbf]\n\t[Jungfrau][Ctb][Moench] Programs FPGA from pof file."
<< "\n\t[Mythen3][Gotthard2] Programs FPGA from rbf file."
<< '\n';
} else if (action == defs::GET_ACTION) {
@ -1832,7 +1847,7 @@ std::string CmdProxy::CopyDetectorServer(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[server_name] [pc_host_name]\n\t[Jungfrau][Ctb] Copies detector "
os << "[server_name] [pc_host_name]\n\t[Jungfrau][Ctb][Moench] Copies detector "
"server via tftp from pc and changes respawn server name in "
"/etc/inittab of detector."
<< '\n';
@ -1854,7 +1869,7 @@ std::string CmdProxy::UpdateFirmwareAndDetectorServer(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[server_name] [pc_host_name] [fname.pof]\n\t[Jungfrau][Ctb] "
os << "[server_name] [pc_host_name] [fname.pof]\n\t[Jungfrau][Ctb][Moench] "
"Updates detector server via tftp from pc, updates firmware to "
"pof file and then reboots controller (blackfin)."
<< '\n';
@ -1904,7 +1919,7 @@ std::string CmdProxy::AdcRegister(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[address] [value]\n\t[Jungfrau][Ctb][Gotthard] Writes to an adc "
os << "[address] [value]\n\t[Jungfrau][Ctb][Moench][Gotthard] Writes to an adc "
"register in hex."
<< '\n';
} else if (action == defs::GET_ACTION) {