Version 1.0.0-rc.12
This commit is contained in:
@@ -29,9 +29,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * 4 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
for (int image = 0; image < 4; image++) {
|
||||
@@ -67,8 +64,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_custom_frame", "[FPGA][Ful
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * nframes * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
for (int image = 0; image < nframes; image++) {
|
||||
@@ -106,9 +101,6 @@ TEST_CASE("HLS_C_Simulation_check_raw", "[FPGA][Full]") {
|
||||
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 0);
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
uint64_t diffs = 0;
|
||||
@@ -142,8 +134,6 @@ TEST_CASE("HLS_C_Simulation_check_cancel", "[FPGA][Full]") {
|
||||
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 0);
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 0);
|
||||
}
|
||||
@@ -167,9 +157,6 @@ TEST_CASE("HLS_C_Simulation_check_cancel_conversion", "[FPGA][Full]") {
|
||||
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 0);
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 0);
|
||||
}
|
||||
|
||||
@@ -235,9 +222,6 @@ TEST_CASE("HLS_C_Simulation_check_lost_frame_raw", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
REQUIRE(test.GetDeviceOutput(0,0)->pixels[0] == 0);
|
||||
@@ -267,8 +251,6 @@ TEST_CASE("HLS_C_Simulation_check_lost_frame_conversion", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -324,9 +306,6 @@ TEST_CASE("HLS_C_Simulation_check_single_packet", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 15 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
REQUIRE(memcmp(test.GetDeviceOutput(0,0)->pixels, data, JUNGFRAU_PACKET_SIZE_BYTES) == 0);
|
||||
@@ -383,8 +362,6 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -434,8 +411,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_HG0", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -464,8 +440,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_HG0", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -515,8 +490,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_fixedG1", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -565,8 +539,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_I32", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), (int32_t *) test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -619,8 +592,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_sum4", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * nsummation * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), (int32_t *) test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -670,8 +642,108 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range_U16", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), (uint16_t *) test.GetDeviceOutput(0,0)->pixels);
|
||||
|
||||
REQUIRE(mean_error < 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_check_conversion_poisson_full_range", "[FPGA][Full]") {
|
||||
// This test is not 100% representable!
|
||||
// At the moment it is not possible to include "hls_math.h" in jfjoch_test
|
||||
// So hls::sqrt is actually implemented as round(sqrt())
|
||||
// This can be only handled by HLS test bench
|
||||
|
||||
Logger logger("HLS_C_Simulation_check_poisson_full_range");
|
||||
std::vector<uint16_t> data(RAW_MODULE_SIZE);
|
||||
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
data[i] = i % UINT16_MAX;
|
||||
}
|
||||
|
||||
const uint16_t nmodules = 1;
|
||||
|
||||
for (int sqrtmult: {1, 2,4,8}) {
|
||||
DiffractionExperiment x((DetectorGeometry(nmodules)));
|
||||
|
||||
x.Mode(DetectorMode::Raw).FPGAOutputMode(FPGAPixelOutput::Int16);
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
x.NumTriggers(1).ImagesPerTrigger(1).LossyCompressionPoisson(sqrtmult);
|
||||
|
||||
test.CreateJFPackets(x, 1, 1, 0, data.data());
|
||||
test.CreateFinalPacket(x);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto data_signed = (int16_t *) data.data();
|
||||
|
||||
uint64_t diff = 0;
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
uint64_t expected_value = 0;
|
||||
if (data_signed[i] == INT16_MAX)
|
||||
expected_value = INT16_MAX;
|
||||
else if (data_signed[i] == INT16_MIN)
|
||||
expected_value = INT16_MIN;
|
||||
else if (data_signed[i] >= 0)
|
||||
expected_value = std::lround(std::sqrt(data_signed[i]) * sqrtmult);
|
||||
|
||||
if (expected_value != test.GetDeviceOutput(0, 0)->pixels[i])
|
||||
diff++;
|
||||
|
||||
}
|
||||
REQUIRE(diff == 0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_check_convert_full_range_poisson", "[FPGA][Full]") {
|
||||
Logger logger("HLS_C_Simulation_check_convert_full_range_poisson");
|
||||
std::vector<uint16_t> data(RAW_MODULE_SIZE);
|
||||
std::vector<double> gain(3 * RAW_MODULE_SIZE);
|
||||
|
||||
JFModulePedestal pedestal_g0(0), pedestal_g1(14500), pedestal_g2(14500);
|
||||
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++) {
|
||||
data[i] = i % UINT16_MAX;
|
||||
}
|
||||
|
||||
std::vector<double> energy_values = {6.0, 12.4, 17.7, 5, 4.5, 3.7};
|
||||
|
||||
const uint16_t nmodules = 1;
|
||||
DiffractionExperiment x((DetectorGeometry(nmodules)));
|
||||
x.LossyCompressionPoisson(2);
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
HLSSimulatedDevice test(0, 64);
|
||||
|
||||
auto gain_from_file = GainCalibrationFromTestFile();
|
||||
|
||||
for (const auto energy : energy_values) {
|
||||
logger.Info("Trying with {} keV", energy);
|
||||
x.PedestalG0Frames(0).NumTriggers(1).ImagesPerTrigger(1).PhotonEnergy_keV(energy).FPGAOutputMode(FPGAPixelOutput::Uint16);
|
||||
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == Catch::Approx(energy));
|
||||
|
||||
JFCalibration c_in(x);
|
||||
c_in.Pedestal(0,0) = pedestal_g0;
|
||||
c_in.Pedestal(0,1) = pedestal_g1;
|
||||
c_in.Pedestal(0,2) = pedestal_g2;
|
||||
for (int i = 0; i < x.GetModulesNum(); i++)
|
||||
c_in.GainCalibration(i) = gain_from_file;
|
||||
|
||||
test.InitializeCalibration(x, c_in);
|
||||
test.CreateJFPackets(x, 1, 1, 0, data.data());
|
||||
test.CreateFinalPacket(x);
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
double mean_error = CheckConversion(x, c_in, data.data(), (uint16_t *) test.GetDeviceOutput(0,0)->pixels);
|
||||
@@ -704,8 +776,6 @@ TEST_CASE("HLS_C_Simulation_no_conversion_U16", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto output = (uint16_t *) test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -740,8 +810,6 @@ TEST_CASE("HLS_C_Simulation_no_conversion_U32", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto output = (uint32_t *) test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -778,8 +846,6 @@ TEST_CASE("HLS_C_Simulation_no_conversion_I32", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
CHECK(test.GetBytesReceived() == 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto data16_signed = (int16_t *) data.data();
|
||||
@@ -840,8 +906,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_convert_full_range", "[FPG
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == nmodules * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -895,8 +959,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_convert_full_range_adu_his
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == nmodules * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -958,8 +1020,6 @@ TEST_CASE("HLS_C_Simulation_check_2_trigger_convert", "[FPGA][Full]") {
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 0);
|
||||
REQUIRE(test.Counters().GetCurrFrameNumber(0) == 0);
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived()== 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -997,8 +1057,6 @@ TEST_CASE("HLS_C_Simulation_check_detect_last_frame", "[FPGA][Full]") {
|
||||
|
||||
REQUIRE(test.Counters().IsAcquisitionFinished());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_check_wrong_packet_size", "[FPGA][Full]") {
|
||||
@@ -1042,202 +1100,6 @@ TEST_CASE("HLS_C_Simulation_check_wrong_packet_size", "[FPGA][Full]") {
|
||||
REQUIRE(test.GetBytesReceived() == 6 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
}
|
||||
|
||||
TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") {
|
||||
DataCollectionConfig act_reg;
|
||||
|
||||
STREAM_512 raw0;
|
||||
STREAM_512 raw1;
|
||||
|
||||
hls::stream<axis_addr> addr0;
|
||||
hls::stream<axis_addr> addr1;
|
||||
|
||||
ap_uint<1> run_data_collection = 0;
|
||||
ap_uint<1> cancel_data_collection = 0;
|
||||
ap_uint<1> idle_data_collection;
|
||||
uint32_t save_data_collection_counter;
|
||||
act_reg.mode = MODE_CONV;
|
||||
|
||||
// state = WAIT_FOR_START
|
||||
volatile rcv_state_t state;
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
REQUIRE(idle_data_collection == 1);
|
||||
REQUIRE(addr1.empty());
|
||||
REQUIRE(raw1.empty());
|
||||
REQUIRE( state == RCV_WAIT_FOR_START);
|
||||
run_data_collection = 1;
|
||||
|
||||
// state = WAIT_FOR_START
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(addr1.empty());
|
||||
REQUIRE(raw1.empty());
|
||||
REQUIRE( state == RCV_WAIT_FOR_START_LOW);
|
||||
// state = WAIT_FOR_START_LOW
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(addr1.empty());
|
||||
REQUIRE(raw1.empty());
|
||||
REQUIRE( state == RCV_WAIT_FOR_START_LOW);
|
||||
// state = WAIT_FOR_START_LOW
|
||||
|
||||
run_data_collection = 0;
|
||||
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(addr1.empty());
|
||||
REQUIRE(raw1.empty());
|
||||
REQUIRE( state == RCV_START);
|
||||
// state = START
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(raw1.size() == 1);
|
||||
|
||||
REQUIRE( state == RCV_INIT);
|
||||
// state = INIT
|
||||
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(raw1.size() == 1);
|
||||
REQUIRE( state == RCV_INIT);
|
||||
// state = INIT
|
||||
|
||||
cancel_data_collection = 1;
|
||||
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(raw1.size() == 1);
|
||||
|
||||
// state = LAST
|
||||
REQUIRE( state == RCV_LAST);
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
|
||||
REQUIRE(idle_data_collection == 0);
|
||||
REQUIRE(addr1.size() == 1);
|
||||
REQUIRE(raw1.size() == 2);
|
||||
REQUIRE( state == RCV_WAIT_FOR_START);
|
||||
// state = WAIT_FOR_START
|
||||
|
||||
data_collection_fsm(raw0, raw1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
act_reg.mode,
|
||||
act_reg.energy_kev,
|
||||
act_reg.nframes,
|
||||
act_reg.nmodules,
|
||||
act_reg.nstorage_cells,
|
||||
act_reg.nsummation,
|
||||
state);
|
||||
|
||||
REQUIRE( state == RCV_WAIT_FOR_START);
|
||||
REQUIRE(idle_data_collection == 1);
|
||||
REQUIRE(addr1.size() == 1);
|
||||
REQUIRE(raw1.size() == 2);
|
||||
|
||||
auto packet = raw1.read();
|
||||
REQUIRE(packet.last == 1);
|
||||
REQUIRE(packet.dest == 0);
|
||||
|
||||
packet = raw1.read();
|
||||
REQUIRE(packet.last);
|
||||
REQUIRE(packet.dest == 0);
|
||||
|
||||
auto addr = addr1.read();
|
||||
REQUIRE(addr.last);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("HLS_C_Simulation_internal_packet_generator_15_storage_cell_convert_G0", "[FPGA][Full]") {
|
||||
const uint16_t nmodules = 2;
|
||||
@@ -1279,8 +1141,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_15_storage_cell_convert_G0
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == ntrigger * nmodules * nstoragecells * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -1330,8 +1190,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_8_storage_cell_convert_G0"
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == ntrigger * nmodules * nstoragecells * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -1380,8 +1238,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_16_storage_cell_convert_G0
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == ntrigger * nmodules * nstoragecells * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -1427,8 +1283,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_storage_cell_convert_G1",
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 32*128*JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -1469,8 +1323,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_integration", "[FPGA][Full
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -1538,8 +1390,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_count_threshol
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -1600,8 +1450,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_mask", "[FPGA]
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -1658,8 +1506,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_min_pix_per_sp
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -1717,8 +1563,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_d_min_max", "[
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -1775,8 +1619,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_spot_finder_snr_threshold"
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -1815,8 +1657,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_32bit", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * nframes * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto test_frame_unsigned = (uint16_t *) test_frame.data();
|
||||
@@ -1866,8 +1706,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_summation", "[FPGA][Full]"
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * nframes * nsummation * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto test_frame_signed = (int16_t *) test_frame.data();
|
||||
@@ -1942,8 +1780,7 @@ TEST_CASE("HLS_C_Simulation_check_convert_pedestal", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == NFRAMES_PEDESTAL_CHECK * 128 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -1995,8 +1832,6 @@ TEST_CASE("HLS_C_Simulation_count_sat_and_err_pixels", "[FPGA][Full]") {
|
||||
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * 4 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
for (int image = 0; image < 4; image++) {
|
||||
@@ -2022,8 +1857,6 @@ TEST_CASE("HLS_C_Simulation_check_bunchid", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 0);
|
||||
REQUIRE(test.GetDataCollectionStatus().current_pulseid == bunchid);
|
||||
@@ -2062,8 +1895,6 @@ TEST_CASE("HLS_C_Simulation_check_raw_eiger", "[FPGA][Full]") {
|
||||
|
||||
REQUIRE(test.Counters().GetSlowestFrameNumber() == 0);
|
||||
|
||||
REQUIRE_NOTHROW(test.OutputStream().read());
|
||||
REQUIRE(test.OutputStream().size() == 0);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 256 * 4096);
|
||||
|
||||
@@ -2100,8 +1931,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_eiger", "[FPGA][Full]") {
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * 4 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
@@ -2160,8 +1989,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_roi_calc", "[FPGA][Full]")
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nimages * nmodules * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
auto imageBuf = test.GetDeviceOutput(0, 0)->pixels;
|
||||
@@ -2203,8 +2030,6 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_4_images", "[FPGA][Full]")
|
||||
REQUIRE_NOTHROW(test.StartAction(x));
|
||||
REQUIRE_NOTHROW(test.WaitForActionComplete());
|
||||
|
||||
REQUIRE(test.OutputStream().size() == 1);
|
||||
|
||||
REQUIRE(test.GetBytesReceived() == 128 * nmodules * 4 * JUNGFRAU_PACKET_SIZE_BYTES);
|
||||
|
||||
for (int image = 0; image < 4; image++) {
|
||||
|
||||
Reference in New Issue
Block a user