[go: up one dir, main page]

CN112783810B - Application-oriented multi-channel SRIO DMA transmission system and method - Google Patents

Application-oriented multi-channel SRIO DMA transmission system and method Download PDF

Info

Publication number
CN112783810B
CN112783810B CN202110022828.7A CN202110022828A CN112783810B CN 112783810 B CN112783810 B CN 112783810B CN 202110022828 A CN202110022828 A CN 202110022828A CN 112783810 B CN112783810 B CN 112783810B
Authority
CN
China
Prior art keywords
dma
upstream
downlink
transmitted
buffer memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110022828.7A
Other languages
Chinese (zh)
Other versions
CN112783810A (en
Inventor
陈明
裘愉涛
王松
戚宣威
方芳
孙文文
曹文斌
王义波
周坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Kemov Electric Co ltd
Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
Wuhan Kemov Electric Co ltd
Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Kemov Electric Co ltd, Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd filed Critical Wuhan Kemov Electric Co ltd
Priority to CN202110022828.7A priority Critical patent/CN112783810B/en
Publication of CN112783810A publication Critical patent/CN112783810A/en
Application granted granted Critical
Publication of CN112783810B publication Critical patent/CN112783810B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)

Abstract

The invention discloses an application-oriented multichannel SRIO DMA transmission system, which comprises a DSP subsystem and an FPGA subsystem, wherein the DSP subsystem comprises a DSP, an SRIO receiving and transmitting hardware module, a plurality of DMA downlink source buffer memories and a plurality of DMA uplink destination buffer memories; the FPGA subsystem comprises an SRIO control module, a DMA downlink virtual control module, a DMA uplink virtual control module, an external interface, a plurality of DMA downlink destination buffer memories and a plurality of DMA uplink source buffer memories; the method can be flexibly configured according to application bandwidth, priority, instantaneity and the like, various requirements of an application layer are met, and the transmission efficiency of the system is improved.

Description

一种面向应用的多通道SRIO DMA传输系统及方法An application-oriented multi-channel SRIO DMA transmission system and method

技术领域technical field

本发明涉及智能变电站二次系统测试与仿真的数据处理与传输领域,具体涉及一种面向应用的多通道SRIO DMA传输系统,还涉及一种面向应用的多通道SRIO DMA传输方法。The invention relates to the field of data processing and transmission of the test and simulation of the secondary system of an intelligent substation, in particular to an application-oriented multi-channel SRIO DMA transmission system and an application-oriented multi-channel SRIO DMA transmission method.

背景技术Background technique

随着智能变电站大规模推广应用,在变电站中二次设备如合并单元、保护装置、智能终端、测控装置等设备的测试与仿真也越来越广泛。采用继保测试仪、合并单元测试仪等测试仪器,由于这些测试仪接口数量少、数据计算能力弱、总线带宽低等特性,往往只能单体设备测试,不能整间隔或多台保护装置或者保护装置与合并单元、智能终端整体测试与仿真。整间隔或多台设备的整体测试与仿真,更具备测试与仿真的完备性、充分性,更能接近实际变电站的运行情况。然而,多个二次设备如合并单元、保护装置、智能终端、测控装置等整体测试与仿真,对整个测试仿真平台的计算能力、数据传输能力、处理时间的实时性等提出了更高的要求。With the large-scale promotion and application of smart substations, the testing and simulation of secondary equipment in substations such as merging units, protection devices, intelligent terminals, and measurement and control devices are becoming more and more extensive. Relay testers, merged unit testers and other test instruments are used. Due to the small number of interfaces, weak data calculation capabilities, and low bus bandwidth, these testers can only test a single device, but not a whole interval or multiple protection devices or Overall testing and simulation of protection devices, merging units, and intelligent terminals. The overall test and simulation of the whole interval or multiple devices is more complete and sufficient for the test and simulation, and can be closer to the actual operation of the substation. However, the overall testing and simulation of multiple secondary devices, such as merging units, protection devices, intelligent terminals, and measurement and control devices, put forward higher requirements for the computing power, data transmission capacity, and real-time processing time of the entire test simulation platform. .

具有较强计算能力的DSP和数据传输能力的FPGA往往是最为合适的方案,DSP负责各个报文任务(SV、Goose、FT3、模拟量功率源等)的计算、状态控制、组包等,而FPGA负责将这些报文按照一定的实时性收或发到对应的光网口、FT3口、DA转换器等。当测试仿真系统需要模拟整间隔或整站的这些IED时,各个报文任务(SV、Goose、FT3、模拟量功率源等)的计算量与数据传输量也将相对较大,各报文带宽估算如下:SV的数据量按照极限带宽1Gbps;Goose变位事件按照2毫秒极限变位、每个事件最大800字节,则Goose极限流量为160Mbps;FT3接口按照18个接口流量为28.8Mbps;模拟量功率,按照24路电压、27路电流配置,则带宽为261.12Mbps;总体带宽为1.449Gbs。因此,DSP与FPGA之间的数据通信成为整个系统性能的关键。DSPs with strong computing power and FPGAs with data transmission capabilities are often the most suitable solutions. DSP is responsible for the calculation, state control, and grouping of each message task (SV, Goose, FT3, analog power source, etc.), while The FPGA is responsible for receiving or sending these messages to the corresponding optical network port, FT3 port, DA converter, etc. in a certain real-time manner. When the test simulation system needs to simulate these IEDs of the whole interval or the whole station, the calculation amount and data transmission amount of each message task (SV, Goose, FT3, analog power source, etc.) will also be relatively large, and the bandwidth of each message will be relatively large. The estimation is as follows: the data volume of SV is 1Gbps according to the limit bandwidth; Goose shift events are shifted according to the limit of 2 milliseconds, and each event is up to 800 bytes, then the limit flow of Goose is 160Mbps; the flow of FT3 interface is 28.8Mbps according to 18 interfaces; According to 24 channels of voltage and 27 channels of current configuration, the bandwidth is 261.12Mbps; the overall bandwidth is 1.449Gbs. Therefore, the data communication between DSP and FPGA becomes the key to the performance of the whole system.

一般地,DSP与FPGA大量数据传输采用SRIO总线,该总线具有总线带宽大、协议开销小等特点。SRIO总线可以是DSP主动发起DMA的数据读写,也可以是FPGA发起数据读写。往往现有的这些SRIO的DMA传输都采用分层模式,即处在应用层的报文收发任务将数据计算整理好后放在各自应用侧的内存空间,统一由处在驱动层的SRIO收发数据程序将各个应用层数据拷贝到驱动层并逐个再打包及添加必要的标示字段;当接收FPGA侧的数据时,FPGA先通过中断方式告知DSP,再由DSP侧的驱动层SRIO接收程序主动读取FPGA侧的数据,并按照一定的包格式解出对应应用层的数据,拷贝到应用层内存空间。这种多次拷贝、多次组封包、多种包分类的处理方式,导致占用了大量的DSP处理时间,并且也无法保证数据量大实时性高的SV、模拟量等应用要求。Generally, DSP and FPGA use SRIO bus for mass data transmission, which has the characteristics of large bus bandwidth and low protocol overhead. The SRIO bus can be the data read and write initiated by the DSP actively, or the data read and write initiated by the FPGA. Often the existing DMA transmission of these SRIOs adopts a layered mode, that is, the message sending and receiving tasks at the application layer arrange the data calculation and put them in the memory space of the respective application side, and the data is sent and received by the SRIO at the driver layer. The program copies the data of each application layer to the driver layer and repackages them one by one and adds the necessary label fields; when receiving data from the FPGA side, the FPGA first informs the DSP through an interrupt, and then the driver layer SRIO on the DSP side receives the program to actively read The data on the FPGA side, and the data corresponding to the application layer is decoded according to a certain packet format, and copied to the application layer memory space. This processing method of multiple copies, multiple groups of packets, and multiple packet classifications takes up a lot of DSP processing time, and cannot guarantee application requirements such as SV and analog quantities with large amounts of data and high real-time performance.

发明内容SUMMARY OF THE INVENTION

本发明的目的是针对现有技术存在的上述缺陷,提供一种面向应用的多通道SRIODMA传输系统,还提供一种面向应用的多通道SRIO DMA传输方法。The purpose of the present invention is to provide an application-oriented multi-channel SRIODMA transmission system and an application-oriented multi-channel SRIO DMA transmission method in view of the above-mentioned defects in the prior art.

本发明的上述目的通过以下技术方案实现:The above-mentioned purpose of the present invention is achieved through the following technical solutions:

一种面向应用的多通道SRIO DMA传输系统,包括DSP子系统和FPGA子系统,An application-oriented multi-channel SRIO DMA transmission system includes a DSP subsystem and an FPGA subsystem,

DSP子系统包括:DSP、SRIO收发硬件模块、多个DMA下行源缓冲存储器和多个DMA上行目的缓冲存储器;The DSP subsystem includes: DSP, SRIO transceiver hardware module, multiple DMA downstream source buffer memories and multiple DMA upstream destination buffer memories;

FPGA子系统包括:SRIO控制模块、DMA下行虚拟控制模块、DMA上行虚拟控制模块、外部接口、多个DMA下行目的缓冲存储器和多个DMA上行源缓冲存储器,The FPGA subsystem includes: SRIO control module, DMA downstream virtual control module, DMA upstream virtual control module, external interface, multiple DMA downstream destination buffer memories and multiple DMA upstream source buffer memories,

每个应用程序对应一个DMA虚拟通道,DMA虚拟通道包括DMA下行虚拟通道和DMA上行虚拟通道,Each application corresponds to a DMA virtual channel. The DMA virtual channel includes a DMA downlink virtual channel and a DMA uplink virtual channel.

DMA下行虚拟通道包括分别与应用程序对应的DMA下行源缓冲存储器、DMA下行虚拟控制模块、DMA下行目的缓冲存储器,The DMA downlink virtual channel includes the DMA downlink source buffer memory, the DMA downlink virtual control module, and the DMA downlink destination buffer memory corresponding to the application program, respectively.

DMA下行虚拟控制模块包括用于存储DMA下行源缓冲存储器的状态的第一下行通道寄存器、用于存储DMA下行源缓冲存储器中待传输的发送数据的传输长度的第二下行通道寄存器、以及用于存储DMA下行源缓冲存储器中待传输的发送数据的首地址,The DMA downlink virtual control module includes a first downlink channel register for storing the state of the DMA downlink source buffer memory, a second downlink channel register for storing the transmission length of the transmit data to be transmitted in the DMA downlink source buffer memory, and a It is used to store the first address of the transmit data to be transmitted in the DMA downlink source buffer memory,

DMA上行虚拟通道包括分别与应用程序对应的DMA上行源缓冲存储器、DMA上行虚拟控制模块、DMA上行目的缓冲存储器,The DMA upstream virtual channel includes the DMA upstream source buffer memory, the DMA upstream virtual control module, and the DMA upstream destination buffer memory corresponding to the application program, respectively.

DMA上行虚拟控制模块包括用于存储DMA上行目的缓冲存储器的存储状态的第一上行通道寄存器、用于存储DMA上行源缓冲存储器中待传输的接收数据的传输长度的第二上行通道寄存器、以及用于存储DMA上行源缓冲存储器中待传输的接收数据的首地址的第三上行通道寄存器。The DMA upstream virtual control module includes a first upstream channel register for storing the storage state of the DMA upstream destination buffer memory, a second upstream channel register for storing the transmission length of the received data to be transmitted in the DMA upstream source buffer memory, and a The third upstream channel register for storing the first address of the received data to be transmitted in the DMA upstream source buffer memory.

DMA下行源缓冲存储器包括第一下行源乒乓存储器和第二下行源乒乓存储器,The DMA downlink source buffer memory includes a first downlink source ping-pong memory and a second downlink source ping-pong memory,

第一下行通道寄存器的第0位和第1位分别对应着DMA下行源缓冲存储器的第一下行源乒乓存储器和第二下行源乒乓存储器的当前状态,The 0th bit and the 1st bit of the first downlink channel register respectively correspond to the current state of the first downlink source ping-pong memory and the second downlink source ping-pong memory of the DMA downlink source buffer memory,

DMA上行目的缓冲存储器包括第一上行目的乒乓存储器和第二上行目的乒乓存储器,The DMA upstream destination buffer memory includes a first upstream destination ping-pong memory and a second upstream destination ping-pong memory,

第一上行通道寄存器的第0位和第1位分别对应着第一上行目的乒乓存储器和第二上行目的乒乓存储器的空闲状态。Bit 0 and bit 1 of the first upstream channel register respectively correspond to the idle states of the first upstream destination ping-pong memory and the second upstream destination ping-pong memory.

一种面向应用的多通道SRIO DMA传输方法,包括数据发送步骤:An application-oriented multi-channel SRIO DMA transmission method, comprising the steps of data transmission:

步骤100、DSP启动后DSP的发送任务获取并初始化DMA下行源缓冲存储器,In step 100, after the DSP is started, the sending task of the DSP acquires and initializes the DMA downlink source buffer memory,

步骤101、当发送任务有发送数据发送时,DSP采用寄存器总线EMIF查询DMA下行虚拟控制模块的第一下行通道寄存器,确定DMA下行源缓冲存储器处于传输完成状态;Step 101, when the sending task has to send data to send, the DSP uses the register bus EMIF to query the first downlink channel register of the DMA downlink virtual control module to determine that the DMA downlink source buffer memory is in a transmission completion state;

步骤102、发送任务将多个发送数据包依次填入到DMA下行源缓冲存储器中,第一个发送数据包从第5字节开始,直到将DMA下行源缓冲存储器放置满为止,且保证最后一个发送数据包的完整性,当待传输的发送数据包填充完DMA下行源缓冲存储器后,将DMA下行源缓冲存储器的首4字节的32位修改为如下定义:Step 102: The sending task fills multiple sending data packets into the DMA downlink source buffer memory in turn. The first send data packet starts from the 5th byte until the DMA downlink source buffer memory is filled, and the last one is guaranteed. The integrity of the sending data packet, when the sending data packet to be transmitted fills the DMA downstream source buffer memory, modify the 32 bits of the first 4 bytes of the DMA downstream source buffer memory to the following definition:

