1. Field of the Invention
The present invention relates to a processor for executing a plurality of instructions in parallel.
2. Description of the Related Art
In a conventional debugging device comprising a processor having an architecture for deciding instructions that are statically executable in parallel, where is a break point in a string of instructions that is logically and physically executable in parallel, can be displayed when all of the strings of instructions are displayed. Further, the break point can be set at the instruction located on the top of the string of instructions that are executable in parallel or at the top of a container in which each of groups of instructions constituting a part of the string of instructions is divided into a fixed length. The group of instructions described here means an instruction or a plurality of serial instructions constituting the string of instructions that is executable in parallel.
However, in the conventional debugging device, it was difficult to set the break point at any arbitrary instruction in the string of instructions that is executable in parallel in any of the following states.
The first state is a state where a boundary of the string of instructions logically executable in parallel (hereinafter, referred to as a parallel boundary), for example, is divided so as to be fixed to such a length as a 128-bit length due to restrictions resulting from the architecture of the processor. In this state, even if any of the instructions in the string of instructions is replaced with a debug instruction, the other instructions with the same dividing unit as that of the relevant instruction are also executed in parallel. The debug instruction is an instruction whose purport is to generate debug interruption.
In a source program shown in
Because the BRK instruction is provided with the symbol “| |”, subsequent instructions “MOV R2, 2” and “MOV R3, 3” are possibly logically executed at the same time as the formation of the break point, and it is possible to halt under a state where instructions in 11th and 12th rows have also been executed regardless of having set the break point at the instruction in the row number 10 in the original source program.
The second state is a state where the parallel boundary is restricted to some patterns though it is not fixed based on the restrictions resulting from the architecture of the processor, and therefore, cannot be designated by any arbitrary instruction. In this state, even though any instruction in the string of sequences is tried to be replaced with the debug instruction, the other instructions based on the same dividing length as that of the relevant instruction are also executed in parallel when a position where the instruction is replaced with the debug instruction cannot be set at the parallel boundary due to the restricted patterns.
A specific example is described again referring to the example referred in the first state. Provided that a processor in which the parallel boundary can only be set every two or three instructions is used, even if the symbol “| |” of the instruction “BRK | |” is tried to be removed, it is not possible to set the parallel boundary because the instruction BRK itself is merely one instruction.
Therefore, a main object of the present invention is to make possible to set a break point at an arbitrary instruction in a string of instructions that can be executed in parallel.
A processor according to the present invention for being able to execute instructions in parallel, and also further executing a string of instructions comprising a plurality of instructions at continuous addresses as an execution unit, comprises:
an instruction analyzer comprising debug instruction detectors for detecting a debug instruction which generates debug interruption, wherein the instruction detectors are provided as many as the instructions that is executable in parallel in the processor;
an instruction executor for executing a group of instructions comprising at least an instruction that is included in the same string of instructions to which the detected debug instruction belongs, and allocated at an address of a lower-order position than that of the detected debug instruction when the debug instruction is detected by the instruction analyzer; and
an instruction canceller for canceling execution of a group of instructions comprising at least an instruction that is included in the same string of instructions to which the detected debug instruction belongs, and allocated at an address of a higher-order position than that of the detected debug instruction when the debug instruction is detected by the instruction analyzer.
According to the foregoing constitution, the break point can be freely set at any of the instructions that is simultaneously executed by setting the break point based on the debug instruction. Further, an execution order associated from the addresses to which the instructions is allocated can be correctly repeated in the string of instructions simultaneously executed when the program is halted at the break point because the execution of the instructions subsequent to the set break point is cancelled.
A processor according to the present invention is a processor capable of executing instructions in parallel, the processor further executing a string of instructions comprising a plurality of instructions at continuous addresses as an execution unit, comprises:
an instruction analyzer comprising debug instruction detectors for detecting a debug instruction which generates debug interruption and the debug instruction detectors are provided as many as the instructions that is executable in parallel by the processor;
an instruction fetcher for fetching the string of instructions from outside;
an instruction part judger for judging whether or not a part of the string of instructions fetched by the instruction fetcher corresponds with a particular bit pattern;
an instruction nullifier for nullifying a group of instructions comprising at least one of the instructions allocated at an address of a higher-order position than the instruction consistent with the particular bit pattern when the instruction part judger judges that the string of instructions includes the instruction consistent with the particular bit pattern;
an instruction issuer for issuing the instruction consistent with the particular bit pattern and a group of instructions comprising at least one of the instructions at an address of a lower-order position than that of the instruction consistent with the particular bit pattern to the instruction analyzer when the instruction part judger judges that the instruction consistent with the particular bit pattern is present in the plurality of instructions; and
an instruction decoder for decoding an arbitrary instruction selected from the instructions consistent with the particular bit pattern as the debug instruction.
According to the foregoing constitution, the break point can be freely set at any of the instructions that is simultaneously executed by setting the break point based on the debug instruction. Further, an execution order associated from the addresses of the instructions can be correctly repeated in the string of instructions simultaneously executed when the program is halted at the break point because the execution of the instructions subsequent to the set break point is cancelled. Further, as it becomes unnecessary to provide the instruction canceller, the structure of the processor is effectively simplified.
Further, the foregoing problem can be solved by means of the following instruction execution control method if the debug instruction can be arranged at any arbitrary position as in the processor according to the present invention.
An instruction execution control method according to the present invention comprises:
a step of changing an instruction boundary in a string of instructions provided in a program operated by a processor capable of executing instructions in parallel and comprising a plurality of instructions logically executable in parallel; and
a step of setting a break point at any of the instructions constituting the string of instructions.
An instruction execution control method according to the present invention comprises:
a step of changing an instruction boundary in a string of instructions provided in a program operated by a processor capable of executing instructions in parallel and comprising a plurality of instructions logically executable in parallel; and
a step of selectively executing at least an arbitrary instruction in the string of instructions.
In the foregoing constitution, it is preferable that a group of instructions comprising at least one of the instructions subsequent to the arbitrary instruction at which the break point is set, are replaced with a group of instructions comprising at least one of the instructions that do not affect an operation result to be guaranteed when the group of instructions are executed. Thereby, such a restriction of the processor that the parallel boundary cannot be changed can be avoided. As the instruction for the replacement like this, there is an NOP instruction which merely serves to advance a program counter, and the instruction of this type does not affect the operation result to be guaranteed when the instruction is executed with a BRK instruction for breaking. Further, a similar effect can be obtained when any instruction other than the arbitrary instruction is replaced with such an instruction that does not affect the operation result to be guaranteed (the foregoing instruction for the replacement) when the instruction is executed.
An instruction execution control method according to the present invention comprises:
a step for changing an order of instructions within such a range that does not affect an operation result to be guaranteed in a string of instructions provided in a program operated by a processor capable of executing instructions in parallel and constituted with a plurality of instructions logically executable in parallel; and
a step of setting a break point at any of the instructions of the above-described instructions constituting the string of instructions.
According to the constitution, it can be avoided even if there is any restriction on a description position of the BRK instruction itself.
Thus, the instruction execution control method according to the present invention is capable of avoiding it even if there is any restrictions on a description position of an NOP instruction itself by changing the order of the instructions within such a range that does not affect the operation result to be guaranteed so that the arbitrary instruction can be step-executed in the processor capable of executing the instructions in parallel.
An instruction execution control method according to the present invention comprises:
a step of changing an order of instructions within such a range that does not affect an operation result to be guaranteed in a string of instructions provided in a program operated by a processor capable of executing instructions in parallel and constituted with a plurality of instructions logically executable in parallel; and
a step of selectively executing an arbitrary instruction in the string of instructions.
An instruction execution control method according to the present invention comprises:
a step for setting a break point at an arbitrary instruction in a string of instructions provided in a program operated by a processor capable of executing instructions in parallel and constituted a plurality of instructions logically executable in parallel;
a step of correcting a position at which the break point is set in accordance with restrictions of the processor;
a step of detecting whether or not the execution of the instruction is halted at the corrected break point; and
a step for software-emulating a group of instructions comprising at least one of the instructions located between the corrected break point and the break point before the correction when it is detected that the execution of the instruction is halted at the corrected break point. Accordingly, an operation result equal to the one when the execution of the instruction is halted at the position before the correction, can be obtained.
An instruction execution control method according to the present invention comprises:
a step for extracting an arbitrary instruction from a string of instructions provided in a program operated by a processor capable of executing instructions in parallel and constituted with a plurality of instructions logically executable in parallel; and
a step for software-emulating the extracted arbitrary instruction.
Accordingly, an operation result equal to the one when the arbitrary instruction is selectively executed, can be obtained.
The processor is generated from a source program. Further, it is preferable that a correlation between an execution statement of the source program and the string of instructions be extracted from a debug information in which the execution statement of the source program and an address position of the instruction are correlated to each other, and thereafter the arbitrary instruction be selected based on the extracted correlation. Thereby, the instructions can be executed in a same order as that of the execution statement after the execution statement of the source program and a string of instructions in a machine language are correlated to each other.
According to the present invention, the break point can be effectively set at any arbitrary instruction in such a debugging in the case of a processor where a program device for determining instructions logically executable in parallel is used at the time of conversion from the source program to the machine language program. Further, each instruction can be step-executed in the case of executing the debug in the same processor.
The processor capable of executing the instructions in parallel according to the present invention is applicable to an electronic device for which a high execution performance is demanded such as control devices of different types and a signal processing device. Such an advantage of the processor according to the present invention that the debug instruction can be freely allocated can be useful in software development for electronic devices. The debugging device according to the present invention is helpful when the break point is set at a string of instructions that is generated by a program conversion device and executable in parallel, and unit execution such as the step execution is operated. In the foregoing case, a degree of freedom similar to that of a debugging device in a processor for executing an instruction as a unit can be obtained. The present invention can also be applied to a processor such as a host computer and the like other than a built-in type.
These and other objects as well as advantages of the invention will become clear by the following description of preferred embodiments of the invention. A number of benefits not recited in this specification will come to the attention of the skilled in the art upon the implementation of the present invention.
Hereinafter, preferred embodiments of the present invention are described referring to the drawings.
A processor 901 is connected to an instruction memory 902 and a data memory 903. The processor 901 fetches an instruction from the instruction memory 902 to execute the fetched instruction and thereby change an internal state of a register or the like of the processor 901 and contents of the data memory 903.
The processor 901 has the VLIW (Very Long Instruction Word) architecture for simultaneously executing a string of instructions comprising a plurality of instructions as an instruction packet. Hereinafter, the processor in which the VLIW architecture is adopted is called a VLIW processor.
Constitution of General Processor
In order to clarify differences between the present invention and the conventional technology, a basic structure of the VLIW processor generally used is described. A block diagram shown in
The processor comprises an instruction fetcher 101 for fetching the instruction from the instruction memory, instruction decoders 1011-1013 for decoding the fetched instruction, a multiplexer 1021 for selecting an operator in accordance with the decoded instruction, an ALU (Arithmetic and Logic Unit) 1031 for executing arithmetic and logical operations, a memory access unit 1032 for accessing the data memory, and a branch unit 1033 for changing the instruction to be fetched.
The respective instructions included in the instruction packet fetched by the instruction fetcher 1001 are separately decoded in parallel by the instruction decoders 1011-1013. At the time, the instruction at a lowest-order address in the instruction packet is decoded by the instruction decoder 1011, the instruction at a second-lowest-order address is decoded by the instruction decoder 1012, and the instruction at a highest-order address is decoded by the instruction decoder 1013.
The multiplexer 1021 selects the operators necessary for executing the respective instructions decoded by the instruction decoders 1011-1013, and transmits the respective instructions to the operators. In the VLIW processor, the respective instructions in the instruction packet (instruction string) are allocated based on the assumption that they are executed in parallel. Therefore, in the instructions in the same instruction packet, there is no duplication of the operators to be used and data dependency. As a result, the multiplexer 1021 has a very simple structure, which is a characteristic of the VLIW processor.
The ALU 1031, memory access unit 1032 and branch unit 1033 separately execute the instructions transmitted from the multiplexer 1021 in parallel.
When a debug instruction is executed in the branch unit 1033, a debug interruption signal 1041 is transmitted to the instruction fetcher 1001. The instruction fetcher 1001 then receives the debug interruption signal 1041 and fetches the instruction from an address designated as a debug interruption handler.
As is clear from the foregoing description, the VLIW processor can use the limited operator-related resource effectively though it is not provided with a complicated instruction scheduling function, and thereby execute the instructions in parallel.
However, the debug instruction cannot be allocated at the same instruction packet (instruction string) as the instruction wherein the branch unit 1033 is used because the debug instruction is executed in the branch unit 1033. Therefore, an arbitrary instruction cannot be replaced with the debug instruction when a break point for halting a program at an arbitrary position is set.
A first preferred embodiment of the processor 901 according to the present invention is described.
In the first preferred embodiment, the processor 901 comprises the instruction fetcher 1001, instruction decoders 1011-1013, multiplexer 1021, ALU 1031, memory access unit 1032, and branch unit 1033, in a manner similar to the basic structure of the processor described earlier.
In the first preferred embodiment, the processor 901 further comprises a debug interruption decoder 2081, a cancellation signal generator 2061, an instruction execution controller 2071, and an OR circuit 2091. The debug interruption decoder 2081 comprises debug interruption detectors 2051-2053 for detecting whether or not an arbitrary instruction generates debug interruption. The cancellation signal generator 2061 generates cancellation signals 2111-2113 for canceling the execution of the instruction. The instruction execution controller 2071 nullifies the instruction to thereby cancel the execution of the instruction. The OR circuit 2091 operates a logical addition of the debug interruption signals 2101-2103 transmitted from the debug interruption detectors 2051-2053.
The debug interruption detectors 2051-2053 obtain instruction signals 2121-2123 which are decoding results of the instruction decoders 1011-1013, and judges whether or not the debug instructions in the obtained instruction signals 2121-2123 generate the debug interruption. The respective debug interruption detectors 2051-2053 output the debug interruption signals 2101-2103 based on judgment results obtained. More specifically, the debug interruption detectors 2051-2053 assert the instruction signals 2121-2123 when it is judged that the debug instructions generate the debug interruption, while negating the instruction signals 2121-2123 when it is judged that the relevant debug instructions do not generate the debug interruption.
The debug interruption signals 2101-2103 asserted by the debug interruption detectors 2051-2053 are merged by the OR circuit 2091 and inputted to the instruction fetcher 1001 as the debug interruption signal 1041. Thereby, the debug interruption can be generated in a manner similar to the conventional processor.
The debug interruption signals 2101-2103 are also supplied to the cancellation signal generator 2061. The cancellation signal generator 2061 asserts the cancellation signals 2111-2113 based on the supplied debug interruption signals 2101-2103. More specifically, in the case where the debug interruption signals 2101-2103 of the instruction allocated at an address in an arbitrary position are asserted, the corresponding cancellation signals 2111-2113 are asserted so that the execution of the relevant instruction and a group of instructions comprising at least one of the instructions at an address of a higher-order position than that of the relevant instruction is cancelled.
The instruction execution controller 2071 converts the instruction signals 2121-2123 corresponding to the asserted cancellation signals 2111-2113 into instruction signals indicating NOP (No Operation), and transmits the converted signals to the ALU 1031, memory access unit 1032 and branch unit 1033 as instruction signals 2131-2133. Thereby, the execution of the instruction corresponding to the asserted cancellation signals 2111-2113 is nullified.
Referring to
The cancellation signal generator 2061 comprises OR circuits 4001-4002. The debug interruption signals 2101-2103 are inputted to the cancellation signal generator 2061. The debug interruption signal 2101 corresponds to the instruction allocated at an address of a lowest-order position in the instruction packet (instruction string). The debug interruption signal 2102 corresponds to the instruction allocated at an address of a second-lowest-order position in the instruction packet. The debug interruption signal 2103 corresponds to the instruction allocated at an address of a third-lowest-order position in the instruction packet.
The cancellation signal generator 2061 outputs the cancellation signals 2111-2113. The cancellation signal 2111 corresponds to the instruction allocated at the address of the lowest-order position in the instruction packet. The cancellation signal 2112 corresponds to the instruction allocated at the address of the second-lowest-order position in the instruction packet. The cancellation signal 2113 corresponds to the instruction allocated at the address of the third-lowest-order position in the instruction packet. The cancellation signal 2111 is generated from the debug interruption signal 2101. The cancellation signal 2112 is generated from a logical addition of the debug interruption signal 2101 inputted to the OR circuit 4001 and the debug interruption signal 2102. The cancellation signal 2112 is generated from the debug interruption signal 2101. The cancellation signal 2112 is generated from a logical addition of the debug interruption signal 2102 inputted to the OR circuit 4001 and the debug interruption signal 2103.
According to the foregoing constitution, in the case where the debug interruption is generated in the arbitrary instruction in the instruction packet, the cancellation signals corresponding to the instruction in which the debug interruption is generated and a group of instructions comprising at least one of the instructions allocated at the address of the higher-order position than that of the instruction, are asserted.
The instruction signals 2121-2123 and a value “0” (NOP) are inputted to the multiplexers 5001-5003. The instruction signals 2121-2123 are supplied from outside of the instruction execution controller 2071. The value “0” (NOP) indicates an instructions signal corresponding to NOP, and can be generated inside the instruction execution controller 2071. The multiplexers 5001-5003 alternatively select any of the foregoing inputs based on the cancellation signals 2111-2113 and output the selection results. The multiplexers 5001-5003 select the instruction signals 2121-2123 when the cancellation signals 2111-2113 indicates the value “0”, while selecting the value “0” (NOP) when the cancellation signals show a value “1”, and then output the selection results as the instruction signals 2131-2133. The instruction signals 2131-2133 are outputted to the ALU 1031, memory access unit 1032, and branch unit 1033.
According to the foregoing constitution, in the case where the cancellation signals 2111-2113 corresponding to the arbitrary instruction are asserted, the instruction signals 2131-2133 corresponding to them are converted into the instruction signals corresponding to the NOP. Thereby, any particular instruction can be nullified based on the asserted cancellation signals.
According to the foregoing constitution described above, in the processor 901 according to the first preferred embodiment 1, when the debug instruction is decoded, the decoded debug instruction and the group of instructions comprising at least one of the instructions allocated at the address of the higher-order position than the debug instruction, are nullified. Therefore, the instruction execution resource such as the operator is prevented from running short no matter where in the instruction packet (instruction string) the debug instruction is allocated. In other words, restrictions on the execution of the debug instruction no longer exist, and the debug instruction can be allocated at any arbitrary position in the instruction packet. Accordingly, the arbitrary instruction can be replaced with the debug instruction when the break point is set to halt the program at any arbitrary position. Further, as the execution of the group of instructions comprising at least one of the instructions subsequent to the debug instruction in the instruction packet is cancelled, a relationship between the break point and the instruction execution is more intuitively grasped due to no execution of any instruction at the address of the higher-order position than the break point when the program is halted at the break point due to the generation of the debug interruption.
The number of the instructions capable of executing simultaneously is made to be three in the foregoing preferred embodiment in order to simplify the description. A similar constitution can be applied to a VLIW processor in which the number of the instructions that can be simultaneously executed is at least two, wherein it is obvious that a similar effect can be obtained.
A second preferred embodiment of the processor 901 according to the present invention is described.
In the second preferred embodiment, the processor 901 comprises the instruction fetcher 1001, multiplexer 1021, ALU 1031, memory access unit 1032, branch unit 1033, debug instruction decoder 2081 with the debug interruption detectors 2051-2053, and OR circuit 2091, which are similar to the first preferred embodiment.
In the second preferred embodiment, the processor 901 further comprises an instruction nullifier 3151, an instruction issuer 3161, and instruction decoders 3011-3013. The instruction nullifier 3151 nullifies a group of instructions comprising at least one of the instructions allocated at an address of a higher-order position than an instruction in which a particular bit pattern is detected among the instructions fetched by the instruction fetcher 1001. The instruction issuer 3161 selectively issues the effective instruction to the instruction decoders 3011-3013. The instruction decoders 3011-3013 decode the instruction issued by the instruction issuer 3161.
Hereinafter, the foregoing operation is described in detail. First, the instruction nullifier 3151 judges whether or not a part of instructions of the instruction packet (instruction string) fetched by the instruction fetcher 1001 have the particular bit pattern. The particular bit pattern mentioned here is a pattern in which a highest-order bit is “1” in a 16-bit instruction as shown in
The instruction nullifier 3151 transmits a signal indicating that the relevant instruction is ineffective to the instruction issuer 3161 when it is judged that an arbitrary instruction has the particular bit pattern. The instruction issuer 3161 selects the instruction to be issued to the instruction decoder 2081 based on the signal indicating that the instruction supplied from the instruction nullifier 3151 is ineffective.
The instruction issuer 3151 nullifies the group of instructions comprising at least one of the instructions allocated at the address of the higher-order position than the ineffective instruction, and therefore, does not issues the group of instructions to the instruction decoders 3011-3013. When the instruction is not issued from the instruction issuer 3161, the instruction decoders 3011-3013 omit the decoding process and transmit the instruction signal corresponding to the NOP instruction to the multiplexer 1021.
The instruction decoders 3011-3013 output such a signal that any operator is not used as the instruction signal to the multiplexer 1021 when the debug instruction is decoded.
As described, all of the debug instructions are decoded as the instructions that do not use the operator resource at all in the second preferred embodiment. Therefore, the shortage of the instruction execution resource such as the operator is not generated no matter where in the instruction packet the debug instruction is allocated. Then, the restrictions on the execution of the debug instruction no longer exist, and the debug instruction can be allocated at any arbitrary position in the instruction packet. Thereby, any arbitrary instruction can be replaced with the debug instruction when the break point for halting the program at any arbitrary position is set. Further, the execution of the instructions subsequent to the debug instruction in the instruction packet is cancelled. Therefore, when the program is halted at the break point due to the generation of the debug interruption, any instruction allocated at the address of the higher-order position than the break point is not executed. As a result, the relationship between the break point and the instruction execution is more intuitively grasped.
The number of the instructions capable of executing simultaneously is made to be three in the foregoing preferred embodiment in order to simplify the description. A similar constitution can be applied to a VLIW processor in which the number of the instructions capable of executing simultaneously is at least two, wherein it is obvious that a similar effect can be obtained.
A preferred embodiment of a debugging method according to the present invention is described below referring to
A source program 101 is converted into an execution program 103a by a program converting device 102 based on directions inputted by a user to an input/output device 105. At the time, a correlation between the source program 101 and the execution program 103a can be outputted as a debug information 103b.
A debugging device 104 refers to the source program 101 and the debug information 103b in the case where the execution program 103a is present based on the user's directions from the input/output device 105 to thereby control various debug operations such as the program execution, program halt, and reference on the state of the program.
Hereinafter, the present embodiment is described in detail referring to these drawings. In the case of debugging the program of the processor capable of executing in parallel using the debugging device, the user loads the execution program 103a into the debugging device 104 according to the flow described referring to
A description is given based on the assumption that a part of the source program 101 has the structure shown in
In the case where the user of the debugging device tries to set the break point in a row number 10 in
An original instruction is memorized in a combination of an address and the original instruction as a data 1020 in Step S1002 as a precaution for a time to delete the break point after starting the instruction replacing process in Step S1001. The original instruction is replaced with the BRK instruction in the case of a post-replacement instruction, that is, the break point setting in Step S1003. The instruction replacing process is terminated in Step S1004. When the break point is deleted, an instruction restoring process starts in Step S1010. The memorized data (address and original instruction) 1020 is read and replaced with the original instruction in Step S1011. Then, the instruction restoring process is terminated in Step S1012.
In the present invention, such a disadvantage in the conventional process (parallel boundary cannot be set) is solved by means of any of methods shown in
In the case where the processor has such an architecture that the parallel boundary can be set at any arbitrary instruction, the method shown in
In the case of deleting the break point, Steps S110-S1112 are executed in a manner similar to the conventional steps S1010-S1012.
In the case of setting the break point in the row number 10 corresponding to the source program shown in
The method shown in
In the case of setting the break point in the row number 10 corresponding to the source program shown in
In the case where the position at which the break point is set cannot be broken down into the parallel boundaries even in the foregoing method, the method according to the present invention shown in
In the case of deleting the break point, Steps S1210-1212 similar to the Steps S1310-S1312 are executed. In the case of setting the break point in the row number 10 corresponding to the source program shown in
Next, a description is given based on an example in which only one execution statement (not the instruction but statement) is step-executed from the position of the row number 10 in the source program shown in
In the case where the processor is requested to execute the step execution, as the mechanical language code corresponding to the row number 10 and the mechanical language code corresponding to row numbers 11 and 12 can be logically executed in parallel, there is a possibility that both codes are simultaneously executed. A method according to the present invention in which the foregoing disadvantage is improved, is shown in
When it is judged that the relevant instruction is not the instruction executed in parallel in Step S2002, only the relevant instruction is unit-executed in Step S2006, and the step execution process is terminated in Step S2007. This process is similar to that of the conventional processor incapable of the parallel execution.
When it is judged that the relevant instruction is the instruction executed in parallel in the Step S2002, the instruction (string of the instruction executed in parallel) is reconstructed so that it can be unit-executed. At the time, the original instruction is stored. Details of the storage will be described later referring to
The reconstructed string of the instruction executed in parallel is unit-executed in Step S2004. Further, the instruction string reconstructed in the Step S2003 is restored to the original instruction string in Step S2005. The original instruction string is stored in the Step S2003 in the same manner. When the foregoing steps are completed, the step execution process is terminated in Step S2007.
The process in S2003 is described in detail. The instruction replacing process starts in Step S2101. Then, in Step S2102, the address of the position at which the instruction is desirable to be executed and the original instruction are stored in combination as a data 2120. Next, the relevant instruction and the bit pattern of the parallel boundary are synthesized in Step S2103. The synthesizing process of the bit pattern of the parallel boundary is the same as in the Step S1103 in the process flow shown in
The instruction restoring process starts when a series of the instruction replacing process is halted (S2105) after the foregoing steps are executed (Step 2110). When the instruction restoring process starts, the replaced instruction is replaced with the address and the original instruction stored in the data 2120, and the instruction restoring process is terminated in Step S2112.
According to the steps described so far, the replacement shown in
In the case where the parallel boundary cannot be changed due to the restrictions of the processor, the method according to the present invention shown in
When a series of the instruction replacing process is halted after the foregoing steps are executed (Step S2204), the instruction restoring process starts (Step S2210). When the instruction restoring process starts, the replaced instruction is replaced with the address and the original instruction stored in the data 2220 in Step S2211, and the instruction restoring process is terminated in Step S2212.
According to the steps described so far, the replacement is executed only during the step execution as shown in
In the case where the processor has such restrictions that the NOP instruction can be allocated only at the end of the instruction string, the order of the instructions is changed so that any instruction other than the NOP instruction is placed at the top of the instruction string and the NOP instruction follows the instruction as shown in
In the case where the processor has such restrictions that a description point of the debug instruction is necessary to be at the end of the instruction string, the position of the debug instruction is moved to the end of the instruction string in accordance with the restrictions, and a group of instructions comprising at least one of the instructions between the position where the debug instruction is originally desirable to be set and the moved position is replaced respectively with the NOP instruction. This process is the same as that of
In the case where the processor has such restrictions that a description point of the debug instruction is necessary to be at the top of the group of the instructions, the debug instruction is inserted at the top of the instruction string in accordance with the restrictions. Further, the order of the instructions up to the point where the debug instruction is originally desirable to be set is changed so that the instructions are moved down by the ones due to the inserted debug instruction. As a result, the restrictions can be avoided. For example, in the case where the break point is desirable to be set at the second instruction in
In the case where the processor has such restrictions that a description point of the debug instruction is necessary to be at the top of the instruction string, the position of the debug instruction is moved to the top of the instruction string in accordance with the restrictions, and a group of instructions comprising at least one of the instructions between the top position and the position at which the break point is originally desirable to be set is simulated with software. As a result, contravention of the restrictions can be avoided. In the case where the break point is desirable to be set at the second instruction in
In the case of the processor having such restrictions that the parallel boundary cannot be changed and there is no NOP instruction, neither of the methods of
Though the preferred embodiments of this invention are described in detail, it will be understood that various modifications may be made therein, and it is intended to cover in the appended claims all such modifications as fall within the true spirit and scope of this invention.
Number | Date | Country | Kind |
---|---|---|---|
2005-245645 | Aug 2005 | JP | national |
Number | Date | Country | |
---|---|---|---|
Parent | 11509797 | Aug 2006 | US |
Child | 12394538 | US |