CN1293739C - High speed link control protocol transmission processing/module and data processing/method - Google Patents
High speed link control protocol transmission processing/module and data processing/method Download PDFInfo
- Publication number
- CN1293739C CN1293739C CNB02122997XA CN02122997A CN1293739C CN 1293739 C CN1293739 C CN 1293739C CN B02122997X A CNB02122997X A CN B02122997XA CN 02122997 A CN02122997 A CN 02122997A CN 1293739 C CN1293739 C CN 1293739C
- Authority
- CN
- China
- Prior art keywords
- data
- state
- frame
- sending
- buffer
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Communication Control (AREA)
Abstract
本发明属于网络互连设备技术领域,涉及HDLC协议发送处理模块及其数据处理方法。该模块包括:由一个端口仲裁模块、一个发送HDLC协议处理器和一个状态存储器模块所组成;其数据处理方法为:端口仲裁模块接收N个端口的数据请求信号,把端口的请求信号依据优先级别依次传给发送HDLC协议处理器,并为N个端口共享数据处理流水线提供仲裁;发送HDLC协议处理器从FIFO读出未处理数据,把数据所属HDLC通道的状态数据从状态存储器模块读出,对其数据进行流水线处理,把处理后的数据送到相应的端口;并把HDLC通道的新状态数据写回状态存储器。本发明具有处理速度快、芯片的面积不会随端口的增多而线性增大且通用性强的优点。
The invention belongs to the technical field of network interconnection equipment, and relates to an HDLC protocol sending processing module and a data processing method thereof. The module includes: a port arbitration module, a sending HDLC protocol processor and a state memory module; its data processing method is: the port arbitration module receives the data request signals of N ports, and sends the request signals of the ports according to the priority level Pass it to the sending HDLC protocol processor in turn, and provide arbitration for the shared data processing pipeline of N ports; the sending HDLC protocol processor reads the unprocessed data from the FIFO, reads the state data of the HDLC channel to which the data belongs from the state memory module, and Its data is processed by the pipeline, and the processed data is sent to the corresponding port; and the new state data of the HDLC channel is written back to the state memory. The invention has the advantages of high processing speed, no linear increase of chip area with the increase of ports and strong versatility.
Description
技术领域technical field
本发明属于网络互连设备技术领域,特别涉及特别涉及高速数据链路控制(HDLC)协议发送处理模块的结构设计及其数据处理方法。The invention belongs to the technical field of network interconnection equipment, and in particular relates to the structural design of a high-speed data link control (HDLC) protocol transmission processing module and a data processing method thereof.
背景技术Background technique
在路由器、交换机等通信设备中通常需要用到的串口通信控制芯片,并且往往需要同时控制多端口、多通道的数据流,也即意味着要同时对多个端口的多个通道进行高速数据链路控制(HDLC)协议的发送/接收处理。Serial communication control chips are usually used in communication devices such as routers and switches, and often need to control multi-port and multi-channel data streams at the same time, which means performing high-speed data links on multiple channels of multiple ports at the same time. Send/receive processing of the HDLC protocol.
HDLC协议处于开放系统互连(OSI)七层网络参考模型的第二层:数据链路层。HDLC协议的数据帧结构如图1所示,图中:HDLC数据帧以16进制数7E(0x7E)为帧起始、帧结束标志,在帧结束符前还有一个帧校验字段(FCS)用来进行数据的帧校验(CRC),该字段为可选字段,可以没有帧校验。帧与帧之间用0x7E或0xFF填充,两个连续帧可以共享一个0x7E作为帧起始和帧结束。另外,若发送一个帧时出现错误,则可以发帧中止标识(0xFF),表明该帧数据有误,在接收时发现7个以上的连1就认为是帧中止标识。在发送时,由于数据中可能也有0x7E,为了避免将数据中的0x7E误认为是帧标识,需要使用零插入功能:在数据和帧校验字段里若发现有5个连1就在5个连1的后面插入一个零,这样数据和帧校验字段里就不会有帧标识了。这时在接收端就要使用零删除功能:在数据和帧校验字段里若发现有5个连1就将后面紧跟的一个零去掉,从而恢复原数据。The HDLC protocol is at the second layer of the Open Systems Interconnection (OSI) seven-layer network reference model: the data link layer. The data frame structure of the HDLC protocol is shown in Figure 1. In the figure: the HDLC data frame uses the hexadecimal number 7E (0x7E) as the frame start and frame end signs, and there is a frame check field (FCS) before the frame end character. ) is used for frame check (CRC) of data, this field is an optional field, there may be no frame check. Frames are filled with 0x7E or 0xFF, and two consecutive frames can share a 0x7E as the frame start and frame end. In addition, if an error occurs when sending a frame, a frame stop flag (0xFF) can be sent to indicate that the frame data is wrong, and if more than 7 consecutive 1s are found during reception, it will be considered as a frame stop mark. When sending, since there may also be 0x7E in the data, in order to avoid mistaking 0x7E in the data as a frame identifier, it is necessary to use the zero insertion function: if there are 5 consecutive 1s found in the data and frame check fields, then add them to the 5 consecutive 1s. Insert a zero after 1, so that there will be no frame identifier in the data and frame check fields. At this time, the zero deletion function must be used at the receiving end: if there are 5 consecutive 1s found in the data and frame check fields, the following zero will be removed to restore the original data.
已有的一种串行通信控制器芯片的结构如图2所示,包括:物理层接口模块、协议处理模块、先进先出缓冲器(FIFO)、直接存储器访问(DMA)模块和周边元件扩展接口(PCI)模块;其中,物理层接口模块模块负责与OSI参考模型第一层物理层的接口,将物理层收到的串行数据变成8bit并行数据送给协议处理模块,或将协议处理模块发送的8bit并行数据变成串行的数据送给物理层处理。The structure of an existing serial communication controller chip is shown in Figure 2, including: physical layer interface module, protocol processing module, first-in-first-out buffer (FIFO), direct memory access (DMA) module and peripheral component expansion Interface (PCI) module; wherein, the physical layer interface module module is responsible for the interface with the first physical layer of the OSI reference model, and converts the serial data received by the physical layer into 8bit parallel data and sends it to the protocol processing module, or processes the protocol The 8bit parallel data sent by the module becomes serial data and sent to the physical layer for processing.
协议处理模块包括HDLC协议处理模块和异步串口协议处理模块,分别进行同步HDLC串口和异步串口的协议处理,异步串口的协议处理与本发明无关,不再介绍。The protocol processing module includes an HDLC protocol processing module and an asynchronous serial port protocol processing module, which respectively perform protocol processing of the synchronous HDLC serial port and the asynchronous serial port. The protocol processing of the asynchronous serial port has nothing to do with the present invention and will not be introduced again.
HDLC协议处理模块的结构如图3所示,由一个接收HDLC协议处理模块和一个发送HDLC协议处理模块组成。这两个模块相互独立,分别处理接收的数据和发送的数据,使得系统可以全双工的工作。The structure of the HDLC protocol processing module is shown in Figure 3, which consists of a receiving HDLC protocol processing module and a sending HDLC protocol processing module. These two modules are independent of each other and process the received data and sent data respectively, so that the system can work in full duplex.
其中发送协议处理模块要完成的功能:Among them, the functions to be completed by the sending protocol processing module:
1.支持M个HDLC通道;1. Support M HDLC channels;
2.支持N个端口,每个端口可同时有多个HDLC通道;2. Support N ports, each port can have multiple HDLC channels at the same time;
3.支持透明传输;3. Support transparent transmission;
4.帧开始、帧结束标志的自动生成;4. Automatic generation of frame start and frame end signs;
5.支持共享的帧开始和帧结束标志;5. Support shared frame start and frame end flags;
6.两个传输帧之间数据自动填充,填充字符可编程;6. The data between two transmission frames is automatically filled, and the filling characters are programmable;
7.支持零插入功能;7. Support zero insertion function;
8.16位/32位CRC帧校验生成(CRC16和CRC32);8.16-bit/32-bit CRC frame check generation (CRC16 and CRC32);
9.支持字节内高低位比特的交换;9. Support the exchange of high and low bits in the byte;
10.支持端口数据取反;10. Support port data inversion;
11.支持流控功能。11. Support flow control function.
已有的发送HDLC协议处理模块的结构如图4所示,它由N个发送HDLC协议处理器、一个状态存储器、一个状态仲裁模块和一个取数据仲裁模块组成。The structure of the existing sending HDLC protocol processing module is shown in Figure 4, which consists of N sending HDLC protocol processors, a state memory, a state arbitration module and a data fetching arbitration module.
为了便于说明发送HDLC协议处理模块及其数据处理方法所存在的问题,下面以对16个端口的256个通道进行HDLC协议的发送处理为例。In order to facilitate the description of the problems existing in the sending HDLC protocol processing module and its data processing method, the following takes the HDLC protocol sending processing for 256 channels of 16 ports as an example.
从图4中可以看到,使用已有的串行HDLC协议处理模块对16端口的串行数据进行处理,需要有16个(每个端口一个)发送HDLC协议处理器,但由于每个HDLC通道有大量的中间数据(约一百多比特)需要保存,所以必须16个处理器共用一个状态存储器进行256个HDLC通道中间数据的存取,因此对状态存储器的操作需要进行仲裁。同时由于是16个发送HDLC协议处理器同时从用来存储各通道待发送数据的先进先出缓冲器电路(FIFO)接收数据,因此这里也需要进行仲裁。这些地方的仲裁成为系统速度的瓶颈,所以即使提高每个处理器的速度,端口的速率也不能有效提高。使用这种方案在主时钟为33MHz时,每个端口的最大端口速率最多也只能达到8Mbps左右,并且由于要使用16个发送HDLC协议处理器,占用的芯片面积也很大。As can be seen from Figure 4, using the existing serial HDLC protocol processing module to process the serial data of 16 ports requires 16 (one for each port) to send HDLC protocol processors, but since each HDLC channel A large amount of intermediate data (about one hundred bits) needs to be saved, so 16 processors must share a state memory to access the intermediate data of 256 HDLC channels, so the operation of the state memory needs to be arbitrated. At the same time, because the 16 sending HDLC protocol processors receive data from the first-in-first-out buffer circuit (FIFO) used to store the data to be sent in each channel at the same time, arbitration is also required here. Arbitration in these places becomes the bottleneck of the system speed, so even if the speed of each processor is increased, the port rate cannot be effectively improved. Using this scheme when the main clock is 33MHz, the maximum port rate of each port can only reach about 8Mbps at most, and since 16 sending HDLC protocol processors are used, the occupied chip area is also large.
发明内容Contents of the invention
本发明的目的是为了克服已有技术的不足之处,提出一种高速数据链路控制协议发送处理模块及其数据处理方法,使其具有处理速度快、芯片的面积不会随端口的增多而线性增大,通用性强的优点。The purpose of the present invention is to propose a high-speed data link control protocol transmission processing module and its data processing method in order to overcome the deficiencies of the prior art, so that it has fast processing speed and the area of the chip will not decrease with the increase of ports. The advantages of linear increase and strong versatility.
本发明提出一种高速数据链路控制协议发送处理模块,其特征在于,由一个端口仲裁模块、一个发送高速数据链路控制协议处理器和一个状态存储器模块所组成;其中,所说的端口仲裁模块的输入端与N个端口相连,所说的发送高速数据链路控制协议处理器的输入端分别与该端口仲裁模块输出端和用来存储各通道待发送数据的先进先出缓冲器电路的输出端相连,同时与所说的状态存储器模块双向连接,该发送高速数据链路控制协议处理器的输出端与N个端口相连接。The present invention proposes a high-speed data link control protocol sending processing module, which is characterized in that it is composed of a port arbitration module, a sending high-speed data link control protocol processor and a state memory module; wherein said port arbitration The input end of the module is connected with N ports, and the input end of the said sending high-speed data link control protocol processor is respectively connected with the output end of the port arbitration module and the first-in-first-out buffer circuit for storing the data to be sent in each channel The output end is connected, and at the same time, it is bidirectionally connected with the state memory module, and the output end of the sending high-speed data link control protocol processor is connected with N ports.
本发明还提出一种用于上述模块的数据处理方法,其特征在于,包括以下步骤:The present invention also proposes a data processing method for the above modules, characterized in that, comprising the following steps:
1)端口仲裁模块接收N个端口的数据请求信号,把端口的请求信号依据优先级别依次传给发送高速数据链路控制协议处理器,并为N个端口共享数据处理流水线提供仲裁;1) The port arbitration module receives the data request signals of N ports, transmits the request signals of the ports to the high-speed data link control protocol processor in sequence according to the priority level, and provides arbitration for the shared data processing pipeline of the N ports;
2)该发送高速数据链路控制协议处理器从用来存储各通道待发送数据的先进先出缓冲器电路读出未处理数据,把该数据所属高速数据链路控制通道的状态数据从状态存储器模块读出,对其数据进行流水线处理,把处理后的数据送到相应的端口;2) The sending high-speed data link control protocol processor reads the unprocessed data from the first-in-first-out buffer circuit used to store the data to be sent in each channel, and transfers the state data of the high-speed data link control channel to which the data belongs from the state memory The module reads out, performs pipeline processing on its data, and sends the processed data to the corresponding port;
3)把该高速数据链路控制通道的新状态数据写回状态存储器。3) Write the new state data of the high-speed data link control channel back to the state memory.
本发明的特点及良好效果:Features and good effects of the present invention:
1)使用本发明方法中的并行的发送高速协议处理器对所有端口的数据流进行处理,若端口同时有数据需要处理则按优先级顺序进行处理。采用对数据的并行和流水线处理,使得HDLC协议处理模块的处理能力大大提高,单向吞吐量为8乘以时钟速率。1) Use the parallel sending high-speed protocol processor in the method of the present invention to process the data streams of all ports, and if the ports have data to be processed at the same time, then process them in priority order. The processing capability of the HDLC protocol processing module is greatly improved by parallel and pipeline processing of data, and the one-way throughput is 8 times the clock rate.
2)本发明的高速处理器内部采用流水线结构,每个时钟即可处理一个8比特的数据,若支持16个端口的芯片在时钟33MHz时单向数据吞吐率达264Mbps,端口的最大速率可以达到52Mbps,平均端口速率为16Mbps。2) the pipeline structure is adopted inside the high-speed processor of the present invention, and each clock can process an 8-bit data. If the chip supporting 16 ports reaches 264Mbps in one-way data throughput when the clock is 33MHz, the maximum rate of the port can reach 52Mbps, with an average port speed of 16Mbps.
3)由于本发明只使用一个发送HDLC协议处理器可处理N个端口数据,协议处理部分所占用的控制芯片面积不会随端口的增多而线性增大。并且事实证明,该发送HDLC协议处理器所占用的芯片面积并不比单个的串行HDLC协议处理器大。也即是说,若支持的端口为16,使用该HDLC协议处理器的协议处理模块所占用的芯片面积只有使用已有串行HDLC协议处理器方案的约16分之一,如果需要支持的端口数更多,如32个、64个,其优势是无可比拟的。3) Since the present invention only uses one sending HDLC protocol processor to process N port data, the area of the control chip occupied by the protocol processing part will not increase linearly with the increase of ports. And it turns out that the chip area occupied by the sending HDLC protocol processor is not larger than that of a single serial HDLC protocol processor. That is to say, if the supported ports are 16, the chip area occupied by the protocol processing module using the HDLC protocol processor is only about 1/16 of that of the existing serial HDLC protocol processor solution. The number is more, such as 32, 64, and its advantages are incomparable.
附图说明Description of drawings
图1为HDLC帧结构示意图。Fig. 1 is a schematic diagram of HDLC frame structure.
图2为已有的串行通信控制器芯片结构框图。Fig. 2 is the structural block diagram of the existing serial communication controller chip.
图3为已有的HDLC协议控制模块结构框图。Fig. 3 is a structural block diagram of an existing HDLC protocol control module.
图4为已有的发送HDLC协议处理模块结构框图。FIG. 4 is a structural block diagram of an existing sending HDLC protocol processing module.
图5为本发明的发送HDLC协议处理模块结构。Fig. 5 is the structure of the sending HDLC protocol processing module of the present invention.
图6为本发明的三级流水线的结构示意图。FIG. 6 is a schematic structural diagram of a three-stage pipeline of the present invention.
图7为本发明的HDLC协议发送处理状态机的示意图。FIG. 7 is a schematic diagram of the HDLC protocol transmission processing state machine of the present invention.
具体实施方式Detailed ways
本发明提出的一种用于控制N(以N=16为实施例)个端口的串口通信控制器芯片的高速数据链路控制协议发送处理模块及其数据处理方法,结合附图详细说明如下:A kind of high-speed data link control protocol sending processing module and data processing method thereof for controlling the serial port communication controller chip of N (taking N=16 as embodiment) ports that the present invention proposes, in conjunction with accompanying drawing, describe in detail as follows:
本实施例的发送HDLC协议处理模块的结构如图5所示,它由一个端口仲裁模块、一个发送HDLC协议处理器和一个状态存储器模块组成。其中,所说的端口仲裁模块的输入端与16个端口相连,所说的发送高速数据链路控制协议处理器的输入端分别与该端口仲裁模块输出端和用来存储各通道待发送数据的FIFO的输出端相连,同时与所说的状态存储器模块双向连接,该发送高速数据链路控制协议处理器的输出端与16个端口相连接。The structure of the sending HDLC protocol processing module of this embodiment is shown in FIG. 5 , which consists of a port arbitration module, a sending HDLC protocol processor and a state memory module. Wherein, the input end of said port arbitration module is connected with 16 ports, and the input end of said sending high-speed data link control protocol processor is respectively connected with the output end of the port arbitration module and the data to be sent for storing each channel. The output end of the FIFO is connected, and is connected bidirectionally with the state memory module at the same time, and the output end of the sending high-speed data link control protocol processor is connected with 16 ports.
本实施例的发送HDLC协议处理模块的数据处理方法为:该端口仲裁模块接收16个端口的数据请求信号,把端口的请求信号依据优先级别依次传给发送HDLC协议处理器,并为16个端口共享数据处理流水线提供仲裁;该发送HDLC协议处理器从FIFO读出数据,把该数据所属HDLC通道的状态数据从状态存储器模块读出,对从FIFO读出的数据进行流水线处理,把处理后的数据送到相应的端口,并把该HDLC通道的新状态数据写回状态存储器。The data processing method of the sending HDLC protocol processing module of the present embodiment is: the port arbitration module receives the data request signals of 16 ports, and sends the request signals of the ports to the sending HDLC protocol processor in turn according to the priority level, and is 16 ports The shared data processing pipeline provides arbitration; the sending HDLC protocol processor reads data from the FIFO, reads the state data of the HDLC channel to which the data belongs from the state memory module, performs pipeline processing on the data read from the FIFO, and processes the processed The data is sent to the corresponding port, and the new state data of the HDLC channel is written back to the state memory.
为了提高发送效率,本实施例的HDLC协议发送处理器设置了由数据缓冲寄存器(一级缓冲)和数据缓冲寄存器(二级缓冲)组成的二级缓存结构对从FIFO读出的数据进行缓存,即:把从FIFO读出的数据放入一级缓冲中,第二级缓冲从一级缓冲取数据,发送协议处理器对第二级缓冲的数据进行处理,这样在该协议处理器对对第二级缓冲的数据进行处理的同时,一级缓冲可以从FIFO读取后面的数据。In order to improve the sending efficiency, the HDLC protocol sending processor of the present embodiment is provided with a secondary cache structure composed of a data buffer register (level one buffer) and a data buffer register (secondary buffer) to cache the data read from the FIFO, That is: put the data read from the FIFO into the first-level buffer, the second-level buffer fetches data from the first-level buffer, and send the protocol processor to process the data in the second-level buffer, so that the protocol processor can process the data in the second-level buffer. While the data in the secondary buffer is being processed, the primary buffer can read the subsequent data from the FIFO.
本实施例的数据处理方法的具体实现步骤分别详细说明如下:The specific implementation steps of the data processing method in this embodiment are described in detail as follows:
上述的对16个端口共享数据处理流水线提供仲裁的方法,具体包括以下步骤:将16个端口的请求数据中速率高的数据通道放在端口号小的端口上,仲裁时端口号越小则优先级越高,即多个端口同时请求数据时,先处理端口号低的。使用时可设置端口速率不超过最大速率且数据总吞吐量不超过最大吞吐量。由于每个端口的数据请求是每隔(8×处理时钟频率/端口速率)个处理时钟才来一个数据,就不会出现前一个数据请求未被处理而下一个数据请求已来的情况。The above-mentioned method of providing arbitration for the shared data processing pipeline of the 16 ports specifically includes the following steps: placing the data channel with the highest rate among the request data of the 16 ports on the port with the smaller port number, and the smaller the port number is, the priority is given to the arbitration. The higher the level, that is, when multiple ports request data at the same time, the port with the lower number is processed first. When in use, the port rate can be set not to exceed the maximum rate and the total data throughput not to exceed the maximum throughput. Since the data request of each port comes every (8×processing clock frequency/port rate) processing clocks, the situation that the previous data request has not been processed and the next data request has come will not occur.
上述发送HDLC协议处理器对数据进行流水线处理的方法,具体步骤为:看端口仲裁模块有没有通道申请数据,如果有申请就启动协议处理流水线,如果没有申请则该时钟周期的处理流水线空闲。The above-mentioned method for sending the HDLC protocol processor to carry out pipeline processing of data, the specific steps are: see whether the port arbitration module has channel application data, if there is an application, the protocol processing pipeline is started, if there is no application, the processing pipeline of this clock cycle is idle.
由于对数据的处理过程比较复杂,在一个时钟周期难以处理完,所以本实施例的处理流水线采用三级流水线实现数据处理,如图6所示,每个时钟可以处理一个8比特的并行数据。每一级流水线完成相应的工作,并把数据用时钟锁存送到下一级继续进行处理,各级流水线的工作并行进行,所以有可能同时在处理3个通道的数据,这三级流水线进行数据处理的方法,具体包括以下步骤:Since the data processing is complicated and difficult to complete in one clock cycle, the processing pipeline of this embodiment adopts a three-stage pipeline to realize data processing. As shown in FIG. 6 , each clock can process an 8-bit parallel data. Each level of pipeline completes the corresponding work, and the data is clocked and sent to the next level for further processing. The work of each level of pipeline is carried out in parallel, so it is possible to process the data of 3 channels at the same time. The data processing method specifically includes the following steps:
第一级first level
1.如果端口有申请就锁存所申请数据的通道号、所在端口、以及工作模式、流控指示信号;1. If there is an application for the port, the channel number of the applied data, the port where it is located, the working mode, and the flow control indicator signal are latched;
2.向状态存储器发出读使能信号;2. Send a read enable signal to the state memory;
第二级second level
1.锁存从状态存储器读出的状态数据;1. Latch the state data read from the state memory;
2.对读出的待发送数据,若当前处于发送数据或帧校验状态,则进行5个连1的检测,进行零插入,得到填零后的数据;2. For the read data to be sent, if it is currently in the state of sending data or frame verification, perform 5 consecutive 1 detections, perform zero insertion, and obtain zero-filled data;
3.将本次待发送数据与上次剩余数据合并,得到总的待发送数据;3. Merge the data to be sent this time with the remaining data from the last time to obtain the total data to be sent;
4.根据状态位信息进行发送处理状态机的状态跳转;4. Perform the state jump of the sending processing state machine according to the state bit information;
5.根据发送处理状态机的状态得到新的待发送数据;5. Obtain new data to be sent according to the state of the sending processing state machine;
6.若数据缓冲寄存器(一级缓冲)已被送入到数据缓冲寄存器(二级缓冲),则向发送FIFO请求新的数据;6. If the data buffer register (
第三级third level
1.对待发送数据完成数据翻转操作(可选),并把数据送到相应的端口;1. Complete the data flip operation (optional) for the data to be sent, and send the data to the corresponding port;
2.若发送处理状态机处于发送数据状态,则对当前准备的数据进行帧校验计算;2. If the send processing state machine is in the state of sending data, perform frame check calculation on the currently prepared data;
3.若数据缓冲寄存器(二级缓冲)被取空且缓冲寄存器(一级缓冲)的数据有效,则把一级缓冲中的数据送入到二级缓冲中,同时完成比特顺序选择功能;3. If the data buffer register (secondary buffer) is emptied and the data in the buffer register (first-level buffer) is valid, then the data in the first-level buffer is sent to the second-level buffer, and the bit sequence selection function is completed at the same time;
4.若第一级已向FIFO发出请求数据则把从FIFO请求得到的新数据写入到缓冲寄存器中;若缓冲寄存器的数据被送出,则清空缓冲寄存器,否则缓冲寄存器不变;4. If the first stage has sent the request data to the FIFO, then write the new data requested from the FIFO into the buffer register; if the data in the buffer register is sent out, the buffer register is cleared, otherwise the buffer register remains unchanged;
5.发写使能信息,把新的状态位写入到状态存储器中去。5. Send the write enable message, and write the new status bit into the status memory.
在上面第二级流水线处理方法中使用了HDLC协议发送处理状态机,该状态机用来控制HDLC协议发送的处理过程。该状态机的状态转移图如图7所示。发送处理状态机的状态包括:空闲状态、帧间填充、异常处理、插入帧头、发送数据、帧校验和帧尾插入;In the second-level pipeline processing method above, the HDLC protocol transmission processing state machine is used, and the state machine is used to control the processing process of HDLC protocol transmission. The state transition diagram of the state machine is shown in Figure 7. The state of the sending processing state machine includes: idle state, inter-frame filling, exception handling, inserting frame header, sending data, frame checking and frame tail insertion;
各跳转条件解释如下:Each jump condition is explained as follows:
在没有发现线路错误时,各状态跳转的条件包括:When no line error is found, the conditions for each state jump include:
复位(rst)时状态机处于空闲状态;The state machine is idle when reset (rst);
a-如果数据缓冲寄存器中有数据,且为非透传模式,如果帧间填充选择比特为0000或0001,而且流控寄存器为高时。从空闲状态跳到帧头插入状态;a- If there is data in the data buffer register and it is in non-transparent mode, if the inter-frame filling selection bit is 0000 or 0001, and the flow control register is high. Jump from idle state to frame header insertion state;
b-而且流控寄存器为高时,如果帧间填充选择比特不为0000或0001,从空闲状态跳到帧间填充状态;b- and when the flow control register is high, if the inter-frame filling selection bit is not 0000 or 0001, jump from the idle state to the inter-frame filling state;
c-无条件沿c路径跳转;c - unconditionally jump along the c path;
d-若该帧数据发送完,工作于非透传模式时且流控打开,帧校验选择为CRC16或CRC32时,从发送数据状态跳转到帧校验状态;d- If the frame data is sent, when working in the non-transparent mode and the flow control is turned on, when the frame check is selected as CRC16 or CRC32, it will jump from the sending data state to the frame checking state;
e-若该帧数据发送完,且流控打开,帧校验选择不为CRC32或CRC16时,从发送数据状态跳转到帧尾插入状态。e- If the frame data is sent, and the flow control is turned on, and the frame check selection is not CRC32 or CRC16, jump from the state of sending data to the state of inserting the end of the frame.
g-如果帧校验选择为CRC16,则在帧校验发送字节计数为2时沿g路径跳转;如果CRC选择为CRC32,则在帧校验发送字节计数为4时从CRC状态跳转到帧尾插入状态;g-If the frame check is selected as CRC16, jump along the g path when the frame check send byte count is 2; if the CRC is selected as CRC32, jump from the CRC state when the frame check send byte count is 4 Go to end-of-frame insertion state;
h-如果缓冲数据有效寄存器为高,且帧间填充选择比特为0000,这时相邻帧的帧标识复用,而且流控打开,从帧尾插入状态直接跳到发送数据状态,此时连续的数据帧共享帧标志;h- If the buffer data valid register is high, and the inter-frame filling selection bit is 0000, then the frame identifiers of adjacent frames are multiplexed, and the flow control is turned on, jumping directly from the frame end insertion state to the sending data state, at this time continuous The data frame shared frame flag;
i-如果缓冲数据有效寄存器为高,且帧间填充选择比特为0001,则从帧尾插入状态跳到帧头插入状态;i- If the buffer data valid register is high, and the inter-frame filling selection bit is 0001, jump from the frame end insertion state to the frame head insertion state;
j-如果缓冲数据有效寄存器为高,且帧间填充选择比特不为0000或0001,从帧尾插入状态跳到帧间填充状态;j- If the buffer data valid register is high, and the inter-frame filling selection bit is not 0000 or 0001, jump from the frame end insertion state to the inter-frame filling state;
k-如果缓冲数据有效寄存器为低,或流控寄存器关闭;则从帧尾插入状态跳转到空闲状态;k-If the buffer data valid register is low, or the flow control register is closed; then jump from the end-of-frame insertion state to the idle state;
r-如果已发送完帧间填充,则从帧间填充状态跳转到帧头插入状态;r- If the inter-frame filling has been sent, jump from the inter-frame filling state to the frame header insertion state;
在发现有线路错误的情况下,如果流控关闭或要求发生错误时一直发送帧中止标识,则状态机一直处在异常处理状态,否则转移条件如下:When a line error is found, if the flow control is closed or the frame stop flag is required to be sent when an error occurs, the state machine is always in the exception processing state, otherwise the transition conditions are as follows:
f-如果缓冲数据有效寄存器为低(可能是错误引起的),且数据帧未结束时,从发送数据状态跳转到异常处理状态;f- If the buffered data valid register is low (may be caused by an error), and the data frame is not over, jump from the sending data state to the exception handling state;
l-如果缓冲数据有效寄存器为高,且帧间填充选择比特为0000或0001,则从异常处理状态跳转到帧头插入状态;l- If the buffer data valid register is high, and the inter-frame filling selection bit is 0000 or 0001, then jump from the exception handling state to the frame header insertion state;
m-如果缓冲数据有效寄存器为高,且帧间填充选择比特不为0000或0001,则沿m路径跳转,从异常处理状态跳转到帧间填充状态;m-If the buffer data valid register is high, and the inter-frame filling selection bit is not 0000 or 0001, then jump along the m path, jump from the exception handling state to the inter-frame filling state;
n-如果缓冲数据有效寄存器为低,则从异常处理状态跳转到空闲状态;n - jump from exception handling state to idle state if the buffer data valid register is low;
o-如果发现发生了错误,则从空闲状态跳转到异常处理状态;o- If an error is found, jump from the idle state to the exception handling state;
p-如果是透传模式,且缓冲数据有效寄存器为高,则从异常处理状态直接跳转到发送数据状态;p- If it is transparent transmission mode, and the buffer data valid register is high, jump directly from the exception handling state to the sending data state;
如不满足上述各跳转条件,则状态机默认保持状态不变。If the above jump conditions are not met, the state machine defaults to keep the state unchanged.
由于采用8比特并行处理,零插入功能的设计与串行处理就大不相同:Due to the 8-bit parallel processing, the design of the zero-insertion function is quite different from serial processing:
零插入的方法为:The zero insertion method is:
对当前的8bit待发送数据数据(new_data)计算其从最低位向上数连1的个数(cur_count1_low)和从最高位向下数连1的个数(cur_count1_high),该数据处理后将cur_count1_high保存为从最高位向下数连1的个数(last_count1_high);For the current 8bit data to be sent (new_data), calculate the number of 1s from the lowest bit up (cur_count1_low) and the number of 1s from the highest bit down (cur_count1_high), and save the cur_count1_high as Count the number of consecutive 1s from the highest bit down (last_count1_high);
令连1计数器count1=last_count1_high,对数据最低位(new_data[0])到数据最高位(new_data[7])依次判断是否为1,若为1则连1计数器加1,并判断连1计数器是否等于5,若等于5则将该比特后面插入一个0,并将连1计数器复位到0。Make continuous 1 counter count1=last_count1_high, judge whether it is 1 from the lowest bit of data (new_data[0]) to the highest bit of data (new_data[7]), if it is 1, add 1 to the continuous 1 counter, and judge whether the continuous 1 counter is It is equal to 5, if it is equal to 5, insert a 0 after the bit, and reset the continuous 1 counter to 0.
上述状态机中的零插入实现方法可以使用硬件描述语言(如verilogHDL,VHDL语言)中的for循环语句或者case语句来实现,只需要占用一个时钟周期。用for循环语句设计出的电路面积较小,而用case语句设计出的电路速度更快。The implementation method of zero insertion in the above state machine can be realized by using a for loop statement or a case statement in a hardware description language (such as verilogHDL, VHDL language), which only needs to occupy one clock cycle. The circuit area designed with the for loop statement is smaller, and the circuit designed with the case statement is faster.
由于其它功能的实现比较简单,可用常规技术手段实现,这里就不再阐述。Since the realization of other functions is relatively simple and can be realized by conventional technical means, it will not be elaborated here.
使用本发明所述的高速数据链路控制协议发送处理模块及其数据处理方法可以实现新的高速HDLC协议模块。并可以组构成如图2所示的串行通信控制器芯片结构,这样整个芯片的性能得到了提高,同时芯片面积也变小了,使得成本更低。由于HDLC协议处理模块占芯片面积较小,还可以轻易地使用可编程逻辑器件实现(如FPGA),并应用到任何需要进行HDLC协议处理的产品中,使得产品的开发速度大大提高,有效的缩短开发周期。The new high-speed HDLC protocol module can be realized by using the high-speed data link control protocol sending processing module and the data processing method of the invention. And it can be assembled into a serial communication controller chip structure as shown in Figure 2, so that the performance of the entire chip is improved, and the chip area is also reduced at the same time, making the cost lower. Since the HDLC protocol processing module occupies a small chip area, it can also be easily implemented with a programmable logic device (such as FPGA) and applied to any product that requires HDLC protocol processing, which greatly improves the product development speed and effectively shortens the Development cycle.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB02122997XA CN1293739C (en) | 2002-06-15 | 2002-06-15 | High speed link control protocol transmission processing/module and data processing/method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB02122997XA CN1293739C (en) | 2002-06-15 | 2002-06-15 | High speed link control protocol transmission processing/module and data processing/method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1466348A CN1466348A (en) | 2004-01-07 |
| CN1293739C true CN1293739C (en) | 2007-01-03 |
Family
ID=34142288
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB02122997XA Expired - Fee Related CN1293739C (en) | 2002-06-15 | 2002-06-15 | High speed link control protocol transmission processing/module and data processing/method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1293739C (en) |
Families Citing this family (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1984148B (en) * | 2006-05-15 | 2010-11-03 | 华为技术有限公司 | Device and method for realizing high-level data link control |
| CN100471156C (en) * | 2007-03-07 | 2009-03-18 | 今创集团有限公司 | Data bus bridge and its working method |
| CN100542180C (en) * | 2007-04-12 | 2009-09-16 | 华为技术有限公司 | Method and device for dynamic adjustment of bandwidth of advanced data link control channel |
| CN101321038B (en) * | 2008-07-23 | 2010-12-08 | 杭州华三通信技术有限公司 | HDLC controller and HDLC controller report breaking method |
| CN102137086B (en) * | 2010-09-10 | 2013-09-11 | 华为技术有限公司 | Method, device and system for processing data transmission |
| US20120143836A1 (en) * | 2010-12-01 | 2012-06-07 | International Business Machines Corporation | Validation of access to a shared data record subject to read and write access by multiple requesters |
| CN102571577B (en) * | 2011-12-29 | 2015-02-18 | 北京中创信测科技股份有限公司 | Method and device for realizing according-to-configuration distribution of scalable bandwidth interconnect (SBI) interface timeslot by utilizing field programmable gate array (FPGA) |
| CN104102473B (en) * | 2013-04-12 | 2017-08-11 | 杭州迪普科技股份有限公司 | A kind of device for realizing data high-speed distribution |
| CN103530259B (en) * | 2013-10-21 | 2016-03-30 | 湖南强军科技有限公司 | The cross clock domain serial data exchange method of geophysical instrument, Apparatus and system |
| CN104717155B (en) * | 2013-12-15 | 2017-10-24 | 中国航空工业集团公司第六三一研究所 | Network traffics process circuit and method in a kind of sampling system |
| CN108347383A (en) * | 2018-02-05 | 2018-07-31 | 吴子仪 | A kind of concurrent multichannel routing inquiry implementation method based on assembly line |
| CN109408428B (en) * | 2018-10-29 | 2021-05-28 | 京信通信系统(中国)有限公司 | Control method and device for direct memory access and physical layer accelerator card |
| CN114465696B (en) * | 2022-04-12 | 2022-06-28 | 井芯微电子技术(天津)有限公司 | State machine verification method and system based on state transfer mode |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN87103247A (en) * | 1986-04-30 | 1987-12-30 | 阿特阿公司 | Message communication interface circuit |
| CN1022724C (en) * | 1990-08-31 | 1993-11-10 | 国际商业机器公司 | Nonsynchronous channel/DASD Communication system |
| CN1208299A (en) * | 1997-07-31 | 1999-02-17 | 松下电器产业株式会社 | Communication device, communication method and medium on which computer program for carrying out method is recorded |
| CN1238050A (en) * | 1996-09-16 | 1999-12-08 | 科罗拉利公司 | System and method for maintaining memory coherency in computer system having multiple system buses |
| WO2001022690A1 (en) * | 1999-09-21 | 2001-03-29 | Xircom, Inc. | Reduced hardware network adapter and communication method |
-
2002
- 2002-06-15 CN CNB02122997XA patent/CN1293739C/en not_active Expired - Fee Related
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN87103247A (en) * | 1986-04-30 | 1987-12-30 | 阿特阿公司 | Message communication interface circuit |
| CN1022724C (en) * | 1990-08-31 | 1993-11-10 | 国际商业机器公司 | Nonsynchronous channel/DASD Communication system |
| CN1238050A (en) * | 1996-09-16 | 1999-12-08 | 科罗拉利公司 | System and method for maintaining memory coherency in computer system having multiple system buses |
| CN1208299A (en) * | 1997-07-31 | 1999-02-17 | 松下电器产业株式会社 | Communication device, communication method and medium on which computer program for carrying out method is recorded |
| WO2001022690A1 (en) * | 1999-09-21 | 2001-03-29 | Xircom, Inc. | Reduced hardware network adapter and communication method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1466348A (en) | 2004-01-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN1293739C (en) | High speed link control protocol transmission processing/module and data processing/method | |
| CN1238796C (en) | Device and method for realizing interface conversion | |
| CN101052013A (en) | Method and system for realizing network equipment internal managing path | |
| EP1413098A2 (en) | Communications system using rings architecture | |
| CN1825292A (en) | Access device for direct memory access and method for implementing single channel bidirectional data interaction | |
| CN1295633C (en) | Method for multiple CPU communication | |
| CN1842057A (en) | Signal disconnection and combination method and apparatus | |
| CN102438121A (en) | Data transmission method, system and serial high-speed input and output gateway device | |
| CN101764797B (en) | Time division multi-channel LAPD processor and designing method thereof | |
| US20130061247A1 (en) | Processor to message-based network interface using speculative techniques | |
| CN1112004C (en) | Apparatus for and method of segmentating and reassembling constant bit rate traffic in asynchronous transfer mode network | |
| CN1466347A (en) | High-speed data link control protocol receiving processing module and data processing method thereof | |
| CN111884952A (en) | Multichannel calculation accelerating equipment based on FPGA | |
| CN1678086A (en) | A device for playing and receiving high-speed code stream based on PCI | |
| CN1297866C (en) | Reset method and reset system for integrated circuit | |
| CN1529476A (en) | Device and method for connecting data between Ethernet and ATM layer | |
| CN1476212A (en) | A method and device for realizing data packet transmission on synchronous digital system | |
| CN1533097A (en) | Method and device for extending cable distance of medium access interface of network processor | |
| CN1862972A (en) | TURBO coding method and coding apparatus | |
| CN1567830A (en) | Multi-channel network management apparatus and method for transmission equipment | |
| CN1731370A (en) | Optical module addressing device and method thereof | |
| CN1347062A (en) | Gigabit IP network card | |
| CN1738224A (en) | TDM data and frame format conversion circuit and method , transmission switching system and method | |
| CN1305323C (en) | Method for implementing high-grade link control procedure prame treatment | |
| CN100387027C (en) | Packet preprocessing circuit assembly in line interface card for high-speed network distribution 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 | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20070103 Termination date: 20150615 |
|
| EXPY | Termination of patent right or utility model |