CN102147786B - Method for dual-port virtual FIFO (first in first out) data exchange - Google Patents

Method for dual-port virtual FIFO (first in first out) data exchange Download PDF

Info

Publication number
CN102147786B
CN102147786B CN 201010612566 CN201010612566A CN102147786B CN 102147786 B CN102147786 B CN 102147786B CN 201010612566 CN201010612566 CN 201010612566 CN 201010612566 A CN201010612566 A CN 201010612566A CN 102147786 B CN102147786 B CN 102147786B
Authority
CN
China
Prior art keywords
fifo
data
pointer
length
head pointer
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
CN 201010612566
Other languages
Chinese (zh)
Other versions
CN102147786A (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.)
AVIC No 631 Research Institute
Original Assignee
AVIC No 631 Research Institute
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 AVIC No 631 Research Institute filed Critical AVIC No 631 Research Institute
Priority to CN 201010612566 priority Critical patent/CN102147786B/en
Publication of CN102147786A publication Critical patent/CN102147786A/en
Application granted granted Critical
Publication of CN102147786B publication Critical patent/CN102147786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention proposes a method for dual-port virtual FIFO (first in first out) data exchange, which comprises the following steps: (1) obtaining FIFO semaphores; (2) judging the relationship between the length of a data block to be sent and the length of the FIFO; (3) obtaining a head pointer and a tail pointer of the FIFO (first in first out); judging whether the length of the data block is less than the length of the current space to be written in of the FIFO through the obtained head pointer and the obtained tail pointer; and if yes, carrying out the step (4); (4) calculating the check sum of the data block; (5) sequentially writing in the length of the data block, the data block and the check sum at a position pointed by the current head pointer and moving the head pointer; and (6) releasing the FIFO semaphores. The method for the dual-port virtual FIFO data exchange is suitable for data exchange among multiprocessor systems in an airborne computer.

Description