第7至0比特位:待发送的发送数据包的流水号,每次组包完后加1;The 7th to 0th bits: the serial number of the sending data packet to be sent, plus 1 after each packet is completed;

第15至8比特位:当前待传输的发送数据包的个数;The 15th to 8th bits: the number of sending packets currently to be transmitted;

第31至16比特位:当前待传输的发送数据包的总字节数,Bits 31 to 16: The total number of bytes of the currently transmitted packet to be transmitted,

步骤103、发送任务通过寄存器总线EMIF将待传输的发送数据的传输长度写入DMA下行虚拟控制模块的第二下行通道寄存器,将DMA下行源缓冲存储器的首地址作为待传输的发送数据源首地址写入DMA下行虚拟控制模块的第三下行通道寄存器,并且将DMA下行虚拟控制模块的第一下行通道寄存器修改为传输未完成,Step 103: The transmission task writes the transmission length of the transmission data to be transmitted into the second downlink channel register of the DMA downlink virtual control module through the register bus EMIF, and uses the first address of the DMA downlink source buffer memory as the first address of the transmission data source to be transmitted. Write the third downlink channel register of the DMA downlink virtual control module, and modify the first downlink channel register of the DMA downlink virtual control module to not complete the transmission,

步骤104、DMA下行虚拟控制模块按照发送周期轮询,确定有数据需要被调度的DMA下行虚拟通道有数据,按照预设的DMA下行虚拟通道的通道带宽值、优先级、SRIO总线的有效带宽对各个DMA下行虚拟通道的待传输的发送数据进行发送,即根据DMA下行虚拟通道的通道带宽值,计算发送周期中DMA下行虚拟通道需要发送的字节数,根据发送周期中DMA下行虚拟通道需要发送的字节数和SRIO总线的有效带宽,计算DMA下行虚拟通道在发送周期中占用的调度时间,根据DMA下行虚拟通道的优先级,依次按照DMA下行虚拟通道对应的调用时间对待发送数据进行发送;Step 104: The DMA downlink virtual control module polls according to the sending cycle, determines that the DMA downlink virtual channel that has data needs to be scheduled has data, and matches the preset channel bandwidth value, priority, and effective bandwidth of the SRIO bus of the DMA downlink virtual channel. The send data to be transmitted of each DMA downlink virtual channel is sent, that is, according to the channel bandwidth value of the DMA downlink virtual channel, the number of bytes to be sent by the DMA downlink virtual channel in the transmission cycle is calculated, and the number of bytes to be sent by the DMA downlink virtual channel in the transmission cycle is calculated. According to the number of bytes and the effective bandwidth of the SRIO bus, calculate the scheduling time occupied by the DMA downlink virtual channel in the transmission cycle, and send the data to be sent according to the calling time corresponding to the DMA downlink virtual channel according to the priority of the DMA downlink virtual channel;

对待发送数据进行发送时,DMA下行虚拟控制模块首先读取DMA下行虚拟通道对应的第一下行通道寄存器,确认DMA下行虚拟通道是否有需要待传送的发送数据,如果有需要待传输的发送数据,则读出第二下行通道寄存器中记载的待输送的发送数据的传输长度,读出第三下行通道寄存器中记载的待传输的发送数据的首地址,依据待输送的发送数据的传输长度和待传输的发送数据的首地址,产生DMA读请求的AVALONE总线时序,When sending the data to be sent, the DMA downlink virtual control module first reads the first downlink channel register corresponding to the DMA downlink virtual channel to confirm whether the DMA downlink virtual channel has send data to be transmitted, and if there is send data to be transmitted , then read the transmission length of the transmission data to be transmitted recorded in the second downlink channel register, read the first address of the transmission data to be transmitted recorded in the third downlink channel register, according to the transmission length of the transmission data to be transmitted and The first address of the transmitted data to be transmitted, the AVALONE bus timing for generating the DMA read request,

步骤105、DMA下行虚拟控制模块将DMA读请求的AVALONE总线时序发送给SRIO控制模块,SRIO控制模块将DMA读请求的AVALONE总线时序打包成SRIO NREAD命令以串行数据格式通过SRIO总线发送到DSP侧的SRIO收发硬件模块;Step 105: The DMA downlink virtual control module sends the AVALONE bus timing of the DMA read request to the SRIO control module, and the SRIO control module packages the AVALONE bus timing of the DMA read request into an SRIO NREAD command and sends it to the DSP side through the SRIO bus in a serial data format SRIO transceiver hardware module;

步骤106、在DSP侧的SRIO收发硬件模块收到SRIO NREAD命令后,解析出对应的待传输的发送数据的传输长度和待传输的发送数据的首地址,并在DSP侧以待传输的发送数据的传输长度和待传输的发送数据的首地址为依据从DMA下行源缓冲存储器中读出对应的待传输的发送数据,并按照SRIO协议的RESP包格式生成对应的RESP数据包回应给FPGA侧的SRIO控制模块;Step 106: After the SRIO transceiver hardware module on the DSP side receives the SRIO NREAD command, it parses out the corresponding transmission length of the transmission data to be transmitted and the first address of the transmission data to be transmitted, and uses the transmission data to be transmitted on the DSP side. The transmission length and the first address of the transmission data to be transmitted are based on reading the corresponding transmission data to be transmitted from the DMA downstream source buffer memory, and according to the RESP packet format of the SRIO protocol, the corresponding RESP data packet is generated and responded to the FPGA side. SRIO control module;

步骤107、FPGA侧的SRIO控制模块收到DSP侧的SRIO收发硬件模块的RESP数据包后,解析成AVALONE总线读响应时序;Step 107: After the SRIO control module on the FPGA side receives the RESP data packet of the SRIO transceiver hardware module on the DSP side, it parses it into an AVALONE bus read response sequence;

步骤108、DMA下行虚拟控制模块从SRIO控制模块获得AVALONE总线读响应时序后,将对应的待传输的发送数据写入到DMA下行目的缓冲存储器中;Step 108, after the DMA downlink virtual control module obtains the AVALONE bus read response sequence from the SRIO control module, the corresponding transmission data to be transmitted is written into the DMA downlink destination buffer memory;

步骤109、FPGA侧对应的发送模块通过查看DMA下行虚拟通道的DMA下行目的缓冲存储器的非空标识,读出待传输的发送数据并通过FPGA侧对应的外部接口将待传输的发送数据发送出去。Step 109 , the sending module corresponding to the FPGA side reads the sending data to be transmitted by checking the non-empty identifier of the DMA downstream destination buffer memory of the DMA downstream virtual channel, and sends the sending data to be transmitted through the external interface corresponding to the FPGA side.

一种面向应用的多通道SRIO DMA传输方法,还包括数据接收步骤:An application-oriented multi-channel SRIO DMA transmission method, further comprising a data receiving step:

步骤200、DSP启动后DSP的接收任务获取并初始化DMA上行目的缓冲存储器,Step 200, after the DSP is started, the receiving task of the DSP acquires and initializes the DMA uplink destination buffer memory,

步骤201、接收任务通过寄存器总线EMIF清除DMA上行虚拟控制模块的第一上行通道寄存器,Step 201, the receiving task clears the first upstream channel register of the DMA upstream virtual control module through the register bus EMIF,

初始化第三上行通道寄存器为DMA上行目的缓冲存储器的首地址,Initialize the third upstream channel register as the first address of the DMA upstream destination buffer memory,

DSP侧的接收任务将轮询各个DMA上行虚拟通道对应第一上行通道寄存器,如果第一上行通道寄存器反映DMA上行目的缓冲存储器缓冲有接收数据,则进入步骤207,否则进入步骤202;The receiving task on the DSP side will poll each DMA upstream virtual channel corresponding to the first upstream channel register, if the first upstream channel register reflects that the DMA upstream destination buffer memory has received data buffered, then enter step 207, otherwise enter step 202;

步骤202、FPGA侧的接收模块实时接收外部接口进来的接收数据包,并将接收数据包标记时间戳,缓存到DMA上行源缓冲存储器中,In step 202, the receiving module on the FPGA side receives the received data packets from the external interface in real time, and marks the received data packets with a timestamp, and buffers them in the DMA upstream source buffer memory,

接收数据包依次填入到DMA上行源缓冲存储器,第一个接收数据包从第5字节开始,后续的接收数据包依次靠后排布,直到将DMA上行源缓冲存储器放置满为止,且最后一个接收数据包的完整,当待传输的接收数据包填充完毕后,将DMA上行源缓冲存储器的首4字节的32位修改为如下定义:The received data packets are filled in the DMA upstream source buffer memory in turn. The first received data packet starts from the 5th byte, and the subsequent received data packets are arranged in sequence until the DMA upstream source buffer memory is full, and finally When a received data packet is complete, when the received data packet to be transmitted is filled, modify the 32 bits of the first 4 bytes of the DMA upstream source buffer memory to the following definition:

第7至0比特位:待传输的接收数据包的流水号,每次组包完后加1;The 7th to 0th bits: the serial number of the received data packet to be transmitted, plus 1 after each packet is completed;

第15至8比特位:当前待传输的接收数据包的个数;Bits 15 to 8: the number of received packets currently to be transmitted;

第31至16比特位:当前待传输的接收数据包的总字节数;Bits 31 to 16: the total number of bytes of the received data packet currently to be transmitted;

当前待传输的接收数据包的总字节数更新到第二上行通道寄存器,The total number of bytes of the received data packets currently to be transmitted is updated to the second upstream channel register,

步骤203、DMA上行虚拟控制模块按照接收周期轮询,确定需要被调度的DMA上行虚拟通道,按照预设的DMA上行虚拟通道的通道带宽值、优先级、SRIO总线的有效带宽对各个DMA上行虚拟通道的待传输的接收数据进行接收,即根据DMA上行虚拟通道的通道带宽值,计算接收周期中DMA上行虚拟通道需要传输的接收数据的字节数,根据接收周期中DMA上行虚拟通道需要接收的字节数和SRIO总线的有效带宽,计算DMA上行虚拟通道在接收周期中占用的调度时间,根据DMA上行虚拟通道的优先级,依次按照DMA上行虚拟通道对应的调用时间对待传输的接收数据进行接收,Step 203, the DMA uplink virtual control module polls according to the receiving period, determines the DMA uplink virtual channel that needs to be scheduled, and performs virtual uplink virtual channels for each DMA according to the preset channel bandwidth value, priority, and effective bandwidth of the SRIO bus of the DMA uplink virtual channel. The received data of the channel to be transmitted is received, that is, according to the channel bandwidth value of the DMA upstream virtual channel, the number of bytes of received data that needs to be transmitted by the DMA upstream virtual channel in the receiving cycle is calculated, and the number of bytes of the received data that needs to be received by the DMA upstream virtual channel in the receiving cycle is calculated. The number of bytes and the effective bandwidth of the SRIO bus, calculate the scheduling time occupied by the DMA uplink virtual channel in the receiving cycle, and receive the received data to be transmitted according to the priority of the DMA uplink virtual channel and the corresponding calling time of the DMA uplink virtual channel. ,

对待传输的接收数据进行接收时,DMA上行虚拟控制模块根据DMA上行虚拟通道的优先级,查看对应的DMA上行源缓冲存储器是否有待传输的接收数据,若有待传输的接收数据,则设定第三上行通道寄存器的值为DMA上行源缓冲存储器的待传输的接收数据的首地址,When receiving the received data to be transmitted, the DMA uplink virtual control module checks whether the corresponding DMA uplink source buffer memory has received data to be transmitted according to the priority of the DMA uplink virtual channel. If there is received data to be transmitted, set the third The value of the upstream channel register is the first address of the received data to be transmitted in the DMA upstream source buffer memory,

设定第二上行通道寄存器的值为DMA上行源缓冲存储器中的待传输的接收数据长度;Set the value of the second upstream channel register as the received data length to be transmitted in the DMA upstream source buffer memory;

确定DMA上行目的缓冲存储器的首地址,Determine the first address of the DMA upstream destination buffer memory,

DMA上行虚拟控制模块获取DMA上行源缓冲存储器中待传输的接收数据的传输长度、DMA上行源缓冲存储器中的待传输的接收数据首地址、DMA上行目的缓冲存储器的首地址后,产生DMA写请求的AVALONE总线时序,The DMA upstream virtual control module generates a DMA write request after obtaining the transmission length of the received data to be transmitted in the DMA upstream source buffer memory, the first address of the received data to be transmitted in the DMA upstream source buffer memory, and the first address of the DMA upstream destination buffer memory. AVALONE bus timing,

步骤204、DMA上行虚拟控制模块将DMA写请求的AVALONE总线时序发送给SRIO控制模块,该SRIO控制模块将应用程序的DMA写请求的AVALONE总线时序打包成SRIO NWRITE命令以串行数据格式通过SRIO总线发送到DSP侧的SRIO收发硬件模块,Step 204, the DMA uplink virtual control module sends the AVALONE bus timing of the DMA write request to the SRIO control module, and the SRIO control module packages the AVALONE bus timing of the DMA write request of the application into an SRIO NWRITE command in a serial data format through the SRIO bus Sent to the SRIO transceiver hardware module on the DSP side,

步骤205、在DSP侧的SRIO收发硬件模块收到SRIO NWRITE命令后,解析、识别到SRIO的DMA写请求,解析出DMA写请求的DMA上行源缓冲存储器中待传输的接收数据的传输长度、DMA上行源缓冲存储器中的待传输的接收数据首地址、DMA上行目的缓冲存储器的首地址后,将待传输的接收数据顺序写到DMA上行目的缓冲存储器中,Step 205: After the SRIO transceiver hardware module on the DSP side receives the SRIO NWRITE command, it parses and recognizes the DMA write request of the SRIO, and parses out the transmission length and DMA of the received data to be transmitted in the DMA upstream source buffer memory of the DMA write request. After the first address of the received data to be transmitted in the upstream source buffer memory and the first address of the DMA upstream destination buffer memory, the received data to be transmitted is sequentially written to the DMA upstream destination buffer memory,

