KR930009064B1 - Communicating method between two systems by using fifo - Google Patents

Communicating method between two systems by using fifo Download PDF

Info

Publication number
KR930009064B1
KR930009064B1 KR1019910002844A KR910002844A KR930009064B1 KR 930009064 B1 KR930009064 B1 KR 930009064B1 KR 1019910002844 A KR1019910002844 A KR 1019910002844A KR 910002844 A KR910002844 A KR 910002844A KR 930009064 B1 KR930009064 B1 KR 930009064B1
Authority
KR
South Korea
Prior art keywords
message
memory buffer
transmission
fifo
length
Prior art date
Application number
KR1019910002844A
Other languages
Korean (ko)
Other versions
KR920016952A (en
Inventor
류상신
Original Assignee
삼성전자 주식회사
정용문
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 삼성전자 주식회사, 정용문 filed Critical 삼성전자 주식회사
Priority to KR1019910002844A priority Critical patent/KR930009064B1/en
Publication of KR920016952A publication Critical patent/KR920016952A/en
Application granted granted Critical
Publication of KR930009064B1 publication Critical patent/KR930009064B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The method consists of a CPU, a EPROM, a RAM, a timer, a interrupt controller, and a FIFO. Transmission messages are stored after detecting the message length and free buffer area and comparing each other. The message is transmitted after reading and testing the status of FIFO. If the status is free, the input and output pointers of transmission memory buffer are read to test the presence of messages. Then if there are messages to send, the message pointed out by the output pointer is written in the FIFO and the output pointer is increased as much as message length. When the output pointer of transmission memory buffer points to the end of area, it is initialized to the start of the transmission memory buffer and sends the maximum number of messages.

Description

피포(FIFO)를 이용한 두 시스템간의 통신방법Communication method between two systems using FIFO

제 1 도는 본 발명에 따른 시스템 블럭도.1 is a system block diagram according to the present invention.

제 2 도는 본 발명에 따른 송신 메세지를 저장하는 흐름도.2 is a flow chart for storing transmission messages in accordance with the present invention.

제 3 도는 송신 메모리 버퍼 구성도.3 is a block diagram of the transmission memory buffer.

제 4 도는 본 발명에 따른 메세지 송신 흐름도.4 is a message transmission flowchart according to the present invention.

제 5 도는 본 발명에 따른 송수신 메세지 구성도.5 is a block diagram of a transmission and reception message according to the present invention.

제 6 도는 본 발명에 따른 메세지 수신 흐름도.6 is a message receiving flow diagram according to the present invention.

제 7 도는 수신 메모리 버퍼 구성도.7 is a schematic diagram of a receiving memory buffer.

제 8 도는 본 발명에 따른 수신 메세지를 저장하는 흐름도.8 is a flow chart for storing received messages in accordance with the present invention.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

10 : 중앙처리장치 20 : 이피롬10: central processing unit 20: ypyrom

30 : 램 40 : 타이머30: RAM 40: Timer

50 : 인터럽트 제어기 60 : FIFO50: interrupt controller 60: FIFO

본 발명은 FIFO(First In First Out ; 이하 FIFO라 함)를 이용한 두시스템간의 통신 방법에 관한 것으로서, 특히 통신의 양에 따라 FIFO 통신을 제어하고 메세지 송수신시에 한 개의 메세지가 중간에 중단됨이 없이 연속적으로 통신할 수 있는 방법에 관한 것이다.The present invention relates to a communication method between two systems using a FIFO (First In First Out), in particular, to control FIFO communication according to the amount of communication, and without interruption of one message during message transmission and reception. The present invention relates to a method of communicating continuously.

종래에는 두 시스템간의 통신시에 FIFO를 이용한 메세지 송수신은 다음과 같이 수행되었다.In the prior art, message transmission and reception using a FIFO was performed as follows.

먼저 메세지의 송신은 상대 시스템으로 메세지를 보낼 때 메모리내에 메세지가 연속적으로 저장되어 있지 않거나, 데이타를 쓰기전에 항상 FIFO가 풀(Full)인지를 체크하여 풀(Full)이면 풀이 아닐때까지 기다렸다가 써야하므로, 한 개의 메세지라도 데이타가 연속적으로 쓰여지지 않고 메세지의 중간 중간에 시간 지연이 발생하는 방식으로 송신이 이루어졌다. 또한 메세지 수신은 상대 시스템으로부터 메세지의 수신을 위해 FIFO상태를 계속 체크하는데 한 개의 메세지가 계속적으로 수신되는 것이 아니라, 한 개의 완전한 메세지가 되기전 중간 중간에 시간 지연이 발생된다. 그러므로 완전한 메세지가 수신될 때까지 계속 그 상태에서 기다리고 현재의 상태를 유지하여 메세지 수신이 재개되면 하나의 완전한 메세지를 수신하여 처리한다.First of all, when sending a message to the other system, the message should not be stored continuously in memory, or always check whether the FIFO is full before writing the data, and if it is full, wait until it is not full. In this case, the transmission was done in such a way that no data was written continuously, but a time delay occurred in the middle of the message. In addition, message reception keeps checking FIFO status for receiving messages from the partner system. Instead of receiving a single message continuously, there is a time delay in between before a complete message is received. Therefore, it waits until the complete message is received, maintains the current state, and when the message reception resumes, it receives and processes one complete message.

이와 같이 종래의 시스템간의 통신 방법은 메세지의 양에 따른 FIFO의 메세지 송수신 속도를 조절하는 기능이 없고, 한 개의 메세지가 연속적으로 FIFO로 보내지거나 수신할 수 없어 오버 헤드(Over Head)나 시간지연으로 인해 시스템의 효율이 떨어지는 문제점이 있었다.As such, the conventional system-to-system communication method does not have a function of adjusting the transmission / reception rate of the FIFO according to the amount of messages, and a single message cannot be sent to or received from the FIFO continuously, resulting in overhead or time delay. There was a problem that the efficiency of the system is reduced.

따라서 본 발명의 목적은 FIFO를 이용한 두 시스템간의 통신시 통신의 양에 따라 FIFO를 제어하고 메세지 송수신시 한 개의 메세지가 중간에 중단되지 않고 연속적으로 송수신 될 수 있는 방법을 제공함에 있다.Accordingly, an object of the present invention is to control a FIFO according to the amount of communication in communication between two systems using a FIFO, and to provide a method in which one message can be continuously transmitted and received without interruption in the middle of a message transmission and reception.

이하 본 발명을 첨부된 도면을 참조하여 상세히 설명한다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

제 1 도는 본 발명에 따른 시스템 블럭도로서, 시스템 A와 시스템 B로 구성되며, 상기 구성중 A와 시스템 B는 각각 다음과 같은 구성으로 이루어진다.1 is a system block diagram according to the present invention, which is composed of system A and system B, wherein A and system B each have the following configuration.

시스템을 제어 처리하는 중앙처리장치(10)와, 각종 프로그램을 저장하고 이피룸(20)과, 프로그램 수행중에 발생되는 각종 데이타를 일시적으로 저장하는 램(30)과, 일정 시간마다 인터럽트를 발생하는 타이머(40)와, 상기 타이며(40)에서 발생된 인터럽트를 제어하여 상기 중앙처리장치(10)에 알리기 위한 인터럽트 제어기(50)와, 두 시스템간의 통신을 위한 송수신 데이타를 저장하기 위한 FIFO(60)로 구성된다.A central processing unit (10) for controlling the system, an epiroom (20) for storing various programs, a RAM (30) for temporarily storing various data generated during program execution, and an interrupt for each predetermined time A timer 40, an interrupt controller 50 for controlling the interrupt generated by the target 40 and informing the CPU 10, and a FIFO for storing transmission / reception data for communication between the two systems. 60).

제 2 도는 본 발명에 따른 송신 메세지를 저장하는 흐름도로서, 저장할 송신 메세지의 길이를 검출하는 A1과정과, 상기A1과정에서 저장할 메세지의 길이를 검출한 다음 송신 메세지를 저장할 송신 메모리 버퍼의 잔여 영역을 검출하는 A2과정과, 상기 A2과정에서 검출된 송신 버퍼의 잔여 영역과 상기 A1과정에서 검출된 송신 메세지의 길이를 비교하여 송신 메모리 버퍼의 잔여 영역이 크게 되면 입력 포인트로부터 끝까지 남은 송신 버퍼의 잔여 영역을 검출하는 A3과정과, 상기 A3과정에서 검출된 포인트로부터 끝까지 남은 송신 메모리 버퍼의 잔여 영역과 상기 A1과정에서 검출된 입력 포인터로부터 끝까지 남은 송신 메모리 버퍼의 잔여 영역과 상기 A1과정에서 검출된 저장할 메세지의 양을 비교하여 송신 메모리 버퍼에 메세지를 저장하는 A4과정으로 이루어진다.2 is a flow chart for storing a transmission message according to the present invention, the process A1 of detecting the length of a transmission message to be stored, and the remaining area of the transmission memory buffer to store the transmission message after detecting the length of the message to be stored in step A1. Detecting A2 process, the remaining area of the transmission buffer detected in the A2 process and the length of the transmission message detected in the A1 process, if the remaining area of the transmission memory buffer becomes large, the remaining area of the transmission buffer remaining from the input point to the end Process A3 to detect the remaining area of the transmission memory buffer remaining from the point detected at the step A3 to the end, and the remaining area of the transmission memory buffer remaining from the input pointer detected at the step A1 to the end and the stored message detected at the step A1. A4 is used to compare the amount of data and store the message in the sending memory buffer. It is done.

제 3 도는 송신 메모리 버퍼 구성도이고, 제 4 도는 본 발명에 따른 메세지 송신 흐름도로서, FIFO의 상태를 읽어 들여 FIFO가 비어 있는가를 검사하는 B1과정과, 상기 B1과정에서 FIFO가 비어 있으며 송신 메모리 버퍼의 입력 포인터와 출력 포인터를 읽어들여 송신할 메세지가 있는가가 있는가를 검사하는 B2과정과, 상기 B2과정에서 송신할 메세지가 있으면 출력 포인터가 가리키는 1개의 메세지를 FIFO에 라이트하여 보내고 출력 포인터를 메세지 길이만큼 증가시키는 B3과정과, 상기 B3과정에서 출력 포인터를 송신한 메세지 길이만큼 증가시키고 송신 메모리 버퍼의 출력 포인터가 가리키는 영역의 끝이면 출력 포인터를 송신 메모리 버퍼의 처음으로 초기화하여 최대 메세지 수만큼 송신하는 B4과정으로 이루어진다.3 is a block diagram of a transmission memory buffer, and FIG. 4 is a flow diagram of a message transmission according to the present invention, which reads the status of the FIFO and checks whether the FIFO is empty. Process B2 checks whether there is a message to be sent by reading the input pointer and output pointer, and if there is a message to be sent in B2, writes one message indicated by the output pointer to the FIFO and increases the output pointer by the message length. Process B3, and process B4 to increase the output pointer by the length of the message transmitted in step B3, and to initialize the output pointer to the beginning of the transmission memory buffer at the end of the area indicated by the output pointer of the transmission memory buffer, and to transmit the maximum number of messages. Is done.

제 5 도는 송수신 메세지의 구성도이고, 제 6 도는 본 발명에 따른 메세지 흐름도로서, FIFO의 상태를 읽어 수신되는 데이타가 한 개의 메세지를 수신하는 C1과정과, 상기 C1과정에서 수신한 메세지를 수신 메모리 버퍼에 저장하는 C2과정과, 상기 C2과정에서 메세지를 수신 메모리 버퍼에 저장하고 최대 메세지 수만큼 수신되었는가를 검사하여 최대 메세지 수만큼 수신되지 않았으면 상기 C1과정으로 돌아가는 제C3과정으로 이루어진다.5 is a block diagram of a transmission / reception message, and FIG. 6 is a message flow diagram according to the present invention. The process of receiving data by reading the state of the FIFO and receiving one message, and the receiving memory of the message received in process C1 are shown in FIG. C2 process of storing the message in the buffer, and C3 process of storing the message in the receiving memory buffer and checking whether the maximum number of messages has been received in step C2, and returns to the process C1 if the maximum number of messages is not received.

제 7 도는 수신 메모리 버퍼 구성도이고, 제 8 도는 본 발명에 따른 수신 메모리 버퍼에 저장하는 흐름도로서, 저장할 수신 메세지의 길이를 검출하는 D1과정과, 상기 D1과정에서 수신 메세지의 양을 검출하고 수신 메모리 버퍼의 저장 가능한 영역을 검출하는 D2과정과, 상기 D2과정에서 검출된 수신 메모리 버퍼의 저장 가능한 영역이 D1과정에서 검출된 저장할 수신 메세지 길이보다 크게되면 수신 메모리 버퍼의 입력 포인터가 가리키는 장소부터 수신 메세지를 저장하고 입력 포인터를 메세지 길이만큼 증가시키는 D3과정으로 이루어진다.7 is a block diagram of a receiving memory buffer, and FIG. 8 is a flow chart of storing the received memory buffer in accordance with the present invention. Process D2 for detecting a storage area of the memory buffer; and if the storage area of the reception memory buffer detected in step D2 is larger than the length of the reception message to be stored detected in step D1, the data is received from the location indicated by the input pointer of the reception memory buffer. D3 saves the message and increments the input pointer by the length of the message.

상술한 구성에 의거 본 발명의 일실시예를 제1-8도를 참조하여 상세히 설명한다.An embodiment of the present invention based on the above-described configuration will be described in detail with reference to FIGS. 1-8.

시스템 A와 시스템 B간의 통신은 각각 메세지 송신과 수신으로 대별된다. 따라서 메세지의 송신은 다른 시스템으로 보낼 메세지를 특정 메모리 버퍼에 저장하는 단계와, 저장된 메세지를 FIFO를 이용하여 보내는 단계로 구분된다.Communication between system A and system B is roughly divided into message transmission and reception, respectively. Therefore, sending a message is divided into storing a message to be sent to another system in a specific memory buffer and sending a stored message by using a FIFO.

또한 메세지 수신은 상대편 시스템에서 메세지를 FIFO를 통해 수신하는 단계와 수신된 메세지를 정해진 수신 메모리 버퍼에 저장하는 단계로 구분되므로 여기서 송수신되는 메세지의 형태는 제 5 도와 같이 구성된다.In addition, since message reception is divided into receiving a message through a FIFO and storing the received message in a predetermined receiving memory buffer, the type of message transmitted and received is configured as shown in FIG. 5.

이상과 같은 4가지 단계로 나누어 설명하면, 메세지를 저장하는 송신 메모리 버퍼는 제 3 도와 같이 구성되며 입력 포인터(InPut Pointer)와 출력 포인터(output pointer)에 의해 제어된다. 입력 포인터는 다음에 메세지가 저장될 위치를 가리키고 출력 포인터는 다음에 상대측 시스템으로 보낼 메세지의 위치를 가리킨다. 한 개의 메세지는 메모리 버퍼내에 연속적으로 저장되어야 하므로 제 2 도를 참조하여 송신 메세지를 메모리 버퍼에 저장하는 방법을 설명하면, (2a)단계에서 저장할 송신 메세지의 길이를 검출하고 (2b)단계를 수행한다. 상기 (2b)단계에서는 송신 메모리 버퍼의 입력 포인터와 출력 포인터 값을 읽은 후에 (2c)단계를 수행한다. 상기 (2c)단계에서는 입력 포인터와 출력 포인터에 의해 송신 메모리 버퍼에 저장 가능한 영역을 검출한다. 즉, 송신 메모리 버퍼가 비어있는 길이를 구한다. 상기 (2c)단계에서 송신 메모리 버퍼의 비어 있는 길이를 구한 다음 (2d)단계에서는 송신 메모리 버퍼의 비어 있는 길이와 송신할 메세지 길이를 비교하여 송신 메모리 버퍼의 비어 있는 길이가 크게되면 (2g)단계를 수행하고, 송신 메모리 버퍼의 비어 있는 길이가 작게되면 (2f)단계에서 송신 메세지를 저장할 버퍼 영역이 없으므로 메세지 저장을 포기하고 리턴한다.In the above-described four steps, the transmission memory buffer for storing the message is configured as shown in the third diagram and controlled by an input pointer and an output pointer. The input pointer points to the location where the next message will be stored, and the output pointer points to the location of the next message to send to the other system. Since one message must be stored in the memory buffer continuously, referring to FIG. 2, a method of storing the transmission message in the memory buffer is described. In step (2a), the length of the transmission message to be stored is detected and the operation of step (2b) is performed. do. In step (2b), after reading the input pointer and the output pointer values of the transmission memory buffer, step (2c) is performed. In step (2c), an area that can be stored in the transmission memory buffer is detected by the input pointer and the output pointer. In other words, the length of the empty transmission memory buffer is obtained. In step (2c), the empty length of the transmission memory buffer is obtained. In step (2d), the empty length of the transmission memory buffer is compared with the empty length of the transmission memory buffer. If the empty length of the transmission memory buffer becomes small, in step 2f, since there is no buffer area to store the transmission message, the message storage is abandoned and returned.

상기 (2g)단계에서는 송신 메모리 버퍼의 입력 포인터로부터 나머지 저장 가능한 영역을 검출하고 (2h)단계를 수행한다. 상기 (2h)단계에서는 송신 메모리 버퍼의 입력 포인터로부터 나머지 저장 가능한 영역과 송신 메세지의 길이를 비교하여 송신 메모리 버퍼의 입력 포인터로부터 나머지 저장 가능한 영역이 크게되면 (2i)단계를 수행하고, 송신 메모리 버퍼의 입력 포인터로부터 나머지 저장 가능한 영역이 작게되면 (2k)단계에서 입력 포인터를 송신 메모리 버퍼의 처음 위치로 초기화시키고 다시 (2c)단계를 수행한다.In step (2g), the remaining storage area is detected from the input pointer of the transmission memory buffer and step (2h) is performed. In the step (2h), if the remaining storage area from the input pointer of the transmission memory buffer is larger than the remaining storage area from the input pointer of the transmission memory buffer and the remaining storage area becomes large, the operation (2i) is performed. If the remaining storage area becomes smaller from the input pointer of, in step (2k), the input pointer is initialized to the initial position of the transmission memory buffer and step (2c) is performed again.

상기 (2i)단계에서는 송신 메모리 버퍼의 입력 포인터가 가리키는 위치에 송신 메세지를 저장하고 (2j)단계를 수행한다. 상기 (2j)단계에서는 송신 메모리 버퍼의 입력 포인터를 해당 메세지 길이만큼 증가시키고 프로그램을 종료한다. 이와 같이 송신 메모리 버퍼에 저장된 메세지를 상대 시스템으로 송신하는 과정은, 타이머(40)에 의해 일정 시간마다 인터럽트가 발생하게 되면 수행된다. 따라서 타이머(40)의 값을 조정함으로 메세지의 송신양을 제어하는 것이 가능하다. 그리고 1주기에 보낼수 있는 최대 메세지의 수를 MAXC(Max Count)라 하면 MAXC는 다음과 같이 구해진다.In step (2i), the transmission message is stored at the location indicated by the input pointer of the transmission memory buffer, and step (2j) is performed. In step (2j), the input pointer of the transmission memory buffer is increased by the corresponding message length and the program is terminated. As described above, the process of transmitting the message stored in the transmission memory buffer to the counterpart system is performed when an interrupt is generated every predetermined time by the timer 40. Therefore, it is possible to control the amount of transmission of the message by adjusting the value of the timer 40. If the maximum number of messages that can be sent in one cycle is called MAXC (Max Count), MAXC is obtained as follows.

Figure kpo00001
Figure kpo00001

예를들어 FIFO(60)의 송신 메모리 버퍼의 크기가 512바이트이고, 최대 메세지 크기가 128바이트이면 MAXC는 4가 되어 1주기 마다 최대 4개의 메세지를 연속적으로 송신할 수 있다.For example, if the size of the transmission memory buffer of the FIFO 60 is 512 bytes and the maximum message size is 128 bytes, the MAXC becomes 4, so that up to four messages can be continuously transmitted per cycle.

따라서 메세지를 송신하는 과정을 제 4 도를 참조하여 설명하면, (4a)단계에서 FIFO(60)의 상태를 읽어들인후 (4b)단계에서 상기 FIFO(60)가 비어있는가를 검사하여 FIFO(60)가 비어 있지 않으면 리턴하고 FIFO(60)가 비어 있으면 (4c)단계에서 수행한다. 상기 (4c)단계에서는 송신 메모리 버퍼의 입력 포인터와 출력 포인터를 읽어들이고 (4d)단계에서 송실할 메세지가 있는가를 검사하여 송신할 메세지가 없으면 프로그램을 종료하고 송신할 메세지가 있으면 (4e)단계를 수행한다. 상기 (4e)단계에서는 출력 포인터가 가리키는 1개의 메세지를 FIFO(60)에 라이트(Write)하여 송신하고 (4f)단계를 수행한다. 상기 (4f)단계에서는 출력 포인터를 송신할 메세지의 길이만큼 증가시키고 (4g)단계를 수행한다. 상기 (4g)단계에서는 출력 포인터가 가리키는 영역이 송신 메모리 버퍼의 끝인가를 검사하여 송신 메모리 버퍼의 끝이 아니면 (4i)단계를 수행하고 송신 메모리 버퍼의 끝이면 (4h)단계를 수행한다. 상기 (4h)단계에서는 출력 포인터를 송신 메모리 버퍼의 처음으로 초기화시킨후 (4i)단계를 수행한다. 상기 (4i)단계에서는 MAXC의 마지막 메세지가 송신되었는가를 검사하여 마지막 메세지가 아니면 다시 (4c)단계를 수행하고 마지막 메세지이면 프로그램을 종료한다.Therefore, the process of transmitting a message will be described with reference to FIG. 4. In step 4a, the FIFO 60 is read and the FIFO 60 is empty in step 4b. Is returned if not empty, and if the FIFO 60 is empty, the process is performed in step 4c. In step (4c), the input pointer and the output pointer of the transmission memory buffer are read, and in step (4d), it is checked whether there are any messages to be sent. do. In step (4e), one message indicated by the output pointer is written and transmitted to the FIFO 60, and step (4f) is performed. In step (4f), the output pointer is increased by the length of the message to be transmitted, and step (4g) is performed. In step (4g), it is checked whether the area indicated by the output pointer is the end of the transmission memory buffer, and if it is not the end of the transmission memory buffer, step (4i) is performed. If the end of the transmission memory buffer is performed, step (4h) is performed. In step (4h), the output pointer is initialized to the beginning of the transmission memory buffer, and then step (4i) is performed. In step (4i), it is checked whether the last message of the MAXC has been transmitted, and if not the last message, step (4c) is performed again. If the last message, the program ends.

상기와 같이 송신된 메세지를 수신하기 위해서는 타이머(40)에서 주기가 설정되어 인터럽트가 발생된다. 상기 타이머(40)에서 인터럽트가 발생되면 인터럽트 제어기(50)에서 인터럽트를 제어하여 메세지를 수신하게 되는데 만약 1주기에 수신할 수 있는 최대 메세지의 수를 MAXRC(Maximum Receive Count)라 하면 MAXRC는 다음과 같이 구해진다.In order to receive the message transmitted as described above, a period is set in the timer 40 to generate an interrupt. When the interrupt is generated in the timer 40, the interrupt controller 50 receives the message by controlling the interrupt. If the maximum number of messages that can be received in one cycle is MAXRC (Maximum Receive Count), MAXRC is as follows. Obtained together.

Figure kpo00002
Figure kpo00002

수신 메세지는 연속적으로 수신되며 수신 메세지의 형태는 제 5 와 같으며 메세지 헤드(Message Head)는 새로운 메세지가 시작됨을 알리는 것이고, 메세지의 길이(Message lenth)는 실제 메세지 내용과 길이를 알려주는 필드이며, 메세지의 내용은 실제로 상대 시스템으로 보내지는 데이타를 포함하는 것이다.Received messages are received continuously and the type of received message is the same as the fifth one. The message head indicates that a new message is started. The message length is a field indicating the actual message content and length. The contents of the message, in fact, contain the data that is actually sent to the other system.

따라서 메세지 수신과정을 제 6, 7 도를 참조하여 설명하면, (6a)단계에서 제 1 도의 FIFO(60)의 상태를 읽어들어 (6b)단계에서 상기 FIFO(60)가 비어 있는가를 검사하여 상기 FIFO(60)가 비어 있지 않으면 (6c)단계를 수행하고, 상기 FIFO(60)가 비어 있으면 프로그램을 종료한다. 상기 (6c)단계에서는 출력 포인터가 가리키는 장소로부터 한 개의 메세지를 수신하고 (6d)단계를 수행한다. 상기 (6d)단계에서는 수신된 메세지를 수신 메모리 버퍼에 저장하는 모듈을 호출하고 (6e)단계를 수행한다. 상기(6e)단계에서는 MAXRC의 마지막 메세지가 수신되었는가를 검사하여 마지막 메세지가 수신되지 않았으면 다시 (6a)단계를 수행하고 마지막 메세지가 수신되었으면 프로그램이 종료한다.Therefore, the message reception process will be described with reference to FIGS. 6 and 7. In step 6a, the state of the FIFO 60 of FIG. 1 is read, and in step 6b, it is checked whether the FIFO 60 is empty. If 60 is not empty, step 6c is performed. If the FIFO 60 is empty, the program ends. In step (6c), one message is received from the location indicated by the output pointer, and step (6d) is performed. In step (6d), a module for storing the received message in the reception memory buffer is called and step (e) is performed. In step (6e), it is checked whether the last message of MAXRC has been received. If the last message is not received, step (6a) is performed again. If the last message is received, the program ends.

한편 수신된 메세지는 제 7 도와 같은 수신 메모리 버퍼에 저장되고 입력 포인터와 출력 포인터로 제어된다. 중앙처리장치(10)는 입력 포인터가 가리키는 장소에 다음의 수신될 메세지를 저장하고 출력 포인터가 가리키는 장소에서 메세지를 읽어 처리한다.Meanwhile, the received message is stored in the receiving memory buffer as in the seventh degree and controlled by the input pointer and the output pointer. The central processing unit 10 stores the next message to be received at the location indicated by the input pointer and reads and processes the message at the location indicated by the output pointer.

이와 같은 수신 메세지 저장과정을 제 8 도를 참조하여 설명하면, (8a)단계에서 저장할 수신 메세지의 길이를 검출하고 (8b)단계를 수행한다. 상기 (8b)단계에서는 수신 메모리 버퍼에 입력 포인터와 출력 포인터값을 읽어들여 수신 메모리 버퍼의 저장 가능한 영역을 검출한다. 즉, 수신 메모리 버퍼가 비어 있는 길이를 구한다. 상기 (8b)단계에서 수신 메모리 버퍼의 비어 있는 길이를 구한 다음 (8c)단계에서는 수신 메모리 버퍼의 비어 있는 길이와 저장할 수신 메세지의 길이를 비교하여 수신 메모리 버퍼의 비어 있는 길이가 크게되면 (8d)단계를 수행하고 수신 메모리 버퍼의 비어 있는 길이가 작게되면 (8e)단계에서 수신 메세지를 저장할 버퍼 영역이 없으므로 수신 메세지 저장을 포기한다.Referring to FIG. 8, the procedure of storing the received message is detected. In step 8a, the length of the received message to be stored is detected, and step 8b is performed. In step (8b), an input pointer and an output pointer value are read into the reception memory buffer to detect a storage area of the reception memory buffer. In other words, the length of the empty receiving memory buffer is obtained. In step (8b), the empty length of the reception memory buffer is obtained. In step (8c), the length of the reception memory buffer is increased by comparing the empty length of the reception memory buffer with the length of the reception message to be stored. If the empty length of the receiving memory buffer becomes small when the step is performed, the storage of the received message is abandoned because there is no buffer area to store the received message in step (8e).

상기 (8d)단계에서는 수신 메모리 버퍼의 입력 포인터와 출력 포인터가 가리키는 장소에 수신 메세지를 저장하고 (8f)단계를 수행한다. 상기 (8f)단계에서는 수신 메모리 버퍼의 입력 포인터를 해당 메세지 길이만큼 증가시키고 프로그램을 종료한다.In step (8d), the reception message is stored in the location indicated by the input pointer and the output pointer of the reception memory buffer, and step (8f) is performed. In step (8f), the input pointer of the reception memory buffer is increased by the corresponding message length and the program is terminated.

상술한 바와 같이 FIFO을 이용한 두 시스템간의 통신시 통신의 양에 따라 FIFO를 제어하고 메세지를 중간에 중단됨이 없이 연속적으로 송수신 함으로써 오버 헤드나 폴링시간의 낭비를 방지할 수 있는 이점이 있다.As described above, when communicating between two systems using the FIFO, it is possible to control the FIFO according to the amount of communication and to continuously transmit and receive a message without interruption in the middle to prevent waste of overhead or polling time.

Claims (5)

FIFO를 이용한 두 시스템간의 통신 방법에 있어서, 송신 메모리 버퍼에 송신 메세지를 연속적으로 저장하는 제 1 과정과, 상기 제 2 과정에서 저장된 송신 메세지를 인터럽트 발생에 의해 연속적으로 송신하는 제 2 과정과, 상기 제 2 과정에서 송신된 메세지를 인터럽트 발생에 의해 연속적으로 수신하여 수신 메모리 버퍼에 저장하는 제 3 과정으로 이루어짐을 특징으로 하는 방법.A communication method between two systems using a FIFO, comprising: a first process of continuously storing a transmission message in a transmission memory buffer, a second process of continuously transmitting a transmission message stored in the second process by generating an interrupt; And a third step of continuously receiving the message transmitted in the second step by an interrupt generation and storing the message in the receiving memory buffer. 제 1 항에 있어서, 상기 제 1 과정이, 저장할 송신 메세지의 길이를 검출하는 A1과정과, 상기 A1과정에서 저장할 메세지의 길이를 검출한 다음 송신 메세지를 저장할 송신 메모리 버퍼의 잔여 영역을 검출하는 A2과정과, 상기 A2과정에서 검출된 송신 버퍼의 잔여 영역과 상기 A1과정에서 검출된 저장할 송신 메세지의 길이를 비교하여 송신 메모리 버퍼의 잔여 영역이 크게되면 입력 포인터로부터 끝까지 남은 송신 버퍼의 잔여 영역을 검출하는 A3과정과, 상기 A3과정에서 검출된 입력 포인터로부터 끝까지 남은 송신 메모리 버퍼의 잔여 영역과 상기 A1과정에서 검출된 저장할 메세지의 양을 비교하여 송신 메모리 버퍼에 메세지를 저장하는 A4과정으로 이루어짐을 특징으로 하는 방법.The method of claim 1, wherein the first process comprises: A1 detecting the length of the transmission message to be stored, and A2 detecting the remaining area of the transmission memory buffer to store the transmission message after detecting the length of the message to be stored in the A1 process. Comparing the remaining area of the transmission buffer detected in step A2 with the length of the transmission message to be stored detected in step A1, and when the remaining area of the transmission memory buffer becomes large, detecting the remaining area of the transmission buffer remaining from the input pointer to the end. Process A3 and step A4 which stores the message in the transmission memory buffer by comparing the remaining area of the transmission memory buffer remaining from the input pointer detected in step A3 to the amount of the stored message detected in the process A1. How to. 제 1 항에 있어서, 상기 제 2 과정이, FIFO의 상태를 읽어들여 FIFO가 비어 있는가를 검사하는 B1과정과, 상기 B1과정에서 FIFO가 비어 있으면 송신 버퍼의 입력 포인터와 출력 포인터를 읽어들여 송신할 메세지가 있는가를 검사하는 B2과정과, 상기 B2과정에서 송신할 메세지가 있으면 출력 포인터가 가리키는 1개의 메세지를 FIFO에 라이트하여 보내고 출력 포인터를 메세지 길이만큼 증가시키는 B3과정과, 상기 B3과정에서 출력 포인터를 송신한 메세지 길이만큼 증가시키고 송신 메모리 버퍼의 출력 포인터가 가리키는 영역이 끝이면 출력 포인터를 송신 메모리 버퍼의 처음으로 초기화하여 최대 메세지 수만큼 송신하는 B4과정으로 이루어짐을 특징으로 하는 방법.2. The method of claim 1, wherein the second process includes: B1 process of reading the state of the FIFO and checking whether the FIFO is empty; and a message to read and transmit an input pointer and an output pointer of the transmit buffer if the FIFO is empty at the process B1. Process B2 to check whether there is a message; if there is a message to be transmitted in process B2, process B3 to write one message indicated by the output pointer to the FIFO, and to increase the output pointer by the length of the message; And increasing the length of one message and ending the area indicated by the output pointer of the transmission memory buffer. The method includes initializing the output pointer to the beginning of the transmission memory buffer and transmitting the maximum number of messages. 제 1 항에 있어서, 상기 제 3 과정이, 상기 FIFO의 상태를 읽어 수신되는 데이타가 있으면 한 개의 메세지를 수신하는 C1과정과, 상기 C1과정에서 수신한 메세지를 수신 메모리 버퍼에 저장하는 C2과정과, 상기 C2과정에서 메세지를 수신 메모리 버퍼에 저장하고, 최대 메세지 수만큼 수신되었는가를 검사하여 최대 메세지 수만큼 수신되지 않았으면 상기 C1과정으로 돌아가는 C3과정으로 이루어짐을 특징으로 하는 방법.The method of claim 1, wherein the third process comprises: process C1 for receiving a message if there is data received by reading the state of the FIFO; process C2 for storing the message received at process C1 in a receiving memory buffer; And storing the message in the reception memory buffer at step C2, checking whether the message is received by the maximum number of messages, and returning to the process C1 when the message is not received by the maximum number of messages. 제 4 항에 있어서, 상기 C2과정이, 저장할 수신 메세지의 길이를 검출하는 D1과정과, 상기 D1과정에서 수신 메세지의 양을 검출하고 수신 메모리 버퍼의 저장 가능한 영역을 검출하는 D2과정과, 상기 D1과정에서 검출된 수신 메세지 길이보다 크게되면 수신 메모리 버퍼의 입력 포인터가 가리키는 장소부터 수신 메세지를 저장하고 입력 포인터를 메세지 길이만큼 증가시키는 D3과정으로 이루어짐을 특징으로 하는 방법.The method of claim 4, wherein the process C2 comprises: a process D1 for detecting the length of the received message to be stored; a process D2 for detecting the amount of the received message at the process D1 and a storage area of the reception memory buffer; And storing the received message from the location indicated by the input pointer of the receiving memory buffer and increasing the input pointer by the length of the message if the length of the received message is greater than the detected length of the received message.
KR1019910002844A 1991-02-21 1991-02-21 Communicating method between two systems by using fifo KR930009064B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019910002844A KR930009064B1 (en) 1991-02-21 1991-02-21 Communicating method between two systems by using fifo

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019910002844A KR930009064B1 (en) 1991-02-21 1991-02-21 Communicating method between two systems by using fifo

Publications (2)

Publication Number Publication Date
KR920016952A KR920016952A (en) 1992-09-25
KR930009064B1 true KR930009064B1 (en) 1993-09-22

Family

ID=19311345

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019910002844A KR930009064B1 (en) 1991-02-21 1991-02-21 Communicating method between two systems by using fifo

Country Status (1)

Country Link
KR (1) KR930009064B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7518920B2 (en) 2006-01-09 2009-04-14 Samsung Electronics Co., Ltd. Flash memory device including a dummy cell

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7518920B2 (en) 2006-01-09 2009-04-14 Samsung Electronics Co., Ltd. Flash memory device including a dummy cell

Also Published As

Publication number Publication date
KR920016952A (en) 1992-09-25

Similar Documents

Publication Publication Date Title
EP0029331B1 (en) Inter-subsystem communication system
US5892979A (en) Queue control apparatus including memory to save data received when capacity of queue is less than a predetermined threshold
US20100005199A1 (en) Direct memory access (dma) data transfers with reduced overhead
US3665406A (en) Automatic polling systems
US20090182798A1 (en) Method and apparatus to improve the effectiveness of system logging
CN114817110B (en) Data transmission method and device
CN105630424A (en) Data processing method, device and system
KR100230451B1 (en) Method of transceiving asynchronous serial data of digital signal processor
KR930009064B1 (en) Communicating method between two systems by using fifo
US6584512B1 (en) Communication DMA device for freeing the data bus from the CPU and outputting divided data
US5228129A (en) Synchronous communication interface for reducing the effect of data processor latency
EP0309676A2 (en) Workstation controller with full screen write mode and partial screen write mode
JP2924783B2 (en) Remote read processing method and device
US5577260A (en) Data processing system having a serial interface comprising an end-of-transmission flag
KR930005124B1 (en) Image data page end mark checking method
KR100221297B1 (en) First-in and first-out buffer
KR100462478B1 (en) Apparatus of transmitting and receiving variable length packet, and method thereof
JP3058010B2 (en) Method and apparatus for communication between processors
KR900000115B1 (en) Interfacing method using fifo system
JP2945123B2 (en) Communications system
KR950002306B1 (en) Data transmission device and method for fax
CN116662248A (en) Multi-CPU communication system and method, electronic device, and storage medium
CN115828811A (en) Method and device for realizing hardware pause mechanism in FPGA (field programmable Gate array) configuration process
JPH0236636A (en) Data link system
JPH0991100A (en) Data transmission controller

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
G160 Decision to publish patent application
G160 Decision to publish patent application
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20070810

Year of fee payment: 15

LAPS Lapse due to unpaid annual fee