A kind of method of dual-port virtual fifo exchanges data
Technical field
The present invention relates to the method for interchanging data between the multicomputer system in a kind of airborne computer, relate in particular to a kind of data of dual-port virtual fifo that realize and write and reading method.
Background technology
In airborne computer, data are obtained and exchanged is the important component part of multicomputer system.Each Flexible Interface Card receives the various control commands of main processor modules, also in time data is offered main processor modules according to the real-time acquisition interface data of control command then.Traditional solution of multicomputer system exchanges data: design dual-ported memory circuit on interface module, solving the exchanges data between the multi-processor module for each functional module division list/double buffering data field on the dual-ported memory then.Along with the fast development of mobile system, the function that airborne computer is concentrated is more and more, and the function that Flexible Interface Card has is more and more, and the communication data amount that causes exchanges data to require is very big, and traditional solution is difficult to satisfy this a series of requirements.
Summary of the invention
In order to solve existing technical matters in the background technology, the present invention proposes a kind of method of dual-port virtual fifo exchanges data, be applicable to the exchanges data between the multicomputer system in the airborne computer.
Technical solution of the present invention is: the method that a kind of dual-port virtual fifo data write, and its special character is: said method comprising the steps of:
1) obtains the fifo signal amount;
2) judge the data block length to be sent and the relation of FIFO length;
3) obtain head pointer and the tail pointer of FIFO, whether the length through the head pointer that gets access to and tail pointer judgment data piece is less than the length in the current space to be written of FIFO; If then carry out step 4);
4) verification of computational data piece with;
5) in the position of current head pointer indication successively length, data block and the verification of writing data blocks and, and slip-on head pointer;
6) discharge the fifo signal amount.
Above-mentioned steps 2) concrete steps are:
2.1) whether the length of judgment data piece less than the length of FIFO, if then carry out step 2.2; If not, then directly carry out step 6);
2.2) whether the length of judgment data piece be 0, if not, then carries out step 3); If then directly carry out step 6);
2.3) judge whether queue full of FIFO, if not, then carry out step 3);
Above-mentioned steps 3) concrete steps are:
3.1) obtain head pointer (head) and the tail pointer (tail) of FIFO;
3.2) judge the magnitude relationship of head pointer and tail pointer: when head pointer during greater than tail pointer, head pointer is moved backward position after the length of data to be written greater than head pointer during perhaps less than tail pointer, this data block can write FIFO; When head pointer during less than tail pointer, when head pointer being moved backward position after the length of data to be written greater than head pointer and less than tail pointer, this data block can write FIFO.
The method that a kind of dual-port virtual fifo data are read, its special character is: said method comprising the steps of:
1) obtains the fifo signal amount;
2) obtain head pointer, the tail pointer of FIFO, judge according to the head pointer that gets access to, tail pointer whether FIFO has the new data block needs to receive;
3) read the length of the data block that need to receive, the data at promptly current head pointer place, then according to data block length sense data piece content successively and verification and;
4) discharge the fifo signal amount.
Above-mentioned steps 2) judge that the concrete steps whether FIFO has new data block to receive are in:
2.1) judge whether head pointer and tail pointer equate, if head pointer and tail pointer are unequal, then there are data to need to receive among the FIFO;
2.2) according to a preconcerted arrangement algorithm (for example calculating the XOR of all data) verification of calculating this data block with; Then with the verification of verification of reading and calculating with compare,, preserve this data block if identical then this data block is effective; Otherwise abandon this data block, and mobile tail pointer;
Advantage of the present invention is:
(1) dual-ported memory uses very generally in airborne computer, so physics realization is very convenient, and hardware circuit design technology maturation, Interface design are simple;
(2) adopt annular design, guarantee the high data volume of handling up, and the set condition message unit, guarantee the high efficiency of exchanges data;
(3) use Semaphore Mechanism to control the competition that double-port access brings, improved the reliability of data access;
(4) can be in a dual-ported memory according to a plurality of virtual fifos of user's requirement definition, and the reference position of each FIFO and length can be used flexibly by User Defined;
(5) mode of operation of virtual fifo (byte, word, double word) can be selected according to user's request, and can increase reliability of data transmission according to user's request definition of data block algorithm.
Description of drawings
Fig. 1 is that synoptic diagram is divided in the functional areas of dual-port virtual fifo;
Fig. 2 is that dual-port virtual fifo data write process flow diagram;
Fig. 3 is that dual-port virtual fifo data read goes out process flow diagram;
Embodiment
Referring to Fig. 1, the function zoning of dual-port virtual fifo is divided into (1) virtual fifo data management area, is used to preserve the duty of FIFO head pointer, FIFO tail pointer, FIFO, other relevant informations such as size of record FIFO; (2) virtual fifo data field is used to preserve data to be exchanged;
Referring to Fig. 2, a kind of method of dual-port virtual fifo exchanges data, the step of data fifo write operation is following:
1) obtains the fifo signal amount;
2) rationality of judgement data block to be sent:
2.1) whether the length (len) of judgment data piece (msg []) less than the length (fifo_size) of FIFO; If carry out step 2.2);
2.2) whether the length of judgment data piece be 0, if not, then carries out step 3);
2.3) judge whether fifo queue expires (if the next position of tail pointer equals head pointer, the expression queue full);
3) judge data block feasibility to be sent, whether the length of judgment data piece (len) is less than the length in the current space to be written of FIFO:
3.1) obtain head pointer (head) and the tail pointer (tail) of FIFO;
3.2) when head pointer during greater than tail pointer, tmp moves the position after the length of data to be written backward with head pointer, when tmp greater than head or tmp during less than tail, this data block can write FIFO; When head pointer during less than tail pointer, tmp moves the position after the length of data to be written backward with head pointer, when tmp greater than head and tmp during less than tail, this data block can write FIFO;
4) verification of good according to a preconcerted arrangement algorithm (for example calculating the XOR of all data) computational data piece with;
5) in the position of present head pointer indication successively length, data block and the verification of writing data blocks and, and slip-on head pointer;
6) discharge the fifo signal amount.
Referring to Fig. 3, a kind of switching method of dual-port virtual fifo exchanges data, the step of data fifo read operation is following:
1) obtains the fifo signal amount;
2) judge that FIFO has new data block: if head pointer and tail pointer are unequal, explaining has data to need to receive among the FIFO;
3) obtain data block: the length of read block is the data at current head pointer place; Then according to length sense data piece content successively and verification with, according to a preconcerted arrangement algorithm (for example calculating the XOR of all data) verification of calculating this data block with, then with the verification of verification of reading and calculating with compare; If this data block of identical explanation is effective; Preserve this data block so, otherwise abandon this data block, and mobile tail pointer;
4) discharge the fifo signal amount.

Claims (3)

1. method that dual-port virtual fifo data write is characterized in that: said method comprising the steps of:
1) obtains the fifo signal amount;
2) judge the magnitude relationship of data block to be sent and the fifo signal amount that gets access to:
2.1) whether the length of judgment data piece less than the length of FIFO, if then carry out step 2.2); If not, then directly carry out step 6);
2.2) whether the length of judgment data piece be 0, if not, then carries out step 3); If then directly carry out step 2.3);
2.3) judge whether queue full of FIFO, if not, then carry out step 3); If then carry out step 6);
3) obtain head pointer and the tail pointer of FIFO, when head pointer during greater than tail pointer, when head pointer being moved backward position after the length of data to be written greater than head pointer or less than tail pointer, this data block writes FIFO; When head pointer during less than tail pointer, when head pointer being moved backward position after the length of data to be written greater than head pointer and less than tail pointer, this data block writes FIFO; Whether the length through the head pointer that gets access to and tail pointer judgment data piece is less than the length in the current space to be written of FIFO; If then carry out step 4); If not, then carry out step 6);
4) verification of computational data piece with;
5) in the position of current head pointer indication successively length, data block and the verification of writing data blocks and, and slip-on head pointer;
6) discharge the fifo signal amount.
2. method that dual-port virtual fifo data are read is characterized in that: said method comprising the steps of:
1) obtains the fifo signal amount;
2) obtain head pointer, the tail pointer of FIFO, judge according to the head pointer that gets access to, tail pointer whether FIFO has the new data block needs to receive:
2.1) judge whether head pointer and tail pointer equate, if head pointer and tail pointer are unequal, then there are data to need to receive among the FIFO;
2.2) according to a preconcerted arrangement this data block of algorithm computation verification with, then with the verification of verification of reading and calculating with compare,, preserve this data block, otherwise abandon this data block, and mobile tail pointer if identical then this data block is effective;
3) read the length of the data block that need to receive, the data at promptly current head pointer place, then according to data block length sense data piece content successively and verification and;
4) discharge the fifo signal amount.
3. the method that dual-port virtual fifo data according to claim 2 are read is characterized in that: engagement arithmetic is the XOR that calculates all data said step 2.2).
CN 201010612566 2010-12-29 2010-12-29 Method for dual-port virtual FIFO (first in first out) data exchange Active CN102147786B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010612566 CN102147786B (en) 2010-12-29 2010-12-29 Method for dual-port virtual FIFO (first in first out) data exchange

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010612566 CN102147786B (en) 2010-12-29 2010-12-29 Method for dual-port virtual FIFO (first in first out) data exchange

Publications (2)

Publication Number Publication Date
CN102147786A CN102147786A (en) 2011-08-10
CN102147786B true CN102147786B (en) 2012-10-03

Family

ID=44422053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010612566 Active CN102147786B (en) 2010-12-29 2010-12-29 Method for dual-port virtual FIFO (first in first out) data exchange

Country Status (1)

Country Link
CN (1) CN102147786B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521179A (en) * 2011-11-28 2012-06-27 曙光信息产业股份有限公司 Achieving device and achieving method of direct memory access (DMA) reading operation
CN102495810B (en) * 2011-12-28 2014-12-17 青岛海信宽带多媒体技术有限公司 Management method for data input into decoder
CN102724112B (en) * 2012-05-31 2015-03-25 华为技术有限公司 Transmission method, receiving terminal equipment and system based on TCP (transmission control protocol)
CN105653247B (en) * 2014-11-12 2019-06-07 阿里巴巴集团控股有限公司 A kind of method and device saving linux kernel type information

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1798091A (en) * 2004-12-30 2006-07-05 中兴通讯股份有限公司 Method for increasing bandwidth of process for SDRAM
CN101504632A (en) * 2009-01-21 2009-08-12 北京红旗胜利科技发展有限责任公司 DMA data transmission method and system, DMA controller

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1798091A (en) * 2004-12-30 2006-07-05 中兴通讯股份有限公司 Method for increasing bandwidth of process for SDRAM
CN101504632A (en) * 2009-01-21 2009-08-12 北京红旗胜利科技发展有限责任公司 DMA data transmission method and system, DMA controller

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李震.一种基于双口RAM的环形数据缓存系统.《计算机技术与发展》.2010,第20卷(第1期),第201页至第204页. *

Also Published As

Publication number Publication date
CN102147786A (en) 2011-08-10

Similar Documents

Publication Publication Date Title
CN102158349B (en) A kind of log management apparatus and method
CN106371807B (en) A kind of method and device of extensible processor instruction set
CN103218329A (en) Digital signal processing data transfer
CN102147786B (en) Method for dual-port virtual FIFO (first in first out) data exchange
CN102866971A (en) Data transmission device, system and method
CN101154202B (en) Managing system management interrupts in a multiprocessor computer system
CN103488565B (en) A kind of distributed real-time testing system test data collection method
CN103885726A (en) Efficient multi-thread log writing-in method
CN105045632A (en) Method and device for implementing lock free queue in multi-core environment
CN101359321A (en) Method and apparatus for implementing intercommunication of processors
CN107277022B (en) Process marking method and device
CN104598194A (en) Initializing method and circuit of head and tail pointer chain table storage
CN104021097A (en) Data transmission method and device and direct memory access
CN114691595B (en) Multi-core circuit, data exchange method, electronic device, and storage medium
CN103488564A (en) Multichannel test data compressing and merging method for distributed real-time test system
CN111181874B (en) Message processing method, device and storage medium
CN109062857A (en) A kind of new type of messages controller and its communication means that can be communicated between realization of High Speed multiprocessor
CN114020529A (en) Backup method and device of flow table data, network equipment and storage medium
EP2899644A1 (en) Device and method for inter-core communication in multi-core processor
CN105608028A (en) EMIF (External Memory Interface) and dual-port RAM (Random Access Memory)-based method for realizing high-speed communication of DSP (Digital Signal Processor) and FPGA (Field Programmable Gate Array)
CN101594305A (en) A kind of message processing method and device
CN114691448A (en) Application program pause monitoring method, device, equipment and storage medium
CN102033823B (en) Method and device for storing data
CN101634936A (en) Method for achieving interfaces between ARM architecture processor and hard disk through FPGA
CN113641614A (en) Single-channel multi-service parallel processing method and chip based on SPI

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