mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
Dev/xilinx acq (#901)
* period and exptime(patternwaittime level 0) * added new regsieterdefs and updated api version and fixedpattern reg * autogenerate commands * formatting * minor * wip resetflow, readout mode, transceiver mask, transceiver enable * acquisition, but streaming done bit and busy (exposing + read chip to fifo) not known yet from fw * programming fpga and device tree done * most configuration done, need to connect configuretransceiver to client * stuck at resetting transciever timed out * minor * fixed virtual, added chip busyto fifo, streaming busy, set/getnext framenumber * configuretransceiver from client, added help in client * make formatt and command generation * tests for xilinx ctb works * command generation * dacs added and tested, power not done * power added * added temp_fpga * binaries in * ctrlreg is 0 to enable chip=fixed, high dac val = min val= fixed, power regulators in weird order=fixed, device tree could be loaded with dacs before adcs=fixed * start works * virtual server sends * receiver works * tests * python function and enum generation, commands generatorn and autocomplete, formatting, tests * tests fail at start(transceiver not aligned) * tests passed * all binaries compiled * eiger binary in * added --nomodule cehck for xilinx
This commit is contained in:
@ -15,6 +15,7 @@ target_sources(tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-gotthard2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-gotthard.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-chiptestboard.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-xilinx-chiptestboard.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-moench.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-global.cpp
|
||||
|
||||
|
@ -368,7 +368,8 @@ TEST_CASE("CALLER::powervalues", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_NOTHROW(caller.call("powervalues", {}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("powervalues", {}, -1, PUT));
|
||||
} else {
|
||||
@ -380,7 +381,8 @@ TEST_CASE("CALLER::slowadcvalues", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_NOTHROW(caller.call("slowadcvalues", {}, -1, GET));
|
||||
REQUIRE_THROWS(caller.call("slowadcvalues", {}, -1, PUT));
|
||||
} else {
|
||||
@ -496,12 +498,7 @@ TEST_CASE("CALLER::dac", "[.cmdcall][.dacs]") {
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
for (int i = 0; i < 18; ++i) {
|
||||
SECTION("dac " + std::to_string(i)) {
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0);
|
||||
} else {
|
||||
REQUIRE_THROWS(
|
||||
caller.call("dac", {std::to_string(i)}, -1, GET));
|
||||
}
|
||||
test_dac_caller(static_cast<defs::dacIndex>(i), "dac", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -613,12 +610,10 @@ TEST_CASE("CALLER::samples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_asamples = det.getNumberOfAnalogSamples();
|
||||
Result<int> prev_dsamples = 0;
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
}
|
||||
auto prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call("samples", {"25"}, -1, PUT, oss);
|
||||
@ -639,16 +634,15 @@ TEST_CASE("CALLER::samples", "[.cmdcall]") {
|
||||
caller.call("asamples", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "asamples 450\n");
|
||||
}
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("dsamples", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "dsamples 450\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setNumberOfAnalogSamples(prev_asamples[i], {i});
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
det.setNumberOfDigitalSamples(prev_dsamples[i], {i});
|
||||
}
|
||||
det.setNumberOfDigitalSamples(prev_dsamples[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("samples", {}, -1, GET));
|
||||
@ -660,7 +654,8 @@ TEST_CASE("CALLER::asamples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getNumberOfAnalogSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -764,7 +759,8 @@ TEST_CASE("CALLER::v_limit", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_LIMIT);
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -832,7 +828,8 @@ TEST_CASE("CALLER::adcenable10g", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getTenGigaADCEnableMask();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -862,7 +859,8 @@ TEST_CASE("CALLER::transceiverenable", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getTransceiverEnableMask();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -894,7 +892,8 @@ TEST_CASE("CALLER::dsamples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getNumberOfDigitalSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -924,7 +923,8 @@ TEST_CASE("CALLER::tsamples", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getNumberOfTransceiverSamples();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -953,7 +953,8 @@ TEST_CASE("CALLER::romode", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_romode = det.getReadoutMode();
|
||||
auto prev_asamples = det.getNumberOfAnalogSamples();
|
||||
auto prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
@ -1037,7 +1038,8 @@ TEST_CASE("CALLER::v_a", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_A);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1058,7 +1060,8 @@ TEST_CASE("CALLER::v_b", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_B);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1079,7 +1082,8 @@ TEST_CASE("CALLER::v_c", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_C);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1100,7 +1104,8 @@ TEST_CASE("CALLER::v_d", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_D);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
@ -1121,7 +1126,8 @@ TEST_CASE("CALLER::v_io", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
// better not to play with setting it
|
||||
REQUIRE_NOTHROW(caller.call("v_io", {}, -1, GET));
|
||||
} else {
|
||||
@ -1251,11 +1257,12 @@ TEST_CASE("CALLER::im_io", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("CALLER::adc", "[.cmdcall]") {
|
||||
TEST_CASE("CALLER::slowadc", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
for (int i = 0; i <= 7; ++i) {
|
||||
REQUIRE_NOTHROW(
|
||||
caller.call("slowadc", {std::to_string(i)}, -1, GET));
|
||||
|
@ -81,9 +81,10 @@ TEST_CASE("Caller::patioctrl", "[.cmdcall]") {
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPatternIOControl();
|
||||
{
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
std::ostringstream oss;
|
||||
caller.call("patioctrl", {"0xc15004808d0a21a4"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "patioctrl 0xc15004808d0a21a4\n");
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "Caller.h"
|
||||
#include "catch.hpp"
|
||||
#include "sls/Detector.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include <sstream>
|
||||
|
||||
#include "sls/Result.h"
|
||||
#include "sls/ToString.h"
|
||||
#include "sls/versionAPI.h"
|
||||
#include "test-Caller-global.h"
|
||||
#include "tests/globals.h"
|
||||
|
||||
namespace sls {
|
||||
|
||||
using test::GET;
|
||||
using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("CALLER::configtransceiver", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
REQUIRE_NOTHROW(caller.call("configtransceiver", {}, -1, PUT));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("configtransceiver", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
} // namespace sls
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user