| China spallation neutron source is one of the major scientific and technological infrastructures in China.In the spectrometer experiment,the ultra-high energy proton beam generated by the high-energy and high-current proton accelerator impacts the metal tungsten target to produce a large amount of neutrons.The neutron spectrometer uses the neutrons generated by the spallation reaction to interact with the sample,and uses the neutron detector to detect the neutrons after the action,thereby performing the neutron experiment.In the process of this experiment,the experimental data of the spectrometer will be analyzed,and the proton bunch information corresponding to each neutron bunch is needed,including the number of protons and the time value of extraction.The clock synchronization accuracy should be within 100 ps.Therefore,a platform with both high-precision clock synchronization function and big data real-time processing function is very important.Since the existing hardware equipment can not meet the two requirements of high-precision clock synchronization and real-time processing of big data at the same time,the ZYNQ processor is selected as the technical basis of this thesis.The high-precision clock synchronization platform is constructed on its FPGA side,and the big data real-time processing platform is constructed on its ARM side.Finally,the framework design of the overall system is completed.The development of the platform mainly includes four parts.The first is the hardware and logic design of the clock synchronization platform.In order to meet the hardware requirements of WR technology clock synchronization,this thesis designs the underlying hardware circuit and the logic design of the clock synchronization module for WR technology.Then,the software design of the clock synchronization platform is carried out.In order to realize the application of the upper software protocol algorithm,the construction of the self-customized system and the realization of the underlying driver device tree are carried out.Finally,the Kafka data processing platform is designed.In order to process the information with timestamp data efficiently and uniformly,the Kafka platform is constructed on the custom system.According to the development content,the specific design work is as follows:(1)The underlying hardware design of the clock synchronization system.For WR technology,the underlying circuit is mainly divided into four modules:clock circuit,storage circuit,SFP circuit and UART circuit.The clock circuit makes the data processing between each module run in accordance with the prescribed timing to ensure that the system can work normally.The storage circuit is used to store the system data,and the data is accessed at high speed and automatically during the operation of the system.The SFP circuit is used as an optical port to receive and transmit optical signals and dock with the optical fiber.UART circuit is responsible for the data transmission of the whole system.(2)Logic design of clock synchronization system.According to the underlying hardware foundation,the clock synchronization module design is carried out,and the WRPC is improved.By analyzing the address allocation of each module in the WRPC,a new address space is opened up after all modules,and a new time latch(LockT)module is added to store the synchronization timestamp at the PL end of the chip to realize the high-precision clock synchronization function of the system.(3)Software design of clock synchronization system.According to the underlying hardware design and logic design,the embedded system configuration is carried out on the ARM side to complete the generation of the device tree file and the construction of the self-customized system.Then,the underlying physical registers are addressed through the AXI bus to complete the driver implementation of the underlying hardware by the upper software.(4)Design of real-time processing system with large amount of data.On the basis of the self-customized system,the Kafka system is constructed by combining the data information of proton number and time value.At the same time,the system requirements are analyzed,and the system function design and database design are carried out.Finally,the system function is realized,including the function realization of the device end,the function realization of the server end and the Kafka cluster management,so as to realize the multi-node distributed time data processing.In summary,based on the unique FPGA+ARM architecture of ZYNQ,this thesis completes the construction of a high-precision clock synchronization platform.After experimental testing,the clock synchronization accuracy reaches 30.37 ps,which meets the requirements of high-precision clock synchronization and spectrometer experimental data processing in neutron spectrometer experiments,saves design costs,improves system performance,and provides a new idea for the design of high-precision clock synchronization platform. |