The embodiments discussed herein are related to an arithmetic processing device, an information processing apparatus, and a method for controlling the arithmetic processing device.
With respect to a multicore architecture, in which a single processor includes a plurality of processor cores (hereinafter referred to as “cores”) as arithmetic processing units, a method is known in which an execution control unit that executes memory load and store instructions and an execution control unit that executes processing instructions are provided for each core and reading (loading) of data from a main memory, writing (storing) of data to the main memory, and arithmetic processing is performed for each core.
Japanese Laid-open Patent Publication No. 5-101207 and Japanese Laid-open Patent Publication No. 2007-148709 disclose examples of the related art.
According to an aspect of the embodiments, an arithmetic processing device includes: a memory controller that accesses a main storage device; a plurality of arithmetic processing cores that execute instructions; an instruction controller that controls execution of an access instruction to load and store data in the plurality of arithmetic processing cores from and to the main storage device; and a transfer controller that controls data transfer between the memory controller and the plurality of arithmetic processing cores in accordance with an instruction from the instruction controller.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
When the number of cores provided is large, for example, the cores are connected to a main memory through an access bus for the sake of convenience of installation of circuits.
A processor 2400 illustrated in
If a first core 2410-1 also executes a store instruction during the transfer, the first core 2410-1 tries to output a write request and write data to the memory bus as illustrated in
If, as illustrated in
In the case of a processor in which a plurality of cores share a memory bus, for example, each core independently executes a memory access control instruction. A circuit for performing control such as bus mediation between cores and a data buffer for each core for holding write data in the case of bus contention, therefore, are provided, which increases the number of circuits. When a plurality of cores request the same data from a memory, for example, bus bands might be wasted. The increase in the number of circuits and the waste of bus bands become evident as the number of cores provided on a chip increases. An arithmetic processing device in which a plurality of cores share a memory bus and for which memory access performance is improved, for example, may be provided.
The processor 100 includes an instruction control unit 110, a data transfer control unit 120, a memory controller 130, and a plurality of processor cores (hereinafter referred to as “cores”) 140. Although
The instruction control unit 110 controls processing operations performed by the processor 100 in accordance with instructions. The instruction control unit 110 collectively controls read instructions and write instructions issued, to the memory 101, by all the cores 140 included in the processor 100. That is, the instruction control unit 110 intensively controls memory access instructions issued by the cores 140 to the memory 101.
The instruction control unit 110 includes a processing control section 111 and an instruction buffer 112. The processing control section 111 obtains instructions from the instruction buffer 112 row by row, identifies operations to be performed based on the instructions, and issues instructions to relevant hardware resources. The processing control section 111 instructs the data transfer control unit 120 to perform an operation according to a read instruction or a write instruction issued to the memory 101 and a core 140 to perform an operation according to a processing instruction. The instruction buffer 112 stores an instruction code to be executed.
The data transfer control unit 120 controls data transfer between the memory controller 130 and the cores 140 in accordance with instructions from the instruction control unit 110. The data transfer control unit 120 and the cores 140 are connected to each other through a memory bus. The memory controller 130 as a memory control unit accesses the memory 101, for example, in accordance with a request from the data transfer control unit 120.
The data transfer control unit 120 receives, from the instruction control unit 110, an instruction (push instruction) to transfer data from the memory 101 to a core 140, issues a read request to the memory 101, and supplies data read in accordance with the read request to the core 140. The data transfer control unit 120 also receives, from the instruction control unit 110, an instruction (pull instruction) to transfer data from a core 140 to the memory 101, obtains data from the core 140, and issues, to the memory controller 130, a write request to the memory 101 in order to write the obtained data.
The cores 140 as arithmetic processing units that execute instructions each include a processing instruction control unit 141 that controls processing performed in accordance with processing instructions and an arithmetic processing unit 144 that performs processing according to processing instructions. The processing instruction control unit 141 includes a processing control section 142 and an instruction buffer 143. The processing control section 142 obtains instructions from the instruction buffer 143 row by row and instructs the arithmetic processing unit 144 to perform arithmetic processing in accordance with the instructions. The instruction buffer 143 stores an instruction code to be executed by the core 140.
The arithmetic processing unit 144 includes a processing section 145 that performs arithmetic processing and a register unit 146. The register unit 146 is a set of registers storing input data used for processing read from the memory 101 and result data obtained as a result of processing. In this example, the register unit 146 includes sixteen registers, namely zeroth to fifteenth registers, and each of the registers has a storage area of 4 bytes. In a first embodiment, instruction codes stored in the instruction buffers 112 and 143 are supplied from the host device 102.
As an instruction set handled by the instruction control unit 110, the following instructions “push”, “pull”, “exec”, “wait”, and “halt” are defined.
The instruction “push” is used to read 4-byte data from a specified memory address and write the 4-byte data to a specified register of a specified core.
The instruction “pull” is used to read 4-byte data from a specified register of a specified core and write the 4-byte data to a specified memory address.
The instruction “exec” is used to cause the processing instruction control unit 141 of a specified core to execute an instruction code having a specified code number.
The instruction “wait” is used to wait without processing an instruction until a specified type of instruction issued prior to the instruction is completed.
The instruction “halt” is used to end an instruction process and issue a completion notification to the host device 102.
As an instruction set handled by the processing instruction control unit 141, the following instructions “add”, “sub”, “mul”, “jmp”, and “halt” are defined.
The instruction “add” is used to add data regarding two registers specified by register numbers 1 and 2 and write a result to a register specified by register number 3
The instruction “sub” is used to subtract data regarding a register specified by register number 2 from data regarding a register specified by register number 1 and write a result to a register specified by register number 3
The instruction “mul” is used to multiply data regarding two registers specified by register numbers 1 and 2 and write a result to a register specified by register number 3
The instruction “jmp” is used, when a data value stored in a specified register is equal to or larger than 0, to execute an instruction in a specified row and, when the data value stored in the specified register is smaller than 0, to execute an instruction in a next row without moving to the specified row.
The instruction “halt” is used to end an instruction process and issue a completion notification to the instruction control unit 110.
As illustrated in
By controlling the use of the memory bus singlehandedly using not the cores 140 but the instruction control unit 110, the cores 140 do not have to include data buffers for holding data in the case of bus contention, and the number of circuits can be reduced.
The instruction control unit 110 instructs the data transfer control unit 120 to execute the push instruction described in an instruction code in order to read data from the memory 101 and transfer the read data to a destination core 140 (S502). The core 140 receives the data (push data) transferred from the data transfer control unit 120 (S503).
After executing the push instruction, the instruction control unit 110 instructs the processing instruction control unit 141 of the core 140 to perform arithmetic processing (S504). The processing instruction control unit 141 that has received the instruction sequentially performs processing operations according to processing instructions managed thereby (S505) and, after all the processing operations are completed, transmits a completion notification to the instruction control unit 110 (S506). Upon receiving the response from the core 140, the instruction control unit 110 instructs the data transfer control unit 120 to execute the pull instruction (S507), and the register unit 146 of the core 140 writes a result of the processing operations to the memory 101 (S508).
The instruction control unit 110 transmits a push instruction to the data transfer control unit 120 (601, 607, and 619), and the data transfer control unit 120 that has received the push instruction issues a read request to the memory 101 (602, 608, and 620). The data transfer control unit 120 receives read data from the memory 101 as a response to the read request (603, 609, and 621), transfers the data to the destination cores (604, 610, and 622), and transmits a completion notification to the instruction control unit 110 (605, 611, and 623).
Upon receiving the completion notification from the data transfer control unit 120, the instruction control unit 110 issues an exec instruction to cause the cores to execute processing instructions (606, 612, and 624). Upon receiving the exec instruction from the instruction control unit 110, the cores execute the processing instructions and, after processing operations are completed, transmit completion notifications to the instruction control unit 110 (613).
Upon receiving the completion notifications from the cores, the instruction control unit 110 issues a pull instruction to the data transfer control unit 120 (614). Upon receiving the pull instruction, the data transfer control unit 120 requests the cores to obtain results of the processing operations (615). The data transfer control unit 120 receives processing result data from the cores as a response to the request (616), writes the result data to the memory 101 (617), and transmits a completion notification to the instruction control unit 110 (618).
For example, first, the instruction control unit 110 supplies data A to the processing storage area of the zeroth core 140-0 to start processing (701 to 706). Meanwhile, the instruction control unit 110 also supplies data C to the prefetching storage area of the zeroth core 140-0 (713 to 717). Similarly, the instruction control unit 110 supplies data D to the prefetching storage area of the first core 140-1 while performing processing for data B (718 to 722).
In addition, after the processing performed by the cores is completed, the instruction control unit 110 instructs, before obtaining result data, the zeroth and first cores 140-0 and 140-1 to start next processing operations (724). By obtaining results of previous processing operations and supplying data to be used in next processing operations while the cores are performing processing operations, the latency of memory access can be hidden in processing time, and the processing sections 145 can continue to operate without waiting for data to be supplied.
Although
Similarly, in #005, data at a memory address 0x000a is written to the registers of the first core 140-1 as a result of an instruction “push”. In #006, completion of the instruction “push” is waited for, and in #007, the first core 140-1 is instructed to execute the zeroth slave instruction code as a result of an instruction “exec”. Here, instructions “wait” are executed in #003 and #006 because if the zeroth slave instruction code is executed before the instructions “push” are completed in #000 to #002 and #005 (i.e., memory data has not been stored in registers), processing is performed using wrong data.
In order to prepare for next processing operations, in #008 to #011, data at other memory addresses is written to registers of the zeroth and first cores 140-0 and 140-1 as a result of instructions “push”. These registers are not used for the zeroth slave instruction code and used for a first slave instruction code to be executed after the zeroth slave instruction code is completed.
The zeroth slave instruction code is then completed for the zeroth and first cores 140-0 and 140-1. Completion of the instructions “push” for the first slave instruction code is waited for, and then the first and zeroth cores 140-0 and 140-1 are instructed to execute the first slave instruction code and obtain a result of the processing of the zeroth slave instruction code. More specifically, in #012 and #013, completion of the prior instructions for the zeroth core 140-0 is ensured. In #014, the zeroth core 140-0 is instructed to execute the first slave instruction code, and in #015, a result of the processing of the zeroth slave instruction code is written back at a memory address 0x0010. Similarly, in #016 and #017, completion of the prior instructions for the first core 140-1 is ensured. In #018, the first core 140-1 is instructed to execute the first slave instruction code, and in #019, the result of the processing of the zeroth slave instruction code is written back at a memory address 0x0014.
Lastly, in #020, completion of the first slave instruction code is waited for. In #021 and #022, result data is written back to the memory 101, and in #023, the processing is completed and the host device 102 is notified of the completion.
A control unit relating to execution of load instructions and store instructions for managing the memory bus is thus separated from the processing instruction control unit 141 of each core, that is, the instruction control unit 110 singlehandedly manages memory access. By intensively describing memory access instructions for all the cores 140 and controlling the memory access instructions using the instruction control unit 110, memory bus control can be performed and memory access performance can be improved while suppressing bus contention and overlap of read data. By including the processing instruction control unit 141 in each of the cores 140, the cores 140 can perform different processing operations (e.g., complex processing operations including branch instructions), and the processing operations can be performed without impairing parallelism.
An example has been described in which the host device 102 stores an instruction code in the instruction buffer of the instruction control unit 110 or the processing instruction control unit 141 in advance and then operations start. A instruction code to be handled is small enough to be stored in an instruction buffer, but when a mechanism for storing an instruction code in a memory and reading the instruction code to the instruction buffer as appropriate is provided, a larger instruction code can be executed.
The instruction fetch control section 901 identifies a memory address at which an instruction code is stored and, after all instructions stored in an instruction buffer are executed, reads the instruction code from the memory 101 through the data transfer control unit 120 and stores the instruction code in the instruction buffer. As a result, the instruction control unit 110 can obtain an instruction code from the memory 101 as appropriate and handle an instruction code too large for the instruction buffer to store.
In
The instruction “pushc” is used to read data having a certain data length (e.g., 256 bytes) from a specified memory address and write the data to an instruction buffer of a specified core as an instruction code having a specified code number.
The instruction control unit 110 and the data transfer control unit 120 control writing of data from the cores 140 to the memory 101 and reading of data from the memory 101 to the cores 140. A method may be employed, instead, in which the cores 140 directly transfer data to one another without performing reading and writing involving the memory 101. For example, a function of transferring data between the cores 140 without using the memory 101 is provided. In this case, when a user desires to use a result of processing performed by a core in another core, for example, the result does not have to be transmitted to the memory 101, which improves transfer latency.
In
The instruction “copy” is used to copy data from a register of a core specified by register number 1 and core number 1 to a register of a core specified by register number 2 and core number 2.
When the data is transferred from the register of the zeroth core 140-0 to the register of the first core 140-1, the data can be copied at high speed since the memory controller 130 is not accessed. Alternatively, instead of providing the copy buffer 1101 for the data transfer control unit 120, the data transfer control unit 120 may copy data read from the zeroth core 140-0 by immediately transferring the data to the first core 140-1 without holding the data. In this case, circuits used to achieve the copy buffer 1101 can be omitted.
Division reading (split push), in which a large data block collectively read from the memory 101 is divided and distributed to a plurality of cores, and combination writing (merge pull), in which pieces of data from different cores are combined as a large data block and collectively written to the memory 101, may be performed. For example, data units communicated through a memory access interface are larger than the size of a register file of each core. If small data is read and written, the use efficiency of the bus decreases. By performing division reading and combination writing of memory data, therefore, the use efficiency of the bus improves.
In
The instruction “pushs” is used to read 8-byte data from a specified memory address and write upper 4 bytes to a register of a core specified by register number 1 and core number 1 and lower 4 bytes to a register of a core specified by register number 2 and core number 2
The instruction “pullm” is used to read 4-byte data from each of registers of cores specified by register numbers 1 and 2 and core numbers 1 and 2, combine the 4-byte data as 8-byte data with the data from the register of the core specified by register number 1 and core number 1 set as upper bits, and writes the 8-byte data to a specified memory address.
Data sizes to be used are not limited to 4 bytes and 8 bytes. For example, division and combination may be performed with larger data sizes such as 32 bytes and 64 bytes. In addition, memory data does not have to be equally divided for cores. For example, 8 bytes out of 32 bytes may be transferred to the zeroth core 140-0, and remaining 24 bytes may be transferred to the first core 140-1. Furthermore, division and combination do not have to be performed between two cores, and, for example, 32-byte memory data may be divided into four pieces and transferred to zeroth to third cores.
In general, in a processor (arithmetic processing device) including a plurality of cores, a large number of transistors simultaneously begin to operate when processing starts. Switching noise, therefore, might be caused due to large current and trigger a malfunction. This can be avoided by causing the cores of the device to begin to operate at different timings. For example, zeroth and first cores 140-0 and 140-1 are adjusted in such a way as not to execute an instruction “exec” at the same time, in order to suppress switching noise.
When an instruction “exec” has been executed for a core 140, the scheduling section 1901 begins to count time and does not allow the execution of a next instruction “exec” until a certain period of time elapses. The certain period of time may be set by software through a control register or the like. Since the scheduling section 1901 of the instruction control unit 110 secures minimum execution intervals of instructions “exec”, a plurality of cores do not simultaneously start processing, and switching noise caused by simultaneous starting of processing by a plurality of cores is reduced.
The throttling control section 1902 changes the throughput of the processing control section 142 in accordance with an instruction from the instruction control unit 110. The processing control section 142 can usually process one row of an instruction in one cycle, for example, and the throttling control section 1902 adjusts the processing control section 142 such that the processing control section 142 processes one row in two or three cycles. When the throttling control section 1902 adjusts the processing control section 142 such that the processing control section 142 executes one instruction in two cycles at a beginning of processing and, after a certain period of time elapses, executes one instruction in one cycle, for example, a change in current at the beginning of processing becomes small, and switching noise caused by simultaneous starting of the operation by processing sections of cores is reduced.
In order to achieve this type of control, in
The instruction “throttle” is used to instruct the throttling control section 1902 of a specified core to process an instruction in one row in a specified number of cycles.
An instruction to perform throttling control can be achieved not as an instruction from the instruction control unit 110 but as an instruction from the processing instruction control unit 141. For example, when the instruction control unit 110 that is controlling the instructions “push”, “pull” and “exec” relating to the cores 140 can overlook processing states of the cores 140 and execute instructions to perform throttling control, more effective control can be performed.
For example, arithmetic processing devices used in fields of basic technologies might have a function of continuing to operate until maintenance work is performed even in the case of a failure. For example, one of cores included in a processor is determined as a spare core in order to provide redundancy and make it possible to continue to operate even in the case of a failure.
When reading data from the memory 101 using an instruction “push”, the data transfer control unit 120 causes the parity generation section 2002 to add a 1-bit parity checksum for each set of 8-bit data and transfers the data to the register unit 146 of a core 140. The core 140 that has received the data from the data transfer control unit 120 holds the checksum and causes the parity update section 2004 to update the checksum in accordance with a result of processing performed by the processing section 145.
After the processing is completed, the data transfer control unit 120 causes, when reading data from a core 140 using an instruction “pull”, the parity check section 2003 to check whether the checksum is correct. If an error is detected as a result of the check, the data transfer control unit 120 notifies the instruction control unit 110 of a number of the core 140 that has transmitted the data as failure information. With this mechanism, a failure of a core can be detected during operation.
The ID conversion section 2001 converts a core number (logical ID) specified by a master instruction code into a physical core number (physical ID) of hardware. In a normal state before a failure occurs, both the zeroth and first cores 140-0 and 140-1 are operating normally, and the second core stands by as a spare core. The ID conversion section 2001, therefore, converts a zeroth logical ID into a zeroth physical ID and a first logical ID into a first physical ID and executes instructions. That is, the ID conversion section 2001 transfers data to the zeroth and first cores 140-0 and 140-1 and instructs the zeroth and first cores 140-0 and 140-1 to execute instructions while using core numbers described in a master instruction code.
If the zeroth core 140-0 fails due to deterioration during operation or an initial defect and the instruction control unit 110 detects the failure, for example, the ID conversion section 2001 converts the zeroth logical ID into a second physical ID and the first logical ID into the first physical ID. That is, an instruction for which the zeroth core 140-0 is specified in a master instruction code is actually executed by the second core. By converting a core number in an instruction code into a spare core number when a failure of a core has been detected, operation can continue using a spare core instead of the failed core.
Although a method in which a parity checksum is added to data has been described as a method for detecting a failure, another failure detection mechanism may be used, instead. For example, a built-in self-test (BIST) circuit or the like that automatically scans register files of each core after the device is turned on may be separately provided.
For example, mirroring, in which a plurality of cores synchronously perform exactly the same processing and a failure is detected by comparing results of the processing, may be performed.
The mirror control section 2201 includes a register capable of enabling or disabling an mirror operation through software and has a function of, when the mirror operation is enabled, copying instructions issued to the zeroth core 140-0 from the instruction control unit 110 and causing the first and second cores 140-1 and 140-2 to execute the instructions. When an instruction “pull” has been copied and data has been read from the zeroth and first cores 140-0 and 140-1, the mirror control section 2201 checks whether values of the data are the same.
The number of cores used for mirror operation does not have to be two. For example, it is assumed that three cores are used for mirror operation. If one of the cores fails and results obtained by executing instructions “pull” become different from one another, the failed core can be immediately identified by the decision of the majority.
Although the topology of a memory bus is a star network based on the memory controller 130 in the above embodiments, the topology of a memory bus is not limited to this. For example, a ring network, in which cores are connected to one another in a row, may be employed for a memory bus, instead. Although the instruction control unit 110 and the processing instruction control unit 141 execute an instruction without waiting for the completion of a previous instruction unless there is an instruction “wait” in the above embodiments, sequential operation, in which the instruction control unit 110 and the processing instruction control unit 141 execute an instruction after a previous instruction is completed, may be employed, instead.
Instructions defined as an instruction set of the instruction control unit 110 are not limited to those described above, and an instruction to perform type conversion and an instruction to process data may also be supported. The following instruction “pushi”, for example, may be added.
The instruction “pushi” is used to read 4-byte data from a specified memory address, convert the 4-byte data from a floating-point type (float type) into an integer type (int type), and write the 4-byte data to a specified register of a specified core. The above embodiments do not have to be independently implemented and may be combined with one another.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2017-063026 | Mar 2017 | JP | national |
This application is a division of application Ser. No. 15/910,029, filed Mar. 2, 2018, which is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2017-63026, filed on Mar. 28, 2017, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 15910029 | Mar 2018 | US |
Child | 16689147 | US |