diff --git a/common/Definitions.h b/common/Definitions.h index 0ec889389..cb3115474 100644 --- a/common/Definitions.h +++ b/common/Definitions.h @@ -50,11 +50,10 @@ // For FPGA #define ACTION_TYPE 0x52324158 -#define RELEASE_LEVEL 0x003B +#define RELEASE_LEVEL 0x003C #define MODE_CONV 0x0001L -#define MODE_INTERNAL_PACKET_GEN 0x0002L -#define MODE_NONBLOCKING_ON_WR 0x0004L // Don't block acquisition if there is no WR available +#define MODE_NONBLOCKING_ON_WR 0x0002L // Don't block acquisition if there is no WR available #define TASK_NO_DATA_STREAM UINT16_MAX diff --git a/fpga/hdl/action_config.v b/fpga/hdl/action_config.v index becd74f97..c6ad155c3 100644 --- a/fpga/hdl/action_config.v +++ b/fpga/hdl/action_config.v @@ -120,7 +120,10 @@ module action_config input last_data_fifo_full , input last_addr_fifo_empty , input last_addr_fifo_full , - + input frame_generator_fifo_empty , + input frame_generator_fifo_full , + input eth_in_fifo_empty , + input eth_in_fifo_full , input mailbox_interrupt_0 , input mailbox_interrupt_1 , @@ -580,6 +583,10 @@ always @(posedge clk) begin reg_fifo_status[21] <= h2c_data_fifo_full; reg_fifo_status[22] <= h2c_cmd_fifo_empty; reg_fifo_status[23] <= h2c_cmd_fifo_full; + reg_fifo_status[24] <= frame_generator_fifo_full; + reg_fifo_status[25] <= frame_generator_fifo_empty; + reg_fifo_status[26] <= eth_in_fifo_full; + reg_fifo_status[27] <= eth_in_fifo_empty; end end diff --git a/fpga/hls/CMakeLists.txt b/fpga/hls/CMakeLists.txt index e4c37aca0..72a190e58 100644 --- a/fpga/hls/CMakeLists.txt +++ b/fpga/hls/CMakeLists.txt @@ -5,14 +5,15 @@ ADD_LIBRARY( HLSSimulation STATIC hls_jfjoch.h ../../common/Definitions.h load_calibration.cpp - internal_packet_generator.cpp host_writer.cpp ethernet.cpp ipv4.cpp icmp.cpp arp.cpp ip_header_checksum.h udp.cpp - sls_detector.cpp) + sls_detector.cpp + frame_generator.cpp + stream_merge.cpp) TARGET_INCLUDE_DIRECTORIES(HLSSimulation PUBLIC ../include) TARGET_LINK_LIBRARIES(HLSSimulation CommonFunctions) @@ -37,26 +38,28 @@ MAKE_HLS_MODULE(timer.cpp timer_host) MAKE_HLS_MODULE(jf_conversion.cpp jf_conversion) MAKE_HLS_MODULE(load_calibration.cpp load_calibration) MAKE_HLS_MODULE(host_writer.cpp host_writer) -MAKE_HLS_MODULE(internal_packet_generator.cpp internal_packet_generator) MAKE_HLS_MODULE(icmp.cpp icmp) MAKE_HLS_MODULE(ipv4.cpp ipv4) MAKE_HLS_MODULE(ethernet.cpp ethernet) MAKE_HLS_MODULE(arp.cpp arp) MAKE_HLS_MODULE(udp.cpp udp) MAKE_HLS_MODULE(sls_detector.cpp sls_detector) +MAKE_HLS_MODULE(frame_generator.cpp frame_generator) +MAKE_HLS_MODULE(stream_merge.cpp stream_merge) SET (HLS_IPS psi_ch_hls_data_collection_fsm_1_0.zip psi_ch_hls_timer_host_1_0.zip psi_ch_hls_jf_conversion_1_0.zip psi_ch_hls_load_calibration_1_0.zip - psi_ch_hls_internal_packet_generator_1_0.zip psi_ch_hls_ethernet_1_0.zip psi_ch_hls_ipv4_1_0.zip psi_ch_hls_arp_1_0.zip psi_ch_hls_udp_1_0.zip psi_ch_hls_sls_detector_1_0.zip psi_ch_hls_icmp_1_0.zip - psi_ch_hls_host_writer_1_0.zip) + psi_ch_hls_host_writer_1_0.zip + psi_ch_hls_frame_generator_1_0.zip + psi_ch_hls_stream_merge_1_0.zip) SET (HLS_IPS ${HLS_IPS} PARENT_SCOPE) ADD_CUSTOM_TARGET(hls DEPENDS ${HLS_IPS}) diff --git a/fpga/hls/data_collection_fsm.cpp b/fpga/hls/data_collection_fsm.cpp index f3034444e..35251d997 100644 --- a/fpga/hls/data_collection_fsm.cpp +++ b/fpga/hls/data_collection_fsm.cpp @@ -88,10 +88,7 @@ void data_collection_fsm(AXI_STREAM ð_in, addr.last = 0; addr_out << addr; - if (mode & MODE_INTERNAL_PACKET_GEN) - rcv_state = RCV_LAST; - else - rcv_state = RCV_INIT; + rcv_state = RCV_INIT; break; case RCV_INIT: out_idle = 0; diff --git a/fpga/hls/frame_generator.cpp b/fpga/hls/frame_generator.cpp new file mode 100644 index 000000000..db2df3271 --- /dev/null +++ b/fpga/hls/frame_generator.cpp @@ -0,0 +1,118 @@ +// Copyright (2019-2023) Paul Scherrer Institute +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "hls_jfjoch.h" +#include "ip_header_checksum.h" + +void generate_packet(STREAM_512 &data_out, + ap_uint<512> *uram, + ap_uint<32> frame, + ap_uint<8> module, + ap_uint<7> eth_packet, + ap_uint<48> src_mac_addr, + ap_uint<48> dest_mac_addr, + ap_uint<32> src_ipv4_addr, + ap_uint<32> dest_ipv4_addr, + ap_uint<64> bunchid, + ap_uint<32> exptime, + ap_uint<64> timestamp, + ap_uint<32> debug) { +#pragma HLS PIPELINE II=130 + ap_uint<720> header = 0; + + header(47 , 0) = dest_mac_addr; + header(95 , 48) = src_mac_addr; + header(111, 96) = 0x0008; // ETHER_IP = IPv4 + header(eth_payload_pos+3 , eth_payload_pos ) = 0x5; // header len of 5 + header(eth_payload_pos+7 , eth_payload_pos+4 ) = 0x4; // IPv4 + header(eth_payload_pos+31 , eth_payload_pos+16 ) = 0x4C20; // total length = 8268 + header(eth_payload_pos+79 , eth_payload_pos+72 ) = PROTOCOL_UDP; // UDP + header(eth_payload_pos+127, eth_payload_pos+96 ) = src_ipv4_addr; + header(eth_payload_pos+159, eth_payload_pos+128) = dest_ipv4_addr; + header(eth_payload_pos+95 , eth_payload_pos+80 ) = computeCheckSum20B(header(eth_payload_pos + 159, eth_payload_pos)); + + header(ipv4_payload_pos+47, ipv4_payload_pos+32) = 0x3820; // UDP length = 8248 + header(udp_payload_pos+63, udp_payload_pos) = frame + 1; + header(udp_payload_pos+95, udp_payload_pos+64) = exptime; + header(udp_payload_pos+127, udp_payload_pos+96) = eth_packet; + header(udp_payload_pos+2*64+63, udp_payload_pos+2*64) = bunchid; + header(udp_payload_pos+3*64+63, udp_payload_pos+3*64) = timestamp; + header(udp_payload_pos+4*64+31, udp_payload_pos+4*64+16) = 2 * module; + header(udp_payload_pos+5*64+31, udp_payload_pos+5*64) = debug; + + packet_512_t packet; + packet.data = header(511 ,0); + packet.last = 0; + packet.dest = 0; + packet.id = 0; + packet.strb = UINT64_MAX; + packet.keep = UINT64_MAX; + packet.user = 0; + + data_out << packet; + + ap_uint<208> remainder = header(719, 512); + for (int i = 0; i < 128; i++) { + ap_uint<512> tmp = uram[eth_packet * 128 + i]; + //tmp(255, 0) = d_hbm_p0[eth_packet * 128 + i]; + //tmp(511, 256) = d_hbm_p1[eth_packet * 128 + i]; + packet.data(207, 0) = remainder; + packet.data(511, 208) = tmp(303, 0); + data_out << packet; + remainder = tmp(511, 304); + } + packet.data(207, 0) = remainder; + packet.data(511, 208) = 0; + packet.keep(63, 26) = 0; + packet.last = 1; + data_out << packet; +} + +void frame_generator(STREAM_512 &data_out, + ap_uint<512> *uram, + ap_uint<32> frames, + ap_uint<5> modules, + ap_uint<48> src_mac_addr, + ap_uint<48> dest_mac_addr, + ap_uint<32> src_ipv4_addr, + ap_uint<32> dest_ipv4_addr, + ap_uint<64> bunchid, + ap_uint<32> exptime, + ap_uint<32> debug) { +#pragma HLS INTERFACE mode=s_axilite port=return +#pragma HLS INTERFACE mode=s_axilite port=frames +#pragma HLS INTERFACE mode=s_axilite port=modules +#pragma HLS INTERFACE mode=s_axilite port=bunchid +#pragma HLS INTERFACE mode=s_axilite port=exptime +#pragma HLS INTERFACE mode=s_axilite port=debug +#pragma HLS INTERFACE mode=s_axilite port=dest_mac_addr +#pragma HLS INTERFACE mode=s_axilite port=dest_ipv4_addr +#pragma HLS INTERFACE mode=ap_none port=src_mac_addr +#pragma HLS INTERFACE mode=ap_none port=src_ipv4_addr + +#pragma HLS INTERFACE register both axis port=data_out +#pragma HLS INTERFACE m_axi port=uram bundle=uram depth=512 offset=off \ + max_read_burst_length=64 max_write_burst_length=2 latency=5 num_write_outstanding=2 num_read_outstanding=2 +//#pragma HLS INTERFACE m_axi port=d_hbm_p0 bundle=d_hbm_p0 depth=512 offset=off \ +// max_read_burst_length=16 max_write_burst_length=2 latency=120 num_write_outstanding=2 num_read_outstanding=9 +//#pragma HLS INTERFACE m_axi port=d_hbm_p1 bundle=d_hbm_p1 depth=512 offset=off \ +// max_read_burst_length=16 max_write_burst_length=2 latency=120 num_write_outstanding=2 num_read_outstanding=9 + + for (uint32_t f = 0; f < frames; f++) { + for (uint32_t p = 0; p < 128; p++) { + for (uint32_t m = 0; m < modules; m++) { + generate_packet(data_out, + uram, + f, m, p, + src_mac_addr, + dest_mac_addr, + src_ipv4_addr, + dest_ipv4_addr, + bunchid + f, + exptime, + exptime * f, + debug); + } + } + } +} diff --git a/fpga/hls/hls_jfjoch.h b/fpga/hls/hls_jfjoch.h index a16f39528..0224036ac 100644 --- a/fpga/hls/hls_jfjoch.h +++ b/fpga/hls/hls_jfjoch.h @@ -95,6 +95,18 @@ void load_calibration(ap_uint<256> *d_hbm_p0, hls::stream > &host_memory_in, uint64_t in_mem_location[LOAD_CALIBRATION_BRAM_SIZE]); +void frame_generator(STREAM_512 &data_out, + ap_uint<512> *uram, + ap_uint<32> frames, + ap_uint<5> modules, + ap_uint<48> src_mac_addr, + ap_uint<48> dest_mac_addr, + ap_uint<32> src_ipv4_addr, + ap_uint<32> dest_ipv4_addr, + ap_uint<64> bunchid, + ap_uint<32> exptime, + ap_uint<32> debug); + void jf_conversion(STREAM_512 &data_in, STREAM_512 &data_out, hls::stream &addr_in, hls::stream &addr_out, @@ -119,11 +131,9 @@ void timer_host(STREAM_512 &data_in, STREAM_512 &data_out, volatile uint64_t &counter); -void internal_packet_generator(STREAM_512 &data_in, STREAM_512 &data_out, - hls::stream &addr_in, - hls::stream &addr_out, - ap_uint<512> module_cache[RAW_MODULE_SIZE * sizeof(uint16_t) / 512 * 8], - volatile ap_uint<1> &in_cancel); +void stream_merge(AXI_STREAM &input_0, + AXI_STREAM &input_1, + AXI_STREAM &output); template ap_uint pack32(ap_int in[32]) { #pragma HLS INLINE diff --git a/fpga/hls/internal_packet_generator.cpp b/fpga/hls/internal_packet_generator.cpp deleted file mode 100644 index 4f8b061ef..000000000 --- a/fpga/hls/internal_packet_generator.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (2019-2022) Paul Scherrer Institute -// SPDX-License-Identifier: CERN-OHL-S-2.0 or GPL-3.0-or-later - -#include "hls_jfjoch.h" - -void internal_packet_generator(STREAM_512 &data_in, STREAM_512 &data_out, - hls::stream &addr_in, - hls::stream &addr_out, - ap_uint<512> *frame, - volatile ap_uint<1> &in_cancel) { -#pragma HLS INTERFACE ap_ctrl_none port=return -#pragma HLS INTERFACE register both axis port=data_in -#pragma HLS INTERFACE register both axis port=data_out -#pragma HLS INTERFACE register both axis port=addr_in -#pragma HLS INTERFACE register both axis port=addr_out -#pragma HLS INTERFACE m_axi port=frame bundle=frame depth=512 offset=off \ - max_read_burst_length=64 max_write_burst_length=2 latency=3 num_write_outstanding=2 num_read_outstanding=2 - -#pragma HLS INTERFACE ap_none register port=in_cancel - - packet_512_t packet_in; - packet_512_t packet_out; - - // Read and forward packet #0 - data_in >> packet_in; - ap_uint<5> modules = ACT_REG_NMODULES(packet_in.data); - ap_uint<64> mode = ACT_REG_MODE(packet_in.data); - ap_uint<1> internal_packet_generator = (mode & MODE_INTERNAL_PACKET_GEN) ? 1 : 0; - ap_uint<32> nframes = ACT_REG_NFRAMES(packet_in.data); - ap_uint<5> storage_cells = ACT_REG_NSTORAGE_CELLS(packet_in.data); - ap_uint<1> conversion = (mode & MODE_CONV) ? 1 : 0; - - data_out << packet_in; - axis_addr addr; - addr_in >> addr; - addr_out << addr; - - if (internal_packet_generator) { - uint32_t frame_number = 1; - uint8_t module_number = 0; - - generate_frames: - while (!in_cancel.read() && (frame_number <= nframes)) { - for (uint32_t i = 0; i < RAW_MODULE_SIZE * 2 / 64; i++) { -#pragma HLS PIPELINE II=1 - uint32_t eth_packet = i / 128; - uint32_t axis_packet = i % 128; - if (axis_packet == 0) { - axis_addr addr_x; - addr_x.eth_packet = eth_packet; - addr_x.module = module_number; - addr_x.frame_number = frame_number; - addr_x.debug = INT_PKT_GEN_DEBUG; - addr_x.timestamp = INT_PKT_GEN_TIMESTAMP; - addr_x.bunchid = INT_PKT_GEN_BUNCHID; - addr_x.exptime = INT_PKT_GEN_EXPTTIME; - addr_x.last = 0; - addr_out << addr_x; - } - packet_out.user = 0; - packet_out.id = 0; - packet_out.last = (axis_packet == 127) ? 1 : 0; - packet_out.data = frame[i]; - data_out << packet_out; - } - if (module_number == modules - 1) { - frame_number++; - module_number = 0; - } else - module_number++; - } - } - - addr_in >> addr; - - forward_packets: - while (!addr.last) { -#pragma HLS PIPELINE II=1 - data_in >> packet_in; - data_out << packet_in; - if (packet_in.last) { - addr_out << addr; - addr_in >> addr; - } - } - - addr_out << addr; - data_in >> packet_in; - data_out << packet_in; -} diff --git a/fpga/hls/load_from_hbm.cpp b/fpga/hls/load_from_hbm.cpp deleted file mode 100644 index 67a109f8b..000000000 --- a/fpga/hls/load_from_hbm.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (2019-2023) Paul Scherrer Institute -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "hls_jfjoch.h" - -void load_from_hbm(STREAM_512 &data_out, - hls::stream &completion_in, - hls::stream &completion_out, - hls::burst_maxi d_hbm_p0, - hls::burst_maxi d_hbm_p1, - ap_uint<32> hbm_size) { -#pragma HLS INTERFACE ap_ctrl_none port=return -#pragma HLS INTERFACE register both axis port=data_out -#pragma HLS INTERFACE register both axis port=completion_in -#pragma HLS INTERFACE register both axis port=completion_out -#pragma HLS INTERFACE register ap_none port=hbm_size - -#pragma HLS INTERFACE m_axi port=d_hbm_p0 bundle=d_hbm_p0 depth=512 offset=off \ - max_read_burst_length=16 max_write_burst_length=2 latency=120 num_write_outstanding=2 num_read_outstanding=8 -#pragma HLS INTERFACE m_axi port=d_hbm_p1 bundle=d_hbm_p1 depth=512 offset=off \ - max_read_burst_length=16 max_write_burst_length=2 latency=120 num_write_outstanding=2 num_read_outstanding=8 - - axis_completion cmpl; - - completion_in >> cmpl; - - ap_uint<32> offset_hbm_0 = 12 * (hbm_size / 32); - ap_uint<32> offset_hbm_1 = 14 * (hbm_size / 32); - - while (!cmpl.last) { - completion_out << cmpl; - for (int i = 0; i < RAW_MODULE_SIZE * sizeof(uint16_t) / 64; i++) { -#pragma HLS PIPELINE II=1 - if (i % 16 == 0) { - d_hbm_p0.read_request(offset_hbm_0 + cmpl.handle * RAW_MODULE_SIZE * sizeof(uint16_t) / 32 / 2 + i, 16); - d_hbm_p1.read_request(offset_hbm_1 + cmpl.handle * RAW_MODULE_SIZE * sizeof(uint16_t) / 32 / 2 + i, 16); - } - packet_512_t packet_out; - packet_out.data(255, 0) = d_hbm_p0.read(); - packet_out.data(511,256) = d_hbm_p1.read(); - if (cmpl.packet_mask[i/128] == 0) { - for (int i = 0; i < 32; i++) - packet_out.data(16*i+15,16*i) = PIXEL_OUT_LOST; - } - packet_out.keep = UINT64_MAX; - packet_out.strb = UINT64_MAX; - packet_out.last = (i == (RAW_MODULE_SIZE / 32 * 2 - 1)); - data_out << packet_out; - } - completion_in >> cmpl; - } - completion_out << cmpl; -} diff --git a/fpga/hls/stream_merge.cpp b/fpga/hls/stream_merge.cpp new file mode 100644 index 000000000..7653f44e6 --- /dev/null +++ b/fpga/hls/stream_merge.cpp @@ -0,0 +1,46 @@ +// Copyright (2019-2023) Paul Scherrer Institute +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "hls_jfjoch.h" + +void stream_merge(AXI_STREAM &input_0, + AXI_STREAM &input_1, + AXI_STREAM &output) { +#pragma HLS INTERFACE ap_ctrl_none port=return +#pragma HLS INTERFACE axis register both port=input_0 +#pragma HLS INTERFACE axis register both port=input_1 +#pragma HLS INTERFACE axis register both port=output + +#pragma HLS PIPELINE II=1 style=flp + enum state {ARBITRATE, FORWARD}; + static state state = ARBITRATE; + static ap_uint<1> select_input = 0; + + packet_512_t packet_in; +#pragma HLS RESET variable=state + switch (state) { + case ARBITRATE: + if (input_0.read_nb(packet_in)) { + select_input = 0; + if (!packet_in.last) + state = FORWARD; + output.write(packet_in); + } else if (input_1.read_nb(packet_in)) { + select_input = 1; + if (!packet_in.last) + state = FORWARD; + output.write(packet_in); + } + break; + case FORWARD: + if (select_input == 0) { + input_0.read(packet_in); + } else + input_1.read(packet_in); + output.write(packet_in); + + if (packet_in.last) + state = ARBITRATE; + break; + } +} diff --git a/fpga/pcie_driver/ActionConfig.h b/fpga/pcie_driver/ActionConfig.h index 8a31793bc..fa6915693 100644 --- a/fpga/pcie_driver/ActionConfig.h +++ b/fpga/pcie_driver/ActionConfig.h @@ -69,6 +69,17 @@ struct ActionEnvParams { bool ethernet_aligned; }; + +struct FrameGeneratorConfig { + uint32_t frames; + uint32_t modules; + uint64_t dest_mac_addr; + uint32_t dest_ipv4_addr; + uint64_t bunchid; + uint32_t exptime; + uint32_t debug; +}; + #pragma pack(pop) #endif //JUNGFRAUJOCH_ACTIONCONFIG_H diff --git a/fpga/pcie_driver/jfjoch_drv.h b/fpga/pcie_driver/jfjoch_drv.h index e5d29cd0d..abf097c5b 100644 --- a/fpga/pcie_driver/jfjoch_drv.h +++ b/fpga/pcie_driver/jfjoch_drv.h @@ -42,11 +42,23 @@ #define CMAC_OFFSET (0x020000) #define PCIE_OFFSET (0x090000) #define INT_PKT_GEN_OFFSET (0x100000) +#define FRAME_GEN_OFFSET (0x080000) -#define ADDR_LOAD_CALIBRATION_CTRL (0x000000) -#define ADDR_LOAD_CALIBRATION_MOD (0x000010) -#define ADDR_LOAD_CALIBRATION_SC (0x000018) -#define ADDR_LOAD_CALIBRATION_MEM (0x002000) +#define ADDR_LOAD_CALIBRATION_CTRL (LOAD_CALIBRATION_OFFSET | 0x000000) +#define ADDR_LOAD_CALIBRATION_MOD (LOAD_CALIBRATION_OFFSET | 0x000010) +#define ADDR_LOAD_CALIBRATION_SC (LOAD_CALIBRATION_OFFSET | 0x000018) +#define ADDR_LOAD_CALIBRATION_MEM (LOAD_CALIBRATION_OFFSET | 0x002000) + +#define ADDR_FRAME_GEN_CTRL (FRAME_GEN_OFFSET | 0x000000) +#define ADDR_FRAME_GEN_FRAMES (FRAME_GEN_OFFSET | 0x000010) +#define ADDR_FRAME_GEN_MODULES (FRAME_GEN_OFFSET | 0x000018) +#define ADDR_FRAME_GEN_DEST_MAC_LO (FRAME_GEN_OFFSET | 0x000020) +#define ADDR_FRAME_GEN_DEST_MAC_HI (FRAME_GEN_OFFSET | 0x000024) +#define ADDR_FRAME_GEN_DEST_IPV4_ADDR (FRAME_GEN_OFFSET | 0x00002C) +#define ADDR_FRAME_GEN_BUNCHID_LO (FRAME_GEN_OFFSET | 0x000034) +#define ADDR_FRAME_GEN_BUNCHID_HI (FRAME_GEN_OFFSET | 0x000038) +#define ADDR_FRAME_GEN_EXPTIME (FRAME_GEN_OFFSET | 0x000040) +#define ADDR_FRAME_GEN_DEBUG (FRAME_GEN_OFFSET | 0x000048) #define JFJOCH_DMA_SETTINGS (XDMA_CTRL_RUN_STOP | XDMA_CTRL_IE_DESC_ALIGN_MISMATCH | XDMA_CTRL_IE_DESC_ERROR | XDMA_CTRL_IE_READ_ERROR \ | XDMA_CTRL_IE_WRITE_ERROR | XDMA_CTRL_IE_DESC_COMPLETED | XDMA_CTRL_STM_MODE_WB) @@ -113,6 +125,7 @@ void jfjoch_get_ipv4_addr(struct jfjoch_drvdata *drvdata, u32 *addr); void jfjoch_load_int_pkt_gen(struct jfjoch_drvdata *drvdata, char* output); void jfjoch_save_int_pkt_gen(struct jfjoch_drvdata *drvdata, const char* input); int jfjoch_load_calibration(struct jfjoch_drvdata *drvdata, struct ActionConfig *config); +int jfjoch_run_frame_gen(struct jfjoch_drvdata *drvdata, struct FrameGeneratorConfig *config); u64 jfjoch_read_mac_addr(struct jfjoch_drvdata *drvdata); diff --git a/fpga/pcie_driver/jfjoch_function.c b/fpga/pcie_driver/jfjoch_function.c index f5f8e4518..17cefe036 100644 --- a/fpga/pcie_driver/jfjoch_function.c +++ b/fpga/pcie_driver/jfjoch_function.c @@ -277,6 +277,8 @@ void jfjoch_get_env_data(struct jfjoch_drvdata *drvdata, struct ActionEnvParams env_params->hbm_0_temp_C = ioread32(drvdata->bar0 + CMS_OFFSET + ADDR_CMS_HBM_TEMP1_INS_REG); env_params->hbm_1_temp_C = ioread32(drvdata->bar0 + CMS_OFFSET + ADDR_CMS_HBM_TEMP2_INS_REG); + // Somehow it is better to ask twice + env_params->ethernet_aligned = ioread32(drvdata->bar0 + CMAC_OFFSET + 0x0204) & 0x2; env_params->ethernet_aligned = ioread32(drvdata->bar0 + CMAC_OFFSET + 0x0204) & 0x2; } @@ -297,8 +299,8 @@ int jfjoch_load_calibration(struct jfjoch_drvdata *drvdata, struct ActionConfig for (i = 0; i < cell_count; i++) { u64 addr = drvdata->bufs[i].dma_address; - iowrite32(PCI_DMA_L(addr), drvdata->bar0 + LOAD_CALIBRATION_OFFSET + ADDR_LOAD_CALIBRATION_MEM + i * 2 * 4); - iowrite32(PCI_DMA_H(addr), drvdata->bar0 + LOAD_CALIBRATION_OFFSET + ADDR_LOAD_CALIBRATION_MEM + (i * 2 + 1) * 4); + iowrite32(PCI_DMA_L(addr), drvdata->bar0 + ADDR_LOAD_CALIBRATION_MEM + i * 2 * 4); + iowrite32(PCI_DMA_H(addr), drvdata->bar0 + ADDR_LOAD_CALIBRATION_MEM + (i * 2 + 1) * 4); } // Start DMA @@ -307,13 +309,13 @@ int jfjoch_load_calibration(struct jfjoch_drvdata *drvdata, struct ActionConfig iowrite32((1 << 2), drvdata->bar0 + PCIE_OFFSET + (0<<12) + 0xC0); iowrite32(JFJOCH_DMA_SETTINGS, drvdata->bar0 + PCIE_OFFSET + (0<<12) + 0x04); - iowrite32(config->nmodules, drvdata->bar0 + LOAD_CALIBRATION_OFFSET + ADDR_LOAD_CALIBRATION_MOD); - iowrite32(config->nstorage_cells, drvdata->bar0 + LOAD_CALIBRATION_OFFSET + ADDR_LOAD_CALIBRATION_SC); - iowrite32(0x1, drvdata->bar0 + LOAD_CALIBRATION_OFFSET + ADDR_LOAD_CALIBRATION_CTRL); + iowrite32(config->nmodules, drvdata->bar0 + ADDR_LOAD_CALIBRATION_MOD); + iowrite32(config->nstorage_cells, drvdata->bar0 + ADDR_LOAD_CALIBRATION_SC); + iowrite32(0x1, drvdata->bar0 + ADDR_LOAD_CALIBRATION_CTRL); i = 0; while (i < 1000) { - if (ioread32(drvdata->bar0 + LOAD_CALIBRATION_OFFSET + ADDR_LOAD_CALIBRATION_CTRL) & (1 << 1)) + if (ioread32(drvdata->bar0 + ADDR_LOAD_CALIBRATION_CTRL) & (1 << 1)) break; msleep(10); i++; @@ -327,5 +329,26 @@ int jfjoch_load_calibration(struct jfjoch_drvdata *drvdata, struct ActionConfig return -ETIMEDOUT; } + return 0; +} + +int jfjoch_run_frame_gen(struct jfjoch_drvdata *drvdata, struct FrameGeneratorConfig *config) { + struct device *const dev = &drvdata->pdev->dev; + + if (ioread32(drvdata->bar0 + ADDR_FRAME_GEN_CTRL) & 0x1) { + dev_err(dev, "Frame generator busy\n"); + return -EBUSY; + } + + iowrite32(config->frames, drvdata->bar0 + ADDR_FRAME_GEN_FRAMES); + iowrite32(config->modules, drvdata->bar0 + ADDR_FRAME_GEN_MODULES); + iowrite32(config->dest_ipv4_addr, drvdata->bar0 + ADDR_FRAME_GEN_DEST_IPV4_ADDR); + iowrite32(config->dest_mac_addr & 0xFFFFFFFF, drvdata->bar0 + ADDR_FRAME_GEN_DEST_MAC_LO); + iowrite32(config->dest_mac_addr >> 32, drvdata->bar0 + ADDR_FRAME_GEN_DEST_MAC_HI); + iowrite32(config->bunchid & 0xFFFFFFFF, drvdata->bar0 + ADDR_FRAME_GEN_BUNCHID_LO); + iowrite32(config->bunchid >> 32, drvdata->bar0 + ADDR_FRAME_GEN_BUNCHID_HI); + iowrite32(config->exptime, drvdata->bar0 + ADDR_FRAME_GEN_EXPTIME); + iowrite32(config->debug, drvdata->bar0 + ADDR_FRAME_GEN_DEBUG); + iowrite32(0x1, drvdata->bar0 + ADDR_FRAME_GEN_CTRL); return 0; } \ No newline at end of file diff --git a/fpga/pcie_driver/jfjoch_ioctl.c b/fpga/pcie_driver/jfjoch_ioctl.c index d66db572b..592f36bd9 100644 --- a/fpga/pcie_driver/jfjoch_ioctl.c +++ b/fpga/pcie_driver/jfjoch_ioctl.c @@ -9,6 +9,7 @@ long jfjoch_cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct ActionStatus status; struct ActionConfig config; struct ActionEnvParams env_params; + struct FrameGeneratorConfig frame_generator_config; u32 exchange[16]; int err; void *tmp = NULL; @@ -101,6 +102,10 @@ long jfjoch_cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { case IOCTL_JFJOCH_DEFAULT_MAC: jfjoch_read_mac_addr(drvdata); return 0; + case IOCTL_JFJOCH_RUN_FRAME_GEN: + if (copy_from_user(&frame_generator_config, (char *) arg, sizeof(struct FrameGeneratorConfig)) != 0) + return -EFAULT; + return jfjoch_run_frame_gen(drvdata, &frame_generator_config); case IOCTL_JFJOCH_SET_INT_PKT: tmp = vmalloc(INT_PKT_GEN_FRAME_SIZE_BYTES); if (tmp == NULL) diff --git a/fpga/pcie_driver/jfjoch_ioctl.h b/fpga/pcie_driver/jfjoch_ioctl.h index 5ccdfed2e..6a239b28a 100644 --- a/fpga/pcie_driver/jfjoch_ioctl.h +++ b/fpga/pcie_driver/jfjoch_ioctl.h @@ -36,5 +36,6 @@ #define IOCTL_JFJOCH_SET_INT_PKT _IOW(IOCTL_JFJOCH_MAGIC, 19, char *) #define IOCTL_JFJOCH_GET_INT_PKT _IOR(IOCTL_JFJOCH_MAGIC, 20, char *) #define IOCTL_JFJOCH_LOAD_CALIB _IOW(IOCTL_JFJOCH_MAGIC, 21, struct ActionConfig) +#define IOCTL_JFJOCH_RUN_FRAME_GEN _IOW(IOCTL_JFJOCH_MAGIC, 22, struct FrameGeneratorConfig) #endif //JUNGFRAUJOCH_JFJOCH_IOCTL_H diff --git a/fpga/scripts/bd_pcie.tcl b/fpga/scripts/bd_pcie.tcl index be36695fd..94280f663 100644 --- a/fpga/scripts/bd_pcie.tcl +++ b/fpga/scripts/bd_pcie.tcl @@ -147,12 +147,13 @@ xilinx.com:ip:axi_bram_ctrl:4.1\ xilinx.com:ip:axis_data_fifo:2.0\ xilinx.com:ip:axis_register_slice:1.1\ psi.ch:hls:data_collection_fsm:1.0\ +psi.ch:hls:frame_generator:1.0\ psi.ch:hls:host_writer:1.0\ -psi.ch:hls:internal_packet_generator:1.0\ xilinx.com:ip:blk_mem_gen:8.4\ psi.ch:hls:jf_conversion:1.0\ psi.ch:hls:load_calibration:1.0\ xilinx.com:ip:mailbox:2.1\ +psi.ch:hls:stream_merge:1.0\ psi.ch:hls:timer_host:1.0\ xilinx.com:ip:cmac_usplus:3.1\ xilinx.com:ip:util_vector_logic:2.0\ @@ -437,10 +438,11 @@ proc create_root_design { parentCell } { assign_bd_address -offset 0x00050000 -range 0x00010000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs axi_intc_0/S_AXI/Reg] -force assign_bd_address -offset 0x00060000 -range 0x00010000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs jungfraujoch_0/load_calibration_0/s_axi_control/Reg] -force assign_bd_address -offset 0x00070000 -range 0x00010000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs pcie_dma_0/axi_firewall_0/S_AXI_CTL/Control] -force + assign_bd_address -offset 0x00080000 -range 0x00010000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs jungfraujoch_0/frame_generator_0/s_axi_control/Reg] -force assign_bd_address -offset 0x00090000 -range 0x00010000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs pcie_dma_0/xdma_0/S_AXI_LITE/CTL0] -force assign_bd_address -offset 0x000C0000 -range 0x00040000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs cms_subsystem_0/s_axi_ctrl/Mem] -force assign_bd_address -offset 0x00100000 -range 0x00100000 -target_address_space [get_bd_addr_spaces pcie_dma_0/xdma_0/M_AXI_LITE] [get_bd_addr_segs jungfraujoch_0/axi_bram_ctrl_internal_packet_generator_0/S_AXI/Mem0] -force - assign_bd_address -offset 0x00100000 -range 0x00100000 -target_address_space [get_bd_addr_spaces jungfraujoch_0/internal_packet_generator_0/Data_m_axi_frame] [get_bd_addr_segs jungfraujoch_0/axi_bram_ctrl_internal_packet_generator_1/S_AXI/Mem0] -force + assign_bd_address -offset 0x00000000 -range 0x00100000 -target_address_space [get_bd_addr_spaces jungfraujoch_0/frame_generator_0/Data_m_axi_uram] [get_bd_addr_segs jungfraujoch_0/axi_bram_ctrl_internal_packet_generator_1/S_AXI/Mem0] -force assign_bd_address diff --git a/fpga/scripts/jfjoch.tcl b/fpga/scripts/jfjoch.tcl index a12141934..f55186331 100644 --- a/fpga/scripts/jfjoch.tcl +++ b/fpga/scripts/jfjoch.tcl @@ -2,7 +2,7 @@ ## SPDX-License-Identifier: CERN-OHL-S-2.0 # Hierarchical cell: jungfraujoch -proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { +proc create_hier_cell_jungfraujoch { parentCell nameHier } { variable script_folder @@ -100,7 +100,7 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { set_property -dict [ list \ CONFIG.DATA_WIDTH {512} \ CONFIG.PROTOCOL {AXI4} \ - CONFIG.READ_LATENCY {1} \ + CONFIG.READ_LATENCY {3} \ CONFIG.SINGLE_PORT_BRAM {1} \ ] $axi_bram_ctrl_internal_packet_generator_0 @@ -109,7 +109,7 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { set_property -dict [ list \ CONFIG.DATA_WIDTH {512} \ CONFIG.PROTOCOL {AXI4} \ - CONFIG.READ_LATENCY {1} \ + CONFIG.READ_LATENCY {3} \ CONFIG.SINGLE_PORT_BRAM {1} \ ] $axi_bram_ctrl_internal_packet_generator_1 @@ -118,6 +118,8 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { set_property -dict [ list \ CONFIG.FIFO_DEPTH {128} \ CONFIG.FIFO_MEMORY_TYPE {block} \ + CONFIG.HAS_AEMPTY {1} \ + CONFIG.HAS_AFULL {1} \ ] $axis_addr_fifo_0 # Create instance: axis_addr_fifo_1, and set properties @@ -129,15 +131,6 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { CONFIG.HAS_AFULL {1} \ ] $axis_addr_fifo_1 - # Create instance: axis_addr_fifo_2, and set properties - set axis_addr_fifo_2 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_addr_fifo_2 ] - set_property -dict [ list \ - CONFIG.FIFO_DEPTH {256} \ - CONFIG.FIFO_MEMORY_TYPE {block} \ - CONFIG.HAS_AEMPTY {1} \ - CONFIG.HAS_AFULL {1} \ - ] $axis_addr_fifo_2 - # Create instance: axis_data_fifo_0, and set properties set axis_data_fifo_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_fifo_0 ] set_property -dict [ list \ @@ -150,6 +143,8 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { set_property -dict [ list \ CONFIG.FIFO_DEPTH {256} \ CONFIG.FIFO_MEMORY_TYPE {block} \ + CONFIG.HAS_AEMPTY {1} \ + CONFIG.HAS_AFULL {1} \ ] $axis_data_fifo_1 # Create instance: axis_data_fifo_2, and set properties @@ -157,25 +152,16 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { set_property -dict [ list \ CONFIG.FIFO_DEPTH {256} \ CONFIG.FIFO_MEMORY_TYPE {block} \ - CONFIG.HAS_AEMPTY {1} \ - CONFIG.HAS_AFULL {1} \ ] $axis_data_fifo_2 # Create instance: axis_data_fifo_3, and set properties set axis_data_fifo_3 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_fifo_3 ] - set_property -dict [ list \ - CONFIG.FIFO_DEPTH {256} \ - CONFIG.FIFO_MEMORY_TYPE {block} \ - ] $axis_data_fifo_3 - - # Create instance: axis_data_fifo_4, and set properties - set axis_data_fifo_4 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_fifo_4 ] set_property -dict [ list \ CONFIG.FIFO_DEPTH {32768} \ CONFIG.FIFO_MEMORY_TYPE {ultra} \ CONFIG.HAS_AEMPTY {1} \ CONFIG.HAS_AFULL {1} \ - ] $axis_data_fifo_4 + ] $axis_data_fifo_3 # Create instance: axis_data_fifo_c2h_cmd, and set properties set axis_data_fifo_c2h_cmd [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_data_fifo_c2h_cmd ] @@ -213,11 +199,19 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { CONFIG.TDATA_NUM_BYTES {64} \ ] $axis_data_fifo_h2c_data - # Create instance: axis_register_slice_addr_0, and set properties - set axis_register_slice_addr_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_register_slice:1.1 axis_register_slice_addr_0 ] + # Create instance: axis_eth_in_fifo, and set properties + set axis_eth_in_fifo [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_eth_in_fifo ] set_property -dict [ list \ - CONFIG.REG_CONFIG {16} \ - ] $axis_register_slice_addr_0 + CONFIG.HAS_AEMPTY {1} \ + CONFIG.HAS_AFULL {1} \ + ] $axis_eth_in_fifo + + # Create instance: axis_frame_generator_fifo_0, and set properties + set axis_frame_generator_fifo_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_data_fifo:2.0 axis_frame_generator_fifo_0 ] + set_property -dict [ list \ + CONFIG.HAS_AEMPTY {1} \ + CONFIG.HAS_AFULL {1} \ + ] $axis_frame_generator_fifo_0 # Create instance: axis_register_slice_addr_1, and set properties set axis_register_slice_addr_1 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_register_slice:1.1 axis_register_slice_addr_1 ] @@ -225,12 +219,6 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { CONFIG.REG_CONFIG {16} \ ] $axis_register_slice_addr_1 - # Create instance: axis_register_slice_data_0, and set properties - set axis_register_slice_data_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_register_slice:1.1 axis_register_slice_data_0 ] - set_property -dict [ list \ - CONFIG.REG_CONFIG {16} \ - ] $axis_register_slice_data_0 - # Create instance: axis_register_slice_data_1, and set properties set axis_register_slice_data_1 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axis_register_slice:1.1 axis_register_slice_data_1 ] set_property -dict [ list \ @@ -292,12 +280,12 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { # Create instance: data_collection_fsm_0, and set properties set data_collection_fsm_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:data_collection_fsm:1.0 data_collection_fsm_0 ] + # Create instance: frame_generator_0, and set properties + set frame_generator_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:frame_generator:1.0 frame_generator_0 ] + # Create instance: host_writer_0, and set properties set host_writer_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:host_writer:1.0 host_writer_0 ] - # Create instance: internal_packet_generator_0, and set properties - set internal_packet_generator_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:internal_packet_generator:1.0 internal_packet_generator_0 ] - # Create instance: internal_packet_generator_uram, and set properties set internal_packet_generator_uram [ create_bd_cell -type ip -vlnv xilinx.com:ip:blk_mem_gen:8.4 internal_packet_generator_uram ] set_property -dict [ list \ @@ -312,6 +300,8 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { CONFIG.Port_B_Clock {100} \ CONFIG.Port_B_Enable_Rate {100} \ CONFIG.Port_B_Write_Rate {50} \ + CONFIG.READ_LATENCY_A {3} \ + CONFIG.READ_LATENCY_B {3} \ CONFIG.Read_Width_B {512} \ CONFIG.Use_Byte_Write_Enable {true} \ CONFIG.Use_RSTB_Pin {true} \ @@ -339,7 +329,7 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { set smartconnect_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:smartconnect:1.0 smartconnect_0 ] set_property -dict [ list \ CONFIG.NUM_CLKS {1} \ - CONFIG.NUM_MI {4} \ + CONFIG.NUM_MI {5} \ CONFIG.NUM_SI {1} \ ] $smartconnect_0 @@ -349,6 +339,9 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { # Create instance: smartconnect_2, and set properties set smartconnect_2 [ create_bd_cell -type ip -vlnv xilinx.com:ip:smartconnect:1.0 smartconnect_2 ] + # Create instance: stream_merge_0, and set properties + set stream_merge_0 [ create_bd_cell -type ip -vlnv psi.ch:hls:stream_merge:1.0 stream_merge_0 ] + # Create instance: timer_hbm, and set properties set timer_hbm [ create_bd_cell -type ip -vlnv psi.ch:hls:timer_host:1.0 timer_hbm ] @@ -357,27 +350,24 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { # Create interface connections connect_bd_intf_net -intf_net Conn2 [get_bd_intf_pins eth_out] [get_bd_intf_pins network_stack/M00_AXIS] - connect_bd_intf_net -intf_net Conn3 [get_bd_intf_pins eth_in] [get_bd_intf_pins network_stack/eth_in] connect_bd_intf_net -intf_net S_AXIS_1 [get_bd_intf_pins s_axis_h2c_data] [get_bd_intf_pins axis_data_fifo_h2c_data/S_AXIS] connect_bd_intf_net -intf_net axi_bram_ctrl_internal_packet_generator_1_BRAM_PORTA [get_bd_intf_pins axi_bram_ctrl_internal_packet_generator_1/BRAM_PORTA] [get_bd_intf_pins internal_packet_generator_uram/BRAM_PORTB] connect_bd_intf_net -intf_net axi_bram_ctrl_internal_packet_generator_BRAM_PORTA [get_bd_intf_pins axi_bram_ctrl_internal_packet_generator_0/BRAM_PORTA] [get_bd_intf_pins internal_packet_generator_uram/BRAM_PORTA] - connect_bd_intf_net -intf_net axis_addr_fifo_0_M_AXIS [get_bd_intf_pins axis_addr_fifo_0/M_AXIS] [get_bd_intf_pins internal_packet_generator_0/addr_in] - connect_bd_intf_net -intf_net axis_addr_fifo_2_M_AXIS [get_bd_intf_pins axis_addr_fifo_1/M_AXIS] [get_bd_intf_pins jf_conversion_0/addr_in] - connect_bd_intf_net -intf_net axis_addr_fifo_2_M_AXIS1 [get_bd_intf_pins axis_addr_fifo_2/M_AXIS] [get_bd_intf_pins host_writer_0/addr_in] - connect_bd_intf_net -intf_net axis_data_fifo_0_M_AXIS [get_bd_intf_pins axis_data_fifo_0/M_AXIS] [get_bd_intf_pins internal_packet_generator_0/data_in] - connect_bd_intf_net -intf_net axis_data_fifo_2_M_AXIS [get_bd_intf_pins axis_data_fifo_1/M_AXIS] [get_bd_intf_pins timer_hbm/data_in] - connect_bd_intf_net -intf_net axis_data_fifo_4_M_AXIS [get_bd_intf_pins axis_data_fifo_2/M_AXIS] [get_bd_intf_pins jf_conversion_0/data_in] - connect_bd_intf_net -intf_net axis_data_fifo_4_M_AXIS1 [get_bd_intf_pins axis_data_fifo_3/M_AXIS] [get_bd_intf_pins timer_host/data_in] - connect_bd_intf_net -intf_net axis_data_fifo_5_M_AXIS [get_bd_intf_pins axis_data_fifo_4/M_AXIS] [get_bd_intf_pins host_writer_0/data_in] + connect_bd_intf_net -intf_net axis_addr_fifo_0_M_AXIS [get_bd_intf_pins axis_addr_fifo_0/M_AXIS] [get_bd_intf_pins jf_conversion_0/addr_in] + connect_bd_intf_net -intf_net axis_addr_fifo_1_M_AXIS1 [get_bd_intf_pins axis_addr_fifo_1/M_AXIS] [get_bd_intf_pins host_writer_0/addr_in] + connect_bd_intf_net -intf_net axis_data_fifo_0_M_AXIS [get_bd_intf_pins axis_data_fifo_0/M_AXIS] [get_bd_intf_pins timer_hbm/data_in] + connect_bd_intf_net -intf_net axis_data_fifo_1_M_AXIS [get_bd_intf_pins axis_data_fifo_1/M_AXIS] [get_bd_intf_pins jf_conversion_0/data_in] + connect_bd_intf_net -intf_net axis_data_fifo_2_M_AXIS1 [get_bd_intf_pins axis_data_fifo_2/M_AXIS] [get_bd_intf_pins timer_host/data_in] + connect_bd_intf_net -intf_net axis_data_fifo_3_M_AXIS [get_bd_intf_pins axis_data_fifo_3/M_AXIS] [get_bd_intf_pins host_writer_0/data_in] connect_bd_intf_net -intf_net axis_data_fifo_c2h_cmd_M_AXIS [get_bd_intf_pins m_axis_c2h_datamover_cmd] [get_bd_intf_pins axis_data_fifo_c2h_cmd/M_AXIS] connect_bd_intf_net -intf_net axis_data_fifo_c2h_data_M_AXIS [get_bd_intf_pins m_axis_c2h_data] [get_bd_intf_pins axis_data_fifo_c2h_data/M_AXIS] connect_bd_intf_net -intf_net axis_data_fifo_h2c_cmd_M_AXIS [get_bd_intf_pins m_axis_h2c_datamover_cmd] [get_bd_intf_pins axis_data_fifo_h2c_cmd/M_AXIS] connect_bd_intf_net -intf_net axis_data_fifo_h2c_data_M_AXIS [get_bd_intf_pins axis_data_fifo_h2c_data/M_AXIS] [get_bd_intf_pins axis_register_slice_data_in_0/S_AXIS] - connect_bd_intf_net -intf_net axis_register_slice_0_M_AXIS [get_bd_intf_pins axis_addr_fifo_2/S_AXIS] [get_bd_intf_pins axis_register_slice_addr_1/M_AXIS] - connect_bd_intf_net -intf_net axis_register_slice_0_M_AXIS1 [get_bd_intf_pins axis_register_slice_data_in_0/M_AXIS] [get_bd_intf_pins load_calibration_0/host_memory_in] - connect_bd_intf_net -intf_net axis_register_slice_1_M_AXIS [get_bd_intf_pins axis_data_fifo_4/S_AXIS] [get_bd_intf_pins axis_register_slice_data_1/M_AXIS] - connect_bd_intf_net -intf_net axis_register_slice_2_M_AXIS [get_bd_intf_pins axis_addr_fifo_1/S_AXIS] [get_bd_intf_pins axis_register_slice_addr_0/M_AXIS] - connect_bd_intf_net -intf_net axis_register_slice_data_0_M_AXIS [get_bd_intf_pins axis_data_fifo_1/S_AXIS] [get_bd_intf_pins axis_register_slice_data_0/M_AXIS] + connect_bd_intf_net -intf_net axis_eth_in_fifo_M_AXIS [get_bd_intf_pins axis_eth_in_fifo/M_AXIS] [get_bd_intf_pins network_stack/eth_in] + connect_bd_intf_net -intf_net axis_frame_generator_fifo_0_M_AXIS [get_bd_intf_pins axis_frame_generator_fifo_0/M_AXIS] [get_bd_intf_pins stream_merge_0/input_0] + connect_bd_intf_net -intf_net axis_register_slice_addr_1_M_AXIS [get_bd_intf_pins axis_addr_fifo_1/S_AXIS] [get_bd_intf_pins axis_register_slice_addr_1/M_AXIS] + connect_bd_intf_net -intf_net axis_register_slice_data_1_M_AXIS [get_bd_intf_pins axis_data_fifo_3/S_AXIS] [get_bd_intf_pins axis_register_slice_data_1/M_AXIS] + connect_bd_intf_net -intf_net axis_register_slice_data_in_0_M_AXIS1 [get_bd_intf_pins axis_register_slice_data_in_0/M_AXIS] [get_bd_intf_pins load_calibration_0/host_memory_in] connect_bd_intf_net -intf_net axis_register_slice_host_mem_M_AXIS [get_bd_intf_pins axis_data_fifo_c2h_data/S_AXIS] [get_bd_intf_pins axis_register_slice_host_mem/M_AXIS] connect_bd_intf_net -intf_net axis_register_slice_udp_M_AXIS [get_bd_intf_pins axis_register_slice_udp/M_AXIS] [get_bd_intf_pins data_collection_fsm_0/eth_in] connect_bd_intf_net -intf_net axis_udp_addr_fifo_0_M_AXIS [get_bd_intf_pins axis_udp_addr_fifo_0/M_AXIS] [get_bd_intf_pins data_collection_fsm_0/addr_in] @@ -386,14 +376,14 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { connect_bd_intf_net -intf_net axis_work_request_fifo_0_M_AXIS [get_bd_intf_pins axis_work_request_fifo_0/M_AXIS] [get_bd_intf_pins host_writer_0/s_axis_work_request] connect_bd_intf_net -intf_net data_collection_fsm_0_addr_out [get_bd_intf_pins axis_addr_fifo_0/S_AXIS] [get_bd_intf_pins data_collection_fsm_0/addr_out] connect_bd_intf_net -intf_net data_collection_fsm_0_data_out [get_bd_intf_pins axis_data_fifo_0/S_AXIS] [get_bd_intf_pins data_collection_fsm_0/data_out] + connect_bd_intf_net -intf_net eth_in_1 [get_bd_intf_pins eth_in] [get_bd_intf_pins stream_merge_0/input_1] + connect_bd_intf_net -intf_net frame_generator_0_data_out [get_bd_intf_pins axis_frame_generator_fifo_0/S_AXIS] [get_bd_intf_pins frame_generator_0/data_out] + connect_bd_intf_net -intf_net frame_generator_0_m_axi_uram [get_bd_intf_pins axi_bram_ctrl_internal_packet_generator_1/S_AXI] [get_bd_intf_pins frame_generator_0/m_axi_uram] connect_bd_intf_net -intf_net host_writer_0_datamover_out_cmd [get_bd_intf_pins axis_data_fifo_c2h_cmd/S_AXIS] [get_bd_intf_pins host_writer_0/datamover_out_cmd] connect_bd_intf_net -intf_net host_writer_0_host_memory_out [get_bd_intf_pins axis_register_slice_host_mem/S_AXIS] [get_bd_intf_pins host_writer_0/host_memory_out] connect_bd_intf_net -intf_net host_writer_0_m_axis_completion [get_bd_intf_pins axis_work_completion_fifo_0/S_AXIS] [get_bd_intf_pins host_writer_0/m_axis_completion] - connect_bd_intf_net -intf_net internal_packet_generator_0_addr_out [get_bd_intf_pins axis_register_slice_addr_0/S_AXIS] [get_bd_intf_pins internal_packet_generator_0/addr_out] - connect_bd_intf_net -intf_net internal_packet_generator_0_data_out [get_bd_intf_pins axis_register_slice_data_0/S_AXIS] [get_bd_intf_pins internal_packet_generator_0/data_out] - connect_bd_intf_net -intf_net internal_packet_generator_0_m_axi_frame [get_bd_intf_pins axi_bram_ctrl_internal_packet_generator_1/S_AXI] [get_bd_intf_pins internal_packet_generator_0/m_axi_frame] connect_bd_intf_net -intf_net jf_conversion_0_addr_out [get_bd_intf_pins axis_register_slice_addr_1/S_AXIS] [get_bd_intf_pins jf_conversion_0/addr_out] - connect_bd_intf_net -intf_net jf_conversion_0_data_out [get_bd_intf_pins axis_data_fifo_3/S_AXIS] [get_bd_intf_pins jf_conversion_0/data_out] + connect_bd_intf_net -intf_net jf_conversion_0_data_out [get_bd_intf_pins axis_data_fifo_2/S_AXIS] [get_bd_intf_pins jf_conversion_0/data_out] connect_bd_intf_net -intf_net jf_conversion_0_m_axi_d_hbm_p0 [get_bd_intf_pins jf_conversion_0/m_axi_d_hbm_p0] [get_bd_intf_pins smartconnect_1/S00_AXI] connect_bd_intf_net -intf_net jf_conversion_0_m_axi_d_hbm_p1 [get_bd_intf_pins m_axi_d_hbm_p1] [get_bd_intf_pins jf_conversion_0/m_axi_d_hbm_p1] connect_bd_intf_net -intf_net jf_conversion_0_m_axi_d_hbm_p2 [get_bd_intf_pins jf_conversion_0/m_axi_d_hbm_p2] [get_bd_intf_pins smartconnect_2/S00_AXI] @@ -417,32 +407,34 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { connect_bd_intf_net -intf_net smartconnect_0_M01_AXI [get_bd_intf_pins mailbox_0/S0_AXI] [get_bd_intf_pins smartconnect_0/M01_AXI] connect_bd_intf_net -intf_net smartconnect_0_M02_AXI [get_bd_intf_pins load_calibration_0/s_axi_control] [get_bd_intf_pins smartconnect_0/M02_AXI] connect_bd_intf_net -intf_net smartconnect_0_M03_AXI [get_bd_intf_pins axi_bram_ctrl_internal_packet_generator_0/S_AXI] [get_bd_intf_pins smartconnect_0/M03_AXI] + connect_bd_intf_net -intf_net smartconnect_0_M04_AXI [get_bd_intf_pins frame_generator_0/s_axi_control] [get_bd_intf_pins smartconnect_0/M04_AXI] connect_bd_intf_net -intf_net smartconnect_1_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p0] [get_bd_intf_pins smartconnect_1/M00_AXI] connect_bd_intf_net -intf_net smartconnect_2_M00_AXI [get_bd_intf_pins m_axi_d_hbm_p2] [get_bd_intf_pins smartconnect_2/M00_AXI] - connect_bd_intf_net -intf_net timer_hbm_data_out [get_bd_intf_pins axis_data_fifo_2/S_AXIS] [get_bd_intf_pins timer_hbm/data_out] + connect_bd_intf_net -intf_net stream_merge_0_output_r [get_bd_intf_pins axis_eth_in_fifo/S_AXIS] [get_bd_intf_pins stream_merge_0/output_r] + connect_bd_intf_net -intf_net timer_hbm_data_out [get_bd_intf_pins axis_data_fifo_1/S_AXIS] [get_bd_intf_pins timer_hbm/data_out] connect_bd_intf_net -intf_net timer_host_data_out [get_bd_intf_pins axis_register_slice_data_1/S_AXIS] [get_bd_intf_pins timer_host/data_out] # Create port connections connect_bd_net -net action_config_0_clear_counters [get_bd_pins action_config_0/clear_counters] [get_bd_pins network_stack/clear_counters] - connect_bd_net -net action_config_0_data_collection_cancel [get_bd_pins action_config_0/data_collection_cancel] [get_bd_pins data_collection_fsm_0/in_cancel] [get_bd_pins internal_packet_generator_0/in_cancel] + connect_bd_net -net action_config_0_data_collection_cancel [get_bd_pins action_config_0/data_collection_cancel] [get_bd_pins data_collection_fsm_0/in_cancel] connect_bd_net -net action_config_0_data_collection_fsm_start [get_bd_pins action_config_0/data_collection_start] [get_bd_pins data_collection_fsm_0/in_run] [get_bd_pins network_stack/data_collection_start] connect_bd_net -net action_config_0_data_collection_mode [get_bd_pins action_config_0/data_collection_mode] [get_bd_pins data_collection_fsm_0/mode] - connect_bd_net -net action_config_0_fpga_ipv4_addr [get_bd_pins action_config_0/fpga_ipv4_addr] [get_bd_pins network_stack/fpga_ipv4_addr] - connect_bd_net -net action_config_0_fpga_mac_addr [get_bd_pins action_config_0/fpga_mac_addr] [get_bd_pins network_stack/fpga_mac_addr] + connect_bd_net -net action_config_0_fpga_ipv4_addr [get_bd_pins action_config_0/fpga_ipv4_addr] [get_bd_pins frame_generator_0/src_ipv4_addr] [get_bd_pins network_stack/fpga_ipv4_addr] + connect_bd_net -net action_config_0_fpga_mac_addr [get_bd_pins action_config_0/fpga_mac_addr] [get_bd_pins frame_generator_0/src_mac_addr] [get_bd_pins network_stack/fpga_mac_addr] connect_bd_net -net action_config_0_frames_per_trigger [get_bd_pins action_config_0/nframes] [get_bd_pins data_collection_fsm_0/nframes] connect_bd_net -net action_config_0_hbm_size_bytes [get_bd_pins action_config_0/hbm_size_bytes] [get_bd_pins data_collection_fsm_0/hbm_size_bytes] [get_bd_pins load_calibration_0/hbm_size_bytes] connect_bd_net -net action_config_0_nmodules [get_bd_pins action_config_0/nmodules] [get_bd_pins data_collection_fsm_0/nmodules] connect_bd_net -net action_config_0_nstorage_cells [get_bd_pins action_config_0/nstorage_cells] [get_bd_pins data_collection_fsm_0/nstorage_cells] connect_bd_net -net action_config_0_one_over_energy [get_bd_pins action_config_0/one_over_energy] [get_bd_pins data_collection_fsm_0/one_over_energy] - connect_bd_net -net ap_clk_1 [get_bd_pins axi_clk] [get_bd_pins action_config_0/clk] [get_bd_pins axi_bram_ctrl_internal_packet_generator_0/s_axi_aclk] [get_bd_pins axi_bram_ctrl_internal_packet_generator_1/s_axi_aclk] [get_bd_pins axis_addr_fifo_0/s_axis_aclk] [get_bd_pins axis_addr_fifo_1/s_axis_aclk] [get_bd_pins axis_addr_fifo_2/s_axis_aclk] [get_bd_pins axis_data_fifo_0/s_axis_aclk] [get_bd_pins axis_data_fifo_1/s_axis_aclk] [get_bd_pins axis_data_fifo_2/s_axis_aclk] [get_bd_pins axis_data_fifo_3/s_axis_aclk] [get_bd_pins axis_data_fifo_4/s_axis_aclk] [get_bd_pins axis_data_fifo_c2h_cmd/s_axis_aclk] [get_bd_pins axis_data_fifo_c2h_data/s_axis_aclk] [get_bd_pins axis_data_fifo_h2c_cmd/s_axis_aclk] [get_bd_pins axis_data_fifo_h2c_data/s_axis_aclk] [get_bd_pins axis_register_slice_addr_0/aclk] [get_bd_pins axis_register_slice_addr_1/aclk] [get_bd_pins axis_register_slice_data_0/aclk] [get_bd_pins axis_register_slice_data_1/aclk] [get_bd_pins axis_register_slice_data_in_0/aclk] [get_bd_pins axis_register_slice_host_mem/aclk] [get_bd_pins axis_register_slice_udp/aclk] [get_bd_pins axis_udp_addr_fifo_0/s_axis_aclk] [get_bd_pins axis_udp_fifo_0/s_axis_aclk] [get_bd_pins axis_work_completion_fifo_0/s_axis_aclk] [get_bd_pins axis_work_request_fifo_0/s_axis_aclk] [get_bd_pins data_collection_fsm_0/ap_clk] [get_bd_pins host_writer_0/ap_clk] [get_bd_pins internal_packet_generator_0/ap_clk] [get_bd_pins jf_conversion_0/ap_clk] [get_bd_pins load_calibration_0/ap_clk] [get_bd_pins mailbox_0/M1_AXIS_ACLK] [get_bd_pins mailbox_0/S0_AXI_ACLK] [get_bd_pins mailbox_0/S1_AXIS_ACLK] [get_bd_pins network_stack/axiclk] [get_bd_pins smartconnect_0/aclk] [get_bd_pins smartconnect_1/aclk] [get_bd_pins smartconnect_2/aclk] [get_bd_pins timer_hbm/ap_clk] [get_bd_pins timer_host/ap_clk] - connect_bd_net -net axis_addr_fifo_2_almost_empty [get_bd_pins action_config_0/calib_addr_fifo_empty] [get_bd_pins axis_addr_fifo_1/almost_empty] - connect_bd_net -net axis_addr_fifo_2_almost_full [get_bd_pins action_config_0/calib_addr_fifo_full] [get_bd_pins axis_addr_fifo_1/almost_full] - connect_bd_net -net axis_addr_fifo_4_almost_empty [get_bd_pins action_config_0/last_addr_fifo_empty] [get_bd_pins axis_addr_fifo_2/almost_empty] - connect_bd_net -net axis_addr_fifo_4_almost_full [get_bd_pins action_config_0/last_addr_fifo_full] [get_bd_pins axis_addr_fifo_2/almost_full] - connect_bd_net -net axis_data_fifo_10_almost_empty [get_bd_pins action_config_0/last_data_fifo_empty] [get_bd_pins axis_data_fifo_4/almost_empty] - connect_bd_net -net axis_data_fifo_10_almost_full [get_bd_pins action_config_0/last_data_fifo_full] [get_bd_pins axis_data_fifo_4/almost_full] - connect_bd_net -net axis_data_fifo_4_almost_empty [get_bd_pins action_config_0/calib_data_fifo_empty] [get_bd_pins axis_data_fifo_2/almost_empty] - connect_bd_net -net axis_data_fifo_4_almost_full [get_bd_pins action_config_0/calib_data_fifo_full] [get_bd_pins axis_data_fifo_2/almost_full] + connect_bd_net -net ap_clk_1 [get_bd_pins axi_clk] [get_bd_pins action_config_0/clk] [get_bd_pins axi_bram_ctrl_internal_packet_generator_0/s_axi_aclk] [get_bd_pins axi_bram_ctrl_internal_packet_generator_1/s_axi_aclk] [get_bd_pins axis_addr_fifo_0/s_axis_aclk] [get_bd_pins axis_addr_fifo_1/s_axis_aclk] [get_bd_pins axis_data_fifo_0/s_axis_aclk] [get_bd_pins axis_data_fifo_1/s_axis_aclk] [get_bd_pins axis_data_fifo_2/s_axis_aclk] [get_bd_pins axis_data_fifo_3/s_axis_aclk] [get_bd_pins axis_data_fifo_c2h_cmd/s_axis_aclk] [get_bd_pins axis_data_fifo_c2h_data/s_axis_aclk] [get_bd_pins axis_data_fifo_h2c_cmd/s_axis_aclk] [get_bd_pins axis_data_fifo_h2c_data/s_axis_aclk] [get_bd_pins axis_eth_in_fifo/s_axis_aclk] [get_bd_pins axis_frame_generator_fifo_0/s_axis_aclk] [get_bd_pins axis_register_slice_addr_1/aclk] [get_bd_pins axis_register_slice_data_1/aclk] [get_bd_pins axis_register_slice_data_in_0/aclk] [get_bd_pins axis_register_slice_host_mem/aclk] [get_bd_pins axis_register_slice_udp/aclk] [get_bd_pins axis_udp_addr_fifo_0/s_axis_aclk] [get_bd_pins axis_udp_fifo_0/s_axis_aclk] [get_bd_pins axis_work_completion_fifo_0/s_axis_aclk] [get_bd_pins axis_work_request_fifo_0/s_axis_aclk] [get_bd_pins data_collection_fsm_0/ap_clk] [get_bd_pins frame_generator_0/ap_clk] [get_bd_pins host_writer_0/ap_clk] [get_bd_pins jf_conversion_0/ap_clk] [get_bd_pins load_calibration_0/ap_clk] [get_bd_pins mailbox_0/M1_AXIS_ACLK] [get_bd_pins mailbox_0/S0_AXI_ACLK] [get_bd_pins mailbox_0/S1_AXIS_ACLK] [get_bd_pins network_stack/axiclk] [get_bd_pins smartconnect_0/aclk] [get_bd_pins smartconnect_1/aclk] [get_bd_pins smartconnect_2/aclk] [get_bd_pins stream_merge_0/ap_clk] [get_bd_pins timer_hbm/ap_clk] [get_bd_pins timer_host/ap_clk] + connect_bd_net -net axis_addr_fifo_0_almost_empty [get_bd_pins action_config_0/calib_addr_fifo_empty] [get_bd_pins axis_addr_fifo_0/almost_empty] + connect_bd_net -net axis_addr_fifo_0_almost_full [get_bd_pins action_config_0/calib_addr_fifo_full] [get_bd_pins axis_addr_fifo_0/almost_full] + connect_bd_net -net axis_addr_fifo_4_almost_empty [get_bd_pins action_config_0/last_addr_fifo_empty] [get_bd_pins axis_addr_fifo_1/almost_empty] + connect_bd_net -net axis_addr_fifo_4_almost_full [get_bd_pins action_config_0/last_addr_fifo_full] [get_bd_pins axis_addr_fifo_1/almost_full] + connect_bd_net -net axis_data_fifo_10_almost_empty [get_bd_pins action_config_0/last_data_fifo_empty] [get_bd_pins axis_data_fifo_3/almost_empty] + connect_bd_net -net axis_data_fifo_10_almost_full [get_bd_pins action_config_0/last_data_fifo_full] [get_bd_pins axis_data_fifo_3/almost_full] + connect_bd_net -net axis_data_fifo_4_almost_empty [get_bd_pins action_config_0/calib_data_fifo_empty] [get_bd_pins axis_data_fifo_1/almost_empty] + connect_bd_net -net axis_data_fifo_4_almost_full [get_bd_pins action_config_0/calib_data_fifo_full] [get_bd_pins axis_data_fifo_1/almost_full] connect_bd_net -net axis_data_fifo_c2h_cmd_almost_empty [get_bd_pins action_config_0/c2h_cmd_fifo_empty] [get_bd_pins axis_data_fifo_c2h_cmd/almost_empty] connect_bd_net -net axis_data_fifo_c2h_cmd_almost_full [get_bd_pins action_config_0/c2h_cmd_fifo_full] [get_bd_pins axis_data_fifo_c2h_cmd/almost_full] connect_bd_net -net axis_data_fifo_c2h_data_almost_empty [get_bd_pins action_config_0/c2h_data_fifo_empty] [get_bd_pins axis_data_fifo_c2h_data/almost_empty] @@ -451,6 +443,10 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { connect_bd_net -net axis_data_fifo_h2c_cmd_almost_full [get_bd_pins action_config_0/h2c_cmd_fifo_full] [get_bd_pins axis_data_fifo_h2c_cmd/almost_full] connect_bd_net -net axis_data_fifo_h2c_data_almost_empty [get_bd_pins action_config_0/h2c_data_fifo_empty] [get_bd_pins axis_data_fifo_h2c_data/almost_empty] connect_bd_net -net axis_data_fifo_h2c_data_almost_full [get_bd_pins action_config_0/h2c_data_fifo_full] [get_bd_pins axis_data_fifo_h2c_data/almost_full] + connect_bd_net -net axis_eth_in_fifo_almost_empty [get_bd_pins action_config_0/eth_in_fifo_empty] [get_bd_pins axis_eth_in_fifo/almost_empty] + connect_bd_net -net axis_eth_in_fifo_almost_full [get_bd_pins action_config_0/eth_in_fifo_full] [get_bd_pins axis_eth_in_fifo/almost_full] + connect_bd_net -net axis_frame_generator_fifo_0_almost_empty [get_bd_pins action_config_0/frame_generator_fifo_empty] [get_bd_pins axis_frame_generator_fifo_0/almost_empty] + connect_bd_net -net axis_frame_generator_fifo_0_almost_full [get_bd_pins action_config_0/frame_generator_fifo_full] [get_bd_pins axis_frame_generator_fifo_0/almost_full] connect_bd_net -net axis_udp_fifo_0_almost_empty [get_bd_pins action_config_0/udp_fifo_empty] [get_bd_pins axis_udp_fifo_0/almost_empty] connect_bd_net -net axis_udp_fifo_0_almost_full [get_bd_pins action_config_0/udp_fifo_full] [get_bd_pins axis_udp_fifo_0/almost_full] connect_bd_net -net axis_work_completion_fifo_0_almost_empty [get_bd_pins action_config_0/work_compl_fifo_empty] [get_bd_pins axis_work_completion_fifo_0/almost_empty] @@ -477,8 +473,8 @@ proc create_hier_cell_jungfraujoch_0 { parentCell nameHier } { connect_bd_net -net network_stack_packets_sls_ap_vld [get_bd_pins action_config_0/packets_sls_valid] [get_bd_pins network_stack/packets_sls_ap_vld] connect_bd_net -net network_stack_packets_udp [get_bd_pins action_config_0/packets_udp] [get_bd_pins network_stack/packets_udp] connect_bd_net -net network_stack_packets_udp_ap_vld [get_bd_pins action_config_0/packets_udp_valid] [get_bd_pins network_stack/packets_udp_ap_vld] - connect_bd_net -net reset_axi [get_bd_pins axi_rst_n] [get_bd_pins action_config_0/resetn] [get_bd_pins axis_addr_fifo_0/s_axis_aresetn] [get_bd_pins axis_addr_fifo_1/s_axis_aresetn] [get_bd_pins axis_addr_fifo_2/s_axis_aresetn] [get_bd_pins axis_data_fifo_0/s_axis_aresetn] [get_bd_pins axis_data_fifo_1/s_axis_aresetn] [get_bd_pins axis_data_fifo_2/s_axis_aresetn] [get_bd_pins axis_data_fifo_3/s_axis_aresetn] [get_bd_pins axis_data_fifo_4/s_axis_aresetn] [get_bd_pins axis_data_fifo_c2h_cmd/s_axis_aresetn] [get_bd_pins axis_data_fifo_c2h_data/s_axis_aresetn] [get_bd_pins axis_data_fifo_h2c_cmd/s_axis_aresetn] [get_bd_pins axis_data_fifo_h2c_data/s_axis_aresetn] [get_bd_pins axis_register_slice_addr_0/aresetn] [get_bd_pins axis_register_slice_addr_1/aresetn] [get_bd_pins axis_register_slice_data_0/aresetn] [get_bd_pins axis_register_slice_data_1/aresetn] [get_bd_pins axis_register_slice_data_in_0/aresetn] [get_bd_pins axis_register_slice_host_mem/aresetn] [get_bd_pins axis_register_slice_udp/aresetn] [get_bd_pins axis_udp_addr_fifo_0/s_axis_aresetn] [get_bd_pins axis_udp_fifo_0/s_axis_aresetn] [get_bd_pins axis_work_completion_fifo_0/s_axis_aresetn] [get_bd_pins axis_work_request_fifo_0/s_axis_aresetn] [get_bd_pins network_stack/resetn] [get_bd_pins smartconnect_0/aresetn] [get_bd_pins smartconnect_1/aresetn] [get_bd_pins smartconnect_2/aresetn] - connect_bd_net -net reset_hls [get_bd_pins ap_rst_n] [get_bd_pins axi_bram_ctrl_internal_packet_generator_0/s_axi_aresetn] [get_bd_pins axi_bram_ctrl_internal_packet_generator_1/s_axi_aresetn] [get_bd_pins data_collection_fsm_0/ap_rst_n] [get_bd_pins host_writer_0/ap_rst_n] [get_bd_pins internal_packet_generator_0/ap_rst_n] [get_bd_pins jf_conversion_0/ap_rst_n] [get_bd_pins load_calibration_0/ap_rst_n] [get_bd_pins mailbox_0/S0_AXI_ARESETN] [get_bd_pins network_stack/ap_rst_n] [get_bd_pins timer_hbm/ap_rst_n] [get_bd_pins timer_host/ap_rst_n] + connect_bd_net -net reset_axi [get_bd_pins axi_rst_n] [get_bd_pins action_config_0/resetn] [get_bd_pins axis_addr_fifo_0/s_axis_aresetn] [get_bd_pins axis_addr_fifo_1/s_axis_aresetn] [get_bd_pins axis_data_fifo_0/s_axis_aresetn] [get_bd_pins axis_data_fifo_1/s_axis_aresetn] [get_bd_pins axis_data_fifo_2/s_axis_aresetn] [get_bd_pins axis_data_fifo_3/s_axis_aresetn] [get_bd_pins axis_data_fifo_c2h_cmd/s_axis_aresetn] [get_bd_pins axis_data_fifo_c2h_data/s_axis_aresetn] [get_bd_pins axis_data_fifo_h2c_cmd/s_axis_aresetn] [get_bd_pins axis_data_fifo_h2c_data/s_axis_aresetn] [get_bd_pins axis_eth_in_fifo/s_axis_aresetn] [get_bd_pins axis_frame_generator_fifo_0/s_axis_aresetn] [get_bd_pins axis_register_slice_addr_1/aresetn] [get_bd_pins axis_register_slice_data_1/aresetn] [get_bd_pins axis_register_slice_data_in_0/aresetn] [get_bd_pins axis_register_slice_host_mem/aresetn] [get_bd_pins axis_register_slice_udp/aresetn] [get_bd_pins axis_udp_addr_fifo_0/s_axis_aresetn] [get_bd_pins axis_udp_fifo_0/s_axis_aresetn] [get_bd_pins axis_work_completion_fifo_0/s_axis_aresetn] [get_bd_pins axis_work_request_fifo_0/s_axis_aresetn] [get_bd_pins network_stack/resetn] [get_bd_pins smartconnect_0/aresetn] [get_bd_pins smartconnect_1/aresetn] [get_bd_pins smartconnect_2/aresetn] + connect_bd_net -net reset_hls [get_bd_pins ap_rst_n] [get_bd_pins axi_bram_ctrl_internal_packet_generator_0/s_axi_aresetn] [get_bd_pins axi_bram_ctrl_internal_packet_generator_1/s_axi_aresetn] [get_bd_pins data_collection_fsm_0/ap_rst_n] [get_bd_pins frame_generator_0/ap_rst_n] [get_bd_pins host_writer_0/ap_rst_n] [get_bd_pins jf_conversion_0/ap_rst_n] [get_bd_pins load_calibration_0/ap_rst_n] [get_bd_pins mailbox_0/S0_AXI_ARESETN] [get_bd_pins network_stack/ap_rst_n] [get_bd_pins stream_merge_0/ap_rst_n] [get_bd_pins timer_hbm/ap_rst_n] [get_bd_pins timer_host/ap_rst_n] connect_bd_net -net timer_hbm_counter [get_bd_pins action_config_0/stalls_hbm] [get_bd_pins timer_hbm/counter] connect_bd_net -net timer_hbm_counter_ap_vld [get_bd_pins action_config_0/stalls_hbm_valid] [get_bd_pins timer_hbm/counter_ap_vld] connect_bd_net -net timer_host_counter [get_bd_pins action_config_0/stalls_host] [get_bd_pins timer_host/counter] diff --git a/fpga/scripts/pcie_dma.tcl b/fpga/scripts/pcie_dma.tcl index 1e1415328..84cfe3b5e 100644 --- a/fpga/scripts/pcie_dma.tcl +++ b/fpga/scripts/pcie_dma.tcl @@ -139,7 +139,7 @@ proc create_hier_cell_pcie_dma_0 { parentCell nameHier } { CONFIG.axi_id_width {2} \ CONFIG.axil_master_64bit_en {false} \ CONFIG.axilite_master_en {true} \ - CONFIG.axilite_master_size {4} \ + CONFIG.axilite_master_size {16} \ CONFIG.axisten_freq {250} \ CONFIG.cfg_mgmt_if {false} \ CONFIG.copy_pf0 {true} \ diff --git a/receiver/FPGAAcquisitionDevice.cpp b/receiver/FPGAAcquisitionDevice.cpp index ee0d770c0..91e6da784 100644 --- a/receiver/FPGAAcquisitionDevice.cpp +++ b/receiver/FPGAAcquisitionDevice.cpp @@ -118,9 +118,6 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, A if ((x.GetDetectorMode() == DetectorMode::Conversion) && x.GetConversionOnFPGA()) job.mode |= MODE_CONV; - - if (x.IsUsingInternalPacketGen()) - job.mode |= MODE_INTERNAL_PACKET_GEN; } @@ -144,7 +141,7 @@ void FPGAAcquisitionDevice::Start(const DiffractionExperiment &experiment) { throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError, "Mismatch between expected and actual values of configuration registers (#modules)"); - FPGA_StartAction(); + FPGA_StartAction(experiment); read_work_completion_future = std::async(std::launch::async, &FPGAAcquisitionDevice::ReadWorkCompletionThread, this); } @@ -165,9 +162,10 @@ inline void FIFO_check(JFJochProtoBuf::FPGAStatus &fpga_status, if (std::bitset<32>(fifo_register).test(pos_empty)) fifo_status->set_value(JFJochProtoBuf::FPGAFIFOStatusEnum::EMPTY); - if (std::bitset<32>(fifo_register).test(pos_full)) + else if (std::bitset<32>(fifo_register).test(pos_full)) fifo_status->set_value(JFJochProtoBuf::FPGAFIFOStatusEnum::FULL); - fifo_status->set_value(JFJochProtoBuf::FPGAFIFOStatusEnum::PARTIAL); + else + fifo_status->set_value(JFJochProtoBuf::FPGAFIFOStatusEnum::PARTIAL); } inline void CheckHostWriterErr(JFJochProtoBuf::FPGAStatus &output, uint32_t status_register, diff --git a/receiver/FPGAAcquisitionDevice.h b/receiver/FPGAAcquisitionDevice.h index 23354e54b..6708d7335 100644 --- a/receiver/FPGAAcquisitionDevice.h +++ b/receiver/FPGAAcquisitionDevice.h @@ -11,7 +11,7 @@ class FPGAAcquisitionDevice : public AcquisitionDevice { uint16_t data_collection_id = 0; bool fpga_non_blocking_mode = true; - virtual void FPGA_StartAction() = 0; + virtual void FPGA_StartAction(const DiffractionExperiment &experiment) = 0; virtual void FPGA_EndAction() = 0; virtual void HW_WriteActionRegister(const ActionConfig *job) = 0; diff --git a/receiver/HLSSimulatedDevice.cpp b/receiver/HLSSimulatedDevice.cpp index a91fe01d6..edac55197 100644 --- a/receiver/HLSSimulatedDevice.cpp +++ b/receiver/HLSSimulatedDevice.cpp @@ -127,13 +127,26 @@ void HLSSimulatedDevice::HW_WriteActionRegister(const ActionConfig *job) { memcpy(&cfg, job, sizeof(ActionConfig)); } -void HLSSimulatedDevice::FPGA_StartAction() { +void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) { if (action_thread.joinable()) action_thread.join(); run_data_collection = 1; cancel_data_collection = 0; idle = false; + if (experiment.IsUsingInternalPacketGen()) { + frame_generator(din_frame_generator, + reinterpret_cast *>(internal_pkt_gen_frame.data()), + 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); + } action_thread = std::thread(&HLSSimulatedDevice::HLSMainThread, this ); } @@ -195,6 +208,8 @@ void HLSSimulatedDevice::HLSMainThread() { STREAM_512 ip1, udp1, udp2, icmp1, arp1; + STREAM_512 network0; + STREAM_512 raw0; STREAM_512 raw1; STREAM_512 raw2; @@ -213,8 +228,11 @@ void HLSSimulatedDevice::HLSMainThread() { ap_uint<8> err_reg; - while(!din_eth.empty()) - ethernet(din_eth, ip1, arp1, mac_addr, eth_packets, clear_counters); + while ((!din_eth.empty()) || (!din_frame_generator.empty())) + stream_merge(din_eth, din_frame_generator, network0); + + while(!network0.empty()) + ethernet(network0, ip1, arp1, mac_addr, eth_packets, clear_counters); while(!ip1.empty()) ipv4(ip1, udp1, icmp1, ipv4_addr); @@ -252,7 +270,7 @@ void HLSSimulatedDevice::HLSMainThread() { // 1. Parse incoming UDP packets idle_data_collection = 0; hls_cores.emplace_back([&] { - while (idle_data_collection == 0) { + while ((idle_data_collection == 0) || (!raw0.empty())) { data_collection_fsm(raw0, raw1, addr0, addr1, run_data_collection, @@ -268,17 +286,12 @@ void HLSSimulatedDevice::HLSMainThread() { } }); - // Generate internal packets - hls_cores.emplace_back([&] { internal_packet_generator(raw1, raw2, addr1, addr2, - reinterpret_cast *>(internal_pkt_gen_frame.data()), - cancel_data_collection); }); - // Timer procedure - count how many times pedestal_corr/gain_corr is not accepting input (to help track down latency issues) - hls_cores.emplace_back([&] { timer_host(raw2, raw3, counter_hbm); }); + hls_cores.emplace_back([&] { timer_host(raw1, raw2, counter_hbm); }); // 2. Apply pedestal & gain corrections - hls_cores.emplace_back([&] { jf_conversion(raw3, converted_1, - addr2, addr3, + hls_cores.emplace_back([&] { jf_conversion(raw2, converted_1, + addr1, addr2, hbm.data(), hbm.data(), hbm.data(), @@ -297,7 +310,7 @@ void HLSSimulatedDevice::HLSMainThread() { // 3. Prepare data to write to host memory hls_cores.emplace_back([&] { - host_writer(converted_2, addr3, datamover_out.GetDataStream(), + host_writer(converted_2, addr2, datamover_out.GetDataStream(), datamover_out.GetCtrlStream(), work_request_stream, completion_stream, packets_processed, host_writer_idle, err_reg); }); @@ -340,6 +353,9 @@ void HLSSimulatedDevice::HLSMainThread() { while (!datamover_out.IsIdle()) std::this_thread::sleep_for(std::chrono::milliseconds(100)); + if (logger) + logger->Info("Packets Eth {} UDP {} SLS {} Proc {}", eth_packets, udp_packets, sls_packets, packets_processed); + idle = true; } diff --git a/receiver/HLSSimulatedDevice.h b/receiver/HLSSimulatedDevice.h index 1cb700324..d4b814a86 100644 --- a/receiver/HLSSimulatedDevice.h +++ b/receiver/HLSSimulatedDevice.h @@ -16,6 +16,7 @@ uint16_t checksum(const uint16_t *addr, size_t count); class HLSSimulatedDevice : public FPGAAcquisitionDevice { AXI_STREAM din_eth; + AXI_STREAM din_frame_generator; AXI_STREAM dout_eth; ActionConfig cfg; @@ -41,14 +42,15 @@ class HLSSimulatedDevice : public FPGAAcquisitionDevice { void HW_ReadActionRegister(ActionConfig *job) override; void HW_WriteActionRegister(const ActionConfig *job) override; - void FPGA_StartAction() override; + void FPGA_StartAction(const DiffractionExperiment &experiment) override; void FPGA_EndAction() override; bool HW_IsIdle() const override; - bool HW_ReadMailbox(uint32_t values[16]); + bool HW_ReadMailbox(uint32_t values[16]) override; bool HW_SendWorkRequest(uint32_t handle) override; void HW_LoadCalibration(uint32_t modules, uint32_t storage_cells) override; void HW_GetStatus(ActionStatus *status) const override; void HLSMainThread() ; + void RunFrameGenerator(const FrameGeneratorConfig& config); public: HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node = -1); ~HLSSimulatedDevice(); diff --git a/receiver/PCIExpressDevice.cpp b/receiver/PCIExpressDevice.cpp index a074f180c..749ce7038 100644 --- a/receiver/PCIExpressDevice.cpp +++ b/receiver/PCIExpressDevice.cpp @@ -92,14 +92,31 @@ bool PCIExpressDevice::HW_SendWorkRequest(uint32_t handle) { return true; } -void PCIExpressDevice::FPGA_StartAction() { - if (ioctl(fd, IOCTL_JFJOCH_SET_INT_PKT, internal_pkt_gen_frame.data()) != 0) - throw JFJochException(JFJochExceptionCategory::PCIeError, - "Failed loading internal packet generator frame", errno); +void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment) { + if (experiment.IsUsingInternalPacketGen()) { + if (ioctl(fd, IOCTL_JFJOCH_SET_INT_PKT, internal_pkt_gen_frame.data()) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed loading internal packet generator frame", errno); + } if (ioctl(fd, IOCTL_JFJOCH_START) != 0) - throw JFJochException(JFJochExceptionCategory::PCIeError, - "Failed starting action", errno); + throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting action", errno); + + if (experiment.IsUsingInternalPacketGen()) { + FrameGeneratorConfig config{}; + config.frames = experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1; + config.modules = experiment.GetModulesNum(data_stream); + + if (ioctl(fd, IOCTL_JFJOCH_GET_MAC, &config.dest_mac_addr) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed getting MAC address", errno); + if (ioctl(fd, IOCTL_JFJOCH_GET_IPV4, &config.dest_ipv4_addr) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed getting MAC address", errno); + + if (ioctl(fd, IOCTL_JFJOCH_RUN_FRAME_GEN, &config) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting frame generator", errno); + } } void PCIExpressDevice::FPGA_EndAction() { diff --git a/receiver/PCIExpressDevice.h b/receiver/PCIExpressDevice.h index 8af755b5f..c6ec7dc87 100644 --- a/receiver/PCIExpressDevice.h +++ b/receiver/PCIExpressDevice.h @@ -11,7 +11,7 @@ class PCIExpressDevice : public FPGAAcquisitionDevice { bool HW_ReadMailbox(uint32_t values[16]) override; bool HW_SendWorkRequest(uint32_t handle) override; - void FPGA_StartAction() override; + void FPGA_StartAction(const DiffractionExperiment &experiment) override; bool HW_IsIdle() const final; void HW_WriteActionRegister(const ActionConfig *job) override; void HW_ReadActionRegister(ActionConfig *job) override; diff --git a/receiver/jfjoch_action_test.cpp b/receiver/jfjoch_action_test.cpp index e8509b657..40bdcc79c 100644 --- a/receiver/jfjoch_action_test.cpp +++ b/receiver/jfjoch_action_test.cpp @@ -155,6 +155,8 @@ int main(int argc, char **argv) { pcie_devices[i]->SetCustomInternalGeneratorFrame(input); pcie_devices[i]->EnableLogging(&logger); pcie_devices[i]->SetFPGANonBlockingMode(nonblocking_mode); + pcie_devices[i]->SetDefaultMAC(); + pcie_devices[i]->SetIPv4Address((i << 24) + 0x010a0a0a); aq_devices.push_back(pcie_devices[i].get()); } diff --git a/tests/FPGAIntegrationTest.cpp b/tests/FPGAIntegrationTest.cpp index 8268a5528..e6a481e4b 100644 --- a/tests/FPGAIntegrationTest.cpp +++ b/tests/FPGAIntegrationTest.cpp @@ -88,14 +88,12 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_custom_frame", "[FPGA][Ful for (int image = 0; image < 4; image++) { for (int m = 0; m < nmodules; m++) { - REQUIRE(test.Counters().GetCompletion(image, m).timestamp == INT_PKT_GEN_TIMESTAMP); - REQUIRE(test.Counters().GetCompletion(image, m).bunchid == INT_PKT_GEN_BUNCHID); + REQUIRE(test.Counters().GetCompletion(image, m).timestamp == INT_PKT_GEN_EXPTTIME * image); + REQUIRE(test.Counters().GetCompletion(image, m).bunchid == INT_PKT_GEN_BUNCHID + image); REQUIRE(test.Counters().GetCompletion(image, m).exptime == INT_PKT_GEN_EXPTTIME); auto imageBuf = (uint16_t *) test.GetFrameBuffer(image, m); for (int i = 0; i < RAW_MODULE_SIZE; i++) { - if (imageBuf[i] != test_frame[i]) - std::cout << m << " " << i << " " << imageBuf[i] << std::endl; REQUIRE(imageBuf[i] == test_frame[i]); } } @@ -405,7 +403,6 @@ TEST_CASE("HLS_C_Simulation_check_convert_full_range", "[FPGA][Full]") { TEST_CASE("HLS_C_Simulation_internal_packet_generator_convert_full_range", "[FPGA][Full]") { double energy = 6.0; - const uint16_t nmodules = 4; DiffractionExperiment x((DetectorGeometry(nmodules, 2, 8, 36, true))); @@ -546,8 +543,6 @@ TEST_CASE("HLS_C_Simulation_check_2_trigger_convert", "[FPGA][Full]") { x.PedestalG0Frames(0).NumTriggers(2).ImagesPerTrigger(5); HLSSimulatedDevice test(0, 64); - Logger logger("bla"); - test.EnableLogging(&logger); JFCalibration c(x); REQUIRE_NOTHROW(c.Pedestal(0, 0).LoadPedestal(pedestal_g0)); @@ -857,7 +852,7 @@ TEST_CASE("HLS_DataCollectionFSM","[OpenCAPI]") { TEST_CASE("HLS_C_Simulation_internal_packet_generator_15_storage_cell_convert_G0", "[FPGA][Full]") { const uint16_t nmodules = 2; - const uint16_t ntrigger = 4; + const uint16_t ntrigger = 2; const uint16_t nstoragecells = 15; DiffractionExperiment x((DetectorGeometry(nmodules))); @@ -905,7 +900,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_15_storage_cell_convert_G0 TEST_CASE("HLS_C_Simulation_internal_packet_generator_8_storage_cell_convert_G0", "[FPGA][Full]") { const uint16_t nmodules = 2; - const uint16_t ntrigger = 4; + const uint16_t ntrigger = 2; const uint16_t nstoragecells = 8; DiffractionExperiment x((DetectorGeometry(nmodules))); @@ -966,7 +961,7 @@ TEST_CASE("HLS_C_Simulation_internal_packet_generator_16_storage_cell_convert_G0 REQUIRE(x.GetImageNum() == ntrigger * nstoragecells); HLSSimulatedDevice test(0, ntrigger * nstoragecells); - + test.SetFPGANonBlockingMode(false); std::vector tmp(3 * RAW_MODULE_SIZE, 50); JFModuleGainCalibration gain(tmp); diff --git a/tests/StreamWriterTest.cpp b/tests/StreamWriterTest.cpp index 761899131..bd7aa656f 100644 --- a/tests/StreamWriterTest.cpp +++ b/tests/StreamWriterTest.cpp @@ -32,6 +32,7 @@ TEST_CASE("StreamWriterTest_ZMQ","[JFJochWriter]") { std::vector> aq_devices; for (int i = 0; i < x.GetDataStreamsNum(); i++) { auto test = new HLSSimulatedDevice(i, 64); + test->SetFPGANonBlockingMode(false); aq_devices.emplace_back(test); } @@ -99,6 +100,7 @@ TEST_CASE("JFJochWriterServiceTest_ZMQ","[JFJochWriter]") { std::vector> aq_devices; for (int i = 0; i < x.GetDataStreamsNum(); i++) { auto test = new HLSSimulatedDevice(i, 64); + test->SetFPGANonBlockingMode(false); aq_devices.emplace_back(test); }