CN106168933B - A method of realizing virtual dual-port shared memory based on high-speed serial communication - Google Patents
A method of realizing virtual dual-port shared memory based on high-speed serial communication Download PDFInfo
- Publication number
- CN106168933B CN106168933B CN201610516553.1A CN201610516553A CN106168933B CN 106168933 B CN106168933 B CN 106168933B CN 201610516553 A CN201610516553 A CN 201610516553A CN 106168933 B CN106168933 B CN 106168933B
- Authority
- CN
- China
- Prior art keywords
- ram
- data
- fpga
- cpu
- layer
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1605—Handling requests for interconnection or transfer for access to memory bus based on arbitration
- G06F13/1652—Handling requests for interconnection or transfer for access to memory bus based on arbitration in a multiprocessor architecture
- G06F13/1663—Access to shared memory
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multi Processors (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明公开了一种基于高速串行通信实现虚拟双端口共享内存的方法,属于嵌入式计算技术领域。本发明的通信CPU双方各有一FPGA芯片对其提供RAM总线接口,两FPGA芯片间以高速通信线路相连,FPGA内部固件实现各层通信协议及RAM访问功能。本发明使得CPU间的交互即能简单高效如双口RAM,又在硬件分布上具备很大的灵活性。
The invention discloses a method for realizing virtual dual-port shared memory based on high-speed serial communication, and belongs to the technical field of embedded computing. Both sides of the communication CPU of the present invention each have an FPGA chip to provide a RAM bus interface to it, and the two FPGA chips are connected with high-speed communication lines, and the internal firmware of the FPGA realizes various communication protocols and RAM access functions. The invention enables the interaction between CPUs to be as simple and efficient as a dual-port RAM, and has great flexibility in hardware distribution.
Description
技术领域technical field
本发明属于嵌入式计算技术领域,具体来说,本发明涉及一种基于高速串行通信实现虚拟双端口共享内存的方法。The invention belongs to the technical field of embedded computing, specifically, the invention relates to a method for realizing virtual dual-port shared memory based on high-speed serial communication.
背景技术Background technique
嵌入式计算系统广泛应用于工业控制领域。电力系统二次侧自动化监控设备为典型的嵌入式计算系统应用,其内部包含一个或多个嵌入式单元,实现特定的保护控制或者数据监控功能。该类自动化设备在逻辑上通常由如下几部分组成:模拟量采集单元、信号输入单元、控制输出单元、逻辑处理单元、数据处理单元、通信接口单元、人机交互单元等。Embedded computing systems are widely used in the field of industrial control. Power system secondary side automatic monitoring equipment is a typical embedded computing system application, which contains one or more embedded units to achieve specific protection control or data monitoring functions. This type of automation equipment is usually logically composed of the following parts: analog quantity acquisition unit, signal input unit, control output unit, logic processing unit, data processing unit, communication interface unit, human-computer interaction unit, etc.
早期的嵌入式计算设备多以单CPU或DSP为核心组成嵌入式控制计算系统,实现设备所需功能。随着电网需求、技术发展等外部环境的变化,设备的计算性能、扩展能力等各项指标逐步提高,使得设备内部必须采用多套嵌入式子系统方能满足要求。多个CPU间如何进行实时数据交互成为系统设计的重点和难点。Most of the early embedded computing devices use a single CPU or DSP as the core to form an embedded control computing system to realize the required functions of the device. With changes in the external environment such as power grid requirements and technological development, various indicators such as the computing performance and expansion capabilities of the equipment have gradually improved, making it necessary to use multiple sets of embedded subsystems inside the equipment to meet the requirements. How to carry out real-time data interaction between multiple CPUs has become the focus and difficulty of system design.
CPU间的实时数据交互大致有两种方式:并行方式、串行方式。并行方式是指采用双端口内存芯片(简称双口RAM)提供两套内存兼容总线,使得两CPU能够共同访问同一段内存。串行方式是指两CPU间通过以太网、LVDS等高速总线连接,执行特定的通信协议进行数据收发。这两种方式都存在一定的局限性。双口RAM的并行方式只能在两CPU位于同一块印制板上时采用;串行通信方式会占用CPU大量的计算资源进行通信协议的执行,降低了CPU的应用性能和实时可靠性。另外,也有标准化的多CPU的高速交互选择,如PCI、PCI-E,但此类方案对系统成本、开发难度和生产工艺度有较高要求,不能广泛应用于中低复杂度及成本敏感的工业控制系统。There are roughly two ways of real-time data interaction between CPUs: parallel mode and serial mode. The parallel method refers to the use of dual-port memory chips (referred to as dual-port RAM) to provide two sets of memory compatible buses, so that the two CPUs can jointly access the same segment of memory. The serial method refers to the connection between two CPUs through high-speed buses such as Ethernet and LVDS, and executes specific communication protocols for data transmission and reception. Both methods have certain limitations. The parallel mode of dual-port RAM can only be used when the two CPUs are located on the same printed board; the serial communication mode will occupy a large amount of computing resources of the CPU for the execution of the communication protocol, reducing the application performance and real-time reliability of the CPU. In addition, there are also standardized multi-CPU high-speed interactive options, such as PCI and PCI-E, but such solutions have high requirements for system cost, development difficulty and production technology, and cannot be widely used in low-to-medium complexity and cost-sensitive Industrial Control Systems.
发明内容Contents of the invention
本发明目的是:针对现有技术中多CPU通信之间的问题,提供一种基于高速串行通信实现虚拟双端口共享内存的方法。The purpose of the present invention is to provide a method for realizing virtual dual-port shared memory based on high-speed serial communication, aiming at the problems between multi-CPU communication in the prior art.
具体地说,本发明是采用以下技术方案实现的:数据交互双方的CPU通过由两个通过高速串行通信链路连接起来的FPGA芯片进行数据交互;所述FPGA芯片内部包括RAM,RAM用于数据的存放,数据交互双方的CPU分别访问各自侧的FPGA的RAM,两侧RAM空间相同,地址对应;当一侧CPU向其侧的FPGA的RAM中写入数据时,该FPGA将此数据通过高速串行通信链路发送给另一侧的FPGA,另一侧CPU通过访问其侧的FPGA的RAM相同地址访问到此数据。Specifically, the present invention is realized by adopting the following technical solutions: the CPUs of both sides of the data interaction perform data interaction through two FPGA chips connected by a high-speed serial communication link; the FPGA chip includes RAM inside, and the RAM is used for Data storage and data exchange The CPUs on both sides access the RAM of the FPGA on each side respectively. The RAM space on both sides is the same and the addresses correspond to each other; when one CPU writes data to the RAM of the FPGA on the other side, the FPGA passes the data The high-speed serial communication link is sent to the FPGA on the other side, and the CPU on the other side accesses this data by accessing the same address of the RAM of the FPGA on its side.
上述技术方案的进一步特征在于,当一侧CPU向其侧的FPGA的RAM写入数据时,在数据到达另一侧CPU后,自动回传到数据原写入侧的FPGA的RAM的相同地址,如数据原写入侧的CPU读到此回传的数据表明数据已经可靠到达对方。The further feature of above-mentioned technical scheme is, when one side CPU writes data to the RAM of the FPGA of its side, after data arrives at the other side CPU, return to the same address of the RAM of the FPGA of data original writing side automatically, If the CPU on the side where the data was originally written reads the returned data, it indicates that the data has reliably arrived at the other party.
上述技术方案的进一步特征在于,所述FPGA的RAM按照地址的顺序划分为多个数据映射优先级,处于优先级高的地址区的数据优先传输。The above technical solution is further characterized in that the RAM of the FPGA is divided into a plurality of data mapping priorities according to the order of addresses, and the data in the address area with higher priority is preferentially transmitted.
上述技术方案的进一步特征在于,所述FPGA的RAM设有读写注册区及系统注册区,用于管理数据的收发时序和错误处理。A further feature of the above technical solution is that the RAM of the FPGA is provided with a read-write registration area and a system registration area for managing data sending and receiving timing and error handling.
本发明还公开了一种基于虚拟双端口共享内存通信的电网安全稳定控制装置,包括中央处理模件以及各功能模件,各模件之间采用前述的基于高速串行通信实现虚拟双端口共享内存的方法进行通信。The invention also discloses a power grid security and stability control device based on virtual dual-port shared memory communication, including a central processing module and various functional modules, and the above-mentioned high-speed serial communication is used between the modules to realize virtual dual-port sharing In-memory method to communicate.
本发明的有益效果如下:本发明将双端口内存与高速通信两者结合的数据交互方法。通信CPU双方各有一FPGA芯片对其提供RAM总线接口,两FPGA芯片间以高速通信线路相连,这样使得CPU间的交互即能简单高效如双口RAM,又在硬件分布上具备很大的灵活性,特别适用于解决多子系统复杂数据交互的难题。The beneficial effects of the present invention are as follows: the data interaction method of the present invention combines dual-port memory and high-speed communication. Both sides of the communication CPU have an FPGA chip to provide RAM bus interface to it, and the two FPGA chips are connected by a high-speed communication line, so that the interaction between the CPUs can be as simple and efficient as a dual-port RAM, and it has great flexibility in hardware distribution , especially suitable for solving complex data interaction problems of multiple subsystems.
附图说明Description of drawings
图1为COM_RAM基本框图。Figure 1 is the basic block diagram of COM_RAM.
图2为COM_RAM常用拓扑图。Figure 2 is a common topology diagram of COM_RAM.
图3为COM_RAM非对称交换节点示意图。FIG. 3 is a schematic diagram of a COM_RAM asymmetric switching node.
图4为COM_RAM工作流程图。Figure 4 is a flowchart of COM_RAM work.
图5为COM_RAM典型应用:稳控装置物理组件示意图。Figure 5 is a typical application of COM_RAM: a schematic diagram of the physical components of the stability control device.
图6为COM_RAM典型应用:稳控装置通信拓扑图。Figure 6 is a typical application of COM_RAM: the communication topology diagram of the stability control device.
具体实施方式Detailed ways
下面结合实施例并参照附图对本发明作进一步详细描述。The present invention will be further described in detail below in conjunction with the embodiments and with reference to the accompanying drawings.
实施例1:Example 1:
本实施例展示了一个以FPGA编程实现的虚拟双口RAM(简称COM_RAM)的实例。它基于FPGA大规模可编程逻辑芯片和高速通信技术,使得位于高速串行通信链路两端的CPU能够进行如同板内双口RAM般的高效便捷的数据交互。This embodiment shows an example of a virtual dual-port RAM (COM_RAM for short) implemented by FPGA programming. It is based on FPGA large-scale programmable logic chip and high-speed communication technology, so that the CPUs at both ends of the high-speed serial communication link can perform efficient and convenient data interaction like on-board dual-port RAM.
COM_RAM实现的基本原理是通过设计FPGA的固件程序,自动实现数据通信的多层协议,对数据交互双方的CPU仅提供标准化的RAM访问接口,简化其通信处理负担,使CPU能够专注于应用软件的实现。The basic principle of COM_RAM is to design the firmware program of the FPGA to automatically realize the multi-layer protocol of data communication, and only provide a standardized RAM access interface for the CPUs on both sides of the data exchange, simplifying its communication processing burden, so that the CPU can focus on the application software. accomplish.
COM_RAM的基本实现如图1所示,COM_RAM由两个通过高速串行通信链路连接起来的FPGA芯片及相应物理接口构成,各FPGA芯片内部都包括2个逻辑单元(LOGIC)及缓存(RAM),其中2个逻辑单元分别用于实现数据发送逻辑(SEND LOGIC)和数据接收逻辑(RECEIVE LOGIC),RAM用于数据的存放。数据交互双方的CPU分别访问各自侧的FPGA的RAM,通过COM_RAM构成共享RAM式的交互。当一侧CPU向其侧的FPGA的RAM中写入数据时,该FPGA将此数据通过高速串行通信链路发送给另一侧的FPGA,另一侧CPU通过访问其侧的FPGA的RAM相同地址访问到此数据。The basic implementation of COM_RAM is shown in Figure 1. COM_RAM is composed of two FPGA chips connected through a high-speed serial communication link and corresponding physical interfaces. Each FPGA chip includes two logic units (LOGIC) and cache (RAM) , where two logic units are used to implement data sending logic (SEND LOGIC) and data receiving logic (RECEIVE LOGIC), and RAM is used for data storage. The CPUs on both sides of the data exchange access the RAM of the FPGA on their respective sides, and form a shared RAM-style interaction through COM_RAM. When the CPU on one side writes data into the RAM of the FPGA on one side, the FPGA sends the data to the FPGA on the other side through a high-speed serial communication link, and the CPU on the other side accesses the RAM of the FPGA on the other side through the same Address to access this data.
由于COM_RAM主要实现的是数据通信功能,可参考开放系统互联OSI的层结构对其进行描述。下表简要列举了COM_RAM对应于OSI在通信各层中的功能对照。以下从各层的功能实现和特性分别进行介绍。Since COM_RAM mainly realizes the data communication function, it can be described with reference to the layer structure of the Open System Interconnection OSI. The following table briefly lists COM_RAM corresponding to the functional comparison of OSI in each layer of communication. The function implementation and characteristics of each layer are introduced separately below.
应用层功能由双方CPU交互应用数据实现。COM_RAM对CPU提供RAM方式的交互接口,该接口可以具备如下特点:The function of the application layer is realized by exchanging application data between CPUs of both parties. COM_RAM provides an interactive interface in the form of RAM to the CPU. This interface can have the following characteristics:
1、数据交互两侧CPU访问一段共享RAM进行交互,接口类似真实双口RAM芯片。1. The CPUs on both sides of the data exchange access a shared RAM for interaction, and the interface is similar to a real dual-port RAM chip.
2、硬件上提供标准SRAM总线接口,8/16/32位可选,Intel/PowerPC方式可选。2. The hardware provides standard SRAM bus interface, 8/16/32 bits are optional, Intel/PowerPC mode is optional.
3、双口RAM的大小根据应用可变,低可为256字节,高可为64k字节。3. The size of the dual-port RAM is variable according to the application, the lowest can be 256 bytes, and the highest can be 64k bytes.
4、COM_RAM模块可重用,使某CPU可通过连续多段RAM实现与多个CPU的并行交互。4. The COM_RAM module can be reused, so that a CPU can realize parallel interaction with multiple CPUs through continuous multi-segment RAM.
传输层的基本功能是将A侧CPU写入共享RAM中某地址的数据可靠地映射到B侧CPU的RAM中相同的地址,即应用数据的映射。这里相同的地址指相对地址,两侧CPU对该段RAM定义的绝对地址可能不同。传输层通过数据注册和弹回机制实现可靠映射。考虑到COM_RAM是虚拟双口RAM,数据映射成功的速度主要取决于串行通信链路的带宽,在多数条件下无法达到板内真实双口RAM的单外设访问周期的数据映射速度,于是传输层引入了优先级机制,即高优先级的数据优先得到映射。本层原理详述如下:The basic function of the transport layer is to reliably map the data written by the A-side CPU to a certain address in the shared RAM to the same address in the B-side CPU's RAM, that is, the mapping of application data. The same address here refers to a relative address, and the absolute addresses defined by the CPUs on both sides of the segment of RAM may be different. The transport layer implements reliable mapping through data registration and bounce mechanisms. Considering that COM_RAM is a virtual dual-port RAM, the speed of successful data mapping mainly depends on the bandwidth of the serial communication link. The layer introduces a priority mechanism, that is, high-priority data is mapped first. The principle of this layer is detailed as follows:
1、COM_RAM的基本使用场景为点对点交互,即 CPU与FPGA间为RAM接口,两侧RAM空间相同,地址对应,以字节为基本单位。1. The basic usage scenario of COM_RAM is peer-to-peer interaction, namely There is a RAM interface between the CPU and the FPGA. The RAM space on both sides is the same, and the addresses correspond to each other, with bytes as the basic unit.
2、数据映射:CPU_A向RAM中某地址写入新数据,CPU_B应在一段时间后在相同地址访问到此新数据。2. Data mapping: CPU_A writes new data to an address in RAM, and CPU_B should access the new data at the same address after a period of time.
3、弹回机制:CPU_A向RAM某地址写入新数据后,在数据到达CPU_B侧后,会自动回传到CPU_A的相同地址(数据原写入侧的FPGA的RAM的相同地址),此时CPU_A才能在此读到新数据。即CPU写入数据后,只要回读正确,就表明数据已经可靠到达对方。3. Rebound mechanism: After CPU_A writes new data to a certain address in RAM, after the data reaches CPU_B, it will automatically return to the same address of CPU_A (the same address of the FPGA RAM on the side where the data was originally written). Only CPU_A can read new data here. That is, after the CPU writes the data, as long as the readback is correct, it means that the data has reliably reached the other party.
4、优先级机制:RAM区按照地址的顺序划分为几个数据映射(即传输)优先级,例如地址0-255为高优先级,地址256-64k为低优先级。不同优先级数据的传输机制,类似CPU中不同优先级中断的相应机制,即当前优先级最高者获得优先传输资源。不同优先级的数据机制给予CPU在应用上的灵活性。CPU可将实时性要求高的交互数据写入到较低地址区,使最快能够被接收方读取。4. Priority mechanism: The RAM area is divided into several data mapping (transmission) priorities according to the order of addresses. For example, addresses 0-255 are high priority, and addresses 256-64k are low priority. The transmission mechanism of different priority data is similar to the corresponding mechanism of different priority interrupts in the CPU, that is, the one with the highest current priority gets the priority transmission resource. The data mechanism with different priorities gives the CPU flexibility in application. The CPU can write interactive data with high real-time requirements to the lower address area, so that it can be read by the receiver as soon as possible.
5、注册机制:每侧RAM分别设计有读写注册区、系统注册区,用于管理数据的收发时序和错误处理。注册区为自动管理区域,CPU无法访问。读写注册区的大小与RAM的实际大小对应,其每个单元记录其对应的RAM写入/读取字节的发送状态、接收状态;系统注册区标注和记录优先级信息、错误处理状态等。5. Registration mechanism: Each side of the RAM is designed with a read-write registration area and a system registration area, which are used to manage the timing of sending and receiving data and error handling. The registration area is an automatic management area, which cannot be accessed by the CPU. The size of the read-write registration area corresponds to the actual size of the RAM, and each unit records the sending status and receiving status of the corresponding RAM write/read bytes; the system registration area marks and records priority information, error handling status, etc. .
在以太网等通信网络中,网络层通常实现通过路由、交换等操作,将复杂拓扑网络中某源节点的数据可靠传输到目标节点。COM_RAM的设计主要面向工业控制计算领域,应用在比较固定的拓扑连接工况下,不具备复杂的路由、交换功能。虽然COM_RAM的基本模块是点对点的虚拟双口RAM,但通过合理配置,可实现点对点、点对多点、多点环等多种拓扑应用。如果结合CPU在应用层的操作,可进一步实现更复杂网络组建。拓扑方式简述如下:In communication networks such as Ethernet, the network layer usually achieves reliable transmission of data from a source node in a complex topology network to a target node through operations such as routing and switching. The design of COM_RAM is mainly oriented to the field of industrial control computing. It is applied in relatively fixed topology connection conditions and does not have complex routing and switching functions. Although the basic module of COM_RAM is a point-to-point virtual dual-port RAM, through reasonable configuration, various topological applications such as point-to-point, point-to-multipoint, and multi-point ring can be realized. If combined with the operation of the CPU at the application layer, more complex network construction can be further realized. The topology is briefly described as follows:
1、点对点:COM_RAM的基本拓扑应用。即两个CPU通过COM_RAM进行互访,如图2所示。1. Point-to-point: the basic topology application of COM_RAM. That is, the two CPUs communicate with each other through COM_RAM, as shown in Figure 2.
2、点对多:某CPU侧,FPGA中重用多个COM_RAM模块,同时硬件链路上也连接至多侧CPU。这样本地CPU通过连续访问多段RAM地址,即可实现与多CPU的并行交互,如图2所示。2. Point-to-multiple: on a certain CPU side, multiple COM_RAM modules are reused in the FPGA, and at the same time, the hardware link is also connected to the multi-side CPU. In this way, the local CPU can realize parallel interaction with multiple CPUs by continuously accessing multiple RAM addresses, as shown in FIG. 2 .
3、多点环:设有三个CPU节点CPU_A、CPU_B和CPU_C,它们分别具备一路COM_RAM接口,每路COM_RAM在通信链路上环形串接即TX_A->RX_B,TX_B->RX_C,TX_C->RX_A。通过上文所述的数据映射和弹回机制,多个CPU即可共享同一段RAM,如图2所示。3. Multipoint ring: There are three CPU nodes CPU_A, CPU_B and CPU_C, each of which has a COM_RAM interface, and each COM_RAM is connected in ring on the communication link, that is, TX_A->RX_B, TX_B->RX_C, TX_C->RX_A . Through the data mapping and bounce mechanism described above, multiple CPUs can share the same segment of RAM, as shown in Figure 2.
4、非对称交换:在多种工业应用中,控制系统的数据流具备非对称特点,如多分布节点采集数据汇聚至中央节点、管理节点发布广播数据至多执行节点,等等。为此,COM_RAM扩展出了一种一对多非对称收发的交换版本:多对一实现汇聚、一对多实现广播。相应的,物理链路也须进行1+N的配置。这样,在上述的多点网络下,以较低的物理和设计成本,一侧多个CPU能够共享同一段RAM实现与另一侧单CPU的数据交互。如图3所示。4. Asymmetric switching: In a variety of industrial applications, the data flow of the control system has asymmetric characteristics, such as collecting data from multiple distributed nodes and converging to the central node, and broadcasting data from management nodes to execution nodes, etc. For this reason, COM_RAM has expanded a one-to-many asymmetric exchange version: many-to-one realizes convergence, and one-to-many realizes broadcast. Correspondingly, the physical link must also be configured with 1+N. In this way, under the above-mentioned multi-point network, multiple CPUs on one side can share the same section of RAM to realize data interaction with a single CPU on the other side with lower physical and design costs. As shown in Figure 3.
链路层的基本功能是将单位数据从通信一端可靠地发送至对端,一般以数据帧为单位。考虑到适应多种物理层通信链路,以及保证工业应用中的高可靠性,COM_RAM在链路层的设计有如下几个特点:The basic function of the link layer is to reliably send unit data from one end of communication to the other end, generally in units of data frames. In consideration of adapting to various physical layer communication links and ensuring high reliability in industrial applications, the design of COM_RAM in the link layer has the following characteristics:
1、高效的同步短帧:为保证传输上层数据的实时性以及基于连接可靠性的考虑,链路层采用帧同步传输,即收发链路以帧为单位重复传输。帧头为特殊字节编码,帧体为可变帧长的上层数据数据,帧尾为本帧CRC校验码。优先级越高的数据帧长越短。其工作流程图如图4所示。1. Efficient synchronous short frames: In order to ensure the real-time transmission of upper layer data and the consideration of connection reliability, the link layer adopts frame synchronous transmission, that is, the sending and receiving links are repeatedly transmitted in units of frames. The frame header is a special byte code, the frame body is the upper layer data with a variable frame length, and the frame tail is the CRC check code of the frame. The data frame length with higher priority is shorter. Its work flow chart is shown in Fig. 4.
2、平衡的字节编码:链路层包括帧头的数据的基本单位为编码后的字节。根据物理层接口的不同,字节采用8b10b或5b4b编码。使用字节编码中的特殊码作为帧收发和优先级的管理。2. Balanced byte encoding: the basic unit of data in the link layer including the frame header is the encoded byte. Depending on the physical layer interface, the bytes are encoded in 8b10b or 5b4b. Use special codes in byte encoding for frame sending and receiving and priority management.
3、灵活的物理层接口:链路层与物理层接口大致分为两类,一是链路层与物理收发器件或电路直接接口,由链路层进行字节编码;二是与标准化的物理层芯片如以太网PHY接口,链路层以专用时序控制PHY芯片进行字节的收发,字节的编解码由PHY芯片自动完成。3. Flexible physical layer interface: the link layer and the physical layer interface are roughly divided into two types, one is the direct interface between the link layer and the physical transceiver device or circuit, and the byte encoding is performed by the link layer; the other is the connection with the standardized physical layer. Layer chip such as Ethernet PHY interface, the link layer controls the PHY chip to send and receive bytes with a dedicated timing, and the encoding and decoding of bytes is automatically completed by the PHY chip.
物理层提供通信传输的物理介质,并在设计上尽可能保证传输的可靠性。为了适应多种工业应用环境,COM_RAM在物理层上支持多种通信规范和介质形式。根据使用场景的不同,所支持方式列举如下:The physical layer provides the physical medium for communication transmission, and is designed to ensure the reliability of transmission as much as possible. In order to adapt to a variety of industrial application environments, COM_RAM supports a variety of communication specifications and media forms on the physical layer. Depending on the usage scenario, the supported methods are listed as follows:
1、板内交互:高速SERDES(1Gbps-2.5Gbps)、LVDS(10Mpbs-800Mbps。1. In-board interaction: high-speed SERDES (1Gbps-2.5Gbps), LVDS (10Mpbs-800Mbps.
2、背板交互:LVDS(10Mpbs-500Mbps)、BLVDS/MLVDS(10Mpbs-100Mbps。2. Backplane interaction: LVDS (10Mpbs-500Mbps), BLVDS/MLVDS (10Mpbs-100Mbps.
3、机箱间交互:10bpsM/100Mbps/1000bpsM以太网电缆、专用光纤(10Mbps-2.5Gbps)。3. Inter-chassis interaction: 10bpsM/100Mbps/1000bpsM Ethernet cable, dedicated optical fiber (10Mbps-2.5Gbps).
4、远程交互:E1同轴电缆(复用链路,2Mbps/路)、SDH光纤(155Mbps-2.5Gbps)。4. Remote interaction: E1 coaxial cable (multiplex link, 2Mbps/channel), SDH optical fiber (155Mbps-2.5Gbps).
为了应对物理层介质多变、应用场景复杂的特点,在物理层的设计上具备如下两个特点:In order to cope with the characteristics of changing physical layer media and complex application scenarios, the design of the physical layer has the following two characteristics:
(1)链路多变,机制不变:在不同的应用场景和限制条件下,物理通信链路有多种情况,如板内应用中通过SERDES或可实现2.5Gbps的通信速率,而中长距离采用以太网电缆的应用中可能会低至10Mbps。由于分层机制的设计,使得物理层的通信方式和速率只影响链路层的帧传输速度,并不对上层实现机制或可靠性产生影响。(1) The link is changeable and the mechanism remains the same: under different application scenarios and constraints, there are many situations in the physical communication link. Distances can be as low as 10Mbps in applications using Ethernet cables. Due to the design of the layered mechanism, the communication mode and rate of the physical layer only affect the frame transmission speed of the link layer, and do not affect the upper layer implementation mechanism or reliability.
(2)链路倍增,带宽倍增:本发明的初衷就是使得串行链路条件下的通信双方尽可能的提高数据交互效率,所以物理条件允许下,应该尽可能的提高数据传输带宽。因此,在链路层与物理层接口之处,另外设计了带宽倍增的机制,即使多条相同的通信链路能提供与数理对应的带宽增量提升(由于数据对齐等通信开销的增加,实际带宽略低)。如在基于背板LVDS通信的应用中,单条100Mbps链路的4字节数据映射(CPU_A写入,CPU_B读出)延时约为1us,5条相同链路同时接入时,延时将缩短到200ns,此速度已与真实的双口RAM响应速度接近。在LVDS类物理链路中,能直接支持此功能;在以太网链路中,需进行直连才能支持;在物理上支持分、复用协议的E1/SDH链路应用中,可实现远方通信的带宽倍增。(2) Link doubling, bandwidth doubling: the original intention of the present invention is to make both communication parties under the serial link condition improve the data interaction efficiency as much as possible, so under the physical conditions permitting, the data transmission bandwidth should be improved as much as possible. Therefore, at the interface between the link layer and the physical layer, a bandwidth doubling mechanism is additionally designed, even if multiple identical communication links can provide an incremental increase in bandwidth corresponding to mathematics (due to the increase in communication overhead such as data alignment, the actual slightly lower bandwidth). For example, in the application based on backplane LVDS communication, the delay of 4-byte data mapping (CPU_A write, CPU_B read) of a single 100Mbps link is about 1us, and when 5 same links are connected at the same time, the delay will be shortened To 200ns, this speed is close to the real dual-port RAM response speed. In LVDS physical links, this function can be directly supported; in Ethernet links, direct connection is required; in E1/SDH link applications that physically support division and multiplexing protocols, remote communication can be realized bandwidth doubled.
实施例2:Example 2:
本实施例展示了COM_RAM在电网安全稳定控制装置中的运用。This embodiment demonstrates the application of COM_RAM in a power grid security and stability control device.
电网安全稳定控制装置是高压变电站中重要的控制设备。每套设备通常由数个机箱组成,每个机箱有多个插件,分别实现模拟采集、逻辑计算、开关量输入输出、人机界面、对外通信等功能。插件内多包含以一个CPU为中心的嵌入式系统。机箱内部的插件、机箱间均需要进行实时交互。交互的数据对实时性、带宽和数据流向各有不同。如开关量数据实时性要求高、带宽低、双向均衡,人机数据带宽高但输入输出不均衡、实时性较低,采集数据带宽、实时性要求均高且单向上行,等等。如果在该系统应用COM_RAM技术,通过多种配置方式的结合,可高效解决多子系统复杂数据交互的难题。The power grid security and stability control device is an important control device in a high voltage substation. Each set of equipment is usually composed of several chassis, and each chassis has multiple plug-ins, which respectively realize functions such as analog acquisition, logic calculation, digital input and output, man-machine interface, and external communication. Most of the plug-ins contain embedded systems centered on a CPU. The plug-ins inside the chassis and the chassis need to interact in real time. Interacting data pairs vary in real-time, bandwidth, and data flow. For example, switching data has high real-time requirements, low bandwidth, and two-way balance, human-machine data has high bandwidth but unbalanced input and output, and low real-time performance, and acquisition data has high bandwidth and real-time requirements and one-way upstream, etc. If COM_RAM technology is applied to this system, through the combination of various configuration methods, it can efficiently solve the problem of complex data interaction of multiple subsystems.
图5列举了一种典型的安全稳定控制装置硬件配置。装置系统由多个机箱组成,分一个主机箱和一至多个从机箱。主机箱中的中央处理单元需要汇集各从机箱的采集、开关、通信等数据并进行实时计算和逻辑判断,同时向各从机箱输出控制命令或通信数据。各从机箱根据应用需求配置内部模件。所有从机箱物理上与主机箱通过光纤进行通信。Fig. 5 lists a typical hardware configuration of the safety and stability control device. The device system consists of multiple chassis, including a master chassis and one or more slave chassis. The central processing unit in the master chassis needs to collect the collection, switching, communication and other data of each slave chassis and perform real-time calculation and logical judgment, and at the same time output control commands or communication data to each slave chassis. Each slave chassis is configured with internal modules according to application requirements. All slave chassis physically communicate with the master chassis through optical fibers.
图6描述了上述稳控装置内部以COM_RAM为主要通信方式的各模件间的通信逻辑结构:Figure 6 describes the communication logic structure between the modules with COM_RAM as the main communication mode inside the above-mentioned stability control device:
1、主机箱内部,中央处理模件通过机箱背板的LVDS链路与数据管理模件、人机界面模件进行通信。数据管理模件实现系统数据的存储、打印、后台通信等功能;人机界面模件实现系统人机接口的液晶显示、键盘输入等功能。1. Inside the main chassis, the central processing module communicates with the data management module and the man-machine interface module through the LVDS link on the backplane of the chassis. The data management module implements functions such as system data storage, printing, and background communication; the man-machine interface module implements functions such as liquid crystal display and keyboard input of the system man-machine interface.
2、中央处理模件通过双向光纤与各从机箱进行通信。每个从机箱配置有通信交换模件,实现从机箱中多模件与中央处理模件间的非对称数据实时交换,使两端共享同一段数据交换空间。根据应用的实际数据传输带宽需要,某从机箱可配置多对光纤以提高通信带宽。2. The central processing module communicates with each slave chassis through bidirectional optical fibers. Each slave chassis is equipped with a communication exchange module to realize asymmetric data real-time exchange between multiple modules in the slave chassis and the central processing module, so that both ends share the same segment of data exchange space. According to the actual data transmission bandwidth requirements of the application, a slave chassis can be configured with multiple pairs of optical fibers to increase the communication bandwidth.
3、配置开入、开出等模件的机箱中,通信带宽较小,可通过多点环的拓扑方式实现多机箱与中央处理模件的连接,这样既能满足需求,又可节约通信接口资源。3. The communication bandwidth is small in the chassis equipped with modules such as input and output, so the connection between multi-chassis and central processing modules can be realized through the topology of multi-point ring, which can not only meet the demand, but also save communication interfaces resource.
4、在从机箱内部,各模件均具备与通信交换模件的通信通道。根据模件的不同类别,可使用背板资源中的LVDS、BLVDS、CAN、RS-485等物理通道,分别采用COM_RAM、MODBUS等通信协议。通信交换模件中的FPGA芯片内,设计有DMA功能的IP模块,以实现COM_RAM与MOD_BUS等低速通信接口的无缝交换,方便通信双方CPU的互访。4. Inside the slave chassis, each module has a communication channel with the communication switching module. According to different types of modules, LVDS, BLVDS, CAN, RS-485 and other physical channels in the backplane resources can be used, and communication protocols such as COM_RAM and MODBUS can be used respectively. In the FPGA chip of the communication exchange module, an IP module with DMA function is designed to realize the seamless exchange of low-speed communication interfaces such as COM_RAM and MOD_BUS, and facilitate the mutual visit of the CPUs of both communication parties.
虽然本发明已以较佳实施例公开如上,但实施例并不是用来限定本发明的。在不脱离本发明之精神和范围内,所做的任何等效变化或润饰,同样属于本发明之保护范围。因此本发明的保护范围应当以本申请的权利要求所界定的内容为标准。Although the present invention has been disclosed above with preferred embodiments, the embodiments are not intended to limit the present invention. Any equivalent changes or modifications made without departing from the spirit and scope of the present invention also belong to the protection scope of the present invention. Therefore, the scope of protection of the present invention should be based on the content defined by the claims of this application.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610516553.1A CN106168933B (en) | 2016-06-30 | 2016-06-30 | A method of realizing virtual dual-port shared memory based on high-speed serial communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610516553.1A CN106168933B (en) | 2016-06-30 | 2016-06-30 | A method of realizing virtual dual-port shared memory based on high-speed serial communication |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106168933A CN106168933A (en) | 2016-11-30 |
CN106168933B true CN106168933B (en) | 2019-08-09 |
Family
ID=58065167
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610516553.1A Active CN106168933B (en) | 2016-06-30 | 2016-06-30 | A method of realizing virtual dual-port shared memory based on high-speed serial communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106168933B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106933757A (en) * | 2017-03-14 | 2017-07-07 | 郑州云海信息技术有限公司 | A kind of method of spread F PGA storage resources |
CN107367991A (en) * | 2017-08-04 | 2017-11-21 | 湖南利能科技股份有限公司 | A kind of data acquisition device based on AMP |
CN110750069B (en) * | 2019-12-24 | 2020-05-22 | 武汉精立电子技术有限公司 | Multi-equipment control device of AOI system |
CN112181886A (en) * | 2020-10-16 | 2021-01-05 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Information interaction system, method and medium based on LVDS channel |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104021098A (en) * | 2014-06-19 | 2014-09-03 | 福州闽台机械有限公司 | Multi-board collaboration architecture based on DMA transparent transmission |
CN105068955A (en) * | 2015-07-20 | 2015-11-18 | 北京广利核系统工程有限公司 | Local bus structure and data interaction method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201163399Y (en) * | 2008-01-04 | 2008-12-10 | 国电南京自动化股份有限公司 | Double-CPU protection information shared system based on double-port RAM |
-
2016
- 2016-06-30 CN CN201610516553.1A patent/CN106168933B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104021098A (en) * | 2014-06-19 | 2014-09-03 | 福州闽台机械有限公司 | Multi-board collaboration architecture based on DMA transparent transmission |
CN105068955A (en) * | 2015-07-20 | 2015-11-18 | 北京广利核系统工程有限公司 | Local bus structure and data interaction method |
Also Published As
Publication number | Publication date |
---|---|
CN106168933A (en) | 2016-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106612141B (en) | A kind of fiber channel protocol common simulation test card and its data interactive method | |
CN108011694B (en) | A kind of efficient data exchange method based on FC | |
KR101502610B1 (en) | 50 Gb/s ETHERNET USING SERIALIZER/DESERIALIZER LANES | |
KR101831550B1 (en) | Control messaging in multislot link layer flit | |
CN102170430B (en) | Multi-port multi-network protocol converter | |
CN103490966B (en) | A kind of dual-redundant CAN bus method for receiving and processing data | |
CN102185833B (en) | Fiber channel (FC) input/output (I/O) parallel processing method based on field programmable gate array (FPGA) | |
CN103095538B (en) | Multi-class industrial Ethernet bus integrated master station | |
CN103440219B (en) | A kind of versabus Bridge IP kernel | |
CN106168933B (en) | A method of realizing virtual dual-port shared memory based on high-speed serial communication | |
CN103823784A (en) | FC-AE-1553 bus controller based on FPGA | |
CN102035688B (en) | Design method for rapidly controlling network link access | |
CN106817249B (en) | FC-AE-1553 simulation communication demonstration system and data transmission method | |
CN202535384U (en) | Network equipment expansion connection and virtual machine interconnection optimization system based on PCIe bus | |
CN103942014B (en) | FC-AE-1553 protocol interface card storage mapping device and storage mapping method | |
CN108234337A (en) | A kind of SpaceWire bus routers for supporting host interface | |
CN202077061U (en) | Multi-port and multi-network protocol converter | |
CN202679397U (en) | Real-time industrial Ethernet EtherCAT slave station system | |
CN109831434A (en) | A kind of multi-protocol communication exchange control unit based on customized exchanging policy | |
CN103036685A (en) | DP83849C-based AFDX interface converter | |
CN109412897A (en) | System and method is realized based on the shared MAC of multi-core processor and FPGA | |
CN111464466A (en) | A multi-bus network communication architecture | |
CN110798479B (en) | Interoperability device and method for dynamically reconfigurable high-speed serial bus and Ethernet | |
CN205304857U (en) | 10, 000, 000, 000 light network switch | |
CN101753486B (en) | Industrial automation field bus gateway equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20171218 Address after: 211106 Jiangning City, Nanjing Province, the integrity of the road No. 19, Applicant after: NARI Technology Development Co., Ltd. Applicant after: ELECTRIC POWER RESEARCH INSTITUTE, STATE GRID JIANGSU ELECTRIC POWER COMPANY Applicant after: State Grid Corporation of China Applicant after: NARI Group Co. Ltd. Address before: 210061 D10, Nanjing high tech Industrial Development Zone, Jiangsu, China Applicant before: NARI Technology Development Co., Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |