Background of the Invention
1. Field of the Invention
The present invention relates to a digital processor.
2. Description of the Related Art
The manner in which the conventional digital processor refers to an external memory will be described with reference to FIG. 6.
In FIG. 6, 601 denotes a digital processor. The digital processor 601 includes as main components an instruction memory 602, a program control unit 603, an external memory reference control circuit 604 for controlling reference to the external memory, an arithmetic unit for actually executing the operation, and an operation block 605 having a register for storing data, an internal memory, and the like. The program control unit 603 contains a sequencer 603a which sequentially executes an instruction code read from the external memory 602 by outputting an address (PC) to the instruction memory 602 in synchronization with a clock 1 (CLK 1) and a decoder 603B which analyzes the instruction code and outputs various operands. The various operands used herein denote an address (adrs), data, and a control signal (ctl) such as a write signal.
Now, the manner in which the digital processor 601 operates to refer to the external memory 606 will be described.
FIG. 7 is a timing chart based on a read cycle involved in an external memory cycle done in the digital processor 601.
The digital processor 601 realizes an asynchronous memory cycle based on an acknowledge signal. In operation, when the external memory reference instruction read by the sequencer 603a is executed, the external memory reference control circuit 604 serves to output the external address (adrs) and the control signal (ctl) such as a write signal. The sequencer 603a stops execution of the next instruction and keeps a WAIT cycle until supplied with an acknowledge signal sent from the external memory 606. In the READ cycle, the data is read on a leading edge of a first clock 1 (CLK 1) after the acknowledge signal is supplied.
The above-mentioned control is realized by the program control unit 603 having the sequencer 603a, the decoder 603b, and the external memory reference control circuit 604.
The foregoing digital processor 601 is, however, required to have too long a WAIT cycle if the processor refers to a memory or a device requiring a long access time, resulting in degradation of a throughput of the total processing. Further, in case the digital processor 601 executes an instruction for continuously transferring a large amount of data between the external memory and the digital processor 601 itself, the throughput is further degraded.
While the external memory reference instruction is being executed, a resource reference instruction is often issued to the program control unit 603 for referring to a resource occupied by the instruction being executed. In general, since the resource is exclusively controlled, the program control unit 603 is disadvantageously required to execute a meaningless instruction (NOP instruction) until the external memory cycle is terminated.
Summary of the Invention
It is, therefore, a first object of the present invention to provide a digital processor which is capable of concurrently executing one or more instructions for referring to one or more resources unoccupied by another instruction while a slow memory or device is being referred to, thereby improving a throughput of the total processing.
It is a second object of the present invention to provide a digital processor which is capable of achieving the first object and which allows both of the instructions to refer properly to the same resource in synchronization if one instruction is issued for referring to the resource being referred to by the other instruction, thereby improving a throughput of the total processing.
In carrying out the objects in a preferred mode, the digital processor of one embodiment comprises an instruction memory, a sequence, a decoder, and an external memory reference control circuit operative when the sequencer reads an external memory reference instruction from an instruction memory, for controlling the operations of fetching an external memory reference instruction signal indicating execution of an external memory reference instruction output by the decoder and an operand of the external memory reference instruction, holding the operand during the execution of an external memory cycle based on the external memory reference instruction, and releasing the operand when the cycle is terminated, the sequencer keeping later instructions being read during the execution of the external memory reference instruction and executing the later instructions concurrently with the external memory reference instruction if the read instructions are an instruction group for referring to resources unoccupied by the external memory reference instruction.
The digital processor of another embodiment comprises an instruction memory, a sequencer, a decoder, and an external memory reference control circuit, operative when the sequencer reads an instruction for continuously transferring streams of data between the digital processor itself and an external memory from the decoder, for controlling the operations of fetching a stream of data continuous transfer instruction signal indicating execution of the stream of data continuous transfer instruction output by the decoder and an operand of the stream of data continuous transfer instruction, holding the operand until the final data transfer cycle executed on the stream of data continuous transfer instruction is terminated, and releasing the operand when the final data transfer cycle is terminated, the sequencer serving to keep later instructions being read during the execution of the stream of data continuous transfer instruction and execute the read instructions concurrently with the stream of data continuous transfer instruction if the read instructions are an instruction group unoccupied by the stream of data continuous transfer instruction.
The digital processor of yet another embodiment comprises an instruction memory, a sequencer, a decoder, and a memory reference control circuit, the memory reference control circuit serving to send out an external memory cycle busy signal to the sequencer during execution of an external memory reference instruction or a stream of data continuous transfer instruction, the sequencer serving to keep the current executing operation if the external memory cycle busy signal indicates a BUSY state during execution of a WAIT instruction for checking whether or not the external memory cycle is busy and to proceed to the next operating step if the busy signal indicates a READY state.
The digital processor of the first embodiment is capable of executing one or more instructions for concurrently referring to one or more resources unoccupied by an external memory reference instruction being executed, thereby enhancing a throughput of the total processing.
The digital processor described in the second embodiment is capable of executing one or more instructions for referring to one or more resources unoccupied by a stream of data continuous transfer instruction for the external memory being executed concurrently with the data continuous transfer instruction, thereby enhancing a throughput of the total processing.
The digital processor described in the third embodiment allows an external memory reference instruction and a resource reference instruction to properly refer to the same resource in synchronization if the latter instruction for the same resource being referred to by the former instruction is issued, thereby enhancing a throughput of the total processing.
Brief Description of the Drawings
FIGS. 1A, 1B, and 1C are block diagrams showing digital processors according to first and second embodiments of the present invention;
FIGS. 2A is a timing chart of the digital processor according to the first embodiment;
FIG. 2B-1 is a view showing a sequence in which instructions are executed in a conventional digital processor;
FIGS. 2B-2 is a view showing a sequence in which instructions are executed in the digital processor according to the first embodiment;
FIG. 3 is a timing chart of the digital processor according to the second embodiment;
FIGS. 4A, 4B, and 4C are block diagrams showing a digital processor according to a third embodiment of the present invention;
FIG. 5A is a flowchart showing the process involving a WAIT instruction;
FIGS. 5B and 5D are timing charts of the digital processor according to the third embodiment;
FIG. 5C is a view showing a sequence on which instructions are executed in the digital processor according to the third embodiment;
FIG. 6 is a block diagram showing a conventional digital processor; and
FIG. 7 is a timing chart of the conventional digital processor.
Description of the Preferred Embodiments
FIG. 1a is a block diagram showing a digital processor according to a first embodiment of the invention.
As shown, 101 denotes a digital processor. The digital processor 101 includes an instruction memory 102, an operation block 103 having an arithmetic unit, a register, an internal memory, and the like, a program control unit 104 having a decoder 104b and a sequencer 104a, and an external memory reference control circuit 105 for controlling the reference to the external memory if an instruction code for referring to the external memory is to be executed. The sequencer 104a serves continuously to read instruction codes from the instruction memory 102 on the basis of a clock 1 (CLK 1) input from the outside. The decoder 104b serves to analyze the instruction codes read by the sequencer 104a and to control the operation block 103 and the external memory reference control circuit 105 based on the analyzed result. Further, the decoder 104b outputs an external memory reference instruction signal indicating execution of the external memory reference instruction and an operand of the instruction to the external memory reference control circuit 105. The operand includes an address (adrs), data (data), and a control signal (ctl) such as a write signal. The digital processor 101 is connected to the external memory 106 provided outside the processor itself. The external memory reference control circuit 105 is controlled on the basis of a clock 2 (CLK 2) and a clock 1 (CLK 1) produced to adapt to the memory cycle of the external memory 106. The digital processor 101 normally operates faster internally than externally. Accordingly CLK 2 is slower than the CLK 1.
FIG. 1B is a block diagram showing the external memory reference control circuit 105 provided in the digital processor 101. The external memory reference control circuit 105 includes a register 1051 for fetching an external memory reference instruction signal output by the decoder 104b, a register 1052 for fetching an operand of the external memory reference instruction, a selector 1053 for holding data stored in the register 1052, a cycle control circuit 1054 for controlling an address (adrs.), data, a control signal (ctl) such as a write signal, and the like contained in a resource stored in the memory, and a synchronous control circuit 1055 for synchronizing CLK 1 and CLK 2, starting the cycle control circuit 1054, sensing the termination, and outputting a holding signal for controlling the selector 1053 and a signal for resetting the register 1052.
The sequencer 104a provided in the digital processor 101 is shown in a block diagram of FIG. 1C. The sequencer 104a includes as main components a program counter 1041, an adder 1042, and an instruction register 1043. With each cycle, the program counter 1041 is increased by 1 since the adder 1042 adds 1 to the current value. The sequencer 104a outputs the output PC of the program counter 1041 as an address of the instruction memory 102. The instruction code stored in the instruction memory 102 is read with PC as its address. Then, the instruction code is written in the instruction register 1043 from which the instruction code is supplied to the decoder 104b. Based on the foregoing control, the sequence 104a makes it possible to keep reading an instruction.
FIG. 2A is a chart of timing on which an instruction is executed for an external memory read cycle executed in the microprocessor 101.
In case the instruction read and executed by the sequencer 104a is an external memory reference instruction, the external memory reference control circuit 105 outputs an external address on a leading edge of the next CLK 2. The external memory 106 is designed to be referred to by the control circuit 105 within one cycle of the CLK 2. Hence, the data can be read in the chip on a leading edge of the next CLK 2.
The data-reading operation done in the memory reference control circuit 105 will be described with reference to FIGS. 1A and 1B. In the selector 105, normally, the holding signal is negated, and the operand of the external memory reference instruction is selected and output to the register 1052. If the external memory reference instruction signal is decoded, the external memory reference instruction signal is supplied and fetched in the register 1051 on CLK 1. At a time, the operand of the external memory reference instruction is fetched in the register 1052 on CLK 1.
Then, the synchronous control circuit 1055 supplies the holding signal on CLK 1 by using the external memory reference instruction signal fetched in the register 1051. Hence, the register 1052 is held until the holding signal is negated.
The cycle control circuit 1054 starts the memory cycle in synchronization with CLK 2 through the synchronous control circuit 1055. The synchronous control circuit 1055 outputs the RESET signal for resetting the register 1052 on the leading edge of the cycle of CLK 2 in which the memory cycle is terminated and on the leading edge of the next CLK 1. At that time, the holding signal is negated, and the operand of the resource reference instruction is fetched in the register 1052.
During the execution of the external memory reference instruction, the sequencer 104a serves continuously to read instructions from the instruction memory in such a manner that it executes the instructions for concurrently referring to the resources unoccupied by the external memory reference instruction being executed.
The executing sequence of the conventional digital processor is shown in FIG. 2B-1, and the executing sequence of the digital processor according to the first embodiment is shown in FIG. 2B-2. The instructions B, C, D, E, F refer to resources unoccupied by the external memory reference instruction. The conventional digital processor terminates the execution of the external memory reference instruction before the instruction B is executed. The digital processor designed according to the first embodiment is capable of executing the instructions B, C, D, E, and F concurrently with the external memory reference instruction.
Hence, as the cycle executed in the external memory 106 is slower than CLK 1, more instructions for referring to the resources unoccupied by the external memory reference instruction can be executed.
In this case, for using the data read on the external memory reference instruction, it is necessary to await passage of several cycles. The cycles to be awaited are defined on the basis of the frequencies of CLK 1 and CLK 2.
The arrangement of the digital processor designed according to the second embodiment is similar to that of the first embodiment shown in FIGS. 1A, 1B and 1C, except in the manner in which the digital processor of the second embodiment controls the external memory reference control circuit 105.
The digital processor according to the second embodiment is capable of executing the stream of data continuous transfer instruction for continuously transferring streams of data between the external memory and the digital processor in addition to the external memory reference instruction described with respect to the first embodiment. That is, the stream of data continuous transfer instruction has a function of pre-setting a format of a stream of data to be transferred (number of pieces of data or the like) and transferring the data between the digital processor and the external memory based on the continuous cycles.
FIG. 3 is a timing chart of a read cycle for the external memory provided on the stream of data continuous transfer instruction done in the digital processor 101 of the second embodiment.
Assuming that the stream of data continuous transfer instruction is read and executed by the program control unit 104, the external memory reference control circuit 105 serves to control the external memory reference cycle described with respect to the first embodiment until the transfer of the predetermined number of pieces of data is terminated. The control is done independently of the sequencer 104a. The external memory reference control circuit 105 also serves to supply the holding signal during a period from the first external memory reference cycle to the last external memory reference cycle. Even during the execution of the stream of data continuous transfer instruction, the sequencer 104a is capable of executing instructions for referring to resources unoccupied by the stream of data continuous transfer instructions concurrently with the stream of data continuous transfer instruction being executed.
The digital processor designated according to a third embodiment of the invention is shown in a block diagram of FIG. 4A. The digital processor 101 shown in FIG. 4A is implemented by the same components as those of the digital processor of the first embodiment, except that the sequencer 104a is controlled by the external memory reference control circuit 105. That is, the external memory reference control circuit 105 supplies a memory cycle busy signal to the sequencer 104a.
FIGS. 4B and 4C are block diagrams showing the external memory reference control circuit 105 and the sequencer 104a included in the digital processor of the present embodiment. The external memory reference control circuit 105 shown in FIG. 4B is implemented by the substantially same components as those of the external memory reference control circuit described with respect to the first embodiment. The external memory cycle busy signal functions as the holding signal used in the first embodiment. Hence, the busy signal is supplied during the execution of the external memory reference instruction.
The sequencer 104a shown in FIG. 4C includes as main components a program counter 1041, an adder 1042, an instruction register 1043, selectors 1044, 1045 for holding the sequence operation, and a WAIT control circuit 1046 for controlling the holding of the sequencer operation. That is, unlike the first embodiment, the sequencer 104a provides the selectors 1044, 1045 and the WAIT control circuit 1046 in addition to the main components of the first embodiment. In operation, in case the external memory cycle busy signal and the WAIT instruction signal output from the decoder 104b are both supplied, the WAIT control circuit 1046 serves to control the selectors 1044 and 1045 so that the program counter 1044 and the instruction register 1043 are held. The WAIT instruction signal is a signal produced by analyzing the WAIT instruction (to be described) and is supplied if the wait instruction is issued.
In the digital processor 101 capable of executing the instructions for referring to the resources unoccupied by the external memory reference instruction concurrently with the external memory reference instruction being executed, consider the case of execution of a resource reference instruction for referring to the resource by the external memory reference instruction being executed. In this case, it is checked whether or not the external memory cycle is busy, and, if it is busy, the sequencer is held so that the later instructions are not allowed to be executed. For this purpose, the wait instruction is stored in the instruction memory 102 one or more cycles before the resource reference instruction is executed.
The foregoing operation can be summarized as an algorithm shown in FIG. 5A. In the overall process, when the external memory reference instruction 501 is read, the instruction group 502 for referring to the resources unoccupied by the instruction 501 is placed immediately after the external memory reference instruction 501. That is, the processing sequence is such that the external memory reference instruction 501, the instruction group 502 for referring to the resources unoccupied by the instruction 501, the WAIT instruction 503, and the resource reference instruction 504 for referring to the resource occupied by the external memory reference instruction 501 are placed in that order.
FIG. 5B is a timing chart based on the process shown in FIG. 5A. The digital processor designed according to the present embodiment functions in a substantially similar manner to the digital processor designed according to the second embodiment, except that the WAIT instruction is used for controlling the sequencer. The timing chart shown in FIG. 5B indicates when the WAIT instruction is executed while the external memory reference instruction is being executed.
During the execution of the external memory reference instruction, the external memory cycle busy signal is supplied. Hence, to execute the WAIT instruction during the execution time, the wait control circuit 104b of the sequencer 104a shown in FIG. 4C serves to supply the WAIT signal and to switch the selectors 1044 and 1045 in a manner to allow the sequencer 104a to be held. The sequencer 104a therefore keeps the WAIT instruction being executed until the external memory cycle busy signal is negated, that is, the external memory reference instruction is terminated. When the external memory cycle busy signal is negated, the resource reference instruction is executed. FIG. 5C shows the executing sequence of the instructions used in this embodiment. FIG. 5D is a timing chart based on the third embodiment applied to the digital processor designed according to the second embodiment.
The foregoing description of the first to the third embodiments has been concerned with the read cycle. Those embodiments are capable of executing a similar control in the write cycle.
The digital processor of the first embodiment has a capability of concurrently executing instructions for referring to resources unoccupied by the external memory reference instruction being executed, thereby enhancing a throughput of the total processing.
The digital processor of the second embodiment has a capability of concurrently executing instructions for referring to resources unoccupied by the stream of data continuous transfer instruction for the external memory being executed, thereby enhancing a throughput of the total processing.
The digital processor of the third embodiment has a capability of properly referring to the same resource in synchronization if the instructions are started for referring to the resource being occupied by the external memory reference instruction, thereby improving a throughput of the total processing.