FPGA: Max module number is 32
This commit is contained in:
@@ -24,7 +24,7 @@ uint16_t checksum(const uint16_t *addr, size_t count) {
|
||||
while (sum>>16)
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
|
||||
return ~sum;
|
||||
return ~sum;
|
||||
}
|
||||
|
||||
HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node)
|
||||
@@ -138,19 +138,22 @@ void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experimen
|
||||
cancel_data_collection = 0;
|
||||
idle = false;
|
||||
if (experiment.IsUsingInternalPacketGen()) {
|
||||
frame_generator(din_frame_generator,
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm_if_size,
|
||||
experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1,
|
||||
experiment.GetModulesNum(data_stream),
|
||||
mac_addr,
|
||||
mac_addr,
|
||||
ipv4_addr,
|
||||
ipv4_addr,
|
||||
INT_PKT_GEN_BUNCHID,
|
||||
INT_PKT_GEN_EXPTTIME,
|
||||
INT_PKT_GEN_DEBUG);
|
||||
auto ret = frame_generator(din_frame_generator,
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm_if_size,
|
||||
experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1,
|
||||
experiment.GetModulesNum(data_stream),
|
||||
mac_addr,
|
||||
mac_addr,
|
||||
ipv4_addr,
|
||||
ipv4_addr,
|
||||
INT_PKT_GEN_BUNCHID,
|
||||
INT_PKT_GEN_EXPTTIME,
|
||||
INT_PKT_GEN_DEBUG);
|
||||
if (ret)
|
||||
throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
|
||||
"Error running internal packet generator");
|
||||
}
|
||||
action_thread = std::thread(&HLSSimulatedDevice::HLSMainThread, this );
|
||||
}
|
||||
@@ -258,7 +261,7 @@ void HLSSimulatedDevice::HLSMainThread() {
|
||||
while ((!din_eth.empty()) || (!din_frame_generator.empty()))
|
||||
stream_merge(din_eth, din_frame_generator, network0);
|
||||
|
||||
while(!network0.empty())
|
||||
while(!network0.empty())
|
||||
ethernet(network0, ip1, arp1, mac_addr, eth_packets, clear_counters);
|
||||
|
||||
while(!ip1.empty())
|
||||
@@ -473,7 +476,7 @@ void HLSSimulatedDevice::HLSMainThread() {
|
||||
if (!datamover_in.GetDataStream().empty())
|
||||
throw std::runtime_error("Datamover queue is not empty");
|
||||
|
||||
if (err_reg != 0)
|
||||
if (err_reg != 0)
|
||||
throw std::runtime_error("Error reg for frame_statistics not zero, val=" + std::to_string(err_reg));
|
||||
|
||||
while (!datamover_out.IsIdle())
|
||||
@@ -506,15 +509,18 @@ void HLSSimulatedDevice::HW_LoadCalibration(uint32_t modules, uint32_t storage_c
|
||||
in_mem_location32[2 * i + 1] = ((uint64_t) buffer_device[i]) >> 32;
|
||||
}
|
||||
|
||||
load_calibration(hbm.data(),
|
||||
hbm.data(),
|
||||
modules,
|
||||
storage_cells,
|
||||
hbm_if_size,
|
||||
LOAD_CALIBRATION_DEST_CALIB,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
calibration_addr_bram);
|
||||
int ret = load_calibration(hbm.data(),
|
||||
hbm.data(),
|
||||
modules,
|
||||
storage_cells,
|
||||
hbm_if_size,
|
||||
LOAD_CALIBRATION_DEST_CALIB,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
calibration_addr_bram);
|
||||
if (ret)
|
||||
throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
|
||||
"Error in loading calibration");
|
||||
if (logger)
|
||||
logger->Info("Load calibration done");
|
||||
|
||||
@@ -533,15 +539,20 @@ void HLSSimulatedDevice::HW_LoadIntegrationMap(uint32_t modules) {
|
||||
in_mem_location32[2 * i + 1] = ((uint64_t) buffer_device[i]) >> 32;
|
||||
}
|
||||
|
||||
load_calibration(hbm.data(),
|
||||
hbm.data(),
|
||||
modules,
|
||||
0,
|
||||
hbm_if_size,
|
||||
LOAD_CALIBRATION_DEST_INTEGRATION,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
calibration_addr_bram);
|
||||
int ret = load_calibration(hbm.data(),
|
||||
hbm.data(),
|
||||
modules,
|
||||
0,
|
||||
hbm_if_size,
|
||||
LOAD_CALIBRATION_DEST_INTEGRATION,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
calibration_addr_bram);
|
||||
|
||||
if (ret)
|
||||
throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
|
||||
"Error in loading calibration");
|
||||
|
||||
if (logger)
|
||||
logger->Info("Load integration_map");
|
||||
|
||||
@@ -560,15 +571,20 @@ void HLSSimulatedDevice::HW_LoadInternalGeneratorFrame(uint32_t modules) {
|
||||
in_mem_location32[2 * i + 1] = ((uint64_t) buffer_device[i]) >> 32;
|
||||
}
|
||||
|
||||
load_calibration(hbm.data(),
|
||||
hbm.data(),
|
||||
modules,
|
||||
0,
|
||||
hbm_if_size,
|
||||
LOAD_CALIBRATION_DEST_FRAME_GEN,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
calibration_addr_bram);
|
||||
int ret = load_calibration(hbm.data(),
|
||||
hbm.data(),
|
||||
modules,
|
||||
0,
|
||||
hbm_if_size,
|
||||
LOAD_CALIBRATION_DEST_FRAME_GEN,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
calibration_addr_bram);
|
||||
|
||||
if (ret)
|
||||
throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
|
||||
"Error in loading calibration");
|
||||
|
||||
if (logger)
|
||||
logger->Info("Load to frame generator done");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user