Summary of the invention
The purpose of the present invention is to provide a kind of transmittings of instruction and verification method and device, to solve in instruction execution mistake
Implementing result is write back memory simultaneously by the instruction that period longer instruction may be shorter with the period in journey, is write to can generate
It backwashes prominent problem.
According in a first aspect, the embodiment of the present invention provides a kind of launching technique of instruction, comprising: acquisition instruction transmitting is single
The firing order of member transmission;Judge that firing order whether there is according to the execution period of the firing order and writes back conflict;Work as institute
It states firing order to exist when writing back conflict, judges whether the firing order is variable to execute cycles per instruction;When the transmitting refers to
When order is variable execution cycles per instruction, change the variable period for executing cycles per instruction, by the variable execution after the change period
Cycles per instruction is transmitted to described instruction transmitting unit, and executes judge the hair according to the execution period of the firing order again
Instruction is penetrated with the presence or absence of the step of writing back conflict;When the firing order, which is not present, writes back conflict, the firing order is sent.
In one embodiment, it when the firing order is not variable execution cycles per instruction, returns and is referred to according to the transmitting
The execution period of order judges the firing order with the presence or absence of the step of writing back conflict.
In one embodiment, described before the firing order that acquisition instruction transmitting unit is sent, the launching technique is also
It include: to classify to the firing order, sorted firing order includes: that the variable execution cycles per instruction and decomposition refer to
At least one of enable;When the firing order is disassembly instruction, the disassembly instruction is decomposed into the first of preferential emission
Instruction;And using the implementing result of first instruction as the second instruction of operand.
In one embodiment, change the variable period for executing cycles per instruction, will change after the period and variable execute week
The step of phase instruction is transmitted to described instruction transmitting unit, comprising: send register for the variable execution cycles per instruction and turn
It changes in grade circuit, the variable period for executing cycles per instruction is changed by the register transfer level circuit;Pass through
The variable execution cycles per instruction after changing the period is transmitted to described instruction transmitting unit by the register transfer level circuit.
In one embodiment, when the firing order there is no write back conflict when, after sending the firing order, institute
State launching technique further include: obtain the first emission results and send institute for sending that the firing order to first receiving device generates
State the second emission results that firing order to the second reception device generates;To first emission results and the second emission results into
Row compares;When first emission results are consistent with the second emission results, the firing order is write back into memory;When described
When the first emission results and inconsistent the second emission results, error message is recorded as to the firing order.
In one embodiment, first emitter junction for sending the firing order and generating to first receiving device is being obtained
Before the second emission results that fruit and the transmission firing order are generated to the second reception device, the launching technique further include:
Judge the firing order whether be the disassembly instruction first instruction;When that the firing order is the disassembly instruction
When one instruction, the second instruction of the disassembly instruction of described instruction transmitting unit transmission is obtained;Judging first instruction is
It is no that there are bypass network conflicts;When first instruction is there are when bypass network conflict, the implementing result of first instruction is put
It is placed in register;When first instruction is there is no when bypass network conflict, the implementing result with first instruction is behaviour
It counts and sends second instruction to the first receiving device and the second reception device.
According to second aspect, the embodiment of the present invention provides a kind of emitter of instruction, comprising: firing order obtains mould
Block, the firing order for the transmission of acquisition instruction transmitting unit;Conflict judgment module is write back, for according to the firing order
The execution period judges that firing order whether there is and writes back conflict;It is variable to execute cycles per instruction judgment module, for working as the transmitting
When instruction presence writes back conflict, judge whether the firing order is variable execution cycles per instruction;Cyclomorphosis module, for working as
When the firing order is variable execution cycles per instruction, change the variable period for executing cycles per instruction, after changing the period
Variable execution cycles per instruction be transmitted to described instruction transmitting unit, and write back conflict judgment module described in triggering;Instruction is sent
Module, for sending the firing order when the firing order is not present and writes back conflict.
According to the third aspect, the embodiment of the present invention provides a kind of computer equipment, comprising: memory and processor, institute
It states and communicates with each other connection between memory and the processor, computer instruction, the processor are stored in the memory
By executing the computer instruction, thereby executing the launching technique of the instruction as described in above-mentioned first aspect.
According to fourth aspect, the embodiment of the present invention provides a kind of computer readable storage medium, described computer-readable
Storage medium is stored with computer instruction, and the computer instruction is for executing the computer such as institute in above-mentioned first aspect
The launching technique for the instruction stated.
The advantageous effects of the above technical solutions of the present invention are as follows:
The embodiment of the present invention provides a kind of launching technique of instruction, comprising: the transmitting of acquisition instruction transmitting unit transmission
Instruction;Judge that firing order whether there is according to the execution period of the firing order and writes back conflict;When the firing order is deposited
When writing back conflict, judge whether the firing order is variable execution cycles per instruction;When the firing order is variable execution
When cycles per instruction, changes the variable period for executing cycles per instruction, the variable execution cycles per instruction after the change period is transmitted
To described instruction transmitting unit, and executes judge whether the firing order is deposited according to the execution period of the firing order again
In the step of writing back conflict;When the firing order, which is not present, writes back conflict, the firing order is sent.When the transmitting refers to
Enable not is when can be changed to execute cycles per instruction, to return and judge whether the firing order is deposited according to the execution period of the firing order
In the step of writing back conflict.It follows that when the firing order be it is variable execute cycles per instruction and exist write back conflict when, lead to
It crosses and changes the variable period for executing cycles per instruction, to avoid writing back conflict;When the firing order is disassembly instruction and is deposited
When writing back conflict, return judges that the firing order whether there is according to the execution period of the firing order and writes back conflict
Step writes back conflict until the disassembly instruction is not present, sends to it;In this way when firing order writes back memory,
It not only avoids and writes back conflict, also improve the efficiency of transmission.
The embodiment of the present invention also provides a kind of emitter of instruction, comprising: firing order obtains module, for obtaining
The firing order of instruction issue unit transmission;Conflict judgment module is write back, for sentencing according to the execution period of the firing order
Disconnected firing order, which whether there is, writes back conflict;It is variable to execute cycles per instruction judgment module, for being write when the firing order exists
When backwashing prominent, judge whether the firing order is variable execution cycles per instruction;Cyclomorphosis module, for referring to when the transmitting
When order is variable execution cycles per instruction, change the variable period for executing cycles per instruction, by the variable execution after the change period
Cycles per instruction is transmitted to described instruction transmitting unit, and writes back conflict judgment module described in triggering;Instruction sending module, for working as
The firing order sends the firing order there is no when writing back conflict.Module is obtained by firing order, conflict is write back and sentences
Disconnected module, variable execution cycles per instruction judgment module, cyclomorphosis module and instruction sending module are obtaining mould when firing order
After block acquisition instruction, by writing back conflict judgment module, variable execution cycles per instruction judgment module and cyclomorphosis module pair
Firing order carries out certain judgement and change, finally will transmitting is specified is sent to instruction sending module so that firing order with
Most fast speed writes back memory.
Specific embodiment
Technical solution of the present invention is clearly and completely described below in conjunction with attached drawing, it is clear that described implementation
Example is a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that unless otherwise clearly defined and limited, term " installation ", " phase
Even ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;It can
To be mechanical connection, it is also possible to be electrically connected;It can be directly connected, can also indirectly connected through an intermediary, it can be with
It is the connection inside two elements, can be wireless connection, be also possible to wired connection.For those of ordinary skill in the art
For, the concrete meaning of above-mentioned term in the present invention can be understood with concrete condition.
As long as in addition, the non-structure each other of technical characteristic involved in invention described below different embodiments
It can be combined with each other at conflict.
As shown in Figure 1, the embodiment of the present invention provides a kind of launching technique of instruction, comprising:
Step S1: the firing order of acquisition instruction transmitting unit transmission;Firing order be as caused by command generator,
The firing order of generation is transferred to instruction issue unit by command generator, and instruction issue unit transmits firing order.
Instruction issue unit can be driver, but the present invention is not limited thereto, in practical applications, the instruction issue
Unit can according to need setting.
Step S2: judge that firing order whether there is according to the execution period of firing order and write back conflict;Specifically, sending out
Penetrate instruction write-back memory when, judge whether there is position to place new instruction in memory, or judge whether there is two instructions
It needs to write back memory simultaneously, thus in the presence of conflict is write back.
Step S3: when firing order, which exists, writes back conflict, judge whether firing order is variable execution cycles per instruction;
When firing order is variable execution cycles per instruction, step S4 is executed, changes the variable period for executing cycles per instruction,
Variable execution cycles per instruction after the change period is transmitted to instruction issue unit, and executes step S2 again;
When there is no when writing back conflict, execute step S5, transmission firing order for firing order.
In an alternative embodiment, when firing order is not variable execution cycles per instruction, above-mentioned steps S2 is returned to.
It follows that the treatment process that the launching technique of the instruction of the embodiment of the present invention is realized, when firing order be can
Change executes cycles per instruction and in the presence of when writing back conflict, can be changed the period of execution cycles per instruction, by changing to avoid writing back conflict;
When firing order is disassembly instruction and presence writes back conflict, returns and judge that firing order is according to the execution period of firing order
It is no to there is the step of writing back conflict, conflict is write back until disassembly instruction is not present, it is sent;It is write in this way in firing order
When restoring reservoir, not only avoids and write back conflict, also improve the efficiency of transmission.
In an alternative embodiment, above-mentioned steps S4 changes the variable period for executing cycles per instruction, after changing the period
It is variable to execute the step of cycles per instruction is transmitted to instruction issue unit, comprising: to send register for variable execution cycles per instruction
In switching stage circuit, the variable period for executing cycles per instruction is changed by register transfer level circuit;Pass through register
Variable execution cycles per instruction after changing the period is transmitted to instruction issue unit by switching stage circuit, and instruction issue unit is to change
Variable execution cycles per instruction after period is sent.
In an alternative embodiment, before the firing order that acquisition instruction transmitting unit is sent, launching technique further include:
Classify to firing order, sorted firing order includes: variable at least one executed in cycles per instruction and disassembly instruction
Kind;
When firing order writes back conflict to can be changed execution cycles per instruction, and exist, according to as described above S4 pairs of step
The variable cycles per instruction that executes carries out the change in period, then is sent;
When firing order is disassembly instruction, disassembly instruction is decomposed into the first instruction of preferential emission;And with first
Second instruction of the implementing result of instruction as operand.Specifically, instruction issue unit preferential emission first instructs, the is judged
One instruction is with the presence or absence of conflict is write back, and when the first instruction exists, when writing back conflict, return instruction transmitting unit is continued waiting for, until
When there is no writing back conflict, the first instruction is sent;After having sent the first instruction, the transmission of acquisition instruction transmitting unit
Second instruction;Judge the first instruction with the presence or absence of bypass network conflict;When the first instruction is there are when bypass network conflict, first refers to
The implementing result of order is placed in register, second instruction waited until in transmitting unit there is no bypass network conflict when,
Transmitting unit sends the second instruction using the implementing result of the first instruction as operand;When there is no bypass networks to rush for the first instruction
When prominent, the implementing result of the first instruction is placed in bypass network, and the second instruction is in next period with the execution knot of the first instruction
Fruit is that operand sends the second instruction.
It should be noted that variable execution cycles per instruction and disassembly instruction that instruction issue unit is sent are sent to first
Reception device and the second reception device.
In an alternative embodiment, when firing order there is no write back conflict when, send firing order after, instruction
Launching technique further include: obtain the first emission results and send firing order for sending that firing order to first receiving device generates
The second emission results generated to the second reception device;First emission results and the second emission results are compared;When first
When emission results are consistent with the second emission results, firing order is write back into memory;When the first emission results and the second emitter junction
When fruit is inconsistent, error message is recorded as to firing order.
The embodiment of the present invention provides a kind of emitter of instruction, as shown in figure 3, the emitter of the instruction includes:
Firing order obtains module 1, the firing order for the transmission of acquisition instruction transmitting unit;It is real that detailed content corresponds to the above method
It applies described in the step S1 of example;Conflict judgment module 2 is write back, for whether judging firing order according to the execution period of firing order
Conflict in the presence of writing back;Detailed content corresponds to described in the step S2 of above method embodiment;The variable cycles per instruction that executes judges mould
Block 3, for when firing order exists and writes back conflict, judging whether firing order is variable execution cycles per instruction;Cyclomorphosis
Module 4 will change all for changing the variable period for executing cycles per instruction when firing order is variable execution cycles per instruction
Variable execution cycles per instruction after phase is transmitted to instruction issue unit, and triggers and write back conflict judgment module;Detailed content is corresponding
Described in the step S4 of above method embodiment, details are not described herein again for specific method;Instruction sending module 5, for referring to when transmitting
It enables there is no when writing back conflict, sends firing order;The firing order is sent to first receiving device and the second reception device,
Detailed content is as described above, details are not described herein again.
By firing order obtain module, write back conflict judgment module, it is variable execute cycles per instruction judgment module, the period changes
Become module and instruction sending module, after firing order obtains module acquisition instruction, by writing back the judgment module that conflicts, can
Become execution cycles per instruction judgment module and cyclomorphosis module carries out certain judgement and change to firing order, it finally will transmitting
It is specified to be sent to instruction sending module, so that firing order writes back memory with most fast speed.
In conclusion as shown in Fig. 2, in one embodiment, firing order writes back memory from starting to get
Detailed process are as follows:
Firing order is grouped, variable execution cycles per instruction and disassembly instruction are divided into;If it is disassembly instruction, decomposition is referred to
Enable the first instruction for being divided into preferential emission;And the second instruction using the implementing result of the first instruction as operand;It will grouping
Firing order afterwards is transferred to instruction issue unit, and the transmitting of module acquisition instruction transmitting unit transmission is obtained by firing order
Instruction;Judge that firing order whether there is according to the execution period of firing order and writes back conflict;
When firing order, which exists, writes back conflict, judge whether firing order is variable execution cycles per instruction;When transmitting refers to
When order is variable execution cycles per instruction, sends variable execution cycles per instruction in register transfer level circuit, pass through register
Switching stage circuit is changed the variable period for executing cycles per instruction;After the period will be changed by register transfer level circuit
The variable cycles per instruction that executes is transmitted to instruction issue unit, and instruction issue unit is to the variable execution cycles per instruction after changing the period
It is sent to first receiving device and the second reception device;Again to the first emission results and transmission being sent in first receiving device
The second emission results into the second reception device are compared, will when the first emission results are consistent with the second emission results
The variable cycles per instruction that executes writes back memory;When the first emission results and inconsistent the second emission results, firing order is remembered
Record is error message.
When firing order, which is not present, writes back conflict, firing order is directly transmitted, then whether judge firing order
For the first instruction of disassembly instruction;When firing order is not the first instruction, by firing order be sent to first receiving device and
Second reception device, then to the first emission results for being sent in first receiving device be sent in the second reception device the
Two emission results are compared, and when the first emission results are consistent with the second emission results, variable execution cycles per instruction is write back
Memory;When the first emission results and inconsistent the second emission results, error message is recorded as to firing order.When transmitting refers to
When order is the first instruction, after having sent the first instruction, the second instruction of acquisition instruction transmitting unit transmission;Judge the first instruction
With the presence or absence of bypass network conflict;When the first instruction is there are when bypass network conflict, the implementing result of the first instruction, which is placed in, is posted
In storage, the second instruction waits until that transmitting unit is sent to be referred to there is no when bypass network conflict with first in transmitting unit
The implementing result of order instructs for the second of operand to first receiving device and the second reception device;Again to being sent to the first reception
The first emission results in device are compared with the second emission results being sent in the second reception device, when the first emitter junction
When fruit is consistent with the second emission results, by the second instruction write-back memory of disassembly instruction;When the first emission results and second are sent out
Penetrate result it is inconsistent when, error message is recorded as to firing order.When the first instruction is there is no when bypass network conflict, first refers to
The implementing result of order is placed in bypass network, until next cycles per instruction transmitting unit is sent with the implementing result of the first instruction
Second for operand instructs to first receiving device and the second reception device;Again to first be sent in first receiving device
Emission results are compared with the second emission results being sent in the second reception device, when the first emission results and second emit
As a result when consistent, by the second instruction write-back memory of disassembly instruction;When the first emission results and the second emission results are inconsistent
When, error message is recorded as to firing order.
When firing order, which exists, writes back conflict, judge whether firing order is variable execution cycles per instruction;When transmitting refers to
Enabling not is variable execution cycles per instruction, and when as the first of disassembly instruction instructs, return instruction transmitting unit is continued waiting for, until
When there is no writing back conflict, first receiving device and the second reception device are sent to the first instruction;It connects again to being sent to first
The first emission results in receiving apparatus are compared with the second emission results being sent in the second reception device, when the first transmitting
As a result when consistent with the second emission results, by the second instruction write-back memory of disassembly instruction;When the first emission results and second
When emission results are inconsistent, error message is recorded as to firing order.
It needs to be explanation, in embodiments of the present invention, above-mentioned first receiving device can be register transfer level electricity
Road, the second reception device are reference model, but the present invention is not limited thereto, in practical applications, the first receiving device and
Second reception device can according to need setting.
The embodiment of the invention also provides a kind of computer equipments, as shown in figure 4, the computer equipment may include processing
Device 41 and memory 42, wherein processor 41 can be connected with memory 42 by bus or other modes, to pass through in Fig. 4
For bus connection.
Processor 41 can be central processing unit (Central Processing Unit, CPU).Processor 41 can be with
For other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
The combination of the chips such as discrete hardware components or above-mentioned all kinds of chips.
Memory 42 is used as a kind of non-transient computer readable storage medium, can be used for storing non-transient software program, non-
Transient computer executable program and module, as the corresponding program of the control method of the server in the embodiment of the present invention refers to
Order/module.Non-transient software program, instruction and the module that processor 41 is stored in memory 42 by operation, to hold
The various function application and data processing of row processor, the i.e. launching technique of instruction in realization above method embodiment.
Memory 42 may include storing program area and storage data area, wherein storing program area can storage program area,
Application program required at least one function;It storage data area can the data etc. that are created of storage processor 41.In addition, storage
Device 42 may include high-speed random access memory, can also include non-transient memory, for example, at least a magnetic disk storage
Part, flush memory device or other non-transient solid-state memories.In some embodiments, it includes relative to place that memory 42 is optional
The remotely located memory of device 41 is managed, these remote memories can pass through network connection to processor 41.The reality of above-mentioned network
Example includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Above-mentioned computer equipment detail can correspond to corresponding correlation in embodiment referring to FIG. 1 to 3 and retouch
It states and is understood with effect, details are not described herein again.
It is that can lead to it will be understood by those skilled in the art that realizing all or part of the process in above-described embodiment method
Computer program is crossed to instruct relevant hardware and complete, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can for magnetic disk,
CD, read-only memory (Read-Only Memory, ROM), random access memory (Random Access
Memory, RAM), flash memory (Flash Memory), hard disk (Hard Disk Drive, abbreviation: HDD) or solid state hard disk
(Solid-State Drive, SSD) etc.;The storage medium can also include the combination of the memory of mentioned kind.
The above is a preferred embodiment of the present invention, it is noted that for those skilled in the art
For, without departing from the principles of the present invention, it can also make several improvements and retouch, these improvements and modifications
It should be regarded as protection scope of the present invention.