步骤206、DMA上行虚拟控制模块将DMA上行虚拟通道的待传输的接收数据传输完成后,将第一上行通道寄存器的值修改为表征DMA上行目的缓冲存储器为满状态,Step 206, after the DMA upstream virtual control module completes the transmission of the received data to be transmitted of the DMA upstream virtual channel, the value of the first upstream channel register is modified to represent that the DMA upstream destination buffer memory is a full state,

步骤207、接收任务处理DMA上行目的缓冲存储器的接收数据,Step 207, the receiving task processes the received data of the DMA uplink destination buffer memory,

步骤208、DMA上行虚拟通道中的接收任务处理完成DMA上行目的缓冲存储器的接收数据,将第一上行通道寄存器的值修改为表征为DMA上行目的缓冲存储器为空状态。Step 208: The receive task in the DMA uplink virtual channel is processed to complete the received data of the DMA uplink destination buffer memory, and the value of the first uplink channel register is modified to indicate that the DMA uplink destination buffer memory is empty.

本发明与现有技术相比,具有以下优点和有益效果:Compared with the prior art, the present invention has the following advantages and beneficial effects:

第一,本发明提出的面向应用的多通道SRIO DMA传输系统,能够虚拟出多个传输逻辑通道,应用与应用之间、通道与通道间彼此耦合度小、独立性高,便于独立应用与管理;First, the application-oriented multi-channel SRIO DMA transmission system proposed by the present invention can virtualize multiple transmission logical channels, with small coupling between applications and between channels and high independence, which is convenient for independent application and management. ;

第二,本发明采用的多通道SRIO DMA传输系统和方法,能够按照应用带宽、优先级、实时性等灵活配置,满足应用层的多种需求;Second, the multi-channel SRIO DMA transmission system and method adopted in the present invention can be flexibly configured according to application bandwidth, priority, real-time performance, etc., to meet various requirements of the application layer;

第三,本发明提出的面向应用的SRIO DMA传输方法,减少数据传输中多次封包、解包、数据拷贝的次数,提高了系统的传输效率。Third, the application-oriented SRIO DMA transmission method proposed by the present invention reduces the number of times of encapsulation, unpacking and data copying in data transmission, and improves the transmission efficiency of the system.

附图说明Description of drawings

图1为SRIO DMA传送硬件示意图;Fig. 1 is a schematic diagram of SRIO DMA transmission hardware;

图2为本发明的整体结构示意图;Fig. 2 is the overall structure schematic diagram of the present invention;

图3为SV发送任务对应的DMA下行虚拟通道组成示意图;Fig. 3 is a schematic diagram of the composition of the DMA downlink virtual channel corresponding to the SV sending task;

图4为SV接收任务对应的DMA上行虚拟通道组成示意图;Fig. 4 is a schematic diagram of the composition of the DMA upstream virtual channel corresponding to the SV receiving task;

图5为DMA下行多应用程序调度进程示意图;5 is a schematic diagram of a DMA downlink multi-application scheduling process;

图6为SRIO控制模块(SRIO IP)的AVALON-MM Read时序示意图;Fig. 6 is the AVALON-MM Read sequence diagram of SRIO control module (SRIO IP);

图7为DMA上行多应用程序调度进程示意图;7 is a schematic diagram of a DMA uplink multi-application scheduling process;

图8为SRIO控制模块(SRIO IP)的AVALON-MM WRITE时序示意图。FIG. 8 is a schematic diagram of the AVALON-MM WRITE timing of the SRIO control module (SRIO IP).

具体实施方式Detailed ways

为了便于本领域普通技术人员理解和实施本发明,下面结合实施例对本发明作进一步的详细描述,应当理解,此处所描述的实施示例仅用于说明和解释本发明,并不用于限定本发明。In order to facilitate the understanding and implementation of the present invention by those of ordinary skill in the art, the present invention will be further described in detail below with reference to the embodiments. It should be understood that the embodiments described herein are only used to illustrate and explain the present invention, but not to limit the present invention.

一种面向应用的多通道SRIO DMA传输系统,包括DSP子系统和FPGA子系统。An application-oriented multi-channel SRIO DMA transmission system includes a DSP subsystem and an FPGA subsystem.

DSP子系统包括:DSP、外部内存DDR3和SRIO收发硬件模块,DSP子系统的外部内存DDR3对应不同的应用程序划分为多个DMA下行源缓冲存储器和多个DMA上行目的缓冲存储器。The DSP subsystem includes: DSP, external memory DDR3 and SRIO transceiver hardware modules. The external memory DDR3 of the DSP subsystem is divided into multiple DMA downstream source buffer memories and multiple DMA upstream destination buffer memories corresponding to different applications.

FPGA子系统包括:SRIO控制模块(SRIO IP)、DMA下行虚拟控制模块、DMA上行虚拟控制模块、外部内存DDR3和外部接口,FPGA子系统的外部内存DDR3对应不同的应用程序划分为多个DMA下行目的缓冲存储器和多个DMA上行源缓冲存储器,外部接口与应用程序一一对应。The FPGA subsystem includes: SRIO control module (SRIO IP), DMA downlink virtual control module, DMA uplink virtual control module, external memory DDR3 and external interfaces. The external memory DDR3 of the FPGA subsystem is divided into multiple DMA downlinks corresponding to different applications. The destination buffer memory and multiple DMA upstream source buffer memories, the external interface corresponds to the application program one by one.

应用程序包括:SV发送任务、模拟量发送任务、FT3发送任务、GOOSE发送任务、其他发送任务、SV接收任务、模拟量接收任务、FT3接收任务、GOOSE接收任务、其他接收任务等;Applications include: SV sending tasks, analog sending tasks, FT3 sending tasks, GOOSE sending tasks, other sending tasks, SV receiving tasks, analog receiving tasks, FT3 receiving tasks, GOOSE receiving tasks, other receiving tasks, etc.;

外部接口包括SV发送模块、模拟量发送模块、FT3发送模块、GOOSE发送模块、其他发送模块、SV接收模块、模拟量接收模块、FT3接收模块、GOOSE接收模块、其他接收模块等;External interfaces include SV sending module, analog sending module, FT3 sending module, GOOSE sending module, other sending modules, SV receiving module, analog receiving module, FT3 receiving module, GOOSE receiving module, other receiving modules, etc.;

每个应用程序对应一个DMA虚拟通道,DMA虚拟通道包括DMA下行虚拟通道和DMA上行虚拟通道,DSP子系统至FPGA子系统为下行,FPGA子系统至DSP子系统为上行。Each application corresponds to a DMA virtual channel. The DMA virtual channel includes a DMA downlink virtual channel and a DMA uplink virtual channel. The DSP subsystem to the FPGA subsystem is the downlink, and the FPGA subsystem to the DSP subsystem is the uplink.

DMA下行虚拟通道包括分别与应用程序对应的DMA下行源缓冲存储器、DMA下行虚拟控制模块、DMA下行目的缓冲存储器。The DMA downlink virtual channel includes the DMA downlink source buffer memory, the DMA downlink virtual control module, and the DMA downlink destination buffer memory respectively corresponding to the application programs.

DMA下行虚拟控制模块包括第一下行通道寄存器、第二下行通道寄存器和第三下行通道寄存器。The DMA downlink virtual control module includes a first downlink channel register, a second downlink channel register and a third downlink channel register.

第一下行通道寄存器用于存储DMA下行源缓冲存储器的存储状态;The first downlink channel register is used to store the storage state of the DMA downlink source buffer memory;

第二下行通道寄存器用于存储DMA下行源缓冲存储器中待传输的发送数据的传输长度;The second downlink channel register is used to store the transmission length of the transmission data to be transmitted in the DMA downlink source buffer memory;

第三下行通道寄存器用于存储DMA下行源缓冲存储器中待传输的发送数据的首地址。The third downlink channel register is used to store the first address of the transmit data to be transmitted in the DMA downlink source buffer memory.

本实施例中,DMA下行源缓冲存储器包括第一下行源乒乓存储器dsram1_a和第二下行源乒乓存储器dsram1_b。In this embodiment, the DMA downlink source buffer memory includes a first downlink source ping-pong memory dsram1_a and a second downlink source ping-pong memory dsram1_b.

DMA下行目的缓冲存储器包括第一下行目的乒乓存储器fdram1_a和第二下行目的乒乓存储器fdram1_b。The DMA downstream destination buffer memory includes a first downstream destination ping-pong memory fdram1_a and a second downstream destination ping-pong memory fdram1_b.

第一下行通道寄存器的第0位和第1位分别对应着DMA下行源缓冲存储器的第一下行源乒乓存储器dsram1_a和第二下行源乒乓存储器dsram1_b的当前状态,The 0th bit and the 1st bit of the first downlink channel register respectively correspond to the current state of the first downlink source ping-pong memory dsram1_a and the second downlink source ping-pong memory dsram1_b of the DMA downlink source buffer memory,

如果第一下行通道寄存器的第0位为1,则第一下行源乒乓存储器dsram1_a下行传输未完成;如果第一下行通道寄存器的第0位为0,则第一下行源乒乓存储器dsram1_a下行传输完成;If the 0th bit of the first downlink channel register is 1, the downlink transmission of the first downlink source ping-pong memory dsram1_a is not completed; if the 0th bit of the first downlink channel register is 0, then the first downlink source ping-pong memory dsram1_a downlink transmission completed;

如果第一下行通道寄存器的第1位为1,则第二下行源乒乓存储器dsram1_b下行传输未完成;如果第一下行通道寄存器的第1位为0,则第二下行源乒乓存储器dsram1_b下行传输完成;If the first bit of the first downlink channel register is 1, the downlink transmission of the second downlink source ping-pong memory dsram1_b is not completed; if the first bit of the first downlink channel register is 0, the second downlink source ping-pong memory dsram1_b downlink transmission completed;

DMA上行虚拟通道包括分别与应用程序对应的DMA上行源缓冲存储器、DMA上行虚拟控制模块、DMA上行目的缓冲存储器。The DMA upstream virtual channel includes the DMA upstream source buffer memory, the DMA upstream virtual control module, and the DMA upstream destination buffer memory respectively corresponding to the application program.

DMA上行虚拟控制模块包括第一上行通道寄存器、第二上行通道寄存器和第三上行通道寄存器。The DMA upstream virtual control module includes a first upstream channel register, a second upstream channel register and a third upstream channel register.

第一上行通道寄存器用于存储DMA上行目的缓冲存储器ddram1的存储状态;The first upstream channel register is used to store the storage state of the DMA upstream destination buffer memory ddram1;

第二上行通道寄存器用于存储DMA上行源缓冲存储器中待传输的接收数据的传输长度;The second upstream channel register is used to store the transmission length of the received data to be transmitted in the DMA upstream source buffer memory;

第三上行通道寄存器用于存储DMA上行源缓冲存储器中待传输的接收数据的首地址。The third upstream channel register is used to store the first address of the received data to be transmitted in the DMA upstream source buffer memory.

在本实施例中,DMA上行源缓冲存储器fsram1包括两片大小一样功能相同的第一上行源乒乓存储器fsram1_a和第二上行源乒乓存储器fsram1_b,形成乒乓操作。In this embodiment, the DMA upstream source buffer memory fsram1 includes two pieces of a first upstream source ping-pong memory fsram1_a and a second upstream source ping-pong memory fsram1_b with the same size and the same function to form a ping-pong operation.

DMA上行目的缓冲存储器ddram1有两个大小相同、以乒乓模式操作的第一上行目的乒乓存储器ddram1_a和第二上行目的乒乓存储器ddram1_b。The DMA upstream destination buffer memory ddram1 has two same-sized first upstream destination ping-pong memory ddram1_a and second upstream destination ping-pong memory ddram1_b operating in ping-pong mode.

第一上行通道寄存器的第0位和第1位分别对应着第一上行目的乒乓存储器ddram1_a和第二上行目的乒乓存储器ddram1_b的空闲状态,The 0th bit and the 1st bit of the first upstream channel register respectively correspond to the idle state of the first upstream destination ping-pong memory ddram1_a and the second upstream destination ping-pong memory ddram1_b,

如果第一上行通道寄存器的第0位为1,则第一上行目的乒乓存储器ddram1_a为非空闲,如果第一上行通道寄存器的第0位为0,则第一上行目的乒乓存储器ddram1_a为空闲;If the 0th bit of the first upstream channel register is 1, then the first upstream destination ping-pong memory ddram1_a is not idle, and if the 0th bit of the first upstream channel register is 0, then the first upstream destination ping-pong memory ddram1_a is idle;

如果第一上行通道寄存器的第1位为1,则第二上行目的乒乓存储器ddram1_b为非空闲,如果第一上行通道寄存器的第1位为0,则第二上行目的乒乓存储器ddram1_b为空闲。If the first bit of the first upstream channel register is 1, the second upstream destination ping-pong memory ddram1_b is not idle, and if the first bit of the first upstream channel register is 0, the second upstream destination ping-pong memory ddram1_b is idle.

DSP通过寄存器总线与各个DMA下行虚拟控制模块和各个DMA上行虚拟控制模块连接。The DSP is connected with each DMA downstream virtual control module and each DMA upstream virtual control module through a register bus.

DSP与FPGA之间的高速SRIO总线采用4个物理通道、2.5Gbps/通道,同时双向最大理论通信带宽10Gbps,10B8B/8B10B转换后有效可用带宽为8Gbps,进一步保留一定余量设置有效用户带宽为80%,即6.4Gbps。The high-speed SRIO bus between DSP and FPGA adopts 4 physical channels, 2.5Gbps/channel, and the maximum theoretical communication bandwidth in both directions is 10Gbps. After 10B8B/8B10B conversion, the effective available bandwidth is 8Gbps, and a certain margin is further reserved to set the effective user bandwidth to 80 %, which is 6.4Gbps.

整个应用角度看,应用程序可分为SV发送任务、模拟量发送任务、Goose发送任务、FT3发送任务,其他发送任务,以及相对应的这些接收任务,本发明将这些应用程序一一绑定到预先定义的DMA虚拟通道上,每个应用独立占用该DMA虚拟通道带宽、内存,彼此独立互不影响。各个应用与DMA虚拟通道对应关系为:第一DMA下行虚拟通道对应SV发送任务,第二DMA下行虚拟通道对应模拟量发送任务,第三DMA下行虚拟通道对应FT3发送任务,第四DMA下行虚拟通道对应Goose发送任务;第一DMA上行虚拟通道对应SV接收任务,第二DMA上行虚拟通道对应模拟量接收任务,第三DMA上行虚拟通道对应FT3接收任务,第四DMA上行虚拟通道对应Goose接收任务;并预留备用通道N,可作为其他发送、接收任务的扩展。From the perspective of the whole application, applications can be divided into SV sending tasks, analog sending tasks, Goose sending tasks, FT3 sending tasks, other sending tasks, and the corresponding receiving tasks. The present invention binds these application programs to one by one. On the pre-defined DMA virtual channel, each application independently occupies the bandwidth and memory of the DMA virtual channel, and does not affect each other independently. The corresponding relationship between each application and the DMA virtual channel is: the first DMA downlink virtual channel corresponds to the SV transmission task, the second DMA downlink virtual channel corresponds to the analog transmission task, the third DMA downlink virtual channel corresponds to the FT3 transmission task, and the fourth DMA downlink virtual channel corresponds to the FT3 transmission task. Corresponding to Goose sending tasks; the first DMA upstream virtual channel corresponds to SV receiving tasks, the second DMA upstream virtual channel corresponds to analog receiving tasks, the third DMA upstream virtual channel corresponds to FT3 receiving tasks, and the fourth DMA upstream virtual channel corresponds to Goose receiving tasks; And reserve a spare channel N, which can be used as an extension for other sending and receiving tasks.

另外,还包含DSP与FPGA交互的寄存器总线,该寄存器总线用来交互DSP侧与FPGA侧DMA传输时的DMA下行虚拟控制模块中的第一下行通道寄存器、第二下行通道寄存器和第三下行通道寄存器,以及DMA上行虚拟控制模块中的第一上行通道寄存器、第二上行通道寄存器和第三上行通道寄存器。In addition, it also includes a register bus for the interaction between the DSP and the FPGA. The register bus is used to interact with the first downstream channel register, the second downstream channel register and the third downstream channel register in the DMA downstream virtual control module during DMA transmission between the DSP side and the FPGA side. The channel register, and the first upstream channel register, the second upstream channel register and the third upstream channel register in the DMA upstream virtual control module.

一种面向应用的多通道SRIO DMA传输方法,为方便该方法能够让技术领域人员实施,如下分别以第一DMA下行虚拟通道和第一DMA上行虚拟通道的操作过程作为实施实例说明。An application-oriented multi-channel SRIO DMA transmission method, in order to facilitate the implementation of the method by those skilled in the art, the following describes the operation processes of the first DMA downlink virtual channel and the first DMA uplink virtual channel as implementation examples.

以SV发送任务通过DMA下行虚拟通道进行SV发送数据的传输为例,一种面向应用的多通道SRIO DMA传输方法,包括以下步骤:Taking the SV sending task to transmit the SV sending data through the DMA downlink virtual channel as an example, an application-oriented multi-channel SRIO DMA transmission method includes the following steps:

步骤100,DSP启动后DSP的SV发送任务获取并初始化DMA下行源缓冲存储器dsram1,Step 100, after the DSP is started, the SV sending task of the DSP acquires and initializes the DMA downlink source buffer memory dsram1,

本实施例中,DMA下行源缓冲存储器dsram1有两个大小相同、以乒乓模式操作的第一下行源乒乓存储器dsram1_a和第二下行源乒乓存储器dsram2_b组成,每个第一下行源乒乓存储器和第二下行源乒乓存储器的最大为32150字节。In this embodiment, the DMA downlink source buffer memory dsram1 is composed of two first downlink source ping-pong memories dsram1_a and second downlink source ping-pong memories dsram2_b that are the same in size and operate in a ping-pong mode. Each of the first downlink source ping-pong memories and The maximum size of the second downstream source ping-pong memory is 32150 bytes.

步骤101,当SV发送任务有SV数据发送时,首先DSP采用寄存器总线EMIF查询DMA下行虚拟控制模块的第一下行通道寄存器,第一下行通道寄存器标志DMA下行源缓冲存储器的状态,确定DMA下行源缓冲存储器处于传输完成状态;Step 101, when the SV sending task has SV data to send, firstly, the DSP uses the register bus EMIF to query the first downlink channel register of the DMA downlink virtual control module, the first downlink channel register marks the state of the DMA downlink source buffer memory, and determines the DMA. The downstream source buffer memory is in the transfer completion state;

在本实施例中,第一下行通道寄存器的第0位和第1位分别对应着DMA下行源缓冲存储器的第一下行源乒乓存储器dsram1_a和第二下行源乒乓存储器dsram1_b的当前状态,如果第一下行通道寄存器的第0位为1,则第一下行源乒乓存储器dsram1_a下行传输未完成,第一下行通道寄存器的第1位为1,则第二下行源乒乓存储器dsram1_b下行传输未完成,需要等待,否则可以继续步骤102。In this embodiment, the 0th bit and the 1st bit of the first downlink channel register respectively correspond to the current state of the first downlink source ping-pong memory dsram1_a and the second downlink source ping-pong memory dsram1_b of the DMA downlink source buffer memory. If The 0th bit of the first downlink channel register is 1, then the downlink transmission of the first downlink source ping-pong memory dsram1_a is not completed, and the first bit of the first downlink channel register is 1, then the second downlink source ping-pong memory dsram1_b downlink transmission If it is not completed, it needs to wait, otherwise, step 102 can be continued.

步骤102,SV发送任务将多个SV发送数据包依次填入到DMA下行源缓冲存储器中,第一个SV发送数据包从第5字节开始,后续的SV发送数据包依次靠后排布,直到能将DMA下行源缓冲存储器放置满为止,但必须保证最后一个SV发送数据包的完整性,即如果剩下的字节数据不足以放置一个待放的SV发送数据包时,余下空间空余,如图3所示。当待传输的SV发送数据包填充完DMA下行源缓冲存储器后,将DMA下行源缓冲存储器的首4字节的32位修改为如下定义:Step 102, the SV sending task fills the multiple SV sending data packets into the DMA downlink source buffer memory in turn, the first SV sending data packet starts from the 5th byte, and the subsequent SV sending data packets are arranged in the back in sequence, Until the DMA downlink source buffer memory can be filled, but the integrity of the last SV sending data packet must be guaranteed, that is, if the remaining byte data is not enough to place a pending SV sending data packet, the remaining space is free, As shown in Figure 3. After the SV transmit data packet to be transmitted fills the DMA downlink source buffer memory, modify the 32 bits of the first 4 bytes of the DMA downlink source buffer memory to the following definition:

第7至0比特位:待传输的SV发送数据包的流水号tx_ch1_dma_stream,每次组包完后加1,即DMA下行源缓冲存储器填充完SV发送数据包后加1,作为后续接收侧验证是否丢包的依据;Bits 7 to 0: The serial number tx_ch1_dma_stream of the SV sending data packet to be transmitted, incremented by 1 after each packet is completed, that is, 1 is added after the DMA downstream source buffer memory is filled with the SV sending data packet, as a follow-up verification on the receiving side. The basis for packet loss;

第15至8比特位:当前待传输的SV发送数据包的个数tx_ch1_dma_pack_num;The 15th to 8th bits: the number of SV transmission packets currently to be transmitted tx_ch1_dma_pack_num;

第31至16比特位:当前待传输的SV发送数据包的总字节数tx_ch1_dma_byte_len。Bits 31 to 16: tx_ch1_dma_byte_len of the total number of bytes of the SV transmit data packet currently to be transmitted.

上述填充过程中,DMA下行源缓冲存储器的第一下行源乒乓存储器dsram1_a和第二下行源乒乓存储器dsram2_b进行交替填充。In the above filling process, the first downlink source ping-pong memory dsram1_a and the second downlink source ping-pong memory dsram2_b of the DMA downlink source buffer memory are alternately filled.

步骤103:SV发送任务通过寄存器总线EMIF将待传输的SV发送数据的传输长度tx_ch1_dma_byte_len写入DMA下行虚拟控制模块的第二下行通道寄存器,将DMA下行源缓冲存储器的待传输的SV发送数据的首地址写入DMA下行虚拟控制模块的第三下行通道寄存器,并且将DMA下行虚拟控制模块的第一下行通道寄存器修改为传输未完成。Step 103: The SV transmission task writes the transmission length tx_ch1_dma_byte_len of the SV transmission data to be transmitted into the second downlink channel register of the DMA downlink virtual control module through the register bus EMIF, and writes the header of the SV transmission data to be transmitted in the DMA downlink source buffer memory. The address is written into the third downlink channel register of the DMA downlink virtual control module, and the first downlink channel register of the DMA downlink virtual control module is modified to indicate that the transmission is not completed.

步骤104,DMA下行虚拟控制模块按照每250u的发送周期轮询哪些DMA下行虚拟通道有SV发送数据需要被调度,即通过各个DMA下行虚拟通道对应的第一下行通道寄存器查询是否需要有SV发送数据需要被调度发送,按照预设的DMA下行虚拟通道的通道带宽值、优先级、SRIO总线的有效带宽对各个DMA下行虚拟通道的待传输的SV发送数据进行传输。即根据DMA下行虚拟通道的通道带宽值,计算发送周期中DMA下行虚拟通道需要发送的字节数,根据发送周期中DMA下行虚拟通道需要发送的字节数和SRIO总线的有效带宽,计算DMA下行虚拟通道在发送周期中占用的调度时间,根据DMA下行虚拟通道的优先级,依次按照DMA下行虚拟通道对应的调用时间对待传输的SV发送数据进行传输;Step 104, the DMA downlink virtual control module polls which DMA downlink virtual channels have SV transmission data to be scheduled according to the transmission cycle of every 250u, that is, through the first downlink channel register corresponding to each DMA downlink virtual channel to query whether SV transmission is required. The data needs to be scheduled for transmission, and the SV transmission data to be transmitted of each DMA downlink virtual channel is transmitted according to the preset channel bandwidth value, priority, and effective bandwidth of the SRIO bus of the DMA downlink virtual channel. That is, according to the channel bandwidth value of the DMA downstream virtual channel, calculate the number of bytes to be sent by the DMA downstream virtual channel in the sending cycle, and calculate the DMA downstream virtual channel according to the number of bytes to be sent by the DMA downstream virtual channel and the effective bandwidth of the SRIO bus in the sending cycle. The scheduling time occupied by the virtual channel in the sending cycle, according to the priority of the DMA downlink virtual channel, and sequentially according to the calling time corresponding to the DMA downlink virtual channel to transmit the SV transmission data to be transmitted;

优先级1为最高,最优先调度,依次次之。在本实施例中,各个DMA下行虚拟通道的通道带宽值及优先级设置如下:Priority 1 is the highest, the highest priority scheduling, followed by the next. In this embodiment, the channel bandwidth value and priority of each DMA downlink virtual channel are set as follows:

第一DMA下行虚拟通道带宽设置为1Gbps,分割到250us发送周期中,即调度数据量为1G*250*10-6/8=31250字节,调度时间为31250*8/6400Mbps=39.0625us,该通道优先级为1;The bandwidth of the first DMA downlink virtual channel is set to 1Gbps, which is divided into 250us transmission cycles, that is, the scheduling data volume is 1G*250* 10-6 /8=31250 bytes, and the scheduling time is 31250*8/6400Mbps=39.0625us. The channel priority is 1;

第二DMA下行虚拟通道带宽设置为261.12Mbps,分割到250us发送周期中,即调度数据量为261.12M*250*10-6/8=8160字节,调度时间为8160*8/6400Mbps=10.2us,该通道优先级为2。The bandwidth of the second DMA downlink virtual channel is set to 261.12Mbps, which is divided into 250us transmission cycles, that is, the scheduling data volume is 261.12M*250*10 -6 /8=8160 bytes, and the scheduling time is 8160*8/6400Mbps=10.2us , the channel priority is 2.

第三DMA下行虚拟通道带宽设置为163.84Mbps,分割到250us发送周期中,即调度数据量为163.84M*250*10-6/8=5120字节,调度时间为5120*8/6400Mbps=6.4us,该通道优先级为3;The bandwidth of the third DMA downlink virtual channel is set to 163.84Mbps, which is divided into 250us transmission cycles, that is, the scheduling data volume is 163.84M*250*10 -6 /8=5120 bytes, and the scheduling time is 5120*8/6400Mbps=6.4us , the channel priority is 3;

第四DMA下行虚拟通道带宽设置为28.8Mbps,分割到250us发送周期中,即调度数据量为28.8M*250*10-6/8=900字节,调度时间为900*8/6400Mbps=1.125us,该通道优先级为4;The bandwidth of the fourth DMA downlink virtual channel is set to 28.8Mbps, which is divided into 250us transmission cycles, that is, the scheduling data volume is 28.8M*250*10 -6 /8=900 bytes, and the scheduling time is 900*8/6400Mbps=1.125us , the channel priority is 4;

上述6400Mbps为SRIO总线的有效带宽。The above 6400Mbps is the effective bandwidth of the SRIO bus.

合计调度占用时间为:39.0625+10.2+6.4+1.125=56.7875us;调度空闲时间为:250us-56.7875us=193.2125us。各个DMA下行虚拟通道的调度时序图见图5。The total scheduling occupied time is: 39.0625+10.2+6.4+1.125=56.7875us; the scheduling idle time is: 250us-56.7875us=193.2125us. The scheduling sequence diagram of each DMA downlink virtual channel is shown in Figure 5.

在250us周期中,先用39.0625us发送优先级为1的第一DMA下行虚拟通道的SV数据包、再用10.2us发送优先级为2的第二DMA下行虚拟通道的模拟量数据包、再用6.4us发送优先级为3的第三DMA下行虚拟通道的GOOSE数据包、再用1.125us发送优先级为4的第四DMA下行虚拟通道的FT3数据包。In the 250us cycle, first use 39.0625us to send the SV data packet of the first DMA downlink virtual channel with priority 1, and then use 10.2us to send the analog data packet of the second DMA downlink virtual channel with priority 2, and then use 6.4us send the GOOSE data packet of the third DMA downlink virtual channel with priority 3, and then use 1.125us to send the FT3 data packet of the fourth DMA downlink virtual channel with priority 4.

DMA下行虚拟控制模块首先按照如上定义的通道优先级读取DMA下行虚拟通道对应的第一下行通道寄存器,确认DMA下行虚拟通道是否有需要待传输的SV发送数据,如果有需要待传输的SV发送数据,再读出第二下行通道寄存器和第三下行通道寄存器,即待DMA下行源缓冲存储器的待传输的SV发送数据的传输长度和DMA下行源缓冲存储器的待传输的发送数据的首地址。The DMA downlink virtual control module first reads the first downlink channel register corresponding to the DMA downlink virtual channel according to the channel priority defined above, and confirms whether the DMA downlink virtual channel has SV transmission data that needs to be transmitted. Send data, and then read the second downlink channel register and the third downlink channel register, that is, the transmission length of the SV transmission data to be transmitted in the DMA downlink source buffer memory and the first address of the transmission data to be transmitted in the DMA downlink source buffer memory. .

在本实施例中,第一下行通道寄存器的第0位和第1位任何一位为1则表示该DMA下行虚拟通道有需要待传送的数据(第0位为1,第一下行源乒乓存储器dsram1_a有待传输的SV发送数据,第1位为1,第二下行源乒乓存储器dsram2_b有待传输的SV发送数据),再读出第二下行通道寄存器和第三下行通道寄存器,即DMA下行源缓冲存储器的待传输的SV发送数据的传输长度和DMA下行源缓冲存储器的待传输的SV发送数据的首地址。In this embodiment, if any one of the 0th bit and the 1st bit of the first downlink channel register is 1, it indicates that the DMA downlink virtual channel has data to be transmitted (the 0th bit is 1, the first downlink source is 1). The ping-pong memory dsram1_a has the SV transmission data to be transmitted, the first bit is 1, the second downlink source ping-pong memory dsram2_b has the SV transmission data to be transmitted), and then read the second downlink channel register and the third downlink channel register, that is, the DMA downlink source The transmission length of the SV transmission data to be transmitted in the buffer memory and the first address of the SV transmission data to be transmitted in the DMA downstream source buffer memory.

进一步的依据DMA下行源缓冲存储器的待传输的SV发送数据的传输长度和DMA下行源缓冲存储器的待传输的SV发送数据的首地址,产生DMA读请求的AVALONE总线时序,该AVALONE总线是Intel SRIO控制模块(SRIO IP)提供的DMA请求总线,如图6所示。Further according to the transmission length of the SV transmission data to be transmitted in the DMA downlink source buffer memory and the first address of the SV transmission data to be transmitted in the DMA downlink source buffer memory, the AVALONE bus timing sequence of the DMA read request is generated, and the AVALONE bus is an Intel SRIO The DMA request bus provided by the control module (SRIO IP) is shown in Figure 6.

步骤105,DMA下行虚拟控制模块按照步骤104的方式将DMA读请求的AVALONE总线时序发送给SRIO控制模块(SRIO IP),该SRIO控制模块(SRIO IP)将DMA读请求的AVALONE总线时序打包成SRIO NREAD命令以串行数据格式通过SRIO总线发送到DSP侧的SRIO收发硬件模块;Step 105, the DMA downlink virtual control module sends the AVALONE bus timing of the DMA read request to the SRIO control module (SRIO IP) according to the method of step 104, and the SRIO control module (SRIO IP) packages the AVALONE bus timing of the DMA read request into SRIO The NREAD command is sent to the SRIO transceiver hardware module on the DSP side through the SRIO bus in serial data format;

步骤106,在DSP侧的SRIO收发硬件模块收到SRIO NREAD命令后,解析、识别到一个SRIO的DMA读请求,并进一步解析出该DMA读请求的DMA下行源缓冲存储器的待传输的SV发送数据的传输长度和DMA下行源缓冲存储器的待传输的SV发送数据的首地址,并在DSP侧以DMA下行源缓冲存储器的待传输的SV发送数据的传输长度和DMA下行源缓冲存储器的待传输的SV发送数据的首地址为依据从DSP侧的DMA下行源缓冲存储器中读出对应地址的待传输的SV发送数据,并按照SRIO协议的RESP包格式生成对应的RESP数据包回应给FPGA侧的SRIO控制模块(SRIO IP);Step 106: After the SRIO transceiver hardware module on the DSP side receives the SRIO NREAD command, it parses and identifies an SRIO DMA read request, and further parses out the SV transmit data to be transmitted in the DMA downlink source buffer memory of the DMA read request. The transmission length and the first address of the SV to be transmitted in the DMA downstream source buffer memory, and the transmission length of the SV to be transmitted in the DMA downstream source buffer memory on the DSP side and the transmission length of the DMA downstream source buffer memory to be transmitted. The first address of the SV sending data is the SV sending data to be transmitted according to the corresponding address read from the DMA downstream source buffer memory on the DSP side, and the corresponding RESP data packet is generated according to the RESP packet format of the SRIO protocol to respond to the SRIO on the FPGA side. Control module (SRIO IP);

步骤107,FPGA侧的SRIO控制模块(SRIO IP)收到DSP侧的SRIO收发硬件模块的RESP数据包后,解析成AVALONE总线读响应时序,作为步骤105的AVALONE总线的后续操作。Step 107 , after the SRIO control module (SRIO IP) on the FPGA side receives the RESP data packet of the SRIO transceiver hardware module on the DSP side, it parses it into an AVALONE bus read response sequence as a follow-up operation of the AVALONE bus in step 105 .

步骤108,DMA下行虚拟控制模块从SRIO控制模块(SRIO IP)获得AVALONE总线读响应时序后,将对应的待传输的SV发送数据写入到DMA下行目的缓冲存储器fdram1中;Step 108, after the DMA downlink virtual control module obtains the AVALONE bus read response sequence from the SRIO control module (SRIO IP), the corresponding SV transmission data to be transmitted is written in the DMA downlink destination buffer memory fdram1;

本实施例中,DMA下行目的缓冲存储器fdra m1由两个容量一样、乒乓操作的第一下行目的乒乓存储器fdram1_a和第二下行目的乒乓存储器fdram1_b组成,并轮流乒乓读写。In this embodiment, the DMA downlink destination buffer memory fdram1 is composed of two first downlink destination ping-pong memory fdram1_a and second downlink destination ping-pong memory fdram1_b with the same capacity and ping-pong operation, and ping-pong reading and writing in turn.

步骤109,FPGA侧对应的SV发送模块通过查看DMA下行虚拟通道的DMA下行目的缓冲存储器fdram1的非空标识,以乒乓操作读出待传输的SV发送数据并通过FPGA侧对应的外部接口将待传输的SV发送数据发送出去。Step 109, the SV sending module corresponding to the FPGA side reads the SV sending data to be transmitted by ping-pong operation by checking the non-empty identifier of the DMA downstream destination buffer memory fdram1 of the DMA downstream virtual channel and sends the data to be transmitted through the corresponding external interface on the FPGA side. The SV send data is sent out.

其他DMA下行虚拟通道,也可以依据上述方法传输各自应用程序的数据到FPGA侧对应的外部接口。Other DMA downlink virtual channels can also transmit the data of their respective applications to the corresponding external interface on the FPGA side according to the above method.

以SV接收任务通过DMA上行虚拟通道进行SV接收数据的传输为例,一种面向应用的多通道SRIO DMA传输方法,包括以下步骤:Taking the SV receiving task to transmit the SV receiving data through the DMA uplink virtual channel as an example, an application-oriented multi-channel SRIO DMA transmission method includes the following steps:

步骤200,DSP启动后DSP的SV接收任务获取并初始化DMA上行目的缓冲存储器ddram1,Step 200, after the DSP is started, the SV receiving task of the DSP acquires and initializes the DMA uplink destination buffer memory ddram1,

在本实施例中,DMA上行目的缓冲存储器ddram1有两个大小相同、以乒乓模式操作的第一上行目的乒乓存储器ddram1_a和第二上行目的乒乓存储器ddram1_b组成,第一上行目的乒乓存储器ddram1_a和第二上行目的乒乓存储器ddram1_b的最大为32150字节。In this embodiment, the DMA upstream destination buffer memory ddram1 is composed of two first upstream destination ping-pong memory ddram1_a and second upstream destination ping-pong memory ddram1_b which are the same in size and operate in ping-pong mode. The first upstream destination ping-pong memory ddram1_a and the second upstream destination ping-pong memory ddram1_a The maximum size of the uplink destination ping-pong memory ddram1_b is 32150 bytes.

步骤201,SV接收任务通过寄存器总线EMIF清除DMA上行虚拟控制模块的第一上行通道寄存器,第一上行通道寄存器反映DMA上行目的缓冲存储器ddram1的存储状态,Step 201, the SV receiving task clears the first upstream channel register of the DMA upstream virtual control module through the register bus EMIF, and the first upstream channel register reflects the storage state of the DMA upstream destination buffer memory ddram1,

在本实施例中,第一上行通道寄存器的第0位和第1位分别对应着DMA上行虚拟通道的第一上行目的乒乓存储器ddram1_a和第二上行目的乒乓存储器ddram1_b的当前状态,当SV接收任务第一次初始化或读空对应的第一上行目的乒乓存储器ddram1_a和第二上行目的乒乓存储器ddram1_b后,清除第一上行通道寄存器的状态寄存器。In this embodiment, bits 0 and 1 of the first upstream channel register correspond to the current states of the first upstream destination ping-pong memory ddram1_a and the second upstream destination ping-pong memory ddram1_b of the DMA upstream virtual channel, respectively. When the SV receives a task After initializing or emptying the corresponding first upstream destination ping-pong memory ddram1_a and the second upstream destination ping-pong memory ddram1_b for the first time, the status register of the first upstream channel register is cleared.

初始化第三上行通道寄存器为DMA上行目的缓冲存储器ddram1的首地址,Initialize the third upstream channel register as the first address of the DMA upstream destination buffer memory ddram1,

在本实施例中,第三上行通道寄存器存储DMA上行虚拟通道的第一上行目的乒乓存储器ddram1_a或第二上行目的乒乓存储器ddram1_b的首地址,当第一上行通道寄存器的第0位为0时,将第一上行目的乒乓存储器ddram1_a的首地址赋值到第三上行通道寄存器,当第一上行通道寄存器的第1位为0时,将第二上行目的乒乓存储器ddram1_b首地址赋值到第三上行通道寄存器。In this embodiment, the third upstream channel register stores the first address of the first upstream destination ping-pong memory ddram1_a or the second upstream destination ping-pong memory ddram1_b of the DMA upstream virtual channel. When the 0th bit of the first upstream channel register is 0, Assign the first address of the first upstream destination ping-pong memory ddram1_a to the third upstream channel register. When the first bit of the first upstream channel register is 0, assign the first address of the second upstream destination ping-pong memory ddram1_b to the third upstream channel register. .

DMA上行虚拟通道的配置完成,将等待FPGA子系统写入数据到对应的DMA上行目的缓冲存储器ddram1中,即DSP侧的SV接收任务将轮询各个DMA上行虚拟通道对应的第一上行通道寄存器,第一上行通道寄存器反映DMA上行目的缓冲存储器ddram1为是否缓冲有SV接收数据,如果缓冲有SV接收数据,则进入步骤207,否则进入步骤202;After the configuration of the DMA upstream virtual channel is completed, it will wait for the FPGA subsystem to write data into the corresponding DMA upstream destination buffer memory ddram1, that is, the SV receiving task on the DSP side will poll the first upstream channel register corresponding to each DMA upstream virtual channel. The first upstream channel register reflects whether the DMA upstream destination buffer memory ddram1 is buffered with SV received data, if buffered with SV received data, then enter step 207, otherwise enter step 202;

在本实施例中,第一上行通道寄存器的第0位为1反映第一上行目的乒乓存储器ddram1_a内缓冲有SV接收数据,第一上行通道寄存器的第1位为1,即反映第二上行目的乒乓存储器ddram1_b内缓冲有SV接收数据。In this embodiment, the 0th bit of the first upstream channel register is 1, which reflects that the SV received data is buffered in the ping-pong memory ddram1_a of the first upstream destination, and the first bit of the first upstream channel register is 1, which reflects the second upstream destination. SV received data is buffered in the ping-pong memory ddram1_b.

步骤202,FPGA侧的SV接收模块实时接收光网口进来的SV以太网数据包,并将SV接收数据包标记时间戳,缓存到DMA上行源缓冲存储器fsram1中,Step 202, the SV receiving module on the FPGA side receives the SV Ethernet data packet from the optical network port in real time, and marks the SV received data packet with a timestamp, and buffers it in the DMA upstream source buffer memory fsram1,

在本实施例中,DMA上行源缓冲存储器fsram1包括两片大小一样功能相同的第一上行源乒乓存储器fsram1_a和第二上行源乒乓存储器fsram1_b,形成乒乓操作。In this embodiment, the DMA upstream source buffer memory fsram1 includes two pieces of a first upstream source ping-pong memory fsram1_a and a second upstream source ping-pong memory fsram1_b with the same size and the same function to form a ping-pong operation.

接收的以太网SV接收数据包,依次填入到DMA上行源缓冲存储器fsram1,第一个SV接收数据包从第5字节开始,后续的SV接收数据包依次靠后排布,直到能将DMA上行源缓冲存储器fsram1放置满为止,但必须保证最后一个SV接收数据包的完整性,即如果剩下的字节数据不足以放置一个待放置的SV接收数据包时,余下空间空余,如4所示。当待传输的SV接收数据包填充完毕后,将DMA上行源缓冲存储器fsram1的首4字节的32位修改为如下定义:The received Ethernet SV received data packets are filled into the DMA upstream source buffer memory fsram1 in turn. The first SV received data packet starts from the 5th byte, and the subsequent SV received data packets are arranged in sequence until the DMA can be The upstream source buffer memory fsram1 is full, but the integrity of the last SV received data packet must be guaranteed, that is, if the remaining byte data is not enough to place a to-be-placed SV received data packet, the remaining space is free, as shown in 4. Show. When the SV received data packets to be transmitted are filled, modify the 32 bits of the first 4 bytes of the DMA upstream source buffer memory fsram1 to the following definition:

第7至0比特位:待传输的SV接收数据包的流水号rx_ch1_dma_stream,每次组包完后加1,作为后续接收侧验证是否丢包的依据;The 7th to 0th bits: the serial number rx_ch1_dma_stream of the SV receiving data packet to be transmitted, which is incremented by 1 after each packet is completed, as the basis for the subsequent receiving side to verify whether the packet is lost;

第15至8比特位:当前待传输的SV接收数据包的个数rx_ch1_dma_pack_num;The 15th to 8th bits: the number of SV received packets currently to be transmitted rx_ch1_dma_pack_num;

第31至16比特位:当前待传输的SV接收数据包的总字节数rx_ch1_dma_byte_len。Bits 31 to 16: the total number of bytes rx_ch1_dma_byte_len of the SV received data packet to be transmitted currently.

并且,当SV接收模块组包待传输数据完成后,将当前待传输的SV接收数据包的个数rx_ch1_dma_byte_len更新到第二上行通道寄存器,第二上行通道寄存器作用为待传输数据长度寄存器。And, after the SV receiving module grouping the data to be transmitted is completed, the number rx_ch1_dma_byte_len of the currently to-be-transmitted SV received data packets is updated to the second upstream channel register, and the second upstream channel register functions as a data length register to be transmitted.

在本实施例中,DMA上行源缓冲存储器fsram1中的第一上行源乒乓存储器fsram1_a和第二上行源乒乓存储器fsram1_b,形成乒乓操作填入以太网SV接收数据包。In this embodiment, the first upstream source ping-pong memory fsram1_a and the second upstream source ping-pong memory fsram1_b in the DMA upstream source buffer memory fsram1 form a ping-pong operation to fill the Ethernet SV receiving data packets.

步骤203:DMA上行虚拟控制模块按照每250us的接收周期轮询哪些DMA上行虚拟通道需要被调度,即轮询DMA上行源缓冲存储器fsram1是否有待传输的SV接收数据,按照预设的DMA上行虚拟通道的通道带宽值、优先级、SRIO总线的有效带宽对各个DMA上行虚拟通道的待传输的SV接收数据进行接收,即根据DMA上行虚拟通道的通道带宽值,计算接收周期中DMA上行虚拟通道需要传输的SV接收数据的字节数,根据接收周期中DMA上行虚拟通道需要接收的字节数和SRIO总线的有效带宽,计算DMA上行虚拟通道在接收周期中占用的调度时间,根据DMA上行虚拟通道的优先级,依次按照DMA上行虚拟通道对应的调用时间对待传输的SV接收数据进行接收。Step 203: The DMA upstream virtual control module polls which DMA upstream virtual channels need to be scheduled according to the receiving cycle of every 250us, that is, polls whether the DMA upstream source buffer memory fsram1 has SV receiving data to be transmitted, and according to the preset DMA upstream virtual channel The channel bandwidth value, priority, and effective bandwidth of the SRIO bus are used to receive the SV received data to be transmitted on each DMA upstream virtual channel, that is, according to the channel bandwidth value of the DMA upstream virtual channel, calculate the DMA upstream virtual channel needs to be transmitted in the receiving cycle. Calculate the number of bytes of data received by the SV in the receiving cycle, and calculate the scheduling time occupied by the DMA upstream virtual channel in the receiving cycle according to the number of bytes that the DMA upstream virtual channel needs to receive in the receiving cycle and the effective bandwidth of the SRIO bus. Priority, in turn receive the SV received data to be transmitted according to the calling time corresponding to the DMA uplink virtual channel.

优先级1为最高,最优先调度,依次次之。各个DMA上行虚拟通道带宽值及优先级设置如下:Priority 1 is the highest, the highest priority scheduling, followed by the next. The bandwidth value and priority of each DMA uplink virtual channel are set as follows:

第一DMA上行虚拟通道的带宽设置为1Gbps,分割到250us接收周期中,即调度数据量为1G*250*10-6/8=31250字节,调度时间为31250*8/6400Mbps=39.0625us,该通道优先级为1;The bandwidth of the first DMA uplink virtual channel is set to 1Gbps, which is divided into a 250us receiving period, that is, the scheduling data volume is 1G*250*10 -6 /8=31250 bytes, and the scheduling time is 31250*8/6400Mbps=39.0625us, The channel priority is 1;

第二DMA上行虚拟通道的带宽设置为261.12Mbps,分割到250us接收周期中,即调度数据量为261.12M*250*10-6/8=8160字节,调度时间为8160*8/6400Mbps=10.2us,该通道优先级为2;The bandwidth of the second DMA uplink virtual channel is set to 261.12Mbps, which is divided into 250us receiving cycles, that is, the scheduling data volume is 261.12M*250*10 -6 /8=8160 bytes, and the scheduling time is 8160*8/6400Mbps=10.2 us, the channel priority is 2;

第三DMA上行虚拟通道的带宽设置为163.84Mbps,分割到250us接收周期中,即调度数据量为163.84M*250*10-6/8=5120字节,调度时间为5120*8/6400Mbps=6.4us,该通道优先级为3;The bandwidth of the third DMA uplink virtual channel is set to 163.84Mbps, which is divided into 250us receiving cycles, that is, the scheduling data volume is 163.84M*250*10 -6 /8=5120 bytes, and the scheduling time is 5120*8/6400Mbps=6.4 us, the channel priority is 3;

第四DMA上行虚拟通道的带宽设置为28.8Mbps,分割到250us接收周期中,即调度数据量为28.8M*250*10-6/8=900字节,调度时间为900*8/6400Mbps=1.125us,该通道优先级为4;The bandwidth of the fourth DMA uplink virtual channel is set to 28.8Mbps, which is divided into 250us receiving cycles, that is, the scheduling data volume is 28.8M*250*10 -6 /8=900 bytes, and the scheduling time is 900*8/6400Mbps=1.125 us, the channel priority is 4;

合计调度占用时间为:39.0625+10.2+6.4+1.125=56.7875us;调度空闲时间为:250us-56.7875us=193.2125us。DMA上行数据调度时序图见图7。The total scheduling occupied time is: 39.0625+10.2+6.4+1.125=56.7875us; the scheduling idle time is: 250us-56.7875us=193.2125us. The DMA uplink data scheduling sequence diagram is shown in Figure 7.

即在250us周期中,先用39.0625us发送优先级为1的第一DMA上行虚拟通道的SV数据包、再用10.2us发送优先级为2的第二DMA上行虚拟通道的模拟;量数据包、再用6.4us发送优先级为3的第三DMA上行虚拟通道的GOOSE数据包、再用1.125us发送优先级为4的第四DMA上行虚拟通道的FT3数据包。That is, in the 250us period, firstly use 39.0625us to send the SV data packet of the first DMA upstream virtual channel with priority 1, and then use 10.2us to send the simulation of the second DMA upstream virtual channel with priority 2; Then use 6.4us to send the GOOSE data packet of the third DMA upstream virtual channel with priority 3, and then use 1.125us to send the FT3 data packet of the fourth DMA upstream virtual channel with priority 4.

对待传输的SV接收数据进行接收时,DMA上行虚拟控制模块根据DMA上行虚拟通道的优先级,查看对应的DMA上行源缓冲存储器fsram1是否有待传输的SV接收数据,若有待传输的SV接收数据,并设定第三上行通道寄存器的值为有待传输的SV接收数据的DMA上行源缓冲存储器fsram1中的待传输的SV接收数据首地址。When receiving the SV receiving data to be transmitted, the DMA uplink virtual control module checks whether the corresponding DMA uplink source buffer memory fsram1 has the SV receiving data to be transmitted according to the priority of the DMA uplink virtual channel. If there is SV receiving data to be transmitted, and The value of the third upstream channel register is set as the first address of the SV receive data to be transmitted in the DMA upstream source buffer memory fsram1 of the SV receive data to be transmitted.

设定第二上行通道寄存器的值为DMA上行源缓冲存储器fsram中的待传输的SV接收数据长度;The value of setting the second upstream channel register is the SV receiving data length to be transmitted in the DMA upstream source buffer memory fsram;

确定DMA上行目的缓冲存储器的首地址。Determines the first address of the DMA upstream destination buffer memory.

DMA上行虚拟控制模块获取DMA上行源缓冲存储器中待传输的SV接收数据的传输长度、DMA上行源缓冲存储器中的待传输的SV接收数据首地址、DMA上行目的缓冲存储器的首地址后,产生DMA写请求的AVALONE总线时序,该AVALONE总线是Intel SRIO控制模块(SRIO IP)提供的DMA请求总线,如图8所示。The DMA upstream virtual control module generates the DMA after obtaining the transmission length of the SV receiving data to be transmitted in the DMA upstream source buffer memory, the first address of the SV receiving data to be transmitted in the DMA upstream source buffer memory, and the first address of the DMA upstream destination buffer memory. The AVALONE bus timing of the write request, the AVALONE bus is the DMA request bus provided by the Intel SRIO control module (SRIO IP), as shown in Figure 8.

步骤204:DMA上行虚拟控制模块将DMA写请求的AVALONE总线时序发送给SRIO控制模块(SRIO IP),该SRIO控制模块(SRIO IP)将SV接收任务的DMA写请求的AVALONE总线时序打包成SRIO NWRITE命令以串行数据格式通过SRIO总线发送到DSP侧的SRIO收发硬件模块。Step 204: The DMA uplink virtual control module sends the AVALONE bus timing of the DMA write request to the SRIO control module (SRIO IP), and the SRIO control module (SRIO IP) packages the AVALONE bus timing of the DMA write request of the SV receiving task into SRIO NWRITE The command is sent to the SRIO transceiver hardware module on the DSP side through the SRIO bus in serial data format.

步骤205,在DSP侧的SRIO收发硬件模块收到SRIO NWRITE命令后,解析、识别到SRIO的DMA写请求,并进一步解析出该DMA写请求对应的DMA上行源缓冲存储器中待传输的SV接收数据的传输长度、DMA上行源缓冲存储器中的待传输的SV接收数据首地址、DMA上行目的缓冲存储器的首地址后,并依此为依据将待传输的SV接收数据顺序写到DSP侧的DDR3内的DMA上行目的缓冲存储器中。Step 205: After the SRIO transceiver hardware module on the DSP side receives the SRIO NWRITE command, it parses and recognizes the DMA write request of the SRIO, and further parses out the SV receive data to be transmitted in the DMA upstream source buffer memory corresponding to the DMA write request. After the transmission length, the first address of the SV receiving data to be transmitted in the DMA upstream source buffer memory, and the first address of the DMA upstream destination buffer memory, and according to this, the SV receiving data to be transmitted is written to the DDR3 on the DSP side in sequence. DMA upstream destination buffer memory.

步骤206,DMA上行虚拟控制模块将DMA上行虚拟通道的待传输的SV接收数据传输完成后,对第一上行通道寄存器进行置1,表征对应的DMA上行目的缓冲存储器ddram1为满状态,Step 206, after the DMA upstream virtual control module completes the transmission of the SV received data to be transmitted on the DMA upstream virtual channel, the first upstream channel register is set to 1, indicating that the corresponding DMA upstream destination buffer memory ddram1 is in a full state,

在本实施例中,如果待传输的SV接收数据上传到第一上行目的乒乓存储器ddram1-a则第一上行通道寄存器的第0位置1,如果待传输的SV接收数据上传到第二上行目的乒乓存储器ddram1-b则第一上行通道寄存器的第1位置1。In this embodiment, if the SV received data to be transmitted is uploaded to the first uplink destination ping-pong memory ddram1-a, the 0th bit of the first uplink channel register is set to 1, and if the SV received data to be transmitted is uploaded to the second uplink destination ping-pong memory In the memory ddram1-b, the first bit of the first upstream channel register is set to 1.

步骤207,第一上行通道寄存器进行置1则表明DMA上行目的缓冲存储器ddram1有SV接收数据更新,SV接收任务处理DMA上行目的缓冲存储器ddram1的更新的SV接收数据,Step 207, the first upstream channel register is set to 1 to indicate that the DMA upstream destination buffer memory ddram1 has the SV received data update, and the SV receive task processes the updated SV received data of the DMA upstream destination buffer memory ddram1,

在本实施例中,第一上行通道寄存器的第0位为1则表示第一上行目的乒乓存储器ddram1-a中有DMA上行数据更新,第一上行通道寄存器的第1位为1则表示第二上行目的乒乓存储器ddram1-b中有数据更新;进一步的,SV接收任务读出、处理、应用该DMA上行虚拟通道中的第一上行目的乒乓存储器ddram1-a或第二上行目的乒乓存储器ddram1-b中的数据。In this embodiment, if the 0th bit of the first upstream channel register is 1, it indicates that there is DMA upstream data update in the first upstream destination ping-pong memory ddram1-a, and the first bit of the first upstream channel register is 1, indicating that the second upstream channel register is 1. There is data update in the upstream destination ping-pong memory ddram1-b; further, the SV receiving task reads out, processes, and applies the first upstream destination ping-pong memory ddram1-a or the second upstream destination ping-pong memory ddram1-b in the DMA upstream virtual channel data in .

步骤208,DMA上行虚拟通道中的SV接收任务处理完成DMA上行目的缓冲存储器ddram1的更新的SV接收数据,将对应的第一上行通道寄存器清零,即DSP侧的SV接收任务释放该DMA上行虚拟通道的DMA上行目的缓冲存储器的控制权,可以让FPGA侧的DMA上行虚拟控制模块再次传输数据到该的DMA上行目的缓冲存储器。Step 208, the SV reception task processing in the DMA upstream virtual channel completes the updated SV reception data of the DMA upstream destination buffer memory ddram1, and the corresponding first upstream channel register is cleared, that is, the SV reception task on the DSP side releases the DMA upstream virtual data. The control right of the DMA upstream destination buffer memory of the channel allows the DMA upstream virtual control module on the FPGA side to transmit data to the DMA upstream destination buffer memory again.

在本实施例中,即为将对应的第一上行通道寄存器中第0位或第1位清零,In this embodiment, that is to clear the 0th bit or the 1st bit in the corresponding first upstream channel register to zero,

其他DMA上行虚拟通道,也可以依据上述方法将FPGA侧各个接口的应用程序的数据传输到DSP侧对应的应用程序。For other DMA uplink virtual channels, the data of the application program of each interface on the FPGA side can also be transmitted to the corresponding application program on the DSP side according to the above method.

需要指出的是,本发明中所描述的具体实施例仅是对本发明精神作举例说明。本发明所属技术领域的技术人员可以对所描述的具体实施例作各种各样的修改或补充或采用类似的方式替代,但并不会偏离本发明的精神或超越所附权利要求书所定义的范围。It should be pointed out that the specific embodiments described in the present invention are only for illustrating the spirit of the present invention. Those skilled in the art to which the present invention pertains can make various modifications or additions to the described specific embodiments or substitute in similar manners, but will not deviate from the spirit of the present invention or go beyond the definition of the appended claims range.

Claims (4)

1.一种面向应用的多通道SRIO DMA传输系统,包括DSP子系统和FPGA子系统,1. An application-oriented multi-channel SRIO DMA transmission system, comprising a DSP subsystem and an FPGA subsystem, DSP子系统包括:DSP、SRIO收发硬件模块、多个DMA下行源缓冲存储器和多个DMA上行目的缓冲存储器;The DSP subsystem includes: DSP, SRIO transceiver hardware module, multiple DMA downstream source buffer memories and multiple DMA upstream destination buffer memories; FPGA子系统包括:SRIO控制模块、DMA下行虚拟控制模块、DMA上行虚拟控制模块、外部接口、多个DMA下行目的缓冲存储器和多个DMA上行源缓冲存储器,The FPGA subsystem includes: SRIO control module, DMA downstream virtual control module, DMA upstream virtual control module, external interface, multiple DMA downstream destination buffer memories and multiple DMA upstream source buffer memories, 每个应用程序对应一个DMA虚拟通道,DMA虚拟通道包括DMA下行虚拟通道和DMA上行虚拟通道,Each application corresponds to a DMA virtual channel. The DMA virtual channel includes a DMA downlink virtual channel and a DMA uplink virtual channel. DMA下行虚拟通道包括分别与应用程序对应的DMA下行源缓冲存储器、DMA下行虚拟控制模块、DMA下行目的缓冲存储器,The DMA downlink virtual channel includes the DMA downlink source buffer memory, the DMA downlink virtual control module, and the DMA downlink destination buffer memory corresponding to the application program, respectively. DMA下行虚拟控制模块包括用于存储DMA下行源缓冲存储器的状态的第一下行通道寄存器、用于存储DMA下行源缓冲存储器中待传输的发送数据的传输长度的第二下行通道寄存器、以及用于存储DMA下行源缓冲存储器中待传输的发送数据的首地址,The DMA downlink virtual control module includes a first downlink channel register for storing the state of the DMA downlink source buffer memory, a second downlink channel register for storing the transmission length of the transmit data to be transmitted in the DMA downlink source buffer memory, and a It is used to store the first address of the transmit data to be transmitted in the DMA downlink source buffer memory, DMA上行虚拟通道包括分别与应用程序对应的DMA上行源缓冲存储器、DMA上行虚拟控制模块、DMA上行目的缓冲存储器,The DMA upstream virtual channel includes the DMA upstream source buffer memory, the DMA upstream virtual control module, and the DMA upstream destination buffer memory corresponding to the application program, respectively. DMA上行虚拟控制模块包括用于存储DMA上行目的缓冲存储器的存储状态的第一上行通道寄存器、用于存储DMA上行源缓冲存储器中待传输的接收数据的传输长度的第二上行通道寄存器、以及用于存储DMA上行源缓冲存储器中待传输的接收数据的首地址的第三上行通道寄存器。The DMA upstream virtual control module includes a first upstream channel register for storing the storage state of the DMA upstream destination buffer memory, a second upstream channel register for storing the transmission length of the received data to be transmitted in the DMA upstream source buffer memory, and a The third upstream channel register for storing the first address of the received data to be transmitted in the DMA upstream source buffer memory. 2.根据权利要求1所述的一种面向应用的多通道SRIO DMA传输系统,其特征在于,2. a kind of application-oriented multi-channel SRIO DMA transmission system according to claim 1, is characterized in that, DMA下行源缓冲存储器包括第一下行源乒乓存储器和第二下行源乒乓存储器,The DMA downlink source buffer memory includes a first downlink source ping-pong memory and a second downlink source ping-pong memory, 第一下行通道寄存器的第0位和第1位分别对应着DMA下行源缓冲存储器的第一下行源乒乓存储器和第二下行源乒乓存储器的当前状态,The 0th bit and the 1st bit of the first downlink channel register respectively correspond to the current state of the first downlink source ping-pong memory and the second downlink source ping-pong memory of the DMA downlink source buffer memory, DMA上行目的缓冲存储器包括第一上行目的乒乓存储器和第二上行目的乒乓存储器,The DMA upstream destination buffer memory includes a first upstream destination ping-pong memory and a second upstream destination ping-pong memory, 第一上行通道寄存器的第0位和第1位分别对应着第一上行目的乒乓存储器和第二上行目的乒乓存储器的空闲状态。Bit 0 and bit 1 of the first upstream channel register respectively correspond to the idle states of the first upstream destination ping-pong memory and the second upstream destination ping-pong memory. 3.一种面向应用的多通道SRIO DMA传输方法,其特征在于,包括数据发送步骤:3. an application-oriented multi-channel SRIO DMA transmission method, is characterized in that, comprises data sending step: 步骤100、DSP启动后DSP的发送任务获取并初始化DMA下行源缓冲存储器,In step 100, after the DSP is started, the sending task of the DSP acquires and initializes the DMA downlink source buffer memory, 步骤101、当发送任务有发送数据发送时,DSP采用寄存器总线查询DMA下行虚拟控制模块的第一下行通道寄存器,确定DMA下行源缓冲存储器处于传输完成状态;Step 101, when the sending task has to send data to send, the DSP uses the register bus to query the first downlink channel register of the DMA downlink virtual control module to determine that the DMA downlink source buffer memory is in a transmission completion state; 步骤102、发送任务将多个发送数据包依次填入到DMA下行源缓冲存储器中,第一个发送数据包从第5字节开始,直到将DMA下行源缓冲存储器放置满为止,且保证最后一个发送数据包的完整性,当待传输的发送数据包填充完DMA下行源缓冲存储器后,将DMA下行源缓冲存储器的首4字节的32位修改为如下定义:Step 102: The sending task fills multiple sending data packets into the DMA downlink source buffer memory in turn. The first send data packet starts from the 5th byte until the DMA downlink source buffer memory is filled, and the last one is guaranteed. The integrity of the sending data packet, when the sending data packet to be transmitted fills the DMA downstream source buffer memory, modify the 32 bits of the first 4 bytes of the DMA downstream source buffer memory to the following definition: 第7至0比特位:待发送的发送数据包的流水号,每次组包完后加1;The 7th to 0th bits: the serial number of the sending data packet to be sent, plus 1 after each packet is completed; 第15至8比特位:当前待传输的发送数据包的个数;The 15th to 8th bits: the number of sending packets currently to be transmitted; 第31至16比特位:当前待传输的发送数据包的总字节数,Bits 31 to 16: The total number of bytes of the currently transmitted packet to be transmitted, 步骤103、发送任务通过寄存器总线将待传输的发送数据的传输长度写入DMA下行虚拟控制模块的第二下行通道寄存器,将DMA下行源缓冲存储器的首地址作为待传输的发送数据源首地址写入DMA下行虚拟控制模块的第三下行通道寄存器,并且将DMA下行虚拟控制模块的第一下行通道寄存器修改为传输未完成,Step 103: The transmission task writes the transmission length of the transmission data to be transmitted into the second downlink channel register of the DMA downlink virtual control module through the register bus, and writes the first address of the DMA downlink source buffer memory as the first address of the transmission data source to be transmitted. Enter the third downlink channel register of the DMA downlink virtual control module, and modify the first downlink channel register of the DMA downlink virtual control module to indicate that the transmission is not completed, 步骤104、DMA下行虚拟控制模块按照发送周期轮询,确定有数据需要被调度的DMA下行虚拟通道有数据,按照预设的DMA下行虚拟通道的通道带宽值、优先级、SRIO总线的有效带宽对各个DMA下行虚拟通道的待传输的发送数据进行发送,即根据DMA下行虚拟通道的通道带宽值,计算发送周期中DMA下行虚拟通道需要发送的字节数,根据发送周期中DMA下行虚拟通道需要发送的字节数和SRIO总线的有效带宽,计算DMA下行虚拟通道在发送周期中占用的调度时间,根据DMA下行虚拟通道的优先级,依次按照DMA下行虚拟通道对应的调用时间对待发送数据进行发送;Step 104: The DMA downlink virtual control module polls according to the sending cycle, determines that the DMA downlink virtual channel that has data needs to be scheduled has data, and matches the preset channel bandwidth value, priority, and effective bandwidth of the SRIO bus of the DMA downlink virtual channel. The send data to be transmitted of each DMA downlink virtual channel is sent, that is, according to the channel bandwidth value of the DMA downlink virtual channel, the number of bytes to be sent by the DMA downlink virtual channel in the transmission cycle is calculated, and the number of bytes to be sent by the DMA downlink virtual channel in the transmission cycle is calculated. According to the number of bytes and the effective bandwidth of the SRIO bus, calculate the scheduling time occupied by the DMA downlink virtual channel in the transmission cycle, and send the data to be sent according to the calling time corresponding to the DMA downlink virtual channel according to the priority of the DMA downlink virtual channel; 对待发送数据进行发送时,DMA下行虚拟控制模块首先读取DMA下行虚拟通道对应的第一下行通道寄存器,确认DMA下行虚拟通道是否有需要待传送的发送数据,如果有需要待传输的发送数据,则读出第二下行通道寄存器中记载的待输送的发送数据的传输长度,读出第三下行通道寄存器中记载的待传输的发送数据的首地址,依据待输送的发送数据的传输长度和待传输的发送数据的首地址,产生DMA读请求的AVALONE总线时序,When sending the data to be sent, the DMA downlink virtual control module first reads the first downlink channel register corresponding to the DMA downlink virtual channel to confirm whether the DMA downlink virtual channel has send data to be transmitted, and if there is send data to be transmitted , then read the transmission length of the transmission data to be transmitted recorded in the second downlink channel register, read the first address of the transmission data to be transmitted recorded in the third downlink channel register, according to the transmission length of the transmission data to be transmitted and The first address of the transmitted data to be transmitted, the AVALONE bus timing for generating the DMA read request, 步骤105、DMA下行虚拟控制模块将DMA读请求的AVALONE总线时序发送给SRIO控制模块,SRIO控制模块将DMA读请求的AVALONE总线时序打包成SRIO NREAD命令以串行数据格式通过SRIO总线发送到DSP侧的SRIO收发硬件模块;Step 105: The DMA downlink virtual control module sends the AVALONE bus timing of the DMA read request to the SRIO control module, and the SRIO control module packages the AVALONE bus timing of the DMA read request into an SRIO NREAD command and sends it to the DSP side through the SRIO bus in a serial data format SRIO transceiver hardware module; 步骤106、在DSP侧的SRIO收发硬件模块收到SRIO NREAD命令后,解析出对应的待传输的发送数据的传输长度和待传输的发送数据的首地址,并在DSP侧以待传输的发送数据的传输长度和待传输的发送数据的首地址为依据从DMA下行源缓冲存储器中读出对应的待传输的发送数据,并按照SRIO协议的RESP包格式生成对应的RESP数据包回应给FPGA侧的SRIO控制模块;Step 106: After the SRIO transceiver hardware module on the DSP side receives the SRIO NREAD command, it parses out the corresponding transmission length of the transmission data to be transmitted and the first address of the transmission data to be transmitted, and uses the transmission data to be transmitted on the DSP side. The transmission length and the first address of the transmission data to be transmitted are based on reading the corresponding transmission data to be transmitted from the DMA downstream source buffer memory, and according to the RESP packet format of the SRIO protocol, the corresponding RESP data packet is generated and responded to the FPGA side. SRIO control module; 步骤107、FPGA侧的SRIO控制模块收到DSP侧的SRIO收发硬件模块的RESP数据包后,解析成AVALONE总线读响应时序;Step 107: After the SRIO control module on the FPGA side receives the RESP data packet of the SRIO transceiver hardware module on the DSP side, it parses it into an AVALONE bus read response sequence; 步骤108、DMA下行虚拟控制模块从SRIO控制模块获得AVALONE总线读响应时序后,将对应的待传输的发送数据写入到DMA下行目的缓冲存储器中;Step 108, after the DMA downlink virtual control module obtains the AVALONE bus read response sequence from the SRIO control module, the corresponding transmission data to be transmitted is written into the DMA downlink destination buffer memory; 步骤109、FPGA侧对应的发送模块通过查看DMA下行虚拟通道的DMA下行目的缓冲存储器的非空标识,读出待传输的发送数据并通过FPGA侧对应的外部接口将待传输的发送数据发送出去。Step 109 , the sending module corresponding to the FPGA side reads the sending data to be transmitted by checking the non-empty identifier of the DMA downstream destination buffer memory of the DMA downstream virtual channel, and sends the sending data to be transmitted through the external interface corresponding to the FPGA side. 4.根据权利要求3所述的一种面向应用的多通道SRIO DMA传输方法,其特征在于,还包括数据接收步骤:4. a kind of application-oriented multi-channel SRIO DMA transmission method according to claim 3, is characterized in that, also comprises data receiving step: 步骤200、DSP启动后DSP的接收任务获取并初始化DMA上行目的缓冲存储器,Step 200, after the DSP is started, the receiving task of the DSP acquires and initializes the DMA uplink destination buffer memory, 步骤201、接收任务通过寄存器总线清除DMA上行虚拟控制模块的第一上行通道寄存器,Step 201, the receiving task clears the first upstream channel register of the DMA upstream virtual control module through the register bus, 初始化第三上行通道寄存器为DMA上行目的缓冲存储器的首地址,Initialize the third upstream channel register as the first address of the DMA upstream destination buffer memory, DSP侧的接收任务将轮询各个DMA上行虚拟通道对应第一上行通道寄存器,如果第一上行通道寄存器反映DMA上行目的缓冲存储器缓冲有接收数据,则进入步骤207,否则进入步骤202;The receiving task on the DSP side will poll each DMA upstream virtual channel corresponding to the first upstream channel register, if the first upstream channel register reflects that the DMA upstream destination buffer memory has received data buffered, then enter step 207, otherwise enter step 202; 步骤202、FPGA侧的接收模块实时接收外部接口进来的接收数据包,并将接收数据包标记时间戳,缓存到DMA上行源缓冲存储器中,In step 202, the receiving module on the FPGA side receives the received data packets from the external interface in real time, and marks the received data packets with a timestamp, and buffers them in the DMA upstream source buffer memory, 接收数据包依次填入到DMA上行源缓冲存储器,第一个接收数据包从第5字节开始,后续的接收数据包依次靠后排布,直到将DMA上行源缓冲存储器放置满为止,且最后一个接收数据包的完整,当待传输的接收数据包填充完毕后,将DMA上行源缓冲存储器的首4字节的32位修改为如下定义:The received data packets are filled in the DMA upstream source buffer memory in turn. The first received data packet starts from the 5th byte, and the subsequent received data packets are arranged in sequence until the DMA upstream source buffer memory is full, and finally When a received data packet is complete, when the received data packet to be transmitted is filled, modify the 32 bits of the first 4 bytes of the DMA upstream source buffer memory to the following definition: 第7至0比特位:待传输的接收数据包的流水号,每次组包完后加1;The 7th to 0th bits: the serial number of the received data packet to be transmitted, plus 1 after each packet is completed; 第15至8比特位:当前待传输的接收数据包的个数;Bits 15 to 8: the number of received packets currently to be transmitted; 第31至16比特位:当前待传输的接收数据包的总字节数;Bits 31 to 16: the total number of bytes of the received data packet currently to be transmitted; 当前待传输的接收数据包的总字节数更新到第二上行通道寄存器,The total number of bytes of the received data packets currently to be transmitted is updated to the second upstream channel register, 步骤203、DMA上行虚拟控制模块按照接收周期轮询,确定需要被调度的DMA上行虚拟通道,按照预设的DMA上行虚拟通道的通道带宽值、优先级、SRIO总线的有效带宽对各个DMA上行虚拟通道的待传输的接收数据进行接收,即根据DMA上行虚拟通道的通道带宽值,计算接收周期中DMA上行虚拟通道需要传输的接收数据的字节数,根据接收周期中DMA上行虚拟通道需要接收的字节数和SRIO总线的有效带宽,计算DMA上行虚拟通道在接收周期中占用的调度时间,根据DMA上行虚拟通道的优先级,依次按照DMA上行虚拟通道对应的调用时间对待传输的接收数据进行接收,Step 203, the DMA uplink virtual control module polls according to the receiving period, determines the DMA uplink virtual channel that needs to be scheduled, and performs virtual uplink virtual channels for each DMA according to the preset channel bandwidth value, priority, and effective bandwidth of the SRIO bus of the DMA uplink virtual channel. The received data of the channel to be transmitted is received, that is, according to the channel bandwidth value of the DMA upstream virtual channel, the number of bytes of received data that needs to be transmitted by the DMA upstream virtual channel in the receiving cycle is calculated, and the number of bytes of the received data that needs to be received by the DMA upstream virtual channel in the receiving cycle is calculated. The number of bytes and the effective bandwidth of the SRIO bus, calculate the scheduling time occupied by the DMA uplink virtual channel in the receiving cycle, and receive the received data to be transmitted according to the priority of the DMA uplink virtual channel and the corresponding calling time of the DMA uplink virtual channel. , 对待传输的接收数据进行接收时,DMA上行虚拟控制模块根据DMA上行虚拟通道的优先级,查看对应的DMA上行源缓冲存储器是否有待传输的接收数据,若有待传输的接收数据,则设定第三上行通道寄存器的值为DMA上行源缓冲存储器的待传输的接收数据的首地址,When receiving the received data to be transmitted, the DMA uplink virtual control module checks whether the corresponding DMA uplink source buffer memory has received data to be transmitted according to the priority of the DMA uplink virtual channel. If there is received data to be transmitted, set the third The value of the upstream channel register is the first address of the received data to be transmitted in the DMA upstream source buffer memory, 设定第二上行通道寄存器的值为DMA上行源缓冲存储器中的待传输的接收数据长度;Set the value of the second upstream channel register as the received data length to be transmitted in the DMA upstream source buffer memory; 确定DMA上行目的缓冲存储器的首地址,Determine the first address of the DMA upstream destination buffer memory, DMA上行虚拟控制模块获取DMA上行源缓冲存储器中待传输的接收数据的传输长度、DMA上行源缓冲存储器中的待传输的接收数据首地址、DMA上行目的缓冲存储器的首地址后,产生DMA写请求的AVALONE总线时序,The DMA upstream virtual control module generates a DMA write request after obtaining the transmission length of the received data to be transmitted in the DMA upstream source buffer memory, the first address of the received data to be transmitted in the DMA upstream source buffer memory, and the first address of the DMA upstream destination buffer memory. AVALONE bus timing, 步骤204、DMA上行虚拟控制模块将DMA写请求的AVALONE总线时序发送给SRIO控制模块,该SRIO控制模块将应用程序的DMA写请求的AVALONE总线时序打包成SRIO NWRITE命令以串行数据格式通过SRIO总线发送到DSP侧的SRIO收发硬件模块,Step 204, the DMA uplink virtual control module sends the AVALONE bus timing of the DMA write request to the SRIO control module, and the SRIO control module packages the AVALONE bus timing of the DMA write request of the application into an SRIO NWRITE command in a serial data format through the SRIO bus Sent to the SRIO transceiver hardware module on the DSP side, 步骤205、在DSP侧的SRIO收发硬件模块收到SRIO NWRITE命令后,解析、识别到SRIO的DMA写请求,解析出DMA写请求的DMA上行源缓冲存储器中待传输的接收数据的传输长度、DMA上行源缓冲存储器中的待传输的接收数据首地址、DMA上行目的缓冲存储器的首地址后,将待传输的接收数据顺序写到DMA上行目的缓冲存储器中,Step 205: After the SRIO transceiver hardware module on the DSP side receives the SRIO NWRITE command, it parses and recognizes the DMA write request of the SRIO, and parses out the transmission length and DMA of the received data to be transmitted in the DMA upstream source buffer memory of the DMA write request. After the first address of the received data to be transmitted in the upstream source buffer memory and the first address of the DMA upstream destination buffer memory, the received data to be transmitted is sequentially written to the DMA upstream destination buffer memory, 步骤206、DMA上行虚拟控制模块将DMA上行虚拟通道的待传输的接收数据传输完成后,将第一上行通道寄存器的值修改为表征DMA上行目的缓冲存储器为满状态,Step 206, after the DMA upstream virtual control module completes the transmission of the received data to be transmitted of the DMA upstream virtual channel, the value of the first upstream channel register is modified to represent that the DMA upstream destination buffer memory is a full state, 步骤207、接收任务处理DMA上行目的缓冲存储器的接收数据,Step 207, the receiving task processes the received data of the DMA uplink destination buffer memory, 步骤208、DMA上行虚拟通道中的接收任务处理完成DMA上行目的缓冲存储器的接收数据,将第一上行通道寄存器的值修改为表征为DMA上行目的缓冲存储器为空状态。Step 208: The receive task in the DMA uplink virtual channel is processed to complete the received data of the DMA uplink destination buffer memory, and the value of the first uplink channel register is modified to indicate that the DMA uplink destination buffer memory is empty.
CN202110022828.7A 2021-01-08 2021-01-08 Application-oriented multi-channel SRIO DMA transmission system and method Active CN112783810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110022828.7A CN112783810B (en) 2021-01-08 2021-01-08 Application-oriented multi-channel SRIO DMA transmission system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110022828.7A CN112783810B (en) 2021-01-08 2021-01-08 Application-oriented multi-channel SRIO DMA transmission system and method

Publications (2)

Publication Number Publication Date
CN112783810A CN112783810A (en) 2021-05-11
CN112783810B true CN112783810B (en) 2022-05-03

Family

ID=75756840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110022828.7A Active CN112783810B (en) 2021-01-08 2021-01-08 Application-oriented multi-channel SRIO DMA transmission system and method

Country Status (1)

Country Link
CN (1) CN112783810B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114297124B (en) * 2021-12-29 2024-03-29 苏州长风航空电子有限公司 Communication system of SRIO high-speed bus based on FPGA
CN114443170B (en) * 2022-01-29 2023-10-24 中国航空无线电电子研究所 FPGA dynamic parallel loading and unloading system
CN115118678B (en) * 2022-06-07 2024-03-12 南京全信传输科技股份有限公司 Multi-partition network communication system of FC equipment end and communication method thereof
CN115061959B (en) * 2022-08-17 2022-10-25 深圳比特微电子科技有限公司 Data interaction method, apparatus, system, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5765023A (en) * 1995-09-29 1998-06-09 Cirrus Logic, Inc. DMA controller having multiple channels and buffer pool having plurality of buffers accessible to each channel for buffering data transferred to and from host computer
WO2006042108A1 (en) * 2004-10-11 2006-04-20 Texas Instruments Incorporated Multi-threaded direct memory access
CN201540564U (en) * 2009-12-21 2010-08-04 东南大学 A circuit for dynamically allocating on-chip heterogeneous storage resources using the virtual memory mechanism
CN107995129A (en) * 2017-11-30 2018-05-04 锐捷网络股份有限公司 A kind of NFV message forwarding methods and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030221086A1 (en) * 2002-02-13 2003-11-27 Simovich Slobodan A. Configurable stream processor apparatus and methods
US8185672B2 (en) * 2011-01-14 2012-05-22 Texas Instruments Incorporated Transmission of data bursts on a constant data rate channel

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5765023A (en) * 1995-09-29 1998-06-09 Cirrus Logic, Inc. DMA controller having multiple channels and buffer pool having plurality of buffers accessible to each channel for buffering data transferred to and from host computer
WO2006042108A1 (en) * 2004-10-11 2006-04-20 Texas Instruments Incorporated Multi-threaded direct memory access
CN201540564U (en) * 2009-12-21 2010-08-04 东南大学 A circuit for dynamically allocating on-chip heterogeneous storage resources using the virtual memory mechanism
CN107995129A (en) * 2017-11-30 2018-05-04 锐捷网络股份有限公司 A kind of NFV message forwarding methods and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《一种支持多种传输模式的DM A主机模块设计与实现》;张帅;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20160315;全文 *
汪冬辉 ; 王志华 ; 陈明 ; 黄志华 ; 裘愉涛.《多核DSP在就地化保护测试中的关键技术研究》.《电力系统保护与控制 》.2020, *

Also Published As

Publication number Publication date
CN112783810A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN112783810B (en) Application-oriented multi-channel SRIO DMA transmission system and method
CN100471156C (en) Data bus bridge and its working method
CA2247341C (en) Asynchronous data pipe for automatically managing asynchronous data transfers between an application and a bus structure
CN103888293B (en) Data channel scheduling method of multichannel FC network data simulation system
CN103309780B (en) The analog of load data processor and its implementation
CN102185833B (en) Fiber channel (FC) input/output (I/O) parallel processing method based on field programmable gate array (FPGA)
CN109710548A (en) A kind of DMA control data transmission method, system and equipment
US12034604B2 (en) MQTT protocol simulation method and simulation device
CN114168520A (en) Optical fiber communication bus device, equipment and system
CN110109872A (en) A kind of remote sensing satellite isomeric data unifies memory management unit
CN113836048A (en) Data exchange method and device based on FPGA memory dynamic allocation
US6714562B1 (en) Method and apparatus for segmenting network traffic variable length frames
CN106843023B (en) A FPGA-based Power Data Acquisition System
CN117675731A (en) Implementation method of MHAL (mobile high definition al) on FPGA (field programmable gate array) based on virtual channel technology
WO2021136127A1 (en) Synchronous communication system and method for embedded real-time operating system
CN114448493B (en) A satellite integrated data interaction system
CN117251117B (en) A spaceborne solid-state storage system based on serial bus polling management
CN101175073A (en) Dual-controller communication system based on hard disk controller and method thereof
US20030084225A1 (en) Programmable interface link layer device
CN101334763B (en) Data transfer method between mainframe and device
CN112702313A (en) High-speed UDP data transmission system and method
CN111552662B (en) On-chip network table formalization storage system and method based on linear optical fiber token bus
CN110519137A (en) Switching device
CN119557256A (en) Multi-channel CAN data transmission system for weapon system
CN110515744A (en) A Method for Spacecraft Software Information Interaction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant