Processor and memory access exception processing method
Patent Information
- Application Number
- JP2023037500
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-03-10
AI Technical Summary
【0011】 本願の態様によれば、メモリアクセス例外検出を高速化することができる。
Smart Images

Figure 2024128508000001
Abstract
Description
[Technical field]
[0001] The present application relates to a processor and a method for handling memory access exceptions, for example exception checking for vector memory access instructions. [Background technology]
[0002] In virtual memory, it is necessary to support precise exceptions. In this case, it is required to identify the instruction that caused the exception according to the order of instructions, and to be able to resume from the instruction that caused the exception after the exception handler processing. To realize this function, a function is required to save the state of various registers of the processor and return it to the state just before the exception occurred, and a function is required to suspend the write processing to memory. Alternatively, a function is required to suspend the execution of a subsequent instruction that may cause an exception until it is determined whether or not the preceding instruction has an exception. There are also processors that do not satisfy the above requirements and do not support precise exceptions. Such processors have a restriction that they cannot support functions that require precise exceptions. For example, a function of demand paging from a page fault corresponds to such a function.
[0003] A vector processor can operate multiple elements in parallel with one instruction. Therefore, the amount of data for write processing to various registers and memory is large, and it tends to be difficult to save the transitional state until the processing is confirmed. As an example, assume a processor that can process 256 elements based on one vector store instruction. One vector register requires a resource of about 16k bits (64 bits x 256 elements). 64 vector registers require a resource of about 1M bit (16k bits x 64). Furthermore, to hold back the memory write processing, a resource required for saving the address for one vector store instruction (e.g., 48 bits) and a resource required for storing the data (e.g., 64 bits) are required. Under this assumption, a resource of about 28k bits ((48 bits + 64 bits) x 256 elements) is required for 256 elements. If 64 vector store instructions can be executed in-flight, a resource of about 1.75M bits (28k bits x 64) is required. Thus, a huge amount of data resources are required to store a transient state in a vector processor, which can make implementation difficult. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Patent No. 6508382 [Patent Document 2] Patent No. 5630281 Summary of the Invention [Problem to be solved by the invention]
[0005] A method for realizing a restartable page fault by a vector processor has been considered. For example, an information processing method described in Patent Document 1 is controlled by a first processor core incorporating an operating system, and when a second processor core capable of executing parallel arithmetic processing detects a page fault, it stops issuing new instructions, freezes issued but incomplete instructions in a restartable state, and transmits a notice to the first processor core that a page fault has been detected. In response to receiving the notice, the first processor core updates a page table held by the second processor core according to a result of a determination as to whether the page fault is tolerable, and transmits an instruction according to the result of the determination to the second processor core.
[0006] However, the information processing method described in Patent Document 1 requires multiple processor cores to be executed, and therefore, it is difficult to implement the information processing method in a computer system that does not have multiple processor cores.
[0007] Also, assume that the execution of a subsequent instruction that may cause an exception is suspended until the presence or absence of an exception for all preceding instructions is determined. In that case, a waiting time occurs before the execution of the subsequent instruction starts. This can also be a factor of performance degradation. In particular, performance degradation can be significant with vector memory access instructions such as a vector gather (VGT) instruction and a vector scatter (VSC) instruction. This is because these instructions cause a delay in determining the memory access address. For example, the list vector overtaking control method described in Patent Document 2 accepts a list vector instruction having a list address including a specification of multiple addresses from the outside, compares the addresses in the list address to extract the maximum address and the minimum address, associates the extracted maximum address and minimum address with the list vector instruction and stores them in an instruction holding circuit, accepts a subsequent instruction of the list vector instruction from the outside, and performs overtaking judgment between the list vector instruction and the subsequent instruction based on the maximum address and the minimum address stored in the instruction holding circuit. However, the method described in Patent Document 2 does not take into consideration the speed-up of the exception handling itself. Therefore, it is expected that memory access exception detection will be speeded up when executing vector memory access instructions. [Means for solving the problem]
[0008] The present application has been made to solve the above-mentioned problems, and has an object to speed up memory access exception detection.
[0009] A first aspect of the present application is a processor that executes an exception check instruction before executing a vector memory access instruction, the exception check instruction indicates an exception check of information related to a reference destination of the vector memory access instruction, the exception check has multiple stages of level-based processing, the higher the level of the level-based processing is the more strict the exception check is for conditions, and the lower the level of the level-based processing is, the earlier the processing is, and when it is determined whether an exception has been detected, the exception check instruction is terminated.
[0010] A second aspect of the present application is a memory access exception handling method in a processor, wherein the processor executes an exception check instruction before executing a vector memory access instruction, the exception check instruction indicates an exception check of information relating to a reference of the vector memory access instruction, the exception check has multiple stages of level-based processing, with higher levels of the level-based processing including exception checks for stricter conditions and lower levels of the level-based processing preceding each other, and when it is determined whether an exception has been detected, the exception check instruction is terminated. Effect of the Invention
[0011] According to the aspects of the present application, memory access exception detection can be speeded up. [Brief description of the drawings]
[0012] [Figure 1] 1 is a block diagram showing an example of the configuration of a memory access control device according to an embodiment of the present invention; [Diagram 2] 4 is a block diagram showing an example of the configuration of an address conversion unit according to the embodiment; FIG. [Diagram 3] FIG. 4 is an explanatory diagram showing an example of the configuration of a page directory according to the embodiment; [Figure 4] FIG. 4 is an explanatory diagram illustrating an example of the configuration of a page table according to the embodiment; [Diagram 5] 11 is an explanatory diagram illustrating an example of a range designation register for the upper and lower limits of a valid address of a page table according to the embodiment; FIG. [Figure 6] 11 is a diagram illustrating an example of the format of a VSC command according to the embodiment. [Figure 7] 11 is a diagram illustrating an example of an exception check instruction format according to the embodiment; [Figure 8] 10 is a diagram illustrating an example of a virtual address according to the embodiment; [Figure 9] 11A and 11B are diagrams illustrating an example of setting valid addresses of a page table according to the embodiment; [Figure 10] 11 is a flow chart illustrating an exception check instruction operation according to the embodiment; [Figure 11] 11 is a flowchart illustrating an exception check process for an address range according to the embodiment. [Figure 12] 11 is a flowchart illustrating an exception check process for a page table and a range specification register according to the embodiment. [Figure 13] 11 is a flowchart illustrating an exception check process based on a set address according to the present embodiment. [Figure 14] 11 is a flowchart illustrating an exception check process based on a setting address and an element number according to the present embodiment. [Figure 15] FIG. 2 is an explanatory diagram showing an example of a minimum configuration of the above embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] A memory access control device according to an embodiment of the present application will be described with reference to the drawings. The memory access control device according to the embodiment can be realized as a processor. In the following description, an exception check instruction is mainly executed for a VSC instruction as a vector memory access instruction. The exception check instruction is an instruction that instructs an exception check for information related to a reference destination of the vector memory access instruction. 1 is a block diagram showing an example of the configuration of a memory access control device according to this embodiment. The memory access control device according to this embodiment includes a scalar processing unit 100, a vector processing unit 200, and a memory access processing unit 300.
[0014] The scalar processing unit 100 includes an instruction cache 110, an instruction decoder 111, a reorder buffer 112, an instruction scheduler 113, an instruction execution control unit 114, a scalar register 120, an arithmetic unit 121, a memory access instruction issue control unit 130, an exception check control unit 131, an address conversion unit 132, and a vector instruction issue control unit 133. The vector processing unit 200 includes an instruction buffer 210 , an instruction scheduler 211 , an instruction execution control unit 212 , a vector register 220 , a vector mask register 221 , and a data buffer 222 . The memory access processor 300 includes an instruction buffer 310 , an instruction scheduler 311 , an instruction execution controller 312 , and an instruction issue controller 313 .
[0015] The memory access control device has signal lines 150, 151, 152, 153, 154, 155, 160, 161, 170, 171, 172, 173, 174, 180, 181, 182, 183, 184, 185, 190, 191, 250, 251, 252, 260, 261, 262, 263, 264, 270, 271, 272, 350, 351, 352, 353, 354, and 360. Each signal line connects multiple components and enables the transmission of various types of data.
[0016] The functional configuration of the memory access control device according to this embodiment will be described below. The main items to be described are as follows. (1) Address translation, (2) Range specification register settings, (3) Exception check instruction operation, (4) VSC instruction operation, (5) VGT instruction operation, (6) Other operations
[0017] (Address translation) Next, an example of address conversion according to this embodiment will be described. The address conversion described below is a process of converting a virtual address designated as an access destination by a VSC instruction into a physical address. The address conversion is executed by the address conversion unit 132. In the address conversion, a page directory and a page table are used. Each page directory is associated with a page table. For example, 32 sets of page tables exist for 32 page directories. The directory 0 shown in the first row of FIG. 3 is associated with the page table 0 shown in the first row of FIG. 4. Each of the page tables illustrated in FIG. 4 has 256 entries. Each entry is distinguished by a number from 0 to 255. In this example, the vector length is 1 to 256. The vector length indicates the number of elements to be processed by one instruction in a vector instruction such as a VSC instruction. The number of elements is specified by a set value of a vector length setting register (not shown) included in the vector instruction.
[0018] FIG. 8 is a diagram showing an example of the configuration of a virtual address according to this embodiment. In the example of FIG. 8, the virtual address is expressed in 48 bits. This virtual address is converted into a 48-bit physical address using a 2MB page table. The virtual address includes a virtual address of a page directory (hereinafter referred to as a "page directory virtual address"), a page table number, and an offset within the page. The page directory virtual address, the page table number, and the offset within the page are expressed in 18 bits, 8 bits, and 22 bits, respectively. Note that the page size is not limited to 2MB, and may be larger or smaller than 2MB. Also, the amount of information of the virtual address and the physical address is not limited to 48 bits, and may be larger or smaller.
[0019] The address conversion unit 132 checks whether or not a valid page directory corresponding to an upper address that is a part of the virtual address, i.e., the page directory virtual address, exists. The existence of a valid page directory is determined by referring to the page directory and checking whether a virtual address whose valid bit (V bit) is 1 and is equal to the page directory virtual address exists, as illustrated in Fig. 3. If a valid page directory does not exist, the address conversion unit 132 detects an exception.
[0020] If a valid page directory exists, the address conversion unit 132 accesses an entry indicated by the page table number of the page table associated with the page directory, and reads out the V bit, attribute, and page base. The memory access control device can determine whether the page table is valid or not based on whether the set value of the read V bit is 1 or 0. Even if the set value of the V bit is 1, the memory access control device determines whether there is a violation in the read attribute (for example, an indication of write prohibition and a store command). The memory access control device detects an exception by determining that the page table is invalid or an attribute violation. If no exception is detected, the memory access control device replaces the page directory virtual address of the virtual address and the number of the page table with the read page base. Here, the intra-page offset, which is the lower address part of the virtual address, is maintained. Thus, the virtual address is converted into a physical address. The physical address is configured to include a page base and a page offset.
[0021] (Range specification register settings) Next, an example of setting the range specification register according to this embodiment will be described. The range of valid addresses of the page table is set in the range specification register. The range of valid addresses of the page table is specified by its upper and lower limits. In general, the mapping of the page table is executed by a processor in accordance with a predetermined program that constitutes a part of the function of an operating system (OS). For example, the address conversion unit 132 uses a certain virtual address A as a reference and sequentially repeats mapping of the page table for addresses with larger values (or addresses with smaller values). The mapping of the page table includes a process of associating a valid bit with an attribute for each page base and assigning it to one of the page tables. In the page table, a range of addresses (i.e., a valid address range) is formed in which addresses associated with valid page bases are continuous. Therefore, the address conversion unit 132 may generate a range specification register indicating a valid address range. As illustrated in FIG. 5, the range command register indicates a valid flag, a page table number that constitutes a lower limit address, and a page table number that constitutes an upper limit address for each entry. The set value of the valid flag is set to 1, and one valid address range is represented by the lower limit address to the upper limit address. Therefore, the address translation unit 132 can detect the presence or absence of an exception by referring to the range specification register and determining the presence or absence of a valid address that includes the virtual address to be translated as a valid address, without needing to access the page table.
[0022] FIG. 2 is a schematic block diagram showing an example of the configuration of the address conversion unit 132 according to the present embodiment. The address conversion unit 132 includes a page directory 400, a page table 401, a setting unit 402, and a range specification register 403. The page table 401 is accessed from the exception check control unit 131 via a signal line 1821. The setting unit 402 monitors writing to the page table 401 using the signal line 1821. Every time the setting unit 402 updates the page table, it searches the V bit set for each entry of the page table in order starting from entry 0, and specifies the entry number of the entry in which 1 appears first as a setting value as the lower limit address, and the entry number of the entry in which 1 appears last as an upper limit address. The setting unit 402 sets the specified lower limit address, upper limit address, and V bit setting values to 1, and sets them in the range specification register 403 in association with each other using a signal line 413.
[0023] FIG. 9 is a diagram showing an example of setting the effective address of the page table according to the present embodiment. In the case of 9-1, V bit=1, lower limit address=0, and upper limit address=7 are set for the range specification register. In the case of 9-2, V bit=1, lower limit address=3, and upper limit address=8 are set. In the case of 9-4, V bit=1, lower limit address=5, and upper limit address=5 are set. In the case of 9-5, all the V bit settings are 0. There is no valid upper limit address and lower limit address. In this case, the setting unit 402 sets V bit=0, lower limit address=0, and upper limit address=0. In the case of 9-6, there are multiple address ranges. In this case, the setting unit 402 sets, for example, the minimum and maximum values as the lower limit address and the upper limit address, respectively, to set the maximum address range of 1n. The setting unit 402 may set individual address ranges. In the above explanation, the case where a V bit is set in a range specification register has been mainly described, but the address conversion unit 132 may set an attribute bit related to exception detection in association with an address range instead of or in addition to the V bit. For example, a write prohibition bit may be applied as such an attribute bit.
[0024] (Exception check instruction operation) Next, an example of an exception check instruction operation according to this embodiment will be described. The exception check instruction operation is controlled by the instruction execution control unit 114 according to the exception check instruction. In the following description, an exception check instruction related to the VSC instruction is taken as an example. The exception check instruction related to the VSC instruction is placed before the VSC instruction when the compiler compiles the program.
[0025] Here, an example of the format of the VSC instruction according to this embodiment will be described. FIG. 6 is a diagram showing an example of the format of the VSC instruction according to this embodiment. The VSC instruction shown in FIG. 6 includes an opcode, a vector mask register M, source scalar registers Sy and Sz, and source vector registers Vx and Vy. The illustrated VSC instruction has an 8-byte field. The opcode, vector mask register M, source scalar registers Sy and Sz, and source vector registers Vx and Vy are arranged in that order, and each is represented by one byte. Byte 6 and byte 7 are unused.
[0026] In the example of FIG. 6, VSC is set as the opcode. An address is stored in the source vector register Vy, and validity information is set for each element number in the vector mask register M. For example, a binary flag indicating that the process is valid when the set value is 1 and invalid when the set value is 0 is stored as the individual validity information. This allows selection of whether or not to execute the process indicated by the instruction for each element of the vector. Data related to a valid element number is stored in the source vector register Vx, and data related to an invalid element number is not stored. Therefore, the exemplified VSC instruction instructs that the valid data stored in Vx is stored in the storage area indicated by Vy as the data of the element number indicated by M. The minimum and maximum addresses of the source vector register Vy may be detected by a compiler by analyzing the source program to be executed. In this case, the detected minimum and maximum addresses are set in the source scalar registers Sy and Sz, respectively. In analyzing the program, for example, a method described in Japanese Patent No. 7040187 is used. This method includes a process of analyzing the source program and translating it into a series of instruction lists including a list vector instruction. This process includes a process of calculating the start address and end address of the memory to be accessed by the list vector instruction for each iteration of the loop of the loop control statement, and setting the start address and end address in the instruction word of the list vector instruction.
[0027] If the analysis result at the time of compilation reveals only the size of the array to be processed in the source vector register Vy, all bits of the source scalar register Sy are set to 1, and the array size is set to Sz. The number of elements to be processed in one instruction in the vector instruction is set as the vector length. The format of the VGT instruction may also have a similar structure to that shown in FIG.
[0028] Next, the exception check instruction (EXCCHK) according to this embodiment will be described. The exception check instruction is also set by analyzing the program by the compiler, similar to the VSC instruction. FIG. 7 is a diagram illustrating an exception check instruction format according to this embodiment. The data configuration of the exception check instruction format illustrated in FIG. 7 is the same as the data configuration of the VSC instruction format illustrated in FIG. 6. The first and second lines show exception check instructions for the VSC instruction and the VGT instruction, respectively. In the VSC instruction and the VGT instruction illustrated in FIG. 7, the address set in the element of the source vector register Vy and the mask 1 set in the element of the vector mask register M are made valid. Values are set in the elements of the source scalar registers Sy and Sz by the compiler.
[0029] The purpose of the exception check instruction is to check the exception. Therefore, unlike the VSC instruction, the exception check instruction does not require a field in the destination vector register Vx. The Vx field is set to indicate the storage destination of the data. By omitting or ignoring the field, the preparation wait time for the store data can be reduced. The opcode of the original instruction to be inspected is set in the Vz field. For example, for an exception check instruction for a VSC instruction, the opcode of the VSC instruction is set in the Vz field. Also, an operation flag may be set in the Vz field to specify an exception check method. For example, either the normal mode or the detailed mode is specified as the exception check method. In the normal mode, the page directory and the range specification register are used in the exception check. In the detailed mode, in addition to the page directory and the range specification register, the V bit and the attribute of the page table are used in the exception check. The exception check is performed at multiple levels as described later. At the final level, it is executed in the detailed mode regardless of the setting of the operation flag. This is because strict exception check is required at the final level.
[0030] Next, the exception check instruction operation illustrated in FIG. 10 will be described. The exception check instruction processing includes multiple levels of level-based processing. The higher the level of the level-based processing, the stricter the exception check for the condition is executed. The level-based processing is executed in ascending order of level. When the instruction decoder 111 detects an exception check instruction, it analyzes the exception check instruction and sets level 1 as the initial value of the level of the exception check processing (S1). When no exception is detected, the processing of FIG. 10 is terminated, and when an exception is detected, a higher level of level-based processing is executed. In the level-based processing of the final level, it is checked whether the strictest condition is satisfied, and the presence or absence of an exception is determined. In the following description, a case where the number of levels of the exception check instruction operation is set to four stages is exemplified.
[0031] Level 1: When the scalar register Sy is set to be valid and the scalar register Sz is set to be valid, the instruction decoder 111 sets the initial value of the level to level 1 (S2). Here, a flag bit is set to indicate whether the immediate value (invalid) or the register (valid) is to be used as the set value of the scalar registers Sy and Sz. The immediate value refers to a directly written numerical value. At this time, it is presumed that a memory access exists within the range specified by the minimum address of the source vector register Vy set to Sy and the maximum address set to Sz. The address translation table where the memory access is presumed to exist is accessed to check whether an exception exists (S5). If no exception is detected, it is determined that there is no exception for the VSC instruction (S12). If an exception is detected, the process proceeds to level 3 (S4).
[0032] Level 2: When the scalar register Sy is set to immediate, all bits are 1, and the scalar register Sz is set to valid, the instruction decoder 111 sets the initial value of the level to level 2 (S3). Based on the array size set in the scalar register Sz and the address of the first determined element of the source vector register Vy, it is estimated that a memory access exists within the range from the minimum value obtained by subtracting the array size from the address to the maximum value obtained by adding the array size to the address. The address translation table where the memory access is estimated to exist is accessed to check whether or not there is an exception (S6). If no exception is detected, the instruction decoder determines that there is no exception for the VSC instruction (S12). If an exception is detected, the process proceeds to level 3 (S4).
[0033] Level 3: When the scalar register Sy is set to immediate value and the scalar register Sz is set to immediate value, the instruction decoder 111 sets the initial value of the level to level 3 (S4). An address is set in the source vector register Vy, and the mask M set in all elements of the vector mask register M is estimated to be all 1. The address conversion table related to the set address is accessed to check whether there is an exception (S7). If no exception is detected, it is determined that there is no exception for the VSC instruction (S12). If an exception is detected, it is checked whether a specific mask register in which the mask M is defined as all 1 is specified (S8). The specific mask register is, for example, a setting value in which all mask register numbers 0 are set to a fixed value 1, that is, all elements of the vector register are enabled. If the mask register number 0 is set, it is checked whether the operation flag indicates detailed mode (S11). If the operation flag indicates detailed mode, the instruction decoder determines that there is an exception (S13). If a mask register number other than 0 is set, or if the mask register number is set to 0 and the operation mode is the normal mode, the instruction decoder proceeds to processing at level 4 (S9).
[0034] Level 4: An address is set in the source vector register Vy, and the address set only for elements in the vector mask register M that have been masked to 1 is presumed to be a valid address. The address translation table for the presumed address is accessed to check whether an exception has occurred (S10). If no exception is detected, it is determined that there is no exception for the VSC instruction (S12). If an exception is detected, it is determined that there is an exception for the VSC instruction (S13).
[0035] By the control described above, the memory access control device executes a memory access exception check instruction before executing the vector memory access instruction. The exception check process executes a check limited to information related to the occurrence of an exception at the reference destination of the vector memory access instruction. The exception check process has a plurality of level-specific processes. The higher the level of the level-specific process, the stricter the process that includes checking of conditions is included. The level-specific processes are executed in ascending order of level. If it is determined by the level-specific process that no exception will occur, the memory access control device ends the exception check process without executing the higher level level-specific process. This allows memory access exceptions of the vector memory access instruction to be detected quickly.
[0036] Returning to FIG. 1, the process of the scalar processing unit 100 according to this embodiment will be described. The instruction cache 110 caches various kinds of instructions. An exception check instruction may be included in the instructions cached by the instruction cache 110. The instruction cache 110 outputs the cached exception check instruction to the instruction decoder 111 via a signal line 150.
[0037] The instruction decoder 111 performs instruction decoding on the exception check instruction, and outputs the instruction decoded result and various information associated with the instruction to the reorder buffer 112 via a signal line 151. Output to the reorder buffer 112 is performed when there is a free entry. The instruction decoder 111 also sets an initial value for the level of the exception check instruction, and outputs the set initial value to the reorder buffer 112. If the scalar register of Sy and the scalar register of Sz are valid, the instruction decoder 111 sets the initial value to level 1. If Sy is an immediate value specification, all bits are 1, and the scalar register of Sz is valid, the instruction decoder 111 sets the initial value to level 2. If Sy is an immediate value specification, and Sz is an immediate value specification, the instruction decoder 111 sets the initial value to level 3.
[0038] The reorder buffer 112 outputs the exception check instruction to the instruction scheduler 113 using a signal line 152. The instruction is output to the instruction scheduler 113 when there is a free entry in the instruction. The reorder buffer 112 adds an instruction ID for identifying each instruction to the instruction to be output.
[0039] The instruction scheduler 113 judges whether the stored instruction can be issued for each entry. When the instruction scheduler 113 can prepare the resources required for issuance and can guarantee the instruction order, it outputs an exception check instruction to the instruction execution control unit 114 using a signal line 153. The instruction scheduler 113 also issues an exception check instruction to both the vector processing unit 200 and the memory access processing unit 300. The exception check instructions to each processing unit do not necessarily have to be issued simultaneously. The instruction scheduler 113 issues an instruction to each processing unit as soon as it is ready to be issued to that processing unit.
[0040] Next, we will explain the level 1 operation of the exception check instruction. In level 1 operation, the setting value of the operation flag is normal mode. Normal mode is an exception check that uses the page directory and range specification register. In level 1 operation, since the page table is not used, exception checks are performed quickly, but the accuracy is reduced. The reduced accuracy means that it is determined that an exception exists even when in reality there is no exception.
[0041] The instruction execution control unit 114 outputs the exception check instruction input from the instruction scheduler 113 to the vector instruction issuance control unit 133 using a signal line 172. When the level of the exception check instruction is level 1, the scalar register Sy and the scalar register Sz are both valid. Therefore, the instruction execution control unit 114 outputs a read request to the scalar register 120 using a signal line 171. The scalar register 120 outputs the data of the scalar register designated by Sy and Sz to the vector instruction issue control unit 133 via a signal line 173 . The vector instruction issuance control unit 133 outputs the exception check instruction, the data of Sy and Sz, and information associated with the instruction to the instruction buffer 210 of the vector processing unit 200 via a signal line 185.
[0042] The instruction buffer 210 outputs the exception check instruction input from the scalar processing unit 100 to the instruction scheduler 211 using a signal line 250. The instruction buffer 210 outputs the exception check instruction to the instruction scheduler 211 when there is a free entry in the instruction buffer 210. The instruction scheduler 211 waits to issue the exception check instruction until it receives an issue request from the exception check control unit 131.
[0043] The instruction execution control unit 114 outputs the exception check instruction to the memory access instruction issuance control unit 130 and the exception check control unit 131 using a signal line 170. In the case of level 1, the scalar register Sy and the scalar register Sz are both valid. Therefore, the instruction execution control unit 114 outputs a read request to the scalar register 120 using a signal line 171. The scalar register 120 outputs data of the scalar register specified by Sy and Sz to the memory access instruction issuance control unit 130 and the exception check control unit 131 using a signal line 173. The memory access instruction issuance control unit 130 outputs the exception check instruction, the data of Sy and Sz, and information associated with the instruction to the instruction buffer 310 of the memory access processing unit 300 using a signal line 180.
[0044] The instruction buffer 310 outputs the exception check instruction input from the scalar processing unit 100 to the instruction scheduler 311 using a signal line 350. The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 when there is a free entry in the instruction buffer 310. The instruction scheduler 311 waits to issue the exception check instruction until it receives an issue request from the exception check control unit 131.
[0045] Next, the operations of exception check control unit 131 and address conversion unit 132 regarding exception checking will be described with reference to FIGS. Here, the signal line 182 relating to the input to the address conversion unit 132 in Fig. 1 corresponds to the signal lines 1820 and 1821 in Fig. 2. The signal line 360 in Fig. 1 corresponds to the signal lines 3600 and 3601 in Fig. 2. Signal line 183 relating to output from address conversion unit 132 in Fig. 1 corresponds to signal lines 1830 and 1831 in Fig. 2. Signal line 191 in Fig. 1 corresponds to signal lines 1910, 1911, and 1912 in Fig. 2.
[0046] Fig. 11 is a flowchart illustrating an exception check process for an address range according to this embodiment. In the process of Fig. 11, it is assumed that an exception is not detected by the exception check. If an exception is detected, the process does not proceed to the following process, and the process when an exception is detected is performed as described above.
[0047] The exception check control unit 131 assigns the minimum address of Sy as the setting value of MIN (indicating the lower limit address of processing) and assigns the maximum address of Sz as the setting value of MAX (indicating the upper limit address of processing) (S101). The exception check control unit 131 outputs the value of MIN to the address conversion unit 132 via the signal line 182. The page directory 400 of the address conversion unit 132 identifies a page directory using the upper bits (bits 0 to 18) of MIN, and performs an exception check on the identified page directory (S102). The exception check of the page directory includes a process of judging whether or not there is an entry where (V bit of the page directory = 1) and (upper bits (bits 0 to 18) of MIN = virtual address of the page directory). The page directory 400 outputs the exception check information and the directory number of the valid page directory to the exception check control unit 131 using a signal line 1910.
[0048] The exception check control unit 131 checks whether or not the condition that the upper bits (bits 0 to 18) of MIN=the upper bits (bits 0 to 18) of MAX is satisfied (S103). If the condition of S103 is met (YES), the exception check control unit 131 outputs the page table number set to MIN, the page table number set to MAX, the directory number of the valid page directory, and information required to check the attribute violation (for example, decode information of a store-related instruction required to check the write prohibition attribute) to the range specification register 403 of the address conversion unit 132 via signal line 1822.
[0049] The range specification register 403 checks the range from the page table number of MIN to the page table number of MAX (S105). The process of S105 is a check as to whether the page table entry is valid or not. That is, this process includes a check as to whether there is a page table attribute violation when (the V bit of the specified directory number = 1) and (the range from the page table number of MIN to the page table number of MAX is included in the range of the lower limit address and the upper limit address of the V bit range specification register). More specifically, it is checked as to whether there is a page table attribute violation when (the V bit of the specified directory number = 1) and (the range from the page table number of MIN to the page table number of MAX is included in the range of the lower limit address and the upper limit address of the attribute range specification register).
[0050] Here, an example of a check when the attribute is write-prohibited will be described. In a store instruction, if the address to be checked is included in the range between the lower limit address and the upper limit address of the range specification register, it is determined that there is an "attribute violation", and if it is not included in the range, it is determined that there is no "attribute violation". In the case of a load instruction, there is no write-prohibited attribute violation. The range specification register 403 outputs the exception check information to the exception check control unit 131 using the signal line 1912. After the determination in S103 is YES and the processing of S105 is executed, the processing of FIG. 11 ends.
[0051] On the other hand, if the condition of S103 is not satisfied (NO), the exception check control unit 131 outputs to the range specification register 403 via signal line 1822 the MIN (lower limit) page table number, the MAX (upper limit) page table number which is 255, which is the maximum value of the entry, the directory number of the valid page directory, and information required for checking attribute violations. The range specification register 403 checks the range from the page table number of MIN to the page table number of MAX (255) (S104). The processing of S104 differs in the values of MIN and MAX but includes the same processing as S105 (i.e., checking whether the page table entry is valid) and checking for page table attribute violations. The range specification register 403 outputs exception check information to the exception check control unit 131 using a signal line 1912.
[0052] The exception checking control unit 131 assigns 1 as an initial value to n to check the next page directory (S106). The exception checking control unit 131 assigns the upper bits (bits 0 to 18) of the original MIN + n as the upper bits (bits 0 to 18) of the new MIN (S107). The exception checking control unit 131 outputs the upper bits (bits 0 to 18) of MIN to the address conversion unit 132 using the signal line 182. The page directory 400 checks the page directory specified by the upper bits (bits 0 to 18) of MIN (S108). The process of S108 is similar to the process of S102, although the value of MIN is different. The page directory 400 outputs the exception check information and the directory number of the valid page directory to the exception check control unit 131 using the signal line 1910. The exception check control unit 131 checks whether the upper bits (bits 0 to 18) of MIN=the upper bits (bits 0 to 18) of MAX (S109). The process of S109 is similar to the process of S103, although the value of MIN is different.
[0053] If the condition of S109 is satisfied (YES), the exception check control unit 131 outputs the minimum entry value 0 as the MIN (lower limit) page table number, the MAX (upper limit) page table number, the directory number of the valid page directory, and information required for checking attribute violations to the range specification register 403 using the signal line 1822. The range specification register 403 checks the range of the MIN page table number (0) to the MAX page table number (S110). The processing of S110 is similar to that of S105, although the values of MIN and MAX are different. The range specification register 403 outputs the exception check information to the exception check control unit 131 using the signal line 1912. After the determination of YES in S109 and the processing of S110 are executed, the processing of FIG. 11 ends.
[0054] If the condition of S109 is not satisfied (NO), the exception check control unit 131 outputs the page table number of MIN, the page table number of MAX, the directory number of the valid page directory, and information required for checking attribute violations to the range specification register 403 using the signal line 1822. The range specification register 403 checks the entire range of the page table number of MIN (0) to the page table number of MAX (255) (S111). The processing of S111 includes checking whether the page table entry is valid and checking the page table attribute violations, which are the same processing as S105, although the values of MIN and MAX are different. The range specification register 403 outputs the exception check information to the exception check control unit 131 using the signal line 1912. The exception check control unit 131 assigns n+1 to n to check the next page directory (S112). Then, the processing returns to S107.
[0055] As a result of the above exception check processing, exception check information indicating either no exception or an exception is obtained. Next, an operation when exception check information indicating no exception is obtained will be described. This operation is a common process when no exception is confirmed. The exception check control unit 131 outputs an instruction ID and an exception check command indicating no exception to the instruction execution control unit 114 using a signal line 190, outputs the instruction ID and an exception check command indicating no exception to the instruction scheduler 211 using a signal line 184, and outputs the instruction ID and an exception check command indicating no exception to the instruction scheduler 311 using a signal line 181. The instruction execution control unit 114 outputs an instruction ID and an exception check command indicating no exception to the instruction scheduler 113 using a signal line 160, and outputs the instruction ID and an exception check command indicating no exception to the reorder buffer 112 using a signal line 161.
[0056] The instruction schedulers 113, 211, 311 each complete the exception check instruction corresponding to the instruction ID that matches the input instruction ID, and release the entry related to that instruction. The reorder buffer 112 changes the exception check instruction corresponding to the instruction ID that matches the input instruction ID to an execution completed instruction indicating no exception. The reorder buffer 112 cannot complete (commit) the exception check instruction alone, but completes it together with the memory access instruction input immediately after.
[0057] Next, an operation in the case where exception check information indicating that an exception has occurred will be described. The exception check control unit 131 outputs an instruction ID, an exception check instruction indicating that an exception has occurred, and a level change request to the instruction execution control unit 114 using signal line 190, outputs them to the instruction scheduler 211 using signal line 184, and outputs them to the instruction scheduler 311 using signal line 181. The instruction execution control unit 114 outputs the instruction ID, the exception check instruction indicating that an exception has occurred, and a level change request to the instruction scheduler 113 using signal line 160. The instruction schedulers 113, 211, and 311 change the level of the exception check instruction corresponding to the instruction ID that matches the input instruction ID. The next level after the change is determined in the same procedure as in the flowchart of Fig. 10. For example, if the level of the executed process is level 1 or level 2, the next level is level 3. If the level of the executed process is level 3, the next level is level 4.
[0058] The above exception check operation example mainly focuses on the case where the operation mode is the normal mode, but the case where the operation mode is the detailed mode will be described. The detailed mode differs from the normal mode in that the exception check operation further includes a check using the page table 401. First, the detailed mode at level 1 will be described. The exception check process using the page table 401 is added to the processes of S104, S105, S110, and S111 in FIG. 11. For example, in the process of S105, the exception check control unit 131 outputs the page table number of MIN, the page table number of MAX, the directory number of the valid page directory, and information required for checking attribute violations to the page table 401 using the signal line 1821. The page table 401 checks the range of the input page table number of MIN to the page table number of MAX.
[0059] The method of checking exceptions in the page table 401 may differ depending on the configuration of the V bit and the attribute. For example, the following three types of configurations can be assumed. Configuration 1: When priority is given to shortening the exception check time, the page table 401 can check both simultaneously in parallel by using a register for the configuration of the V bit and the attribute. Configuration 2: When priority is given to reducing the amount of hardware, the page table 401 uses an SRAM (Static Random Access Memory) for the configuration of the V bit and the attribute (SRAM configuration), and checks by accessing each page table in sequence while incrementing the page table number from the MIN page table number to the MAX page table number. Configuration 3: When both the exception check time and the reduction in the amount of hardware are achieved, an SRAM configuration is adopted, and a set of the V bit and the attribute is stored collectively for each of multiple entries. For example, the V bit and the attribute for 32 entries corresponding to the page table number are stored collectively in each address of the SRAM. In that case, a collectively check is possible for the page table numbers for 32 entries.
[0060] Next, a method of checking exceptions in the page table 401 will be described using an example in which page table numbers for 32 entries are stored in each address in configuration 3. The page table 401 calculates an address required to read the page table number of MAX from the page table number of MIN. The page table 401 can calculate the page table number÷32+page directory number×(256÷32) as an SRAM address. The page table 401 reads page directory numbers in the range from (page table number of MIN÷32+page directory number×(256÷32)) to (page table number of MAX÷32+page directory number×(256÷32)) of the page table in which the V bit and attribute are stored, and performs an exception check. The page table 401 outputs exception check information indicating the check result to the exception check control unit 131 using a signal line 1911.
[0061] In the detailed mode, the exception check information by the page table 401 and the exception check information by the range specification register 403 may differ. This is because the range specification register 403 uses information of a simplified page table for the purpose of speeding up the exception check, and is not completely equivalent to the information used in the page table 401. Therefore, as illustrated in FIG. 12, the address conversion unit 132 adopts the exception check information by the page table 401 in preference to the exception check information by the range specification register 403. The combination of an exception for the page table and no exception for the range specification register illustrated in FIG. 12 does not need to exist in reality. The processes of S104, S110, and S111 can be operated in the same manner as the process of S105, except that the values of MIN and MAX are different.
[0062] Next, the operation of level 2 of the exception check instruction will be described. It is assumed that the operation flag is set to the normal mode. In the processing of the scalar processing unit 100, the operation from the instruction cache 110 to the issuance of the instruction scheduler 113 is the same as the operation of level 1. The instruction execution control unit 114 outputs the exception check instruction to the vector instruction issuance control unit 133 using the signal line 172. At level 2, the scalar register Sz is set as valid. Therefore, the instruction execution control unit 114 outputs a read request to the scalar register 120 using the signal line 171. The scalar register 120 outputs the data of the scalar register designated by Sz to the vector instruction issue control unit 133 via a signal line 173 . The vector instruction issuance control unit 133 outputs the exception check instruction, the data of Sz, and information associated with the instruction to the instruction buffer 210 of the vector processing unit 200 via a signal line 185.
[0063] The instruction buffer 210 outputs the exception check instruction to the instruction scheduler 211 using a signal line 250. The instruction is output to the instruction scheduler 211 when there is a free entry in the instruction scheduler 211. The instruction scheduler 211 judges whether or not the instruction stored in each entry can be issued. When the resources required for issuance are ready and the instruction order can be guaranteed, the instruction scheduler 211 outputs an exception check instruction to the instruction execution control unit 212 using a signal line 251. In the case of level 2, the vector register of Vy is set to valid, so that the instruction can be issued when Vy is ready. The instruction execution control unit 212 outputs a read request to the vector register 220 using a signal line 260 . Upon receiving the read request, the vector register 220 outputs the data of the vector register designated by Vy to the exception check control unit 131 via a signal line 262 .
[0064] The instruction execution control unit 114 outputs the exception check instruction to the memory access instruction issuance control unit 130 and the exception check control unit 131 using a signal line 170. In the case of level 2, the scalar register Sz is set as valid, so the instruction execution control unit 114 outputs a read request to the scalar register 120 using a signal line 171. Upon receiving the read request, the scalar register 120 outputs the data in the scalar register specified by Sz to the memory access instruction issue control unit 130 and the exception check control unit 131 via a signal line 173 . The memory access instruction issuance control unit 130 outputs the exception check instruction, the data of Sz, and information associated with the instruction to the instruction buffer 310 of the memory access processing unit 300 via a signal line 180 .
[0065] The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 using a signal line 350. The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 when there is a free entry in the instruction buffer 310. The instruction scheduler 311 waits to issue the exception check instruction until it receives an issue request from the exception check control unit 131.
[0066] Next, the operations of exception check control unit 131 and address conversion unit 132 regarding exception checking will be described with reference to FIGS. The exception check control unit 131 assigns one element of Vy - Sz (array size) to MIN (indicating the lower limit address of the process), and assigns one element of Vy + Sz (array size) to MAX (indicating the upper limit address of the process) (S101). Apart from the method of calculating the initial values of MIN and MAX being different, the processes from S102 onwards are similar to the processes of level 1. Also, when the operation flag is set to the detailed mode, an exception check using a page table is added, similar to the processes of level 1.
[0067] The instruction execution control unit 114 outputs the exception check instruction to the vector instruction issue control unit 133 using the signal line 172. In the case of level 3, the instruction execution control unit 114 does not use the scalar registers Sy and Sz. The vector instruction issue control unit 133 outputs the exception check instruction and information associated with the instruction to the instruction buffer 210 of the vector processing unit 200 via a signal line 185. The instruction buffer 210 outputs the exception check instruction to the instruction scheduler 211 using a signal line 250. The instruction is output to the instruction scheduler 211 when there is a vacancy in the entry. The instruction scheduler 211 determines whether or not the instruction stored in each entry can be issued, and when the necessary resources are ready and the instruction order can be guaranteed, outputs the exception check instruction to the instruction execution control unit 212 using a signal line 251. In the case of level 3, Vy is set to be valid, so when Vy is ready, the instruction can be issued. The instruction execution control unit 212 outputs a read request to the vector register 220 using a signal line 260. The vector register 220 receives the read request and outputs the data of the vector register specified by Vy to the exception check control unit 131 using a signal line 262.
[0068] The instruction execution control unit 114 outputs the exception check instruction to the memory access instruction issuance control unit 130 and the exception check control unit 131 via a signal line 170. In the case of level 3, the instruction execution control unit 114 does not use the scalar registers Sy and Sz. The memory access instruction issuance control unit 130 outputs the exception check instruction and information associated with the instruction to an instruction buffer 310 of the memory access processing unit 300 via a signal line 180. The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 using a signal line 350. The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 when there is a free entry in the instruction buffer 310. The instruction scheduler 311 waits to issue the exception check instruction until it receives an issue request from the exception check control unit 131.
[0069] Next, the operation of the exception check control unit 131 and the address conversion unit 132 regarding the exception check will be described with reference to Fig. 1, Fig. 2 and Fig. 13. Fig. 13 is a flow chart illustrating an exception check process based on a set address according to this embodiment. The process in Fig. 13 assumes a case where an exception is not detected by the exception check. If an exception is detected, the process does not proceed to the subsequent process, and the same process as when an exception is detected as described above is performed.
[0070] The exception checking control unit 131 acquires VL pieces of data (element number 0 to element number VL-1) as the address of Vy from the vector processing unit 200. The exception checking control unit 131 assigns 0 as the initial value of the element number of the element to be checked for exceptions (S201). The exception check control unit 131 checks whether the element number of the element to be checked for the exception satisfies the condition that the element number is greater than VL-1 (S202). If the condition of S202 is not satisfied (NO), the exception check control unit 131 assigns the data of the element number of Vy to the address ADR (S203).
[0071] The exception check control unit 131 outputs the data substituted into ADR to the address conversion unit 132 via a signal line 182. The page directory 400 of the address conversion unit 132 performs an exception check on the page directory using the upper bits (bits 0 to 18) of the ADR (S204). The exception check on the page directory includes a process of checking whether an entry exists where (V bit of the page directory=1) and (upper bits (bits 0 to 18) of the ADR=virtual address of the page directory). The page directory 400 outputs the exception check information and the directory number of the valid page directory to the exception check control unit 131 using a signal line 1910.
[0072] The exception check control unit 131 outputs the page table number of the ADR, the directory number of a valid page directory, information required for checking an attribute violation, and the like to the range specification register 403 of the address conversion unit 132 via a signal line 1822. The range specification register 403 checks the page table number of the ADR (S205). The process of S205 includes checking whether the page table entry is valid, and checking whether (the V bit of the specified directory number=1) and (the ADR page table number is included in the range of the lower limit address and upper limit address of the V bit range specification register) and whether there is an attribute violation of the page table. The check of the attribute violation of the page table includes checking whether (the V bit of the specified directory number=1) and (the ADR page table number is within the range of the lower limit address and upper limit address of the attribute range specification register, with no attribute violation). The range specification register 403 outputs exception check information indicating the check result to the exception check control unit 131 using a signal line 1912. The exception check control unit 131 assigns the element number +1 to the element number in order to check the next element number (S206). Then, the process returns to the check in S202. If it is determined that the condition in S202 is satisfied (YES), the process of the exception check with Vy as the address is terminated.
[0073] 13 shows an example in which the process is executed element by element, but is not limited to this. For the purpose of speeding up the exception check process, the initial value assignment in S201, which is element number←0, may be changed to element number←m (m is an integer between 0 and m-1), so that parallel processing is executed for every m elements. In this case, in S206, instead of the assignment process of element number←element number+1, an assignment process of element number←element number+m is performed.
[0074] As a result of the above exception check processing, exception check information indicating either no exception or an exception is obtained. Next, an operation when exception check information indicating no exception is obtained will be described. This operation is a common process when no exception is confirmed. The exception check control unit 131 outputs an instruction ID and an exception check command indicating no exception to the instruction execution control unit 114 using a signal line 190, outputs the instruction ID and an exception check command indicating no exception to the instruction scheduler 211 using a signal line 184, and outputs the instruction ID and an exception check command indicating no exception to the instruction scheduler 311 using a signal line 181. The instruction execution control unit 114 outputs an instruction ID and an exception check command indicating no exception to the instruction scheduler 113 using a signal line 160, and outputs the instruction ID and an exception check command indicating no exception to the reorder buffer 112 using a signal line 161.
[0075] The instruction schedulers 113, 211, 311 each complete the exception check instruction corresponding to the instruction ID that matches the input instruction ID, and release the entry related to that instruction. The reorder buffer 112 changes the exception check instruction corresponding to the instruction ID that matches the input instruction ID to an execution completed instruction indicating no exception. The reorder buffer 112 cannot complete (commit) the exception check instruction alone, but completes it together with the memory access instruction input immediately after.
[0076] Next, the operation when exception check information indicating that an exception has occurred will be described. The exception check control unit 131 checks whether or not a specific mask register in which the mask M of the exception check instruction is defined as all 1s (for example, the mask register number 0 is all fixed value 1, i.e., all elements of the vector register are valid) is specified (see FIG. 10, S8). The exception check control unit 131 also checks whether or not the detailed mode is set in the operation flag (see FIG. 10, S11). If the mask M is not all 1s, or if the mask M is all 1s and the normal mode is set as the operation mode, the exception check control unit 131 outputs the instruction ID, the exception check instruction indicating that an exception has occurred, and the level change request to the instruction execution control unit 114 using the signal line 190, outputs it to the instruction scheduler 211 using the signal line 184, and outputs it to the instruction scheduler using the signal line 181. The instruction execution control unit 114 outputs the instruction ID, the exception check instruction indicating that an exception has occurred, and the level change request to the instruction scheduler 113 using the signal line 160.
[0077] The instruction schedulers 113, 211, and 311 change the level of the exception check instruction corresponding to the instruction ID that matches the input instruction ID. The next level after the change is determined in the same procedure as in the flowchart of FIG. 10. For example, if the level of the executed process is level 3, the next level is level 4. If the mask M is all 1 and the operation mode is the detailed mode, it is determined that an exception has occurred (see FIG. 10, S13). The exception check control unit 131 outputs the instruction ID, the exception check instruction indicating that an exception has occurred, the type of exception (for example, page directory invalid, page table invalid, page table attribute violation, etc.), and the minimum element number at which the exception has occurred to the instruction execution control unit 114 via the signal line 190, to the instruction scheduler 211 via the signal line 184, and to the instruction scheduler 311 via the signal line 181.
[0078] The instruction execution control unit 114 outputs the instruction ID and an exception check instruction indicating that an exception has occurred to the instruction scheduler 113 via signal line 160, and outputs the instruction ID, the exception check instruction indicating that an exception has occurred, and the smallest element number in which the exception has occurred to the reorder buffer 112 via signal line 161. The instruction schedulers 113, 211, and 311 change the setting value of the exception flag to 1 (valid), and save the instruction ID of the instruction with exception. When the instruction schedulers 113, 211, and 311 acquire a new exception check instruction indicating an exception with the exception flag=1 (multiple instructions with exceptions), they compare the saved instruction ID with the instruction ID of the instruction newly detected as having an exception, and save the instruction ID of the preceding instruction. The instruction schedulers 113, 211, and 311 complete the exception check instruction corresponding to the instruction ID that matches the new instruction ID, and release the entry. The reorder buffer 112 changes the exception check instruction corresponding to the instruction ID that matches the new instruction ID to an execution completion instruction indicating an exception, and saves the smallest element number where an exception has occurred. The reorder buffer 112 cannot complete (commit) the exception check instruction alone, but completes it together with the immediately following memory access instruction.
[0079] When the operation mode is the detailed mode, it is different from the normal mode in that a check using the page table 401 is added to the exception check using the range specification register 403. The exception check process using the page table 401 is added to the process of S205 in FIG. 13. The exception check control unit 131 outputs the page table number of the ADR, the directory number of the valid page directory, and information required for checking the attribute violation to the page table 401 using the signal line 1821. The page table 401 checks the page table number of the ADR (S205). The page table 401 calculates the address required to read the page table number of the ADR using the method described in level 1. The page table 401 reads the address of the page table (page table number of the ADR ÷ 32 + page directory number × (256 ÷ 32)) in which the V bit and the attribute are stored and performs the exception check. The page table 401 outputs the exception check information indicating the check result to the exception check control unit 131 using the signal line 1911. In the detailed mode, the exception check information in the page table and the exception check information in the range specification register may differ, so as shown in the example of FIG. 12, the exception check information in the page table is given priority.
[0080] Next, the operation of level 4 of the exception check instruction will be explained. In order to check for exceptions under strict conditions, the operation flag is set to detailed mode at level 4. In the processing of the scalar processing unit 100, the operation from the instruction cache 110 to the issuance of the instruction scheduler 113 is the same as the operation at level 1.
[0081] The instruction execution control unit 114 outputs the exception check instruction to the vector instruction issuance control unit 133 using a signal line 172. The instruction execution control unit 114 does not use the scalar registers Sy and Sz in the case of level 4. The vector instruction issuance control unit 133 outputs the exception check instruction and information associated with the instruction to the instruction buffer 210 of the vector processing unit 200 using a signal line 185.
[0082] The instruction buffer 210 outputs the exception check instruction to the instruction scheduler 211 using a signal line 250. The instruction is output to the instruction scheduler 211 when the entry has a vacancy. The instruction scheduler 211 determines whether or not the stored instruction can be issued for each entry, and when the necessary resources are ready and the instruction order can be guaranteed, outputs the exception check instruction to the instruction execution control unit 212 using a signal line 251. In the case of level 4, Vy is valid and M is valid, so when Vy and M are ready, the instruction can be issued. In the case of level 4, the instruction execution control unit 212 outputs a read request to the vector register 220 via a signal line 260 because the vector register of Vy is valid, and outputs a read request to the vector mask register 221 via a signal line 261 because the mask register of M is valid. The vector register 220 outputs the data of the vector register specified by Vy to the exception check control unit 131 using a signal line 262. The vector mask register 221 outputs the data of the vector mask register specified by the mask M to the exception check control unit 131 via a signal line 263 .
[0083] The instruction execution control unit 114 outputs the exception check instruction to the memory access instruction issuance control unit 130 and the exception check control unit 131 using a signal line 170. The instruction execution control unit 114 does not use the scalar registers Sy and Sz in the case of level 4. The memory access instruction issuance control unit 130 outputs the exception check instruction and information associated with the instruction to the instruction buffer 310 of the memory access processing unit 300 using a signal line 180. The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 using a signal line 350. The instruction buffer 310 outputs the exception check instruction to the instruction scheduler 311 when there is a free entry in the instruction buffer 310. The instruction scheduler 311 waits to issue the exception check instruction until it receives an issue request from the exception check control unit 131.
[0084] Next, the operation of the exception check control unit 131 and the address conversion unit 132 regarding the exception check will be described with reference to Fig. 1, Fig. 2 and Fig. 14. Fig. 14 is a flow chart illustrating an exception check process based on a set address and an element number according to this embodiment. The process in Fig. 14 assumes a case where an exception is not detected by the exception check. If an exception is detected, the process does not proceed to the subsequent process, and the process when an exception is detected as described above is performed. The process of FIG. 14 relating to level 4 differs from the process of FIG. 13 relating to level 3 in that a process of S303 is added.
[0085] The exception check control unit 131 acquires VL pieces of data (element number 0 to element number VL-1) as the address of Vy and the mask of M from the vector processing unit 200. At level 4, the exception check control unit 131 checks whether or not the condition that the set value of M is 1 is satisfied for each element number (S303). In this respect, it differs from level 3, in that the address of Vy is used as is. For element numbers that satisfy the condition of S303 (YES), the exception check control unit 131 assumes that the address of Vy is a valid address, and assigns the data of the element number of Vy to ADR (S304). The exception check control unit 131 outputs the data of ADR to the address conversion unit 132 using the signal line 182. The process of S305 is equivalent to the process of S204 in FIG. 13, the process of S306 is equivalent to the process of S205 in FIG. 13 in the detailed mode, and the process of S207 is equivalent to the process of S206 in FIG. 13. The exception checks of S304, S305, and S306 and the process of S307 for the next check are performed. If the condition of S303 is not satisfied (NO), the address of Vy is not a valid address, so the exception check is omitted and the process of S307 for the next check is performed.
[0086] As a result of the above exception check processing, exception check information indicating either no exception or an exception is obtained. Next, an operation when exception check information indicating no exception is obtained will be described. This operation is a common process when no exception is confirmed. The exception check control unit 131 outputs an instruction ID and an exception check command indicating no exception to the instruction execution control unit 114 using a signal line 190, outputs the instruction ID and an exception check command indicating no exception to the instruction scheduler 211 using a signal line 184, and outputs the instruction ID and an exception check command indicating no exception to the instruction scheduler 311 using a signal line 181. The instruction execution control unit 114 outputs an instruction ID and an exception check command indicating no exception to the instruction scheduler 113 using a signal line 160, and outputs the instruction ID and an exception check command indicating no exception to the reorder buffer 112 using a signal line 161.
[0087] The instruction schedulers 113, 211, 311 each complete the exception check instruction corresponding to the instruction ID that matches the input instruction ID, and release the entry related to that instruction. The reorder buffer 112 changes the exception check instruction corresponding to the instruction ID that matches the input instruction ID to an execution completed instruction indicating no exception. The reorder buffer 112 cannot complete (commit) the exception check instruction alone, but completes it together with the memory access instruction input immediately after.
[0088] Next, the operation when exception check information indicating that an exception has occurred will be described. At level 4, the check result indicates that an exception has occurred (see FIG. 10, S13). The exception check control unit 131 outputs the instruction ID, the exception check command indicating that an exception has occurred, the exception type (page directory invalid, page table invalid, page table attribute violation, etc.), and the minimum element number in which the exception has occurred to the instruction execution control unit 114 using the signal line 190, outputs the command to the instruction scheduler 211 using the signal line 184, and outputs the command to the instruction scheduler 311 using the signal line 181. The instruction execution control unit 114 outputs the instruction ID and the exception check command indicating that an exception has occurred to the instruction scheduler 113 using the signal line 160, and outputs the instruction ID, the exception check command indicating that an exception has occurred, and the minimum element number in which the exception has occurred to the reorder buffer 112 using the signal line 161.
[0089] The instruction scheduler 113, 211, 311 changes the setting value of the exception flag to 1 (enabled) and saves the instruction ID related to the instruction with exception. When a new exception check instruction indicating an exception arrives while the exception flag is 1 (multiple instructions with exceptions), it compares the saved instruction ID with the instruction ID of the instruction that newly detected the exception, and saves the instruction ID of the preceding instruction. The instruction scheduler 113, 211, 311 completes the exception check instruction corresponding to the instruction ID that matches the instruction ID related to the new instruction, and releases the entry. The reorder buffer 112 changes the exception check instruction corresponding to the instruction ID that matches the instruction ID related to the new instruction to an execution completed instruction indicating an exception, and saves the smallest element number where the exception occurred.
[0090] (VSC instruction operation) Next, an example of the operation of the VSC instruction according to this embodiment will be described. Returning to Fig. 1, the processing of the scalar processing unit 100 will be described. The instruction cache 110 outputs the VSC instruction to the instruction decoder 111 using a signal line 150. The instruction decoder 111 performs instruction decoding of the VSC instruction, and outputs the instruction decoded result and various information associated with the instruction to the reorder buffer 112 via a signal line 151 when there is a free entry in the reorder buffer 112 .
[0091] When there is a free entry in the instruction scheduler 113, the reorder buffer 112 outputs the VSC instruction to the instruction scheduler 113 using a signal line 152. In addition, the reorder buffer 112 adds an instruction ID for identifying each instruction to the instruction to be output. The instruction scheduler 113 judges whether or not an instruction can be issued for each stored entry. When the necessary resources are ready and the instruction order can be guaranteed, the instruction scheduler 113 outputs the VSC instruction to the instruction execution control unit 114 using the signal line 153. The instruction scheduler 113 issues the VSC instruction to both the vector processing unit and the memory access processing unit. The instruction scheduler 113 issues an instruction independently as soon as each processing unit is ready. When the exception flag=1 is set as a condition for issuing an instruction related to an exception, it is possible to issue up to the memory access instruction immediately after the instruction whose instruction ID is saved. However, the instruction scheduler 113 stops issuing subsequent instructions. For the purpose of improving performance, the instruction scheduler 113 according to this embodiment does not wait until the presence or absence of exceptions in all preceding memory access instructions is determined. Therefore, depending on the timing of issuing an instruction, there may be a case where an instruction following a memory access instruction related to an exception is issued to the vector processing unit 200 or the memory access processing unit 300. The instruction scheduler 311, the instruction execution control unit 312, and the reorder buffer 112 of the memory access processing unit 300 do not execute instructions following the memory access instruction with an exception, thereby ensuring accurate exceptions.
[0092] The instruction execution control unit 114 outputs the VSC instruction to the vector instruction issuance control unit 133 using a signal line 172. The instruction execution control unit 114 outputs a read request to the scalar register 120 using a signal line 171 when the scalar register is set as valid. The scalar register 120 outputs the data of the scalar register specified by the read request to the vector instruction issue control unit 133 via a signal line 173 . When the instruction execution control unit 114 completes issuing an instruction to the vector instruction issue control unit 133 , it outputs the instruction ID to the reorder buffer 112 via a signal line 161 . The reorder buffer 112 changes the VSC instruction corresponding to the instruction ID that matches the input instruction ID to a completed issuance to the vector processing unit 200. When the VSC instruction and the scalar register are set to be valid, the vector instruction issuance control unit 133 outputs the data of the scalar register and information associated with the instruction to the instruction buffer 210 of the vector processing unit 200 via the signal line 185.
[0093] The instruction buffer 210 outputs the VSC instruction to the instruction scheduler 211 using a signal line 250 when there is a free entry in the instruction scheduler 211. The instruction scheduler 211 determines whether the instruction stored in each entry can be issued, and when the necessary resources are ready and the instruction order can be guaranteed, outputs an exception check instruction to the instruction execution control unit 212 using a signal line 251. When Vx (store data), Vy (store address), and M (mask) are ready, the instruction can be issued. The instruction execution control unit 212 outputs a read request to the vector register 220 using a signal line 260 , and outputs a read request to the vector mask register 221 using a signal line 261 .
[0094] The vector register 220 outputs the specified vector register data and the instruction ID store data to the instruction execution control unit 312 of the memory access processing unit 300 via a signal line 262 . The vector mask register 221 outputs the specified vector mask register data and the instruction ID to the instruction execution control unit 312 via a signal line 263. After outputting the instruction ID to the memory access processing unit 300, the instruction execution control unit 212 outputs the instruction ID to the instruction scheduler 211 via a signal line 252. The instruction scheduler 211 completes the VSC instruction corresponding to the instruction ID that matches the input instruction ID, and releases the entry.
[0095] The instruction execution control unit 114 outputs the VSC instruction to the memory access instruction issuance control unit 130 via a signal line 170 . When the scalar register is set as valid, the instruction execution control unit 114 outputs a read request to the scalar register 120 using a signal line 171 . The scalar register 120 outputs the data of the scalar register specified by the read request to the memory access instruction issuance control unit 130 via a signal line 173 . When the instruction execution control unit 114 completes issuing an instruction to the memory access instruction issue control unit 130 , it outputs the instruction ID to the instruction scheduler 113 via a signal line 160 .
[0096] The instruction scheduler 113 completes the VSC instruction corresponding to the instruction ID that matches the input instruction ID and releases the entry. When the instruction execution control unit 114 completes the instruction issuance to the memory access instruction issuance control unit 130, it outputs the instruction ID to the reorder buffer 112 via a signal line 161. The reorder buffer 112 changes the VSC instruction corresponding to the instruction ID that matches the input instruction ID to "issue completed" to the memory access processing unit 300. The memory access instruction issuance control unit 130 outputs the VSC instruction, the data of the scalar register (if the scalar register is valid), and information associated with the instruction to the instruction buffer 310 of the memory access processing unit 300 via the signal line 180.
[0097] The instruction buffer 310 outputs the VSC instruction to the instruction scheduler 311 via a signal line 350 when there is a free entry in the instruction scheduler 311 . If the presence or absence of an exception is not yet determined for any of the preceding memory access instructions, the instruction scheduler 311 waits to issue a VSC instruction. When the presence or absence of an exception is determined for the preceding memory access instruction, the instruction scheduler 311 checks the exception flag. The instruction scheduler 311 issues a VSC instruction when (exception flag=0) or (exception flag=1 and indicates the instruction immediately following the instruction whose instruction ID is saved). The instruction scheduler 311 outputs the issued instruction to the instruction execution control unit 312 using a signal line 351. When the exception flag=1, it has been determined that an exception has occurred in the preceding instruction for instructions subsequent to the immediately following instruction. Therefore, the instruction scheduler 311 stops issuing instructions.
[0098] The instruction execution control unit 312 checks whether Vx (store data), Vy (store address), and M (mask) that match the instruction ID of the VSC instruction have arrived from the vector processing unit 200 in VL pieces (element number 0 to element number VL-1). If they have not arrived, the instruction execution control unit 312 waits for the execution of the VSC instruction. If they have arrived, the instruction execution control unit 312 uses the address conversion unit 132 to convert the store address of Vy (from virtual address to physical address) and perform an exception check (see FIG. 14). The instruction execution control unit 312 assigns 0 to the element number (S301). The instruction execution control unit 312 checks whether the element number to be executed is greater than VL-1 (S302). The instruction execution control unit 312 checks whether the condition that the set value of M related to the element number is 1 is satisfied (S303). If the condition of S303 is satisfied (YES), the address is valid, so the instruction execution control unit 312 assigns the data of the element number of Vy to ADR (S304). The instruction execution control unit 312 outputs the data assigned to ADR to the address conversion unit 132 via the signal line 360.
[0099] The page directory 400 of the address conversion unit 132 checks the page directory by referring to the upper bits (bits 0 to 18) of the ADR (S305). In the exception check, the page directory 400 checks whether or not there is an entry where (V bit of the page directory=1) and (upper bits (bits 0 to 18) of the ADR=virtual address of the page directory). The page directory 400 outputs the exception check information and the directory number of the valid page directory to the instruction execution control unit 312 of the memory access processing unit 300 using a signal line 1830.
[0100] The instruction execution control unit 312 outputs the page table number of the ADR, the directory number of the valid page directory, information required for checking an attribute violation, and the like to the page table 401 of the address conversion unit 132 via a signal line 3601 . The page table 401 of the address conversion unit 132 checks the page table number of the ADR (S306).
[0101] The page table 401 reads the V bit, attribute, and page base of the page table entry using the page table number of the ADR and the directory number of the valid page directory. When checking for an exception, the page table 401 checks whether the page table entry is valid. That is, a check is made for a page table attribute violation, that is, (V bit of the specified directory number = 1) and (V bit of the ADR page table number = 1). When checking for a page table attribute violation, a check is made for (V bit of the specified directory number = 1) and (no attribute violation for the page table number of the ADR). The page table 401 outputs the page base and exception check information to the instruction execution control unit 312 using a signal line 1831.
[0102] The instruction execution control unit 312 assigns element number+1 to the element number to check the next element number (S307). Then, the process returns to S302. When the instruction execution control unit 312 completes the process up to the last element number, it outputs the instruction ID to the instruction scheduler 311 using the signal line 354. The instruction scheduler 311 completes the input instruction ID and the VSC instruction corresponding to the instruction ID, and releases the entry.
[0103] The instruction execution control unit 312 checks the exception check information output after the process of S306 for the element number for which the set value of M is 1. If the exception check information indicates that there is no exception, the process continues. The instruction execution control unit 312 converts the page base to the used physical address. In the address conversion, the instruction execution control unit 312 replaces the upper bits (the page directory and page table number part, bits 0 to 26) of the virtual address of the store address of Vy with the page base, and converts it to a physical address without converting the offset within the page. The instruction execution control unit 312 outputs the physical address and the store data to the instruction issue control unit 313 using a signal line 352.
[0104] The instruction issuance control unit 313 outputs the VSC instruction to the memory using the signal line 353. If the exception check information indicates that an exception has occurred, the instruction issuance control unit 313 changes the exception occurrence element flag to 1 (valid) and saves the element number where an exception has first been detected as the exception occurrence element number. Since the VSC instruction is processed in the order of element number 0 to element number VL-1, the element number where an exception has first been detected is the smallest element number where an exception occurs. The instruction execution control unit 312 does not output elements having an exception element flag=1 and an element number equal to or greater than the exception element number to the instruction issuance control unit 313. When the instruction execution control unit 312 completes processing up to the last element number, it outputs an instruction ID to the instruction scheduler 311 using a signal line 354. The instruction scheduler 311 completes the VSC instruction corresponding to the instruction ID that matches the input instruction ID, and releases the entry.
[0105] The reorder buffer 112 of the scalar processing unit 100 periodically checks the completion of instruction issuance by the vector processing unit of the VSC instruction, the completion of instruction issuance by the memory access processing unit, and the completion of the immediately preceding exception check instruction. When these three are completed, the reorder buffer 112 saves the exception information (presence or absence of an exception, the type of exception, the minimum element number, the instruction IC, etc.) saved in the entry of the immediately preceding exception check instruction in the entry of the VSC instruction, and changes the VSC instruction to an execution completed instruction. When all preceding instructions are completed, the reorder buffer 112 completes (commits) the immediately preceding exception check instruction and the VSC instruction as a set. Since the VSC instruction is an instruction that does not write to a vector register, if the VSC instruction does not have an exception, the reorder buffer 112 completes without notifying other blocks and releases the entry. If the VSC instruction has an exception and the preceding instruction has no exception, the reorder buffer 112 saves the exception information of the VSC instruction in an exception register (not shown) that can be confirmed by software and releases the entry. If the VSC instruction has an exception and the preceding instruction has an exception, the reorder buffer 112 completes without notifying other blocks and releases the entry because the exception information for the preceding instruction has already been saved in the exception register.
[0106] (VGT instruction operation) Next, an example of the operation of the VGT instruction according to this embodiment will be described. The operation of the exception check instruction for the VGT instruction is performed prior to the VGT instruction. The operation of the exception check instruction for the VGT instruction is basically the same as the operation of the exception check instruction for the VSC instruction. As illustrated in FIG. 6, the exception check instruction for the VGT instruction is also because the vector register Vx is unused, similar to the exception check instruction for the VSC instruction. However, unlike the exception check instruction for the VSC instruction, there is no write prohibition that would be a page table attribute violation in the exception check instruction for the VGT instruction.
[0107] Returning to FIG. 1, the process of scalar processing unit 100 will be described. The instruction cache 110 outputs the VGT instruction to the instruction decoder 111 via a signal line 150 . The instruction decoder 111 performs instruction decoding on the input VGT instruction, and outputs the instruction decoded result and various information associated with the instruction to the reorder buffer 112 via a signal line 151 when there is a free entry in the reorder buffer 112. The reorder buffer 112 outputs the input VGT instruction to the instruction scheduler 113 using a signal line 152 when there is a vacant entry in the instruction scheduler 113. In addition, the reorder buffer 112 adds an instruction ID for identifying each instruction to the instruction to be output.
[0108] The instruction scheduler 113 determines whether an instruction can be issued for each stored entry, and if the resources required for issuance are ready and the instruction order can be guaranteed, it outputs the VGT instruction to the instruction execution control unit 114 via signal line 153. The instruction scheduler 113 issues the VGT instruction to both the vector processing unit 200 and the memory access processing unit 300. The instruction scheduler 113 issues the VGT instruction individually as soon as preparations for issuance to each unit are completed. When the exception flag=1 is set as a condition for issuing an instruction related to an exception, it is possible to issue up to the memory access instruction immediately following the instruction whose instruction ID is saved, and issuance of the subsequent instructions is stopped. For the purpose of improving performance, the instruction scheduler 113 according to this embodiment does not wait until the presence or absence of exceptions in all preceding memory access instructions is confirmed. There are cases where the instruction following the memory access instruction with an exception is issued to the vector processing unit 200 or the memory access processing unit 300 depending on the timing of issuing the instruction, but the instruction execution control unit 212 and the reorder buffer 112 of the vector processing unit 200 do not execute the instruction following the memory access instruction with an exception. This guarantees accurate exceptions.
[0109] The instruction execution control unit 114 outputs the VGT instruction to the vector instruction issuance control unit 133 using a signal line 172. The instruction execution control unit 114 outputs a read request to the scalar register 120 using a signal line 171 when the scalar register is to be enabled. The scalar register 120 outputs the data of the scalar register specified in the input read request to the vector instruction issue control unit 133 via a signal line 173 . Upon completing the issuance of an instruction to the vector instruction issuance control unit 133 , the instruction execution control unit 114 outputs the instruction ID to the reorder buffer 112 via a signal line 161 .
[0110] The reorder buffer 112 changes the status of the VGT instruction corresponding to the instruction ID that matches the input instruction ID to the vector processing unit 200 as "issue completed." When the vector instruction issuance control unit 133 validates the VGT instruction and the scalar register, it outputs the data in the scalar register and information associated with the instruction to the instruction buffer 210 of the vector processing unit 200 via a signal line 185 .
[0111] When there is a free entry in the instruction scheduler 211 , the instruction buffer 210 outputs the VGT instruction to the instruction scheduler 211 via a signal line 250 . The instruction scheduler 211 judges whether or not the instruction stored in each entry can be issued, and when the resources required for issuance are ready and the instruction order can be guaranteed, it outputs an exception check instruction to the instruction execution control unit 212 via a signal line 251. When Vy (store address) and M (mask) are ready and there is free space in the entry of the data buffer 222 to which data from the memory is written, the instruction can be issued.
[0112] The instruction execution control unit 212 outputs a read request to the vector register 220 using a signal line 260, and outputs a read request to the vector mask register 221 using a signal line 261. The instruction execution control unit 212 outputs the instruction ID, the entry number to which the load data from the memory is written, and the number of elements of the data to be returned to the data buffer 222 using a signal line 264. The vector register 220 outputs the specified vector register data, the instruction ID, and the entry number of the data buffer 222 to which the load data from the memory is to be written to the instruction execution control unit 312 via a signal line 262. The vector mask register 221 outputs the specified vector mask register data and the instruction ID to the instruction execution control unit 312 via a signal line 263.
[0113] After outputting the instruction ID to the memory access processor 300 , the instruction execution controller 212 outputs the instruction ID to the instruction scheduler 211 via a signal line 252 . The instruction scheduler 211 changes the VGT instruction corresponding to the instruction ID that matches the input instruction ID to "issue completed." The data buffer 222 stores the instruction ID, the entry number to which the load data from the memory is written, and the number of elements of the data to be returned to the data buffer 222 itself.
[0114] The instruction execution control unit 114 outputs the VGT instruction to the memory access instruction issuance control unit 130 using a signal line 170. When the instruction execution control unit 114 validates the scalar register, it outputs a read request to the scalar register 120 using a signal line 171 . The scalar register 120 outputs the data of the specified scalar register to the memory access instruction issuance control unit 130 via a signal line 173 . When the instruction execution control unit 114 completes issuing an instruction to the memory access instruction issue control unit 130 , it outputs the instruction ID to the instruction scheduler 113 via a signal line 160 . The instruction scheduler 113 completes the VGT instruction corresponding to the instruction ID that matches the input instruction ID, and releases the entry.
[0115] When the instruction execution control unit 114 completes issuing an instruction to the memory access instruction issue control unit 130 , it outputs the instruction ID to the reorder buffer 112 via a signal line 161 . The reorder buffer 112 changes the VGT instruction corresponding to the instruction ID that matches the input instruction ID to the memory access processing unit 300 to "issue completed." When the memory access instruction issuance control unit 130 validates the VGT instruction and the scalar register, it outputs the data in the scalar register and information associated with the instruction to the instruction buffer 310 of the memory access processing unit 300 via the signal line 180 . The instruction buffer 310 outputs the input VGT instruction to the instruction scheduler 311 via a signal line 350 when there is a vacant entry in the instruction scheduler 311 .
[0116] In the instruction scheduler 311, the conditions for issuing an instruction differ depending on the processor configuration. In a configuration in which data from memory to be written to Vx by the VGT instruction cannot be reserved when it is written to the vector register 220, the instruction scheduler 311 waits to issue the VGT instruction if there is a preceding memory access instruction for which it is not yet determined whether an exception has occurred. The instruction scheduler 311 issues the VGT instruction after it has determined whether an exception has occurred in the preceding instruction. For an instruction in which an exception has occurred, the vector register 220 is updated up to just before the element in which the exception has occurred. For instructions following the instruction in which an exception has occurred, the instruction scheduler 311 cancels issuance because it has been determined that an exception has occurred in the preceding instruction.
[0117] In a configuration that allows a hold when writing to a vector register, the instruction scheduler 311 issues a VGT instruction to memory even if the presence or absence of an exception is not yet determined in the preceding memory access instruction, and ensures an accurate exception when writing to a vector register. Next, a case will be described in which the data buffer 222 exists in the vector processing unit 200 and a configuration that ensures an accurate exception when writing to a vector register 220 is provided. Except for the operation of waiting for the result of the preceding instruction and the operation of holding the write to the vector register, the operation is generally similar to that when issuing the VGT instruction described above. First, the instruction scheduler 311 checks the exception flag. In the case of (exception flag=0) or (exception flag=1 and the instruction immediately following the instruction whose instruction ID is saved), the instruction scheduler 311 issues a VGT instruction. The instruction scheduler 311 outputs the VGT instruction to the instruction execution control unit 312 using the signal line 351. In the case of the exception flag=1, it is determined that an exception has occurred in the preceding instruction for the VGT instruction following the immediately following instruction. In that case, the instruction scheduler 311 will cease issuing the VGT instruction.
[0118] The instruction execution control unit 312 checks whether or not VL pieces (element number 0 to element number VL-1) of the entry number of the data buffer entry corresponding to the instruction ID that matches the instruction ID of the VGT instruction have arrived from the vector processing unit 200 (element number 0 to element number VL-1). If they have not arrived, the instruction execution control unit 312 waits for the execution of the VGT instruction. If they have arrived, the instruction execution control unit 312 uses the address conversion unit 132 to convert the store address of Vy (from virtual address to physical address) and perform an exception check (see FIG. 14). The instruction execution control unit 312 assigns 0 to the element number (S301). The instruction execution control unit 312 checks whether or not the element number to be executed is greater than VL-1 (S302). The instruction execution control unit 312 checks whether or not the condition that the setting value of the mask M related to the element number is 1 is met (S303). If the condition of S303 is satisfied (YES), the address is valid, so the instruction execution control unit 312 assigns the data of the element number of Vy to ADR (S304). The instruction execution control unit 312 outputs the data assigned to ADR to the address conversion unit 132 via the signal line 360.
[0119] The page directory 400 of the address conversion unit 132 checks the page directory using the upper bits (bits 0 to 18) of the ADR (S305). The exception check of the page directory includes checking whether or not there is an entry where (V bit of the page directory = 1) and (upper bits (bits 0 to 18) of the ADR = virtual address of the page directory). The page directory 400 outputs the exception check information and the directory number of the valid page directory to the instruction execution control unit 312 via a signal line 1830 . The instruction execution control unit 312 outputs the page table number of the ADR, the directory number of a valid page directory, information required for checking an attribute violation, and the like to the page table 401 via a signal line 3601 .
[0120] The page table 401 checks the page table number of the ADR (S306). The page table 401 reads the V bit, attribute, and page base of the page table entry using the page table number of the ADR and the directory number of the valid page directory. The exception check of the page table includes a check of whether the page table entry is valid, that is, whether (V bit of the specified directory number=1) and (V bit of the ADR page table number=1), and a check of the page table attribute violation. The check of the page table attribute violation includes a check of whether (V bit of the specified directory number=1) and (the page table number of the ADR has no attribute violation). The page table 401 outputs the page base and exception check information to the instruction execution control unit 312 using the signal line 1831. The instruction execution control unit 312 assigns the element number + 1 to the element number in order to check the next element number (S307). Then, the process returns to S302. When the processing up to the last element number is completed, the instruction execution control unit 312 outputs the instruction ID to the instruction scheduler 311 via a signal line 354. The instruction scheduler 311 completes the VGT instruction corresponding to the instruction ID that matches the input instruction ID, and releases the entry.
[0121] The instruction execution control unit 312 checks the exception check information output after the process of S306 for the element number for which the set value of M is 1. If the exception check information indicates that there is no exception, the instruction execution control unit 312 continues the process related to the instruction. The instruction execution control unit 312 converts the virtual address into a physical address by using the page base. The upper bits (the page directory and page table number part, bits 0 to 26) of the virtual address of the load address of Vy are replaced with the page base, and the address is converted into a physical address without converting the offset within the page. The instruction execution control unit 312 outputs the physical address and the entry number of the data buffer to the instruction issue control unit 313 using the signal line 352.
[0122] The instruction issuance control unit 313 outputs the VGT instruction to the memory using the signal line 353. When the exception check information indicates that an exception exists, the value of the exception-existing element flag is changed to 1 (valid), and the element number where the exception is first detected is stored as the exception-existing element number. Since the VGT instruction is processed in the order of element number 0 to element number VL-1, the element number where the exception is first detected is the smallest element number where an exception occurs. The instruction execution control unit 312 outputs elements with exception-existing element flag=1 and with an exception-existing element number or greater to the instruction issuance control unit 313 as elements with exceptions. When the instruction execution control unit 312 completes the processing up to the last element number, it outputs the instruction ID to the instruction scheduler 311 using the signal line 354. The instruction scheduler 311 completes the VGT instruction corresponding to the instruction ID that matches the input instruction ID, and releases the entry.
[0123] The load data of the VGT instruction is written from the memory to a specified entry number in the data buffer 222 via a signal line 270. Elements issued to the memory with an exception are returned as data unrelated to the original data (for example, data of all 0). The data buffer 222 counts the number of elements returned from the memory, and when the number matches the number of elements saved in advance, it outputs the instruction ID and completion of writing the load data of the VGT instruction to the instruction execution control unit 212 via a signal line 272. The instruction execution control unit 212 outputs the instruction ID and a notification of the completion of writing the load data of the VGT instruction to the instruction scheduler 211 via a signal line 252 . The instruction scheduler 211 changes the data buffer to available for use by a VGT instruction corresponding to an instruction ID that matches the input instruction ID. When this state is reached, the instruction scheduler 211 can use data stored in the data buffer 222 as load data for the VGT instruction. However, the instruction scheduler 211 suspends writing to the vector register 220 until the reorder buffer 112 notifies the completion (commitment) of the VGT instruction.
[0124] The reorder buffer 112 of the scalar processing unit 100 checks the completion of the instruction issue of the vector processing unit 200 of the VGT instruction, the completion of the instruction issue of the memory access processing unit 300, and the completion of the immediately preceding exception check instruction at regular intervals. When these three are completed, the reorder buffer 112 saves the exception information (whether there is an exception, the type of exception, and the smallest element number) saved in the entry of the immediately preceding exception check instruction in the entry of the VGT instruction, and changes the VGT instruction to an execution completed instruction. When all preceding instructions are completed, the reorder buffer 112 completes (commits) the immediately preceding exception check instruction and the VGT instruction as a set. Since the VGT instruction is an instruction that writes to a vector register, the reorder buffer 112 notifies the vector processing unit 200 of the completion (commit). When there is no exception, the reorder buffer 112 outputs the instruction ID, exception information, and completion (commit) to the instruction scheduler 211 using the signal line 155, and releases the entry, but does not change the exception register. If the instruction to be processed has an exception and the preceding instruction has no exception, reorder buffer 112 outputs the instruction ID, exception information, and completion (commit) of the instruction to be processed to instruction scheduler 211 using signal line 155, releases the entry, and saves the exception information of the VGT instruction in an exception register (not shown) that can be confirmed by software. If the instruction to be processed has an exception and the preceding instruction has an exception, reorder buffer 112 outputs the instruction ID, exception information, and completion (commit) related to the instruction to be processed to instruction scheduler 211 using signal line 155, releases the entry, and does not change the exception register.
[0125] When the instruction scheduler 211 receives a completion (commit) from the reorder buffer 112, it waits until a VGT instruction corresponding to an instruction ID matching the received instruction ID becomes available in the data buffer, and outputs the VGT instruction to the instruction execution control unit 212 using a signal line 251 to complete (commit) the instruction, and releases the entry. The instruction execution control unit 212 outputs a read request to the data buffer 222 using a signal line 264, outputs a write request to the vector register 220 using a signal line 260, and outputs a read request to the vector mask register 221 using a signal line 261.
[0126] The data buffer 222 outputs the load data of the VGT instruction to the vector register 220 via a signal line 271 . The vector register 220 writes the load data of the VGT instruction. The vector mask register 221 outputs M (mask) data to the vector register 220 using the signal line 263. When writing to the vector register 220, data with element numbers where the setting value of M is 1 is the write target, but the operation differs depending on whether or not an exception occurs. If there is no exception, the vector register 220 writes in normal operation (no restriction due to exceptions). If there is an exception in the instruction being processed and there is no exception in the preceding instruction, the vector register 220 writes elements up to the smallest element number where the exception occurred minus 1, and does not write elements after the smallest element number. If there is an exception in the instruction being processed and there is an exception in the preceding instruction, the vector register 220 does not write. This is because the instruction follows the instruction where the exception occurred.
[0127] As explained above, the instruction scheduler 211, the instruction execution control unit 212, the vector register 220, and the reorder buffer 112 of the vector processing unit 200 do not execute instructions following an instruction with an exception, thereby ensuring accurate exceptions.
[0128] (Other actions) Next, other operations will be described. For memory access instructions involving writing to other memories, there is no exception check instruction, but the operations for the instructions are basically the same as the operations for the VSC instruction. The instruction scheduler 311, the instruction execution control unit 312, and the reorder buffer 112 of the memory access processing unit 300 do not execute instructions following the memory access instruction with an exception, thereby ensuring accurate exceptions.
[0129] The operation for instructions that write to other vector registers is basically the same as the processing for the VGT instruction. The instruction scheduler 211, the instruction execution control unit 212, the vector register 220, and the reorder buffer 112 of the vector processing unit 200 do not execute instructions after the instruction with an exception, so that the correct exception is guaranteed.
[0130] When all in-flight instructions in the reorder buffer 112 and the instruction schedulers 113, 211, and 311 are completed (committed), a transition to exception handling becomes possible. The computer system according to this embodiment may include an exception handler. The exception handler refers to information in an exception register that can be checked by software, identifies the exception type and the instruction IC in which the exception occurred, and performs the above-mentioned exception check operation. Furthermore, if the instruction in which the exception occurred is a vector instruction, the exception handler may use information on the smallest element number in which the exception occurred to identify the instruction or element in which the exception occurred, and resume operation related to the identified instruction or element.
[0131] In the above description, it is assumed that the exception check instruction for the vector memory access instruction is an instruction defined by software, but this is not limited to the above. When the instruction decoder 111 detects an instruction such as a VSC instruction or a VGT instruction, the instruction may be defined as an internal instruction dedicated to hardware that is automatically generated before the instruction. In the above explanation, the exception check instruction having the same structure as the VSC instruction or the VGT instruction is mainly exemplified, but the present invention is not limited to this. The present invention can also be applied to an exception check instruction having the same structure as the vector store (VST) instruction or the vector load (VLD) instruction.
[0132] In these instructions, distance can be specified in Sy, base address in Sz, destination vector register in Vx, and mask in M. For exception check instructions, if distance is a positive number in level 1, the range to be checked is from MIN=Sz to MAX=(Sz+Sy×(VL-1)+access data size of instruction (8 bytes, 4 bytes, 2 bytes, 1x, etc.)), and if distance is a negative number, the range to be checked is from MIN=(Sz-Sy×(VL-1)-access data size of instruction) to MAX=Sz. Level 2 is not set. Level 3 sets the mask M value to 1 for all element numbers, and if distance is a positive number as an address, Sz+Sy×(VL-1)+access data size of instruction is checked, and if distance is a negative number, Sz-Sy×(VL-1)-access data size of instruction is checked. Level 4 checks the address of the element where mask M is set to 1. Other operations are the same as those of the VSC instruction for the VST instruction, and the same as those of the VGT instruction for the VLD instruction.
[0133] In recent years, the miniaturization of semiconductor processes has increased the number of logic circuits that can be mounted on LSIs (Large Scale Integration), and the computing performance of CPUs (Central Processing Units) has improved. This improvement in computing performance is largely due to the multi-core technology that increases the number of cores, and the performance improvement per single core is slowing down. However, since there are many programs that are difficult to parallelize, which is necessary to enjoy the performance improvement of multi-core technology, improving the performance of a single core is still important. As a method for improving the performance of a single core, SIMD (Single Instruction Multiple Data) technology, which allows multiple data and multiple arithmetic units to operate with one instruction, and vector technology are widely known. In particular, in vector processors that use vector technology, the number of elements processed by vector instructions is very large when supporting accurate exceptions required for virtual memory. Therefore, there has been a problem in that it is difficult to realize a function that saves a transient state and cancels instructions that should not be executed after the processing of each instruction has been confirmed. An instruction that should not be executed is, for example, a subsequent instruction to the instruction that detected the exception. In addition, if the execution of a subsequent command is suspended until the processing of all preceding commands is finalized, a waiting period during which commands cannot be processed occurs, which can result in a decrease in performance. Therefore, there is a demand for faster determination of the processing of preceding commands.
[0134] In this embodiment, a processor that executes a vector memory access instruction executes a memory access exception check instruction before executing the vector memory access instruction. According to the exception check instruction, a check is performed limited to information related to the occurrence of an exception at the reference destination of the original vector memory access instruction. The exception check instruction is provided with multiple stages of exception check conditions, and the exception check is performed while changing the conditions to stricter conditions. If it is determined by the exception check that an exception will not occur, the subsequent conditions are skipped and a series of processes is terminated. In addition, an address translation table that is configured to specify the range in which a page is valid by an address range is used in the exception check. This makes it possible to reduce the number of times that individual page tables are accessed when detecting a memory access exception. This makes it possible to meet the demand for high-speed detection of memory access exceptions of vector memory access instructions.
[0135] Next, the minimum configuration of the above embodiment will be described. Fig. 15 is an explanatory diagram showing an example of the minimum configuration. The processor 10 according to the above embodiment is a processor that executes an exception check instruction before executing a vector memory access instruction, and the exception check instruction indicates an exception check of information related to the reference destination of the vector memory access instruction, and the exception check has multiple stages of level-based processing, with the higher level of the level-based processing including an exception check for stricter conditions, and the lower level of the level-based processing precedes, and when the presence or absence of an exception detection is determined, the exception check instruction is terminated.
[0136] The above embodiment may be implemented as follows. (a) In the processor 10, the multi-stage level-based processing may include at least a first level-based processing that determines whether or not an exception has occurred for each address range specified by the exception check instruction, and a second level-based processing that is a higher level than the first level-based processing and determines whether or not an exception has occurred for each individual address specified by the exception check instruction. (b) In the first level-specific process, the processor 10 in (a) may refer to a validity flag indicating the validity of the page directory for each address range to determine the presence or absence of a page directory. (c)(b) Processor 10 may hold a page table in which a validity flag indicating validity is stored for each page directory, and determine the validity of the page table based on the validity flag indicated in the page table corresponding to the page directory. (d) In the processor 10 of (c), the page table may indicate an attribute for each page directory, and the presence or absence of a violation in the attribute indicated in the page table corresponding to the page directory may be determined. (e) In the processor 10 of (a), the exception check instruction may have a vector mask indicating the validity of each element, and a third level-by-level process may be executed as a higher level process than the second level-by-level process, which determines whether or not an exception exists for each element indicated by the vector mask among the individual addresses indicated by the exception check instruction. (f) In the processor 10 of (a), the exception check instruction may indicate an address and an array size for each array that stores multiple vectors, and may execute a third level-by-level process that is a higher level than the first level-by-level process and a lower level than the second level-by-level process, and determines whether or not an exception exists for each address range indicated by the address and the array size. (g) A memory access exception handling method in a processor 10, wherein the processor 10 executes an exception check instruction before executing a vector memory access instruction, the exception check instruction indicates an exception check of information relating to a reference destination of the vector memory access instruction, the exception check has multiple stages of level-based processing, with higher level level processing including exception checks against stricter conditions and lower level level processing preceding the lower level level processing, and when it is determined whether an exception has been detected, the exception check instruction is terminated.
[0137] Although the present embodiment has been described above, these embodiments are presented as examples and are not intended to limit the scope of the invention. These embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope of the invention and its equivalents as described in the claims, as well as in the scope and spirit of the invention. [Explanation of symbols]
[0138] 10... processor, 100... scalar processing unit, 110... instruction cache, 111... instruction decoder, 112... reorder buffer, 113... instruction scheduler, 114... instruction execution control unit, 120... scalar register, 121... arithmetic unit, 130... memory access instruction issue control unit, 131... exception check control unit, 132... address conversion unit, 133... vector instruction issue control unit, 200... vector processing unit, 210... instruction buffer, 211... instruction scheduler, 212... instruction execution control unit, 220... vector register, 221... vector mask register, 222... data buffer, 300... memory access processing unit, 310... instruction buffer, 311... instruction scheduler, 312... instruction execution control unit, 313... instruction issue control unit, 400... page directory, 401... page table, 402... setting unit, 403... range specification register
Claims
1. A processor that executes an exception check instruction before executing a vector memory access instruction, the exception check instruction indicates an exception check of information regarding a reference destination of the vector memory access instruction, The exception checking has a multi-stage level-based processing; The higher the level of the level-specific processing, the more strict the exception check for the condition is included, The lower the level of the processing, the earlier the level-specific processing. When it is determined whether an exception has been detected, the exception check instruction is terminated. Processor.
2. The multi-stage level processing includes: a first level-specific process for determining whether or not an exception exists for each address range designated by the exception check instruction; As a level-by-level process higher than the first level-by-level process, and a second level-by-level process for determining the presence or absence of the exception for each address designated by the exception check instruction. The processor of claim 1 .
3. In the first level-by-level processing, For each address range, a validity flag indicating the validity of the page directory is referenced to determine whether or not the page directory exists. The processor of claim 2 .
4. A page table is maintained for each page directory, in which a valid flag indicating validity is stored. The validity of the page table corresponding to the page directory is determined based on the validity flag indicated in the page table. The processor of claim 3.
5. the page table indicates attributes for each of the page directories; Determine whether there is a violation in the attributes indicated in the page table corresponding to the page directory. The processor of claim 4.
6. the exception checking instruction has a vector mask indicating element-wise validity; As a level-by-level process higher than the second level-by-level process, A third level-specific process is executed to determine the presence or absence of the exception for each element specified by the vector mask among the individual addresses specified by the exception check instruction. The processor of claim 2 .
7. The exception check instruction indicates an address and an array size for each of an array that stores a plurality of vectors; As a level-by-level process having a higher level than the first level-by-level process and a lower level than the second level-by-level process, A third level-specific process is executed to determine whether or not the exception exists for each address range indicated by the array size from the address. The processor of claim 2 .
8. A memory access exception handling method in a processor, comprising: The processor, Execute an exception check instruction before executing a vector memory access instruction, the exception check instruction indicates an exception check of information regarding a reference destination of the vector memory access instruction, The exception checking has a multi-stage level-based processing; The higher the level of the level-specific processing, the more strict the exception check for the condition is included, The lower the level of the processing, the earlier the level-specific processing. When it is determined whether an exception has been detected, the exception check instruction is terminated. Memory access exception handling method.
Citation Information
Patent Citations
Method of connecting rubber* plastic cable
JP1981030281A
Information processing device, information processing method, and program
JP6508382B1
