[go: up one dir, main page]

CN101097559A - A system and method for realizing interface and interconnection between main processor and coprocessor - Google Patents

A system and method for realizing interface and interconnection between main processor and coprocessor Download PDF

Info

Publication number
CN101097559A
CN101097559A CNA2006100894531A CN200610089453A CN101097559A CN 101097559 A CN101097559 A CN 101097559A CN A2006100894531 A CNA2006100894531 A CN A2006100894531A CN 200610089453 A CN200610089453 A CN 200610089453A CN 101097559 A CN101097559 A CN 101097559A
Authority
CN
China
Prior art keywords
coprocessor
primary processor
main processor
status word
data
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.)
Pending
Application number
CNA2006100894531A
Other languages
Chinese (zh)
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.)
Institute of Microelectronics of CAS
Original Assignee
Institute of Microelectronics of CAS
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 Institute of Microelectronics of CAS filed Critical Institute of Microelectronics of CAS
Priority to CNA2006100894531A priority Critical patent/CN101097559A/en
Publication of CN101097559A publication Critical patent/CN101097559A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Advance Control (AREA)

Abstract

本发明公开了一种实现主处理器与协处理器接口与互连的系统,包括主处理器、至少一个协处理器、双端口数据存储器、主处理器数据总线、协处理器数据总线、至少一个命令字寄存器和至少一个状态字寄存器。本发明还公开了一种实现主处理器与协处理器接口与互连的方法,包括:A.主处理器将需传递给协处理器的数据写入双端口数据存储器中的指定存储区域,并向协处理器发送协处理器启动指令;B.协处理器接收到启动指令后向主处理器返回命令接收状态字,访问双端口数据存储器中的指定存储区域获取主处理器写入的数据,执行启动指令中定义的操作;C.协处理器完成指令中定义的操作后向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果。

The invention discloses a system for realizing the interface and interconnection of a main processor and a coprocessor, including a main processor, at least one coprocessor, a dual-port data memory, a main processor data bus, a coprocessor data bus, at least A command word register and at least one status word register. The invention also discloses a method for realizing the interface and interconnection between the main processor and the coprocessor, comprising: A. the main processor writes the data to be transmitted to the coprocessor into a designated storage area in the dual-port data memory, And send the coprocessor startup instruction to the coprocessor; B. After the coprocessor receives the startup instruction, return the command reception status word to the main processor, and access the designated storage area in the dual-port data memory to obtain the data written by the main processor , execute the operation defined in the start instruction; C. After the coprocessor completes the operation defined in the instruction, it returns the command completion status word to the main processor, and the main processor obtains the execution result of the coprocessor.

Description

一种实现主处理器与协处理器接口与互连的系统及方法A system and method for realizing interface and interconnection between main processor and coprocessor

技术领域technical field

本发明涉及计算机体系结构及超大规模集成电路设计技术领域,尤其涉及一种实现主处理器与协处理器接口与互连的系统及方法。The invention relates to the technical field of computer architecture and VLSI design, in particular to a system and method for realizing the interface and interconnection of a main processor and a coprocessor.

背景技术Background technique

协处理器是针对不同的应用场合和需求,对主处理器扩展的、协助主处理器完成特殊应用处理的处理器。例如浮点运算协处理器,多媒体协处理器等。A coprocessor is a processor that extends the main processor and assists the main processor in completing special application processing for different applications and requirements. Such as floating-point arithmetic coprocessor, multimedia coprocessor, etc.

协处理器具有可编程性。协处理器有着在主处理器指令集基础上扩充的协处理器指令集,协处理器含有面向特定应用的功能单元,可以用于加速特定应用的处理。Coprocessors are programmable. The coprocessor has a coprocessor instruction set expanded on the basis of the main processor instruction set, and the coprocessor contains application-specific functional units that can be used to accelerate the processing of a specific application.

传统的主处理器与协处理器的接口采用较为复杂的紧密耦合的方式。例如,高级精简指令集处理器(Advanced RISC Machines,ARM)与其协处理器接口通过专用的协处理器接口进行互连和通讯。协处理器的接口包括以下四类信号:时钟信号、时钟控制信号、流水线跟随信号和握手信号。ARM的协处理器与ARM处理器使用同一时钟信号。协处理器中有自己的流水线。协处理器通过与ARM处理器连接的协处理器接口使用一个流水线跟随器,对ARM内核流水线中执行的指令进行跟踪,并且保持两个流水线的步调一致。Traditionally, the interface between the main processor and the coprocessor adopts a relatively complex and tightly coupled method. For example, Advanced RISC Machines (ARM) and its coprocessor interface are interconnected and communicated through a dedicated coprocessor interface. The interface of the coprocessor includes the following four types of signals: clock signal, clock control signal, pipeline follow signal and handshake signal. ARM coprocessors use the same clock signal as the ARM processor. The coprocessor has its own pipeline. The coprocessor uses a pipeline follower through the coprocessor interface connected to the ARM processor to track the instructions executed in the ARM core pipeline and keep the two pipelines in sync.

但是,现有的主处理器与协处理器的接口及互连结构有着一些无法回避的内在缺陷。譬如,兼容性不强,只能支持特定的主处理器和协处理器;协处理器进行数据处理的粒度较细,只能有效进行单个数据字的处理,并不能支持粒度较粗的数据处理;协处理器和主处理器共用一段流水线,两者不能同时并行运行;不支持灵活的协处理器指令集设计等。However, the existing main processor and coprocessor interface and interconnection structure have some unavoidable inherent defects. For example, the compatibility is not strong, and it can only support specific main processors and coprocessors; the granularity of data processing by coprocessors is relatively fine, and it can only effectively process a single data word, and cannot support coarser granularity data processing ; The coprocessor and the main processor share a pipeline, and the two cannot run in parallel at the same time; it does not support flexible coprocessor instruction set design, etc.

发明内容Contents of the invention

(一)要解决的技术问题(1) Technical problems to be solved

针对上述现有技术存在的不足,本发明的一个主要目的在于提供一种实现主处理器与协处理器接口与互连的系统,以提高主处理器与协处理器之间的兼容性,使协处理器能够支持各种粒度的数据处理,并使协处理器和处理器能够并行运行,支持灵活的协处理器指令集设计。Aiming at the deficiencies in the above-mentioned prior art, a main purpose of the present invention is to provide a system for realizing the interface and interconnection between the main processor and the coprocessor, so as to improve the compatibility between the main processor and the coprocessor, so that The coprocessor can support data processing of various granularities, and enables the coprocessor and the processor to run in parallel, and supports flexible coprocessor instruction set design.

本发明的另一个主要目的在于提供一种实现主处理器与协处理器接口与互连的方法,以提高主处理器与协处理器之间的兼容性,使协处理器能够支持各种粒度的数据处理,并使协处理器和处理器能够并行运行,支持灵活的协处理器指令集设计。Another main purpose of the present invention is to provide a method for realizing the interface and interconnection between the main processor and the coprocessor, so as to improve the compatibility between the main processor and the coprocessor, so that the coprocessor can support various granularities data processing, and enables coprocessors and processors to run in parallel, supporting flexible coprocessor instruction set design.

(二)技术方案(2) Technical solution

为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:

一种实现主处理器与协处理器接口与互连的系统,包括一个主处理器和至少一个协处理器,该系统还包括:A system for interfacing and interconnecting a main processor and a coprocessor, comprising a main processor and at least one coprocessor, the system further comprising:

双端口数据存储器,用于实现所述主处理器与至少一个协处理器之间的数据通讯;a dual-port data memory for realizing data communication between the main processor and at least one coprocessor;

主处理器数据总线,用于连接所述主处理器与双端口数据存储器;a main processor data bus for connecting the main processor and a dual-port data memory;

协处理器数据总线,用于连接双端口数据存储器与所述至少一个协处理器;a coprocessor data bus for connecting the dual-port data memory with the at least one coprocessor;

至少一个命令字寄存器,用于将接收自所述主处理器的指令发送给与自身连接的协处理器;At least one command word register for sending instructions received from the main processor to a coprocessor connected to itself;

至少一个状态字寄存器,用于将接收自协处理器的状态信息发送给所述主处理器。At least one status word register for sending status information received from the coprocessor to the main processor.

所述双端口数据存储器包括:通过所述主处理器数据总线与主处理器连接的数据访问端口;通过所述协处理器数据总线与至少一个协处理器连接的数据访问端口;和与所述两个数据访问端口对应的地址译码逻辑电路。The dual-port data memory includes: a data access port connected to the main processor through the main processor data bus; a data access port connected to at least one coprocessor through the coprocessor data bus; The address decoding logic circuits corresponding to the two data access ports.

所述双端口数据存储器的两个数据访问端口分别至少包括:时钟信号、控制信号、地址信号和数据信号。The two data access ports of the dual-port data memory respectively at least include: a clock signal, a control signal, an address signal and a data signal.

所述主处理器通过与自身连接的数据访问端口,以及协处理器通过与自身连接的数据访问端口,同时对双端口数据存储器的不同存储区域进行读操作或写操作。The main processor simultaneously reads or writes to different storage areas of the dual-port data memory through the data access port connected to itself and the coprocessor through the data access port connected to itself.

所述主处理器为哈佛结构的主处理器;所述主处理器数据总线为哈佛结构主处理器的数据总线,用于连接所述哈佛结构的主处理器与双端口数据存储器的一个数据访问端口;所述协处理器数据总线用于连接所述至少一个协处理器与双端口数据存储器的另一个数据访问端口。Described main processor is the main processor of Harvard structure; Described main processor data bus is the data bus of Harvard structure main processor, is used to connect the main processor of described Harvard structure and a data access of dual-port data memory port; the coprocessor data bus is used to connect the at least one coprocessor with another data access port of the dual-port data memory.

所述命令字寄存器与协处理器一一对应;所述主处理器通过执行写操作对全部命令字寄存器进行访问,所述协处理器通过执行读操作对与自身对应的命令字寄存器进行访问。There is a one-to-one correspondence between the command word registers and the coprocessors; the main processor accesses all the command word registers by performing a write operation, and the coprocessor accesses the command word registers corresponding to itself by performing a read operation.

所述状态字寄存器与协处理器一一对应;所述主处理器通过执行读操作对全部状态字寄存器进行访问,所述协处理器通过执行写操作对与自身对应的状态字寄存器进行访问。There is a one-to-one correspondence between the status word registers and the coprocessors; the main processor accesses all the status word registers by performing a read operation, and the coprocessor accesses the status word registers corresponding to itself by performing a write operation.

一种实现主处理器与协处理器接口与互连的方法,该方法包括:A method for interfacing and interconnecting a host processor and a coprocessor, the method comprising:

A、主处理器将需传递给协处理器的数据写入双端口数据存储器中的指定存储区域,并向协处理器发送协处理器启动指令;A. The main processor writes the data to be delivered to the coprocessor into the designated storage area in the dual-port data memory, and sends the coprocessor start command to the coprocessor;

B、协处理器接收到启动指令后向主处理器返回命令接收状态字,访问双端口数据存储器中的指定存储区域获取主处理器写入的数据,执行启动指令中定义的操作;B. After the coprocessor receives the startup instruction, it returns the command reception status word to the main processor, accesses the designated storage area in the dual-port data memory to obtain the data written by the main processor, and executes the operation defined in the startup instruction;

C、协处理器完成指令中定义的操作后向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果。C. After the coprocessor completes the operation defined in the instruction, it returns the command completion status word to the main processor, and the main processor obtains the execution result of the coprocessor.

步骤A中所述主处理器将需传递给协处理器的数据写入双端口数据存储器中的指定存储区域,是通过主处理器数据总线与双端口数据存储器的一个数据访问端口访问双端口数据存储器中的指定存储区域实现的。The main processor described in the step A writes the data that needs to be delivered to the coprocessor into the designated storage area in the dual-port data memory, and accesses the dual-port data through a data access port of the main processor data bus and the dual-port data memory implemented in a specified memory area in memory.

步骤A中所述主处理器向协处理器发送协处理器启动指令包括:主处理器通过命令字寄存器向协处理器发送至少携带有执行定义操作和访问指定存储区域信息的协处理器启动指令。In step A, the main processor sending the coprocessor startup instruction to the coprocessor includes: the main processor sends the coprocessor startup instruction to the coprocessor through the command word register, which at least carries the information of executing the defined operation and accessing the designated storage area .

步骤B中所述协处理器向主处理器返回命令接收状态字是通过状态字寄存器返回的。In step B, the coprocessor returns the command receiving status word to the main processor through the status word register.

步骤B中所述协处理器向主处理器返回命令接收状态字后进一步包括:主处理器根据接收的命令接收状态字执行正常的程序流。In step B, after the coprocessor returns the command receiving status word to the main processor, it further includes: the main processor executes a normal program flow according to the received command receiving status word.

步骤C中所述协处理器完成指令中定义的操作后进一步将执行结果携带在命令完成状态字中,步骤C中所述协处理器向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果包括:After the coprocessor described in the step C completes the operation defined in the instruction, the execution result is further carried in the command completion status word, the coprocessor described in the step C returns the command completion status word to the main processor, and the main processor obtains the coprocessor The processor's execution results include:

C1、协处理器通过状态字寄存器向主处理器发送携带有执行结果的命令完成状态字;C1. The coprocessor sends the command completion status word carrying the execution result to the main processor through the status word register;

C2、主处理器接收到协处理器发送的命令完成状态字,从命令完成状态字中获取协处理器返回的执行结果。C2. The main processor receives the command completion status word sent by the coprocessor, and obtains the execution result returned by the coprocessor from the command completion status word.

步骤C中所述协处理器完成指令中定义的操作后进一步将执行结果数据写入双端口数据存储器中的指定存储区域,步骤C中所述协处理器向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果包括:After the coprocessor described in the step C completes the operation defined in the instruction, the execution result data is further written into the specified storage area in the dual-port data memory, and the coprocessor described in the step C returns the command completion status word to the main processor, The execution results obtained by the main processor from the coprocessor include:

C1′、协处理器通过状态字寄存器向主处理器发送命令完成状态字;C1', the coprocessor sends a command to the main processor through the status word register to complete the status word;

C2′、主处理器接收到命令完成状态字,访问双端口数据存储器中的指定存储区域,获取协处理器写入的执行结果数据。C2'. The main processor receives the command completion status word, accesses the specified storage area in the dual-port data memory, and obtains the execution result data written by the coprocessor.

(三)有益效果(3) Beneficial effects

从上述技术方案可以看出,本发明具有以下有益效果:As can be seen from the foregoing technical solutions, the present invention has the following beneficial effects:

1、利用本发明,由于主处理器和协处理器分别利用各自的数据总线及流水线,所以主处理器能够与各种类型的协处理器互连并协同工作,大大提高了主处理器与协处理器之间的兼容性。1. Utilize the present invention, because main processor and coprocessor utilize respective data bus and pipeline respectively, so main processor can be interconnected and cooperate with various types of coprocessors, greatly improve main processor and coprocessor. Compatibility between processors.

2、利用本发明,由于协处理器在进行数据处理时,既能够进行单个数据字的细粒度数据处理,又能够进行多个数据字的粗粒度数据处理,所以协处理器能够支持各种粒度的数据处理。2. Utilizing the present invention, since the coprocessor can both perform fine-grained data processing of a single data word and coarse-grained data processing of multiple data words when performing data processing, the coprocessor can support various granularity data processing.

3、利用本发明,由于主处理器和协处理器对双端口数据存储器的特定区域采用分时访问的机制,协处理器对数据存储器的访问操作及执行操作的过程不会影响主处理器对数据存储器的访问操作及执行操作的过程,二者访问数据存储器的时序也不会互相影响,在协处理器执行操作的同时主处理器也可以正常执行程序流,所以主处理器和协处理器可以并行运行。3. Utilize the present invention, because main processor and coprocessor adopt the mechanism of time-sharing access to the specific area of dual-port data memory, coprocessor can not affect the process of the access operation of data memory and the execution operation of main processor to data memory. The access operation of the data memory and the process of executing the operation, the timing of the two accessing the data memory will not affect each other, and the main processor can also execute the program flow normally while the coprocessor is performing the operation, so the main processor and the coprocessor Can run in parallel.

4、利用本发明,主处理器和协处理器也可以通过双端口数据存储器获得很高的数据访问带宽,协处理器还能够支持灵活的协处理器指令集设计。4. Using the present invention, the main processor and the coprocessor can also obtain high data access bandwidth through the dual-port data memory, and the coprocessor can also support flexible coprocessor instruction set design.

5、利用本发明,主处理器每次只发出一个协处理器指令,即只有一个协处理器进行操作并有可能访问协处理器数据总线,在任意时刻也只有一个协处理器对协处理器数据总线进行访问,因此不会出现协处理器数据总线访问冲突的问题。5. With the present invention, the main processor only sends a coprocessor instruction at a time, that is, only one coprocessor operates and may access the coprocessor data bus, and at any moment there is only one coprocessor to the coprocessor The data bus is accessed, so there is no problem of coprocessor data bus access conflicts.

6、利用本发明,在协处理器完成协处理器指令定义的特定操作并且返回状态之前,主处理器不会启动其它的协处理器。这样,在某一时刻只有主处理器和一个协处理器同时工作,不会出现多个协处理器同时工作的情况,因此不会出现协处理器之间操作冲突的问题。6. With the present invention, the main processor will not start other coprocessors until the coprocessor completes the specific operation defined by the coprocessor instruction and returns the status. In this way, at a certain moment, only the main processor and one coprocessor work at the same time, and there is no situation that multiple coprocessors work at the same time, so there is no problem of operation conflict between coprocessors.

附图说明Description of drawings

图1为本发明提供的实现主处理器与N个协处理器接口与互连的系统的示意图;Fig. 1 is the schematic diagram of the system that realizes main processor and N coprocessor interfaces and interconnection provided by the present invention;

图2为本发明提供的实现主处理器与一个协处理器接口与互连的系统的示意图;Fig. 2 is the schematic diagram of the system that realizes main processor and a coprocessor interface and interconnection provided by the present invention;

图3为本发明提供的实现主处理器与协处理器接口与互连总体技术方案的实现流程图;Fig. 3 is the realization flow chart of realizing main processor and coprocessor interface and interconnection overall technical scheme provided by the present invention;

图4为依照本发明第一个实施例实现主处理器与协处理器接口与互连的方法流程图;4 is a flow chart of a method for realizing the interface and interconnection between the main processor and the coprocessor according to the first embodiment of the present invention;

图5为依照本发明第二个实施例实现主处理器与协处理器接口与互连的方法流程图。FIG. 5 is a flowchart of a method for implementing the interface and interconnection between the main processor and the coprocessor according to the second embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

如图1所示,图1为本发明提供的实现主处理器与N个协处理器接口与互连的系统的示意图,该系统包括一个主处理器和至少一个协处理器,该系统还包括:As shown in Figure 1, Figure 1 is a schematic diagram of a system for realizing the interface and interconnection between the main processor and N coprocessors provided by the present invention, the system includes a main processor and at least one coprocessor, and the system also includes :

双端口数据存储器,用于实现所述主处理器与至少一个协处理器之间的数据通讯;a dual-port data memory for realizing data communication between the main processor and at least one coprocessor;

主处理器数据总线,用于连接所述主处理器与双端口数据存储器;a main processor data bus for connecting the main processor and a dual-port data memory;

协处理器数据总线,用于连接双端口数据存储器与所述至少一个协处理器;a coprocessor data bus for connecting the dual-port data memory with the at least one coprocessor;

至少一个命令字寄存器,用于将接收自所述主处理器的指令发送给与自身连接的协处理器;At least one command word register for sending instructions received from the main processor to a coprocessor connected to itself;

至少一个状态字寄存器,用于将接收自协处理器的状态信息发送给所述主处理器。At least one status word register for sending status information received from the coprocessor to the main processor.

上述主处理器为哈佛结构的主处理器,具有独立的数据存储器和程序存储器,分别与数据总线和程序总线相连接,取指和执行并行独立进行。The above-mentioned main processor is a main processor of Harvard structure, has independent data memory and program memory, and is respectively connected with the data bus and the program bus, fetches instructions and executes in parallel and independently.

其中,主处理器的数据总线为了和协处理器的数据总线相区别,被标识为主处理器数据总线,协处理器的数据总线被标识为协处理器数据总线。Wherein, in order to distinguish the data bus of the main processor from the data bus of the coprocessor, it is identified as the main processor data bus, and the data bus of the coprocessor is identified as the coprocessor data bus.

双端口数据存储器是由主处理器原有的单端口存储器扩展而来的,主处理器和协处理器通过双端口数据存储器进行数据通讯。所述双端口数据存储器包括:通过所述主处理器数据总线与主处理器连接的数据访问端口,即数据访问端口A;通过所述协处理器数据总线与至少一个协处理器连接的数据访问端口,即数据访问端口B;和与所述两个数据访问端口对应的地址译码逻辑电路。The dual-port data memory is extended from the original single-port memory of the main processor, and the main processor and the coprocessor perform data communication through the dual-port data memory. The dual-port data memory includes: a data access port connected to the main processor through the main processor data bus, i.e. data access port A; a data access port connected to at least one coprocessor through the coprocessor data bus port, that is, data access port B; and an address decoding logic circuit corresponding to the two data access ports.

双端口数据存储器具有完全独立的两套数据访问端口及相应的地址译码逻辑电路。双端口的数据存储器具有的数据访问端口A和数据访问端口B相互独立。数据访问端口A和数据访问端口B分别至少包括:时钟信号、控制信号、地址信号和数据信号等。The dual-port data memory has two sets of completely independent data access ports and corresponding address decoding logic circuits. The data access port A and the data access port B of the dual-port data memory are independent of each other. The data access port A and the data access port B respectively at least include: a clock signal, a control signal, an address signal, a data signal, and the like.

主处理器数据总线与双端口数据存储器的数据访问端口A相连,主处理器通过主处理器数据总线和数据访问端口A访问双端口数据存储器。双端口数据存储器的数据访问端口A保持与主处理器数据总线的连接。The main processor data bus is connected to the data access port A of the dual-port data memory, and the main processor accesses the dual-port data memory through the main processor data bus and the data access port A. Data access port A of the dual-port data memory remains connected to the main processor data bus.

协处理器数据总线与双端口数据存储器的数据访问端口B相连,协处理器通过协处理器数据总线和数据访问端口B访问双端口数据存储器。双端口数据存储器的数据访问端口B与协处理器数据总线连接,并通过协处理器数据总线并联多个协处理器。The coprocessor data bus is connected to the data access port B of the dual-port data memory, and the coprocessor accesses the dual-port data memory through the coprocessor data bus and the data access port B. The data access port B of the dual-port data memory is connected to the coprocessor data bus, and multiple coprocessors are connected in parallel through the coprocessor data bus.

由于主处理器每次只发出一个协处理器指令,即只有一个协处理器进行操作并有可能访问协处理器数据总线,所以在任意时刻最多只有一个协处理器对协处理器数据总线进行访问,因此不会出现协处理器数据总线的访问冲突。Since the main processor only issues one coprocessor instruction at a time, that is, only one coprocessor operates and may access the coprocessor data bus, so at most one coprocessor can access the coprocessor data bus at any time , so there will be no access conflicts on the coprocessor data bus.

由于主处理器每次最多只能启动一个协处理器,在协处理器数据总线上不会出现多个协处理器同时工作,竞争总线资源的情况,并且协处理器都自带有地址译码的逻辑。Since the main processor can only start one coprocessor at most at a time, there will not be multiple coprocessors working at the same time on the coprocessor data bus, competing for bus resources, and the coprocessors have their own address decoding logic.

双端口数据存储器的两套数据访问端口可独立工作于不同的时钟频率,并可同时对双端口数据存储器进行访问。但是,如果同时对双端口数据存储器的某一特定的存储区域进行读写操作,则有可能访问失败。为了保证数据通讯的正确有效,在本发明中主处理器和协处理器对双端口存储器的访问分时进行。The two sets of data access ports of the dual-port data memory can work independently at different clock frequencies, and can simultaneously access the dual-port data memory. However, if a specific storage area of the dual-port data memory is read and written at the same time, the access may fail. In order to ensure correct and effective data communication, in the present invention, the access of the main processor and the coprocessor to the dual-port memory is carried out in time division.

主处理器通过数据访问端口A,协处理器通过数据访问端口B,同时对双端口数据存储器的不同存储区域进行读操作或写操作。但是,主处理器通过数据访问端口A,协处理器通过数据访问端口B,不能同时读写双端口数据存储器的同一存储单元。The main processor accesses port A through data, and the coprocessor accesses port B through data, and simultaneously performs read or write operations on different storage areas of the dual-port data memory. However, the main processor accesses port A through data, and the coprocessor accesses port B through data, so they cannot read and write the same storage unit of the dual-port data memory at the same time.

主处理器发出协处理器指令启动协处理器工作时,在协处理器指令中指定了协处理器可以访问的存储器区域。在协处理器对此存储器区域进行访问的时候,协处理器的操作并不影响主处理器正常执行程序流,但主处理器只能访问除指定协处理器访问区域以外的其它存储器区域。当协处理器完成了对指定存储器区域的访问并执行完相应操作之后,将向主处理器返回命令完成状态字。主处理器接收到命令完成状态字之后,才可以对指定协处理器访问的存储器区域进行访问。When the main processor issues a coprocessor command to start the coprocessor, the coprocessor command specifies the memory area that the coprocessor can access. When the coprocessor accesses this memory area, the operation of the coprocessor does not affect the normal execution of the program flow of the main processor, but the main processor can only access other memory areas except the designated coprocessor access area. When the coprocessor completes the access to the designated memory area and executes the corresponding operation, it will return the command completion status word to the main processor. The main processor can only access the memory area accessed by the designated coprocessor after receiving the command completion status word.

在进行主处理器和协处理器的数据通讯时,主处理器首先将需传递到协处理器的数据写入双端口数据存储器的特定存储器区域,并启动主处理器。当主处理器发送协处理器指令并启动协处理器工作之后,协处理器可以通过协处理器数据总线和双端口存储器的端口B,访问双端口数据存储器的特定存储器区域读入操作数据,并操作完成后写入数据。此时主处理器不能对此存储器区域进行访问,只有当协处理器完成对数据存储器的访问并返回命令完成状态字,且主处理器接收到命令完成状态字之后,主处理器才可以对双端口数据存储器的特定存储器区域进行访问。主处理器通过访问双端口数据存储器的特定存储器区域获取协处理器写入的数据,完成主处理器和协处理器间的数据通讯。When performing data communication between the main processor and the coprocessor, the main processor first writes the data to be transmitted to the coprocessor into a specific memory area of the dual-port data memory, and starts the main processor. After the main processor sends the coprocessor instruction and starts the coprocessor to work, the coprocessor can access the specific memory area of the dual-port data memory through the coprocessor data bus and port B of the dual-port memory to read in the operation data and operate Write data when done. At this time, the main processor cannot access this memory area. Only when the coprocessor completes the access to the data memory and returns the command completion status word, and the main processor receives the command completion status word, the main processor can access the dual A specific memory area of the port data memory is accessed. The main processor obtains the data written by the coprocessor by accessing a specific memory area of the dual-port data memory, and completes the data communication between the main processor and the coprocessor.

所述命令字寄存器与协处理器一一对应,主处理器通过执行写操作对全部命令字寄存器进行访问,协处理器通过执行读操作对与自身对应的命令字寄存器进行访问。The command word registers are in one-to-one correspondence with the coprocessors, the main processor accesses all the command word registers by performing a write operation, and the coprocessor accesses the command word registers corresponding to itself by performing a read operation.

所述状态字寄存器与协处理器一一对应,主处理器通过执行读操作对全部状态字寄存器进行访问,协处理器通过执行写操作对与自身对应的状态字寄存器进行访问。The status word registers are in one-to-one correspondence with the coprocessors, the main processor accesses all the status word registers by performing a read operation, and the coprocessor accesses the status word registers corresponding to itself by performing a write operation.

主处理器通过命令字寄存器向协处理器传递协处理器指令,协处理器通过状态字寄存器并结合中断请求信号向主处理器返回状态。命令字寄存器将从主处理器发出的协处理器指令传递给协处理器,状态字寄存器则将从协处理器返回的状态传递给主处理器。同时,协处理器的状态返回是和主处理器的外部中断结合在一起的。The main processor transmits coprocessor instructions to the coprocessor through the command word register, and the coprocessor returns the status to the main processor through the status word register combined with the interrupt request signal. The command word register transmits the coprocessor instruction issued from the main processor to the coprocessor, and the status word register transmits the status returned from the coprocessor to the main processor. At the same time, the status return of the coprocessor is combined with the external interrupt of the main processor.

图1中的N个命令字寄存器和N个状态字寄存器都是主处理器可寻址访问的。而协处理器则只能寻址访问到其所属的一个命令字寄存器和一个状态字寄存器。例如协处理器N只能访问命令字寄存器N和状态字寄存器N。The N command word registers and N status word registers in Fig. 1 are all addressable and accessible by the main processor. But the coprocessor can only address and access a command word register and a status word register to which it belongs. For example, coprocessor N can only access command word register N and status word register N.

同时,主处理器只能对状态字寄存器进行读操作,协处理器只能对状态字寄存器进行写操作;主处理器只能对命令字寄存器进行写操作,协处理器只能对命令字寄存器进行读操作。At the same time, the main processor can only read the status word register, and the coprocessor can only write to the status word register; the main processor can only write to the command word register, and the coprocessor can only write to the command word register. to perform a read operation.

中断请求信号和中断响应信号也是一一对应的。例如图1中的中断申请信号N对应中断响应信号N。中断请求信号和中断响应信号属于主处理器,分别对应N个外部中断,例如中断申请信号N和中断响应信号N对应主处理器的外部中断N。每一个协处理器被分配一个外部中断资源,并分别连接一个中断请求信号和一个中断响应信号。例如协处理器N连接到中断请求信号N和中断响应信号N。协处理器N通过中断申请信号N和中断响应信号N与主处理器连接并可申请主处理器的外部中断N,当协处理器发出外部中断请求的时候,主处理器进入外部中断N对应的中断服务程序执行。There is also a one-to-one correspondence between the interrupt request signal and the interrupt response signal. For example, the interrupt request signal N in FIG. 1 corresponds to the interrupt response signal N. The interrupt request signal and the interrupt response signal belong to the main processor and correspond to N external interrupts respectively, for example, the interrupt request signal N and the interrupt response signal N correspond to the external interrupt N of the main processor. Each coprocessor is allocated an external interrupt resource, and is connected with an interrupt request signal and an interrupt response signal respectively. For example, coprocessor N is connected to interrupt request signal N and interrupt response signal N. The coprocessor N is connected to the main processor through the interrupt application signal N and the interrupt response signal N and can apply for the external interrupt N of the main processor. When the coprocessor sends an external interrupt request, the main processor enters the corresponding interrupt of the external interrupt N. Interrupt service routine execution.

主处理器向协处理器发送命令的过程是:主处理器在执行正常的程序流的过程中,如需启动协处理器N进行某种特定的操作,则将命令字R写入命令字寄存器。其中命令字R定义了协处理器的操作类型及主处理器指定的可以访问的存储器区域。与主处理器连接的N个协处理器,在未接收到命令的时候,都处于命令查询状态,不断查询命令字寄存器。如协处理器中的某个协处理器N查询到命令字寄存器N中的值为其可识别并执行的协处理器指令R,则会返回命令接收状态字,并且开始相应的协处理器操作。在协处理器N完成协处理器指令R定义的特定操作并且返回状态之前,主处理器不会启动其它的协处理器。这样,在某一时刻最多只有处理器和一个协处理器同时工作,不会出现多个协处理器同时工作的情况,因此不会出现协处理器之间操作冲突的问题。The process of the main processor sending a command to the coprocessor is: the main processor is in the process of executing the normal program flow, if it needs to start the coprocessor N to perform a certain operation, write the command word R into the command word register . Among them, the command word R defines the operation type of the coprocessor and the accessible memory area specified by the main processor. The N coprocessors connected with the main processor are all in the command query state when they do not receive the command, and constantly query the command word register. If a coprocessor N in the coprocessor finds that the value in the command word register N is a coprocessor instruction R that it can recognize and execute, it will return the command receiving status word and start the corresponding coprocessor operation . The main processor will not start other coprocessors until coprocessor N completes the specific operation defined by coprocessor instruction R and returns status. In this way, at a certain moment, only the processor and one coprocessor work at the same time, and there will be no situation that multiple coprocessors work at the same time, so there will be no problem of operation conflict between coprocessors.

协处理器向主处理器返回状态的过程是:当协处理器N发起向主处理器的状态返回的时候,协处理器N在将状态字S写入状态字寄存器N后,将中断请求信号N置为有效以便处理器N能够即时响应并处理。其中状态字S中定义了协处理器N向主处理器返回的状态。The process for the coprocessor to return the state to the main processor is: when the coprocessor N initiates the state return to the main processor, the coprocessor N sends the interrupt request signal after writing the status word S into the status word register N. N is asserted so that processor N can respond and process immediately. The state word S defines the state returned by the coprocessor N to the main processor.

主处理器在接收到中断申请N后,由中断控制器根据中断屏蔽位以及中断优先级等条件判断是否接收该中断。如接收中断请求N,主处理器会将中断响应信号N置为有效。处于中断申请等待状态的协处理器N检测到中断响应N信号有效后,撤销中断申请信号N。After the main processor receives the interrupt request N, the interrupt controller judges whether to receive the interrupt according to conditions such as the interrupt mask bit and the interrupt priority. If an interrupt request N is received, the host processor will assert the interrupt response signal N. After the coprocessor N in the waiting state for interrupt application detects that the interrupt response N signal is valid, it cancels the interrupt application signal N.

基于图1所示的本发明实现主处理器与N个协处理器接口与互连的系统的示意图,图2示出了本发明提供的实现主处理器与一个协处理器接口与互连的系统的示意图。Based on the schematic diagram of the present invention shown in Fig. 1 realizing the main processor and N coprocessor interfaces and the interconnection system, Fig. 2 shows the implementation of the main processor and a coprocessor interface and interconnection provided by the present invention Schematic diagram of the system.

主处理器和一个协处理器接口及互联的结构是图1中的主处理器和N个协处理器连接的结构方式当N=1时的特殊情况。在主处理器和N个协处理器接口及互联的结构中,多个协处理器不会同时工作。在某一个时刻最多只有主处理器和一个协处理器同时并行工作。协处理器和协处理器间也不存在数据通讯,协处理器间也不会出现资源访问冲突等情况。因此,在主处理器和一个协处理器接口及互联的结构中主处理器与协处理器间的通讯方式与主处理器和N个协处理器接口及互联的结构中的完全一致。The interface and interconnection structure of the main processor and a coprocessor is a special case of the connection structure between the main processor and N coprocessors in FIG. 1 when N=1. In the structure where the main processor and N coprocessors are interfaced and interconnected, multiple coprocessors will not work at the same time. At a certain moment, only the main processor and one coprocessor are working in parallel at the same time. There is no data communication between coprocessors and coprocessors, and resource access conflicts do not occur between coprocessors. Therefore, in the interface and interconnection structure of the main processor and a coprocessor, the communication mode between the main processor and the coprocessor is completely consistent with that in the interface and interconnection structure of the main processor and N coprocessors.

基于图1所示的本发明实现主处理器与N个协处理器接口与互连的系统的示意图,以及图2所示的本发明实现主处理器与一个协处理器接口与互连的系统的示意图,图3示出了本发明提供的实现主处理器与协处理器接口与互连总体技术方案的实现流程图,该方法包括以下步骤:A schematic diagram of a system for realizing the interface and interconnection between the main processor and N coprocessors based on the present invention shown in Figure 1, and the system for realizing the interface and interconnection between the main processor and a coprocessor shown in Figure 2 Fig. 3 shows the implementation flowchart of the overall technical solution for the interface and interconnection between the main processor and the coprocessor provided by the present invention, and the method includes the following steps:

步骤301:主处理器将需传递给协处理器的数据写入双端口数据存储器中的指定存储区域,并向协处理器发送协处理器启动指令;Step 301: the main processor writes the data to be delivered to the coprocessor into a specified storage area in the dual-port data memory, and sends a coprocessor start instruction to the coprocessor;

步骤302:协处理器接收到启动指令后向主处理器返回命令接收状态字,访问双端口数据存储器中的指定存储区域获取主处理器写入的数据,执行启动指令中定义的操作;Step 302: After the coprocessor receives the startup instruction, it returns the command reception status word to the main processor, accesses the designated storage area in the dual-port data memory to obtain the data written by the main processor, and executes the operations defined in the startup instruction;

步骤303:协处理器完成指令中定义的操作后向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果。Step 303: After the coprocessor completes the operation defined in the instruction, it returns the command completion status word to the main processor, and the main processor obtains the execution result of the coprocessor.

上述步骤301中所述主处理器将需传递给协处理器的数据写入双端口数据存储器中的指定存储区域,是通过主处理器数据总线与双端口数据存储器的一个数据访问端口访问双端口数据存储器中的指定存储区域实现的。The main processor described in the above step 301 writes the data that needs to be delivered to the coprocessor into the designated storage area in the dual-port data memory, and accesses the dual-port through a data access port of the main processor data bus and the dual-port data memory. implemented in a specified memory area in data memory.

上述步骤301中所述主处理器向协处理器发送协处理器启动指令包括:主处理器通过命令字寄存器向协处理器发送至少携带有执行定义操作和访问指定存储区域信息的协处理器启动指令。The main processor sending the coprocessor startup instruction to the coprocessor in the above step 301 includes: the main processor sends the coprocessor startup command to the coprocessor through the command word register, which carries at least the information of executing the defined operation and accessing the designated storage area. instruction.

上述步骤302中所述协处理器向主处理器返回命令接收状态字是通过状态字寄存器返回的。The command receiving status word returned by the coprocessor to the main processor in the above step 302 is returned through the status word register.

上述步骤302中所述协处理器向主处理器返回命令接收状态字后进一步包括:主处理器根据接收的命令接收状态字执行正常的程序流。After the coprocessor in step 302 returns the command receiving status word to the main processor, it further includes: the main processor executes a normal program flow according to the received command receiving status word.

上述步骤303中协处理器完成指令中定义的操作后,主处理器可以通过以下两种方式获取执行结果:After the coprocessor in step 303 above completes the operations defined in the instruction, the main processor can obtain the execution result in the following two ways:

方式一、协处理器完成指令中定义的操作后进一步将执行结果携带在命令完成状态字中,所述协处理器向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果包括:Mode 1: After the coprocessor completes the operation defined in the instruction, it further carries the execution result in the command completion status word, the coprocessor returns the command completion status word to the main processor, and the main processor obtains the execution result of the coprocessor include:

步骤3031:协处理器通过状态字寄存器向主处理器发送携带有执行结果的命令完成状态字;Step 3031: the coprocessor sends the command completion status word carrying the execution result to the main processor through the status word register;

步骤3032:主处理器接收到协处理器发送的命令完成状态字,从命令完成状态字中获取协处理器返回的执行结果。Step 3032: The main processor receives the command completion status word sent by the coprocessor, and obtains the execution result returned by the coprocessor from the command completion status word.

方式二、协处理器完成指令中定义的操作后进一步将执行结果数据写入双端口数据存储器中的指定存储区域,所述协处理器向主处理器返回命令完成状态字,主处理器获取协处理器的执行结果包括:Mode 2: After the coprocessor completes the operation defined in the instruction, it further writes the execution result data into the designated storage area in the dual-port data memory, and the coprocessor returns the command completion status word to the main processor, and the main processor obtains the coprocessor The processor's execution results include:

步骤3031′:协处理器通过状态字寄存器向主处理器发送命令完成状态字;Step 3031': the coprocessor sends the command completion status word to the main processor through the status word register;

步骤3032′:主处理器接收到命令完成状态字,访问双端口数据存储器中的指定存储区域,获取协处理器写入的执行结果数据。Step 3032': The main processor receives the command completion status word, accesses the specified storage area in the dual-port data memory, and obtains the execution result data written by the coprocessor.

下面,基于图3所示的本发明提供的实现主处理器与协处理器接口与互连总体技术方案的实现流程图,以图2所示的主处理器和一个协处理器接口及互连的系统为例,详细说明本发明中的处理器与协处理器的接口及互联的方法。Below, based on the implementation flow diagram of the overall technical solution for realizing the main processor and coprocessor interface and interconnection provided by the present invention shown in Figure 3, the main processor and a coprocessor interface and interconnection shown in Figure 2 Taking the system as an example, the interface and interconnection method of the processor and coprocessor in the present invention will be described in detail.

如图4所示,图4为依照本发明第一个实施例实现主处理器与协处理器接口与互连的方法流程图,该方法的具体实施步骤如下:As shown in FIG. 4, FIG. 4 is a flowchart of a method for realizing the interface and interconnection between the main processor and the coprocessor according to the first embodiment of the present invention. The specific implementation steps of the method are as follows:

步骤401:开始。Step 401: start.

步骤402:发送协处理器启动指令。即主处理器通过命令字寄存器向协处理器发送协处理器启动指令R,协处理器启动指令R定义了协处理器需要执行的具体操作,并且指定了协处理器可以访问的数据存储器区域。Step 402: Send a coprocessor start command. That is, the main processor sends a coprocessor start command R to the coprocessor through the command word register. The coprocessor start command R defines the specific operations that the coprocessor needs to perform and specifies the data memory area that the coprocessor can access.

步骤403:返回命令接收状态字。即协处理器通过状态字寄存器向主处理器发送命令接收状态字S,同时置中断请求信号有效,标识协处理器已经接收协处理器启动指令,开始进行协处理器指令R所定义的操作处理。Step 403: Return the command receiving status word. That is, the coprocessor sends a command to the main processor through the status word register to receive the status word S, and at the same time sets the interrupt request signal to be valid, indicating that the coprocessor has received the coprocessor start command, and starts the operation process defined by the coprocessor command R .

步骤404:撤销协处理器启动指令。即主处理器接收中断请求信号有效,进入此外部中断对应的中断服务程序,接收状态字寄存器中的状态字,如果状态字为命令接收状态字S,则撤销协处理器启动指令,主处理器开始执行正常的程序流,但不能对协处理器正在访问的数据存储器区域进行访问。Step 404: cancel the coprocessor activation instruction. That is, the main processor receives the interrupt request signal valid, enters the interrupt service program corresponding to the external interrupt, receives the status word in the status word register, if the status word is the command receiving status word S, cancels the coprocessor start instruction, and the main processor Normal program flow begins, but no accesses can be made to the data memory region being accessed by the coprocessor.

步骤405:返回命令完成状态字。即协处理器完成协处理器指令R所定义的操作后,将执行结果携带在命令完成状态字U中,通过状态字寄存器向主处理器发送命令完成状态字U,同时置中断请求信号有效,标识协处理器已经完成协处理器指令R所定义的操作,通过命令完成状态字U返回操作完成后需要返回的执行结果信息。Step 405: Return the command completion status word. That is, after the coprocessor completes the operation defined by the coprocessor instruction R, it carries the execution result in the command completion status word U, sends the command completion status word U to the main processor through the status word register, and simultaneously sets the interrupt request signal to be valid. Indicates that the coprocessor has completed the operation defined by the coprocessor instruction R, and returns the execution result information that needs to be returned after the operation is completed through the command completion status word U.

步骤406:接收命令完成状态字。即主处理器接收中断请求信号有效,进入中断对应的中断服务程序,接收状态字寄存器中的命令完成状态字U,并主处理器从命令完成状态字U中提取出所需要的协处理器返回的执行结果信息。Step 406: Receive the command completion status word. That is, the main processor receives the interrupt request signal and enters the interrupt service program corresponding to the interrupt, receives the command completion status word U in the status word register, and the main processor extracts the required coprocessor return from the command completion status word U Execution result information.

在本步骤中,主处理器只有接收到命令完成状态字U后,才能对双端口数据存储器中的特定存储区域进行访问。In this step, the main processor can only access the specific storage area in the dual-port data memory after receiving the command completion status word U.

步骤407:结束。协处理器执行的一个轮回结束。Step 407: end. A cycle of coprocessor execution ends.

在本发实施例的步骤405中,协处理器完成协处理器指令R所定义的操作后,将执行结果携带在命令完成状态字U中,通过状态字寄存器向主处理器发送命令完成状态字U,同时置中断请求信号有效,标识协处理器已经完成协处理器指令R所定义的操作,通过命令完成状态字U返回操作完成后需要返回的执行结果信息。在实际应用中,协处理器也可以在完成指令中定义的操作后进一步将执行结果数据写入双端口数据存储器中的指定存储区域。此时,主处理器接收到协处理器返回的命令完成状态字后,可以通过访问双端口数据存储器中的指定存储区域来获取协处理器的执行结果信息。In step 405 of the embodiment of the present invention, after the coprocessor completes the operation defined by the coprocessor instruction R, the execution result is carried in the command completion status word U, and the command completion status word is sent to the main processor through the status word register U, and at the same time set the interrupt request signal to be valid, indicating that the coprocessor has completed the operation defined by the coprocessor instruction R, and the execution result information that needs to be returned after the operation is completed is returned by the command completion status word U. In practical applications, the coprocessor can also further write the execution result data into a specified storage area in the dual-port data memory after completing the operations defined in the instruction. At this time, after receiving the command completion status word returned by the coprocessor, the main processor can obtain the execution result information of the coprocessor by accessing a designated storage area in the dual-port data memory.

上述过程具体可参见图5,图5为依照本发明第二个实施例实现主处理器与协处理器接口与互连的方法流程图,该方法的具体实施步骤如下:The above-mentioned process can be referred to FIG. 5 for details. FIG. 5 is a flow chart of a method for realizing the interface and interconnection between the main processor and the co-processor according to the second embodiment of the present invention. The specific implementation steps of the method are as follows:

步骤501:开始。Step 501: start.

步骤502:发送协处理器启动指令。即主处理器通过命令字寄存器向协处理器发送协处理器启动指令R,协处理器启动指令R定义了协处理器需要执行的具体操作,并且指定了协处理器可以访问的数据存储器区域。Step 502: Send a coprocessor start instruction. That is, the main processor sends a coprocessor start command R to the coprocessor through the command word register. The coprocessor start command R defines the specific operations that the coprocessor needs to perform and specifies the data memory area that the coprocessor can access.

步骤503:返回命令接收状态字。即协处理器通过状态字寄存器向主处理器发送命令接收状态字S,同时置中断请求信号有效,标识协处理器已经接收协处理器启动指令,开始进行协处理器指令R所定义的操作处埋。Step 503: Return the command receiving status word. That is, the coprocessor sends a command to the main processor through the status word register to receive the status word S, and at the same time sets the interrupt request signal to be valid, indicating that the coprocessor has received the coprocessor startup command, and begins to perform the operation defined by the coprocessor command R buried.

步骤504:撤销协处理器启动指令。即主处理器接收中断请求信号有效,进入此外部中断对应的中断服务程序,接收状态字寄存器中的状态字,如果状态字为命令接收状态字S,则撤销协处理器启动指令,主处理器开始执行正常的程序流,但不能对协处理器正在访问的数据存储器区域进行访问。Step 504: cancel the coprocessor activation instruction. That is, the main processor receives the interrupt request signal valid, enters the interrupt service program corresponding to the external interrupt, receives the status word in the status word register, if the status word is the command receiving status word S, cancels the coprocessor start instruction, and the main processor Normal program flow begins, but no accesses can be made to the data memory region being accessed by the coprocessor.

步骤505:返回命令完成状态字。即协处理器完成协处理器指令R所定义的操作后,将执行结果数据写入双端口数据存储器中的指定存储区域,并通过状态字寄存器向主处理器发送命令完成状态字U,同时置中断请求信号有效,标识协处理器已经完成协处理器指令R所定义的操作。Step 505: Return the command completion status word. That is, after the coprocessor completes the operation defined by the coprocessor instruction R, it writes the execution result data into the specified storage area in the dual-port data memory, and sends a command to the main processor through the status word register to complete the status word U, and simultaneously sets The interrupt request signal is valid, indicating that the coprocessor has completed the operation defined by the coprocessor instruction R.

步骤506:接收命令完成状态字。即主处理器接收中断请求信号有效,进入中断对应的中断服务程序,接收状态字寄存器中的命令完成状态字U,并根据接收的命令完成状态字U访问双端口数据存储器中的指定存储区域,获取协处理器写入的执行结果数据。Step 506: Receive the command completion status word. That is, the main processor receives the interrupt request signal and enters the interrupt service program corresponding to the interrupt, receives the command completion status word U in the status word register, and accesses the designated storage area in the dual-port data memory according to the received command completion status word U, Get the execution result data written by the coprocessor.

步骤507:结束。协处理器执行的一个轮回结束。Step 507: end. A cycle of coprocessor execution ends.

以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (14)

1, a kind of system that realizes primary processor and coprocessor interface and interconnection comprises a primary processor and at least one coprocessor, it is characterized in that this system also comprises:
Dual port data memory is used to realize the data communication between described primary processor and at least one coprocessor;
The primary processor data bus is used to connect described primary processor and dual port data memory;
The coprocessor data bus is used to connect dual port data memory and described at least one coprocessor;
At least one command word register, the instruction that is used for being received from described primary processor sends to the coprocessor that is connected with self;
At least one status word register, the status information that is used for being received from coprocessor sends to described primary processor.
2, the system of realization primary processor according to claim 1 and coprocessor interface and interconnection is characterized in that, described dual port data memory comprises:
The data access port that is connected with primary processor by described primary processor data bus;
The data access port that is connected with at least one coprocessor by described coprocessor data bus; With
With described two data access port corresponding address decoding logic circuits.
3, the system of realization primary processor according to claim 2 and coprocessor interface and interconnection, it is characterized in that two data access ports of described dual port data memory comprise respectively at least: clock signal, control signal, address signal and data-signal.
4, the system of realization primary processor according to claim 2 and coprocessor interface and interconnection is characterized in that,
The data access port of described primary processor by being connected with self, and the data access port of coprocessor by being connected with self are carried out read operation or write operation to the different storage zone of dual port data memory simultaneously.
5, the system of realization primary processor according to claim 1 and coprocessor interface and interconnection is characterized in that, described primary processor is the primary processor of Harvard structure;
Described primary processor data bus is the data bus of Harvard structure primary processor, is used to connect the primary processor of described Harvard structure and a data access port of dual port data memory;
Described coprocessor data bus is used to connect another data access port of described at least one coprocessor and dual port data memory.
6, the system of realization primary processor according to claim 1 and coprocessor interface and interconnection is characterized in that, described command word register is corresponding one by one with coprocessor;
Described primary processor conducts interviews to the complete order word register by carrying out write operation, and described coprocessor conducts interviews by carrying out the read operation pair command word register corresponding with self.
7, the system of realization primary processor according to claim 1 and coprocessor interface and interconnection is characterized in that, described status word register is corresponding one by one with coprocessor;
Described primary processor conducts interviews to whole status word registers by carrying out read operation, and described coprocessor conducts interviews by carrying out the write operation pair status word register corresponding with self.
8, a kind of method that realizes primary processor and coprocessor interface and interconnection is characterized in that this method comprises:
The data that A, primary processor pass to coprocessor with need write the designated storage area in the dual port data memory, and send the coprocessor enabled instruction to coprocessor;
B, coprocessor receive after the enabled instruction to primary processor return command accepting state word, and the designated storage area in the visit dual port data memory is obtained the data that primary processor writes, and carries out the operation that defines in the enabled instruction;
C, coprocessor are finished after the operation that defines in the instruction to primary processor return command completion status word, and primary processor obtains the execution result of coprocessor.
9, the method for realization primary processor according to claim 8 and coprocessor interface and interconnection, it is characterized in that, the data that primary processor described in the steps A passes to coprocessor with need write the designated storage area in the dual port data memory, are to realize by the designated storage area in the data access port visit dual port data memory of primary processor data bus and dual port data memory.
10, the method for realization primary processor according to claim 8 and coprocessor interface and interconnection is characterized in that, primary processor described in the steps A sends the coprocessor enabled instruction to coprocessor and comprises:
Primary processor sends to coprocessor by command word register and carries the coprocessor enabled instruction of carrying out defining operation and visit designated storage area domain information at least.
11, the method for realization primary processor according to claim 8 and coprocessor interface and interconnection is characterized in that, coprocessor described in the step B returns by status word register to primary processor return command accepting state word.
12, the method for realization primary processor according to claim 8 and coprocessor interface and interconnection is characterized in that, coprocessor described in the step B further comprises behind primary processor return command accepting state word:
Primary processor is carried out normal program flow according to the order accepting state word that receives.
13, the method for realization primary processor according to claim 8 and coprocessor interface and interconnection is characterized in that, coprocessor described in the step C further is carried at execution result in the order completion status word after finishing the operation that defines in the instruction,
Coprocessor described in the step C is to primary processor return command completion status word, and the execution result that primary processor obtains coprocessor comprises:
C1, coprocessor send the order completion status word that carries execution result by status word register to primary processor;
C2, primary processor receive the order completion status word that coprocessor sends, and obtain the execution result that coprocessor returns from order completion status word.
14, the method for realization primary processor according to claim 8 and coprocessor interface and interconnection, it is characterized in that, coprocessor described in the step C is finished the designated storage area that further the execution result data is write after the operation that defines in the instruction in the dual port data memory
Coprocessor described in the step C is to primary processor return command completion status word, and the execution result that primary processor obtains coprocessor comprises:
C1 ', coprocessor send order completion status word by status word register to primary processor;
C2 ', primary processor receive order completion status word, and the designated storage area in the visit dual port data memory is obtained the execution result data that coprocessor writes.
CNA2006100894531A 2006-06-28 2006-06-28 A system and method for realizing interface and interconnection between main processor and coprocessor Pending CN101097559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2006100894531A CN101097559A (en) 2006-06-28 2006-06-28 A system and method for realizing interface and interconnection between main processor and coprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2006100894531A CN101097559A (en) 2006-06-28 2006-06-28 A system and method for realizing interface and interconnection between main processor and coprocessor

Publications (1)

Publication Number Publication Date
CN101097559A true CN101097559A (en) 2008-01-02

Family

ID=39011395

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2006100894531A Pending CN101097559A (en) 2006-06-28 2006-06-28 A system and method for realizing interface and interconnection between main processor and coprocessor

Country Status (1)

Country Link
CN (1) CN101097559A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777037A (en) * 2010-02-03 2010-07-14 中兴通讯股份有限公司 Method and system for searching data transmission in engine real-time system
CN101944077A (en) * 2010-09-02 2011-01-12 东莞市泰斗微电子科技有限公司 Communication interface between primary processor and coprocessor and control method thereof
CN103246496A (en) * 2012-02-10 2013-08-14 上海算芯微电子有限公司 Non-blocking coprocessor interface method and non-blocking coprocessor interface system
CN103885841A (en) * 2014-04-16 2014-06-25 国网上海市电力公司 Real-time control system and method of portable master station
CN104424033A (en) * 2013-09-02 2015-03-18 联想(北京)有限公司 Electronic device and data processing method
CN104540050A (en) * 2015-01-14 2015-04-22 北京飞音时代技术有限公司 Data processing method of integrated access devices
CN108647009A (en) * 2018-03-22 2018-10-12 中钞信用卡产业发展有限公司杭州区块链技术研究院 Device, method and the storage medium of block chain information interaction
CN109347474A (en) * 2018-09-28 2019-02-15 深圳忆联信息系统有限公司 Signal sequence configuration method, device, computer equipment and storage medium
CN109857029A (en) * 2019-02-20 2019-06-07 珠海格力电器股份有限公司 Working method of dual-processor control system, magnetic suspension bearing monitoring system and working method thereof, compressor and air conditioner
CN110532040A (en) * 2019-08-29 2019-12-03 北京地平线机器人技术研发有限公司 Loading method and device, the storage medium and electronic equipment of firmware program
CN114995911A (en) * 2022-06-01 2022-09-02 北京东土军悦科技有限公司 Starting method of network equipment and network equipment
CN115955733A (en) * 2022-12-30 2023-04-11 中国科学院计算技术研究所 Communication baseband processor
CN116541336A (en) * 2023-07-04 2023-08-04 南方电网数字电网研究院有限公司 Software running method of multi-core chip and coprocessor

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777037A (en) * 2010-02-03 2010-07-14 中兴通讯股份有限公司 Method and system for searching data transmission in engine real-time system
CN101944077A (en) * 2010-09-02 2011-01-12 东莞市泰斗微电子科技有限公司 Communication interface between primary processor and coprocessor and control method thereof
CN101944077B (en) * 2010-09-02 2011-10-19 东莞市泰斗微电子科技有限公司 Communication interface between primary processor and coprocessor and control method thereof
CN103246496B (en) * 2012-02-10 2015-12-16 上海算芯微电子有限公司 Unblock coprocessor interface method and system
CN103246496A (en) * 2012-02-10 2013-08-14 上海算芯微电子有限公司 Non-blocking coprocessor interface method and non-blocking coprocessor interface system
CN104424033B (en) * 2013-09-02 2018-10-12 联想(北京)有限公司 A kind of electronic equipment and data processing method
CN104424033A (en) * 2013-09-02 2015-03-18 联想(北京)有限公司 Electronic device and data processing method
CN103885841B (en) * 2014-04-16 2017-10-10 国网上海市电力公司 A kind of real-time control system and method for portable main website
CN103885841A (en) * 2014-04-16 2014-06-25 国网上海市电力公司 Real-time control system and method of portable master station
CN104540050A (en) * 2015-01-14 2015-04-22 北京飞音时代技术有限公司 Data processing method of integrated access devices
CN108647009A (en) * 2018-03-22 2018-10-12 中钞信用卡产业发展有限公司杭州区块链技术研究院 Device, method and the storage medium of block chain information interaction
CN109347474A (en) * 2018-09-28 2019-02-15 深圳忆联信息系统有限公司 Signal sequence configuration method, device, computer equipment and storage medium
CN109857029A (en) * 2019-02-20 2019-06-07 珠海格力电器股份有限公司 Working method of dual-processor control system, magnetic suspension bearing monitoring system and working method thereof, compressor and air conditioner
CN110532040A (en) * 2019-08-29 2019-12-03 北京地平线机器人技术研发有限公司 Loading method and device, the storage medium and electronic equipment of firmware program
CN114995911A (en) * 2022-06-01 2022-09-02 北京东土军悦科技有限公司 Starting method of network equipment and network equipment
CN115955733A (en) * 2022-12-30 2023-04-11 中国科学院计算技术研究所 Communication baseband processor
CN116541336A (en) * 2023-07-04 2023-08-04 南方电网数字电网研究院有限公司 Software running method of multi-core chip and coprocessor
CN116541336B (en) * 2023-07-04 2024-06-11 南方电网数字电网研究院有限公司 Software running method of multi-core chip and coprocessor

Similar Documents

Publication Publication Date Title
CN101097559A (en) A system and method for realizing interface and interconnection between main processor and coprocessor
US5935233A (en) Computer system with a switch interconnector for computer devices
CN100555257C (en) The memory controller of the dma operation between the processing page replicative phase and method
US6480941B1 (en) Secure partitioning of shared memory based multiprocessor system
US20040022107A1 (en) Unidirectional bus architecture for SoC applications
US7761696B1 (en) Quiescing and de-quiescing point-to-point links
KR20120092176A (en) Method and system for entirety mutual access in multi-processor
CN101593164A (en) Based on built-in Linux from USB HID device and firmware implementation method
CN107391400A (en) A kind of memory expanding method and system for supporting complicated access instruction
KR101575070B1 (en) Apparatus, system and method for providing access to a device function
JP2024515055A (en) Seamlessly integrated microcontroller chip
US7996592B2 (en) Cross bar multipath resource controller system and method
JP2012238306A (en) Method and device for routing
JP2002529810A (en) Processing configuration
CN102063337B (en) Method and system for information interaction and resource allocation of multiprocessor cores
KR20010040936A (en) Accessing a messaging unit from a secondary bus
CN102591817B (en) Multi-bus bridge controller and implementing method thereof
US5867728A (en) Preventing corruption in a multiple processor computer system during a peripheral device configuration cycle
US8843728B2 (en) Processor for enabling inter-sequencer communication following lock competition and accelerator registration
CN103793263A (en) DMA transaction-level modeling method based on Power PC processor
US8688890B2 (en) Bit ordering for communicating an address on a serial fabric
EP0840223B1 (en) Microcomputer capable of accessing an external memory
US20160314086A1 (en) Secure digital host controller virtualization
CN115328832B (en) Data scheduling system and method based on PCIE DMA
CN116757132A (en) Heterogeneous multi-core FPGA circuit architecture, construction method and data transmission method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication