PARALLELIZATION METHOD, PARALLELIZATION TOOL AND VEHICLE-INSTALLED DEVICE
Patent Information
- Application Number
- DE102016219721
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2015-10-12
- Filing Date
- 2016-10-11
- Publication Date
- 2024-10-02
- Estimated Expiration
- 2036-10-11
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
The invention relates to a parallelization method and a parallelization tool for generating a parallel program for a multi-core microcomputer from a program for a single-core microcomputer, and to a vehicle-mounted device implementing the parallel program generated by the parallelization method.Hitherto, as an example of the parallelization method for generating the parallel program for the multi-core microcomputer from the program for the single-core microcomputer, there is a parallelization compilation method disclosed in Patent Literature 1.In the parallelization compilation method, after a sequential program for an embedded system to be executed by a single processor system is divided into a plurality of macro tasks (hereinafter referred to as "MTs"), the MTs having a control dependency are aggregated into one MT. Thereafter, in the parallelization compilation process, parallelizable MTs are extracted based on the data dependency, and static scheduling is performed to generate a parallel program.Patent Literature 1: JP-2015-1807A corresponding to US 2014 372 995 A1 and DE 10 2014 211 047 A1The parallel program generated in a method disclosed in Patent Literature 1 includes a queuing process of waiting for execution of an MT allocated for one core to be completed, and then allowing an MT allocated for another core to be executed.The following describes related art which does not necessarily form the prior art. It is conceivable that in the multi-core microcomputer, a value indicating completion of execution of an MT by each core is stored in a storage unit via a bus shared by the cores, and the queuing process is performed while querying the values in the storage unit.In this case, the core executing the MT accesses the bus for the purpose of executing the MT. On the other hand, the core which is in a waiting state in which the core has already executed the MT accesses the bus for the purpose of confirming whether or not another core has finished executing the MT. Therefore, the multi-core microcomputer may suffer from a problem that the bus accesses compete with each other.In the related art, in order to suppress such contention, a parallelization method allocates a no-operation ("no-operation") command to a parallel program to restrict the core in the wait state from accessing the bus. Furthermore, the number of "nop" commands is determined empirically or by systematic trial and error. For this reason, in the parallel program, the number of nop instructions may be larger or smaller than a suitable number. Therefore, the parallel program suffers from a problem that a wait state time becomes longer and the performance of the multi-core microcomputer cannot be sufficiently utilized.Further relevant prior art is known from US 2014 / 0 372 995 A1; Dietz, H. G. et al.: An Introduction to Static Scheduling for MIMD Architectures. In: Advances in Languages and Compilers for Parallel Processing. 1991, The MITPress Cambridge, MA, pp. 425-444; and lp, N.J.H. et al.: A Processor Extension for Cycle-Accurate Real-Time Software. In: Proceedings of the International Conference on Embedded and Ubiquitous Computing (EUC 2006), Korea, 2006. LNCS 4096, Springer, pp. 449-458.In view of the above problem, the present invention has as an object to provide a parallelization method and a parallelization tool capable of generating a parallel program that can restrict a waiting time from becoming longer while reducing contention of bus accesses. Another object of the present invention is to provide an on-vehicle device capable of restraining the waiting time from becoming longer while reducing the contention for bus access.The object is achieved by the features of claims 1, 6 or 11.In a first aspect of the invention, there is provided a parallelization method for generating, from a plurality of processes in a single program, for a single-core microcomputer having a core, a parallel program parallelized for a multi-core microcomputer having a plurality of cores including a subject core and another core accessing a common bus. The parallel program includes a synchronization process of, upon completion of execution of a process allocated to the subject core, waiting for completion of execution of a process allocated to another core, and then executing a next process allocated to the subject core. The parallelization method includes: a detection procedure of detecting a location in the parallel program where the synchronization process is performed; a calculation procedure of calculating a waiting time in the detected synchronization process, the waiting time being a time from completion of execution of the process allocated to the subject core to execution of the process allocated to the other core; An addition procedure of adding a suppressing process to the parallel program for suppressing access of the subject core to the bus during waiting of the subject core, wherein, in accordance with the calculated waiting time, the addition procedure determines a suppressing time which is an execution time of the suppressing process, and the addition procedure adds the suppressing process of prohibiting the subject core from accessing the bus during the suppressing time.According to the parallelization method, since the suppressing process is added to the parallel program, the parallel program can reduce contention of access to the bus between the subject core and another core while the other core executes the process. Further, because the location of the synchronization process is acquired from the parallel program, and the waiting time of the subject core in the synchronization process is calculated and the suppression time is determined in accordance with the waiting time, the parallel program can restrict the waiting time from becoming longer.In a second aspect of the invention, a parallelization tool includes a computer for generating, from a plurality of processes in a single program for a single-core microcomputer having a core, a parallel program parallelized for a multi-core microcomputer having a plurality of cores including a subject core and another core accessing a common bus. The parallel program includes a synchronization process of, upon completion of execution of a process allocated to the subject core, waiting for completion of execution of a process allocated to another core, and executing a next process allocated to the subject core. The parallelization tool includes a detection unit, a calculation unit, and an addition unit. The acquisition unit acquires a location in the parallel program where the synchronization process is performed. The calculation unit calculates a waiting time in the acquired synchronization process. The waiting time is a time from the completion of the execution of the process allocated for the subject core to the execution of the process allocated for the other core. The adding unit adds a suppressing process to the parallel program for suppressing the access of the subject core to the bus during the waiting of the subject core. In accordance with the calculated waiting time, the adding unit determines a suppressing time which is an execution time of the suppressing process. The adding unit adds the suppressing process of prohibiting the subject core from accessing the bus during the suppressing time.According to the parallelization tool, the parallel program can prevent the waiting time from becoming longer.In a third aspect of the invention, a vehicle-mounted device includes a multi-core microcomputer and a parallel program. The multi-core microcomputer has a plurality of cores including a first core and a second core that access a common bus. The parallel program is parallelized for the multi-core microcomputer from a plurality of processes in a single program for a single-core microcomputer with a core. The plurality of processes are allocated to different cores of the multi-core microcomputer. The parallel program includes a synchronization process of, upon completion of execution of a process allocated to the subject core, waiting for completion of execution of a process allocated to another core, and executing a next process allocated to the subject core. A location in the parallel program where the synchronization process is performed is detected. A waiting time in the acquired synchronization process is calculated. The waiting time is a time from the completion of the execution of the process allocated for the subject core to the execution of the process allocated for the other core. A suppressing process for suppressing the access of the subject core to the bus during the waiting of the subject core is added to the parallel program.A suppression time, which is an execution time of the suppression process, is determined in accordance with the calculated waiting time. The plurality of cores execute the processes allocated for the cores, the synchronization process, and the suppression process.According to the above configuration, since the suppressing process is added to the parallel program, the access contention to the bus between the object core and one core while the other core is executing the process can be reduced. Further, the location of the synchronization process is acquired from the parallel program, and the waiting time of the subject core in the synchronization process is calculated. Because the suppressing time is determined in accordance with the waiting time, the waiting time can be restricted from becoming longer. Therefore, because the cores execute the processes allocated for the cores, the synchronization process, and the suppression process, the contention for the bus access can be reduced, and the waiting time can be restricted from becoming longer.The foregoing and other objects, features and advantages of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings. The following are shown: FIG. 1 is a block diagram illustrating a schematic configuration of a computer according to a first embodiment; FIG. 2 is a block diagram illustrating a schematic configuration of a vehicle-mounted device according to the first embodiment; FIG. 3 is a block diagram illustrating a function of the computer according to the embodiment; FIG. 4 is a block diagram illustrating a processing operation of the computer according to the embodiment; FIG. 5 is an image diagram illustrating a schematic configuration of a parallelization program according to the embodiment; and FIG. 6 is a diagram illustrating a processing operation of a vehicle-mounted device according to comparative examples.Hereinafter, embodiments will be described with reference to the drawings. The present embodiment is directed to an example of generating a parallel program 21 a 1 parallelized for a multi-core microcomputer 21 including a first core 21 cand a second core 21 dfrom a plurality of processes MT 1 to MT 7 in a single program for a single-core microcomputer including a core. The processes may also be referred to as "processing blocks" or "macro tasks.". The multi-core microcomputer may also be referred to as a "multi-core processor.".A background for generating the parallel program 21 a 1 is that the multi-core processor 21 becomes a general trend from the viewpoint of an increase in the heat value or an increase in the power consumption of the microcomputer, or a limitation problem of a clock frequency. The multi-core processor 21 even needs to be applied to the field of vehicle-mounted equipment. The parallel program 21 a 1 needs to make the process executable with high reliability and high speed while a development period and development cost of software needs to be suppressed.In the generation of the parallel program 21 a 1, dependency of the plurality of processes MT 1 to MT 7 in the single program is analyzed, and the plurality of processes MT 1 to MT 7 are allocated for the different cores 21 cand 21 dof the multi-core processor 21. In this regard, reference is made to Patent Literature 1.The present embodiment includes, for example, a first process MT 1 to a seventh process MT 7 in the single program. The plurality of processes MT 1 to MT 7 include a process having dependency on each other. In the present embodiment, it is assumed that the first process MT 1 and the fourth process MT 4 have the dependency.The dependency is, for example, a relationship in which a process refers to data updated from another process that has been executed earlier than the one process. More specifically, the plurality of processes include a preceding process to be executed earlier in the execution order in the single program and a following process to be executed after the preceding process is executed. The following process is a process that is affected by the previous process and that uses data whose contents are likely to be updated in the previous process.A configuration of the computer 10 will be described with reference to FIG. 1. The computer 10 corresponds to a parallelization tool that executes a parallelization process, and generates the parallel program 21 a 1. The computer 10 includes a display 11, a HDD 12, a CPU 13, a ROM 14, a RAM 15, an input unit 16, and a reading unit 17. the computer 10 can read storage contents stored in a storage medium 18. An automatic parallelization compiler 1 is stored in the storage medium 18. The HDD is an abbreviation for a hard disk drive. The CPU is an abbreviation for a central processing unit. The ROM is an abbreviation for a read only memory. The RAM is an abbreviation for a random access memory. As for the configurations of the computer 10 and the storage medium 18, reference is made to a personal computer 100 and a storage medium 180 disclosed in Patent Literature 1.The automatic parallelization compiler 1 includes procedures for generating the parallel program 21 a 1. Therefore, the automatic parallelization compiler 1 corresponds to a parallelization method. More specifically, the automatic parallelization compiler 1 is a program including the parallelization method. The automatic parallelization compiler 1 includes a detection procedure, a calculation procedure, and an addition procedure in addition to the procedures disclosed in Patent Literature 1. The acquisition procedure, the calculation procedure, and the addition procedure will be described later.Next, a configuration of the vehicle-mounted device 20 will be described. As illustrated in FIG. 2, the vehicle-mounted device 20 includes the multi-core processor 21, a communication unit 22, a sensor unit 23, and an input / output port 24. the multi-core processor 21 includes a ROM 21 a, a RAM 21 b, the first core 21 c, the second core 21 d, and a bus 21 e. The vehicle-mounted device 20 may be applied to an engine control device or a hybrid control device mounted on an automobile. When the vehicle-mounted device 20 is applied to, for example, the engine control device, the parallel program 21 a 1 may be regarded as an automobile control program such as an engine controller. However, the parallel program 21 a 1 is not limited to the above. The cores may also be referred to as "processor elements.".As for the RAM 21 b, the communication unit 22, the sensor unit 23, and the input / output port 24, reference is made to a RAM 420, a communication unit 430, a sensor unit 450, and an input / output port 460 disclosed in Patent Literature 1.The parallel program 21 a 1 generated by the automatic parallelization compiler 1 is stored in the ROM 21 a. The first core 21 cand the second core 21 dexecute the parallel program 21 a 1 to perform motor control. More specifically, the first core 21 cand the second core 21 dexecute the parallel program 21 a 1 to perform motor control while using a temporary storage function of the RAM 21 bwith access to the bus 21 e. Therefore, the bus 21 eis shared between the first core 21 cand the second core 21 d. Also, the RAM 21b is shared between the first core 21c and the second core 21d. The first core 21 cand the second core 21 doperate in synchronization with a clock signal output from an not-shown oscillation circuit.In the parallel program 21 a 1, two processing MTs having dependency on each other may be arranged in the different cores 21 cand 21 d. Therefore, when the two processing MTs are arranged in the different cores 21 cand 21 dwith dependency on each other, the parallel program 21 a 1 includes a synchronization process of executing the processing MT later in the processing order after waiting for completion of execution of the processing MT allocated for another core earlier in the processing order. More specifically, in the synchronization process, upon termination of the processing MT allocated for one subject core, the subject core waits for termination of execution of the processing MT allocated for the other core, and then executes a next processing MT allocated for the subject core. In this example, the processing MT allocated to the other core has dependency on the next processing MT allocated to the subject core, and is earlier in the execution order than the next processing MT allocated to the subject core.For this reason, in order to perform the synchronization process, each of the first core 21 cand the second core 21 dengages the bus 21 eon completion of the execution of the processing MT allocated thereto, and stores information (hereinafter referred to as "completion information") indicating waiting for synchronization in the RAM 21 b. The subject core waiting for another core to end the execution of the processing MT with the dependency periodically accesses the bus 21e without executing the processing MT, and checks whether or not the end information is stored in the RAM 21b. More specifically, the subject core waiting for another core to end the execution of the processing MT with the dependency accesses the RAM 21b via the bus 21e, and checks whether or not the end information has been stored. As described above, the first core 21 cand the second core 21 dexecute the processing MT while being queued, in other words, while synchronizing. Therefore, the synchronization process may also be referred to as a "queuing process".The parallel program 21a1 includes a known "nop" instruction. Therefore, when the first core 21 cand the second core 21 dexecute the nop command, the first core 21 cand the second core 21 dgoes into a non-operation state in which they do nothing, and the first core 21 cand the second core 21 ddo not access the bus 21 e. Therefore, the "nop" command corresponds to a suppressing process for suppressing access to the bus 21 eby the subject core while the subject core is waiting. The nop command also corresponds to a "prohibition command.".The parallel program 21 a 1 includes a program to be executed by the first core 21 cand a program to be executed by the second core 21 d. The access to the bus 21e may be referred to as a "RAM access".Next, the processing operation for the computer 10 for executing the automatic parallelizing compiler 1 will be described with reference to FIGS. 3 and 4. The computer 10 executes the automatic parallelization compiler 1 to generate the parallel program 21 a 1.FIG. 3 is a drawing for illustrating the processing of the computer 10 by functional blocks. The computer 10 includes a dependency analysis unit 10 a, a processing time analysis unit 10 b, a core allocation unit 10 c, a planning unit 10 d, a calculation unit 10 e, and a code generation unit 10 f.The dependency analysis unit 10 aanalysiss the dependency of the individual program and extracts parallelizable processing MTs. The processing time analysis unit 10 banalysiss processing times of the respective processes MT 1 to MT 7, that is, a time required for execution of each processing from MT 1 to MT 7. The core allocation unit 10 callocates (more specifically, allocates) the processes MTs MT 1 to MT 7 for the cores 21 cand 21 d. The planning unit 10 dmaps the respective processing MTs MT 1 to MT 7, and thereby rearranges the respective processing MTs MT 1 to MT 7. Up to this stage, refer to Patent Literature 1. In this example, at this time, the respective processing MTs MT1 to MT7 are allocated for the cores 21c and 21d as shown in FIG. 5. In this manner, the computer 10 allocates the plurality of processing MTs MT 1 to MT 7 for the first core 21 cand the second core 21 dbased on the dependency and the processing times in the same manner as that disclosed in Patent Literature 1. The respective processing MTs MT 1 to MT 7 at this time may be used as the parallel program 21 a 1. However, in the respective processing MTs MT 1 to MT 7, the waiting time is likely to be long as described above.In view of this, the computer 10 includes the calculation unit 10 eand the code generation unit 10 f. The calculation unit 10 eand the code generation unit 10 fexecute a process illustrated in a flowchart of FIG. 4. The plurality of processing MTs MT 1 to MT 7 allocated to the first core 21 cand the second core 21 dat this time are referred to as a "preprogram" and a "preprogram", respectively. The processing MTs to be executed first by the first core 21 cand the second core 21 dare synchronized with each other and started at a start time t 0. In the respective processing MTs MT 1 to MT 7, start times and end times are known as predicted values. The start times and the end times are represented by times relative to the start time t 0.First, in step S10, it is determined whether or not there is a queuing process in which no no "nop" command is inserted. Note that the planning unit 10 dof the computer 10 performs step S 10 before the calculation unit 10 eand the code generation unit 10 fperforms the processing thereof.From the pre-program, the computer 10 acquires a location where the queuing process is performed (acquisition unit). The computer 10 determines whether or not there is the queuing process in which no no no "nop" command is inserted. If the computer 10 determines that there is the queuing process in which no no nop command is inserted, the computer 10 proceeds to step S 11, and if the computer 10 determines that the queuing process in which no no no nop command is inserted is absent, the computer 10 terminates the flowchart of FIG. 4. more specifically, the computer 10 determines whether or not the nop command is inserted for each of the queuing processes extracted from the preprocess.In an example of FIG. 5, the computer 10 detects a first queuing process W 1 and a second queuing process W 2. The computer 10 determines whether or not there is the queuing process in which no no nop command is inserted from the first queuing process W 1 and the second queuing process W 2.As described above, the preprogram may be used as the parallel program 21 a 1. Therefore, in step S 10, the location where the queuing process is performed is acquired from the parallel program 21 a 1, and it is determined whether or not there is the queuing process in which no no no "nop" command is inserted. The computer 10 executes the automatic parallelization compiler 1 to execute step S 10. Therefore, step S 10 corresponds to a detection procedure.In step S 11, the calculation unit 10 eacquires an end time tb of the process just before queuing. In step S 12, the calculation unit 10 eacquires a start time ta of the process just after queuing. This is because the calculation of a waiting time since the execution of the process allocated for the subject core is completed until the execution of the process allocated for the other core is completed in the acquired queuing process. The calculation unit 10 eacquires the end time tb of the processing MT to be executed just before the queuing process in which no no nop command is inserted and the start time ta of the processing MT to be executed just after this queuing process. The calculation unit 10 e subtracts the start time ta from the end time tb to calculate the waiting time.For example, when the first queuing process W 1 is addressed, the calculation unit 10 eacquires a time te 2 as the end time tb and a time ts 4 as the start time ta, and performs calculation of (time te 2 - time ts 4) to calculate the waiting time. Moreover, when the second queuing process W 2 is addressed, the calculation unit 10 eacquires a time te 4 as the end time tb and a time ts 7 as the start time ta, and performs calculation of (time te 4 - time ts 7) to calculate the waiting time.The computer 10 executes the automatic parallelization compiler 1 to execute steps S 11 and S 12. Therefore, steps S11 and S12 correspond to a calculation procedure.In step S 13, the number of "nop" calculated by ((tb-ta) x ratio) is added to the queuing process. The code generation unit 10 facquires ratio information 2 stored in the ROM 14. The ratio used in step S 13 is stored in the ratio information 2. More specifically, a constant or table (linear interpolation) for obtaining the ratio from a relationship between the waiting time and the nop command is included in the ratio information 2. The constant and the table serve to determine the number of nop commands corresponding to the waiting time to prevent the waiting time from becoming longer than necessary.The subject core waiting for another core to end the execution of the processing MT does not access the bus 21e while executing the nop command. The access to the bus 21e by the subject core is suppressed by the subject core execution time of the nop command. Therefore, a time during which the subject core executes the nop commands corresponds to the suppression time during which the access to the bus 21 eis suppressed by the subject core waiting for the completion of the execution of the processing MT of another core. More specifically, the number of "nop" commands corresponds to a suppression time.As described above, the suppressing process for suppressing the access of the subject core to the bus 21 eduring the waiting of the subject core is inserted into the queuing process of the parallel program 21 a 1 by the code generating unit 10 f. The code generation unit 10 fdetermines the number of nop commands in accordance with the calculated waiting time, and adds the nop commands for prohibiting the subject core from accessing the bus 21 eduring the suppression time. More specifically, the code generation unit 10 finsertions the determined number of nop commands into the queuing process in the preprogram. For example, when the code generation unit 10f adds the detected number of "nop" instructions, the code generation unit 10f adds the "nop" instructions so that the "nop" instructions are executed at equal time intervals. It can be said that the code generation unit 10 fadjusts the number of "nop" commands to be added to the parallel program 21 a 1 in accordance with the calculated waiting time.Therefore, the code generation unit 10 fcorresponds to an addition unit. The computer 10 executes the automatic parallelization compiler 1 to execute step S 13. For this reason, step S 13 corresponds to an addition procedure.As described above, as illustrated in FIG. 5, the computer 10 generates the parallel program 21 a 1. The nop commands of the number corresponding to a length of the waiting time (te2 - ts4) are added to the first queuing process W1. Also, the nop commands of the number corresponding to a length of the waiting time (te4 - ts7) are added to the second queuing process W2. The first queuing process W 1 and the second queuing process W 2 are different from each other in the length of the waiting time. Therefore, the number of "nop" in the first queuing process W 1 is different from the number of "nop" in the second queuing process W 2.Moreover, it can be said that the computer 10 generates a source code of the parallel program 21 a 1. The source of the parallel program 21 a 1 is stored by compiling and writing into the ROM 21 aof the vehicle-mounted device 20.The first processing MT 1 has a start time ts 1 and an end time te 1. The second processing time MT 2 has a start time ts 2 and an end time te 1. The start time ts 1 and the start time ts 2 are the same time and equal to the processing start time t 0. A start time ts 3 of the third processing MT MT 3 is equal to the end time te 1 and the start time ts 4. As described above, the execution start of the third processing MT MT3 is synchronized with the execution start of the fourth processing MT MT4. Because the fifth processing MT MT 5 is executed at the completion of the execution of the third processing MT MT 3, the end time te 3 of the third processing MT MT 3 is equal to a start time ts 5 of the fifth processing MT MT 5.Also, a start time ts 6 of the sixth processing MT MT 6 is equal to an end time te 5 of the fifth processing MT MT 5 and a start time ts 7 of the seventh processing MT MT 7. As described above, the execution start of the sixth processing MT MT6 is synchronized with the execution start of the seventh processing MT MT7.A symbol te 4 is an end time of the fourth processing MT MT 4. A symbol te 6 is an end time of the sixth processing MT MT 6. A symbol te 7 is an end time of the seventh processing MT MT 7.The advantages of the computer 10 will now be described with reference to comparative examples of FIG. 6. In the comparative examples, as illustrated in an upper part, the first processing MT MT 1 and the third processing MT MT 3 are allocated to the first core with the dependency on each other, and the second processing MT MT 2 is allocated to the second core with the dependency on the third process. The middle of FIG. 6 illustrates a first example of the comparative examples in which the number of nop instructions during the queuing process is relatively small, as illustrated in the middle of FIG. 6. The lower part of FIG. 6 illustrates a second example of the comparative examples in which the number of nop instructions during the queuing process is relatively large. A multi-core processor in the first comparative example executes the first processing MT MT 1 to the third processing MT MT 3 as illustrated in the middle stage of FIG. 6. A multi-core processor in the second comparative example executes the first processing MT MT 1 to the third processing MT MT 3 as illustrated in a lower stage of FIG. 6.In the multi-core processor of the first comparative example, because the number of "nop" instructions is small, a RAM access for the first core for executing the first processing MT MT MT1 is likely to compete for a RAM access for the second core for checking the termination information. Therefore, in the multi-core processor of the first comparative example 1, compared with the case where the number of "nop" instructions is large, contention frequency is increased, and the waiting time is likely to become longer.On the other hand, in the multi-core processor of the second comparative example, since the number of "nop" instructions is large, the RAM access for the first core for executing the first processing MT MT1 is unlikely to compete for the RAM access for the second core for checking the termination information. However, in the multi-core processor of the second comparative example, since the number of nop instructions is large, the waiting time is likely to become longer. In the multi-core processor of the second comparative example, the execution start of the third processing MT MT MT 3, which is a next process of the first processing MT MT 1, is likely to be delayed.Because the nop commands are added to the parallel program 21 a 1 as in the comparative examples, the computer 10 can provide the parallel program 21 a 1 that can reduce the contention of access to the bus 21 ebetween the subject core and another core during execution of the processing MT by the other core. The computer 10 may provide the parallel program 21 a 1 that may restrict, for example, the second core 21 dthat performs the first queuing process W 1 from accessing the bus during the execution of the first processing MT MT 1 by the first core 21 c. Therefore, the computer 10 can provide the parallel program 21 a 1 that can reduce the contention of access to the bus 21 ebetween the first core 21 cand the second core 21 d.Further, the computer 10 acquires the location of the queuing process from the parallel program 21 a 1, and calculates the waiting time in the queuing process. Because the computer 10 detects the number of "nop" commands in accordance with the waiting time, the computer 10 can provide the parallel program 21 a 1, which can restrict the waiting time from becoming longer. Also, the automatic parallelization compiler 1 may provide the parallel program 21 a 1 that may restrict the waiting time from becoming longer.As described above, in parallelizing the processes MT 1 to MT 7, information on the processing times of the respective processes MT 1 to MT 7 is analyzed and scheduled. For this reason, it is known which processing MT is executed by another core during the execution of the queuing process. More specifically, when a core waits for another core to end the execution of the processing MT, the processing MT executed by the other core is known. Therefore, the parallelization method can calculate how long the subject core waits. By using a result of this calculation, the computer 10 automatically sets the number of "nop" instructions. Therefore, the computer 10 can easily provide the parallel program 21 a 1 described above. The automatic parallelization compiler 1 can obtain the same advantages as those of the computer 10.The multi-core processor 21 executes the parallel program 21 a 1 generated as described above. More specifically, each of the first core 21 cand the second core 21 dexecutes the processing MT allocated thereto, the queuing process, and the suppressing process. For this reason, each of the cores 21 cand 21 dmay reduce contention of access to the bus 21 eand restrict the waiting time from becoming longer.Although the embodiment has been illustrated above, the embodiment is illustrative and not restrictive. Various modifications are possible within the scope and spirit of the invention, examples of which are described below.The automatic parallelization compiler 1 can suppress a suppressing process of prohibiting the subject core from accessing the bus 21 euntil a preset condition is satisfied since the execution of the processing MT allocated to the subject core is completed (adding procedure). The automatic parallelization compiler 1 may add a suppression process of prohibiting the subject vehicle from accessing the bus 21 efor only a suppression time by prohibiting the subject core from accessing the bus 21 euntil the preset condition is satisfied.Also, the computer 10 may add a suppressing process of prohibiting the subject core from accessing the bus 21 euntil a predetermined condition is satisfied since the execution of the processing MT allocated to the subject core has been completed (adding unit). The computer 10 may add a suppressing process of prohibiting access to the bus 21 eby the subject core only for the suppressing time by prohibiting the subject core from accessing the bus 21 euntil the preset condition is satisfied.The vehicle-mounted device 20 may include the parallel program 21 a 1 to which the above suppression process is added.The automatic parallelization compiler 1 can add a suppression process of prohibiting the subject core from accessing the bus 21 euntil a time elapsed from the completion of the execution of the processing MT allocated for the subject core reaches a preset time preset as a condition (addition procedure). The automatic parallelization compiler 1 may add a suppression process of prohibiting the subject core from accessing the bus 21 eby prohibiting the subject core from accessing the bus until the elapsed time reaches the preset time.Also, the computer 10 may execute a suppressing process of prohibiting the subject core from accessing the bus 21 euntil a time elapsed from completion of the execution of the processing MT allocated to the subject core reaches a predetermined time preset as a condition (adding unit). The computer 10 may add a suppressing process of prohibiting the subject core from accessing the bus 21 euntil the elapsed time reaches the preset time to prohibit the access to the bus 21 eby the subject core.The vehicle-mounted device 20 may include the parallel program 21 a 1 to which the suppression process as described above is added.The automatic parallelization compiler 1 can add a suppression process of prohibiting the subject core from accessing the bus 21 euntil operation timings of the subject core after the completion of the execution of the processing MT allocated to the subject core reach a preset number preset as a condition (addition procedure). As described above, the automatic parallelization compiler 1 can add a suppressing process of prohibiting the subject core from accessing the bus 21 eby prohibiting the subject core from accessing the bus 21 euntil the operation timings reach the preset number. The operation clock is a timing for operation in synchronization with the clock signal.Also, the computer 10 can add (adding unit) a suppression process of prohibiting the subject core from accessing the bus 21 euntil the operation timings of the subject core since the completion of the execution of the processing MT allocated to the subject core reach the preset number preset as the condition. The computer 10 may add the suppressing process of prohibiting the subject core from accessing the bus 21 eby prohibiting the subject core from accessing the bus 21 euntil the operation clocks reach the preset number.The vehicle-mounted device 20 may include the parallel program 21 a 1 to which the suppression process as described above is added.
Claims
A parallelization method for generating a program having a plurality of parallel executable processes for a multi-core microcomputer from a sequential program for a single-core microcomputer divided into a plurality of macro tasks, wherein the plurality of cores of the multi-core microcomputer access a common bus, wherein in an analysis of the sequential program, parallel executable macro tasks are determined with their start and end times on the individual cores of the multi-core microcomputer, wherein two macro tasks dependent on each other and executed on a subject core and another core are synchronized, wherein upon termination of the macro task allocated to the subject core, the subject core waits for termination of execution of the macro task allocated to the other core for synchronization, and then executes a next macro task, the core allocated for the sub-core, wherein synchronization is performed by a synchronization process by periodically accessing the bus the subject core waiting for the other core to finish execution of the dependent macro task, and checking whether the other core has stored termination information in the RAM and thereby confirmed completion of execution of its macro task, wherein the parallelization method further includes: a detection procedure of detecting a location in the parallel program at which the synchronization process is performed; a calculation procedure of calculating the waiting time in the detected synchronization process, wherein the waiting time is a time period from the completion of execution of the macro task allocated for the subject core to the completion of execution of the macro task allocated for the other core, and an insertion procedure of inserting a suppressing process into the synchronizing process for suppressing access of the subject core to the bus, wherein the insertion procedure determines a suppressing time which is the execution time of the suppressing process in accordance with the calculated waiting time, and the suppressing process prevents the subject core from accessing the bus during the suppressing time.The parallelization method according to claim 1, wherein the insertion procedure includes inserting, as the suppressing process, a prohibition command for prohibiting the subject core from accessing the bus, wherein the number of inserted prohibition commands corresponds to the suppressing time.The parallelization method according to claim 1, wherein the suppression process inserted in the insertion procedure for preventing the subject core from accessing the bus during the suppression time prevents the subject core from accessing the bus from the completion of execution of the process allocated to the subject core until a preset condition is satisfied.The parallelization method according to claim 3, wherein the suppression process inserted in the insertion procedure for preventing the subject core from accessing the bus during the suppression time prevents the subject core from accessing the bus until a time elapsed from completion of execution of the process allocated for the subject core reaches a preset time as the condition.The parallelization method according to claim 3, wherein the suppression process inserted in the insertion procedure for preventing the subject core from accessing the bus during the suppression time prevents the subject core from accessing the bus until operation timings of the subject core since the completion of the execution of the process allocated to the subject core reach a preset number as the condition.A parallelization tool comprising a computer for generating a program having a plurality of parallel executable processes for a multi-core microcomputer from a sequential program for a single-core microcomputer divided into a plurality of macro tasks, wherein the plurality of cores of the multi-core microcomputer access a common bus, wherein in an analysis of the sequential program, parallel executable macro tasks are determined with their start and end times on the individual cores of the multi-core microcomputer, wherein two mutually dependent macro tasks executed on a subject core and another core are synchronized, wherein upon termination of the macro task allocated for the subject core, the subject core waits for termination of the execution of the macro task allocated for the other core for synchronization, and then executes a next macro task, which is allocated to the sub-core, synchronization is performed by a synchronization process by periodically accessing the bus the subject core waiting for the other core to finish execution of the dependent macro task, and checking whether the other core has stored termination information in the RAM and thus confirmed completion of execution of its macro task, wherein the parallelization tool further includes: a detection unit that detects a location in the parallel program at which the synchronization process is performed; a calculation unit that calculates the waiting time in the detected synchronization process, the waiting time being a time period from completion of execution of the macro task allocated to the subject core to completion of execution of the macro task allocated to the other core; and an insertion unit, the inserting unit inserts a suppressing process into the synchronizing process to suppress access of the subject core to the bus, wherein the inserting unit determines a suppressing time which is the execution time of the suppressing process in accordance with the calculated waiting time, and the suppressing process prevents the subject core from accessing the bus during the suppressing time.The parallelization tool according to claim 6, wherein the insertion unit inserts a prohibition command for prohibiting the subject core from accessing the bus as the suppression process, and the number of prohibition commands added corresponds to the suppression time.The parallelization tool according to claim 6, wherein the suppression process inserted by the insertion unit for preventing the subject core from accessing the bus during the suppression time prevents the subject core from accessing the bus from the completion of execution of the process allocated to the subject core until a preset condition is satisfied.The parallelization tool according to claim 8, wherein the suppression process inserted by the insertion unit for preventing the subject core from accessing the bus during the suppression time prevents the subject core from accessing the bus until a time elapsed from completion of execution of the process allocated for the subject core reaches a preset time as the condition.The parallelization tool according to claim 8, wherein the suppression process inserted by the insertion unit for preventing the subject core from accessing the bus during the suppression time prevents the subject core from accessing the bus until operation timings of the subject core since the completion of the execution of the process allocated to the subject core reach a preset number as the condition.A vehicle-mounted device comprising a multi-core microcomputer having a plurality of cores including a subject core and another core that access a common bus, and a parallel program having a plurality of parallel executable processes with macro tasks for the multi-core microcomputer, wherein two independent macro tasks executed on the subject core and the other core are synchronized, wherein upon termination of the macro task allocated to the subject core, the subject core waits for termination of execution of the macro task allocated to the other core for synchronization, and then executes a next macro task allocated to the subject core, wherein the synchronization is performed by a synchronization process in which the subject core waits for the other core to terminate execution of the dependent macro task, A method of periodically accessing the bus and checking whether the other core has stored termination information in the RAM to confirm termination of execution of its macro task, a suppressing process is inserted into the synchronizing process for suppressing access of the subject core to the bus, wherein the suppressing process prevents the subject core from accessing the bus during a suppressing time, wherein the suppressing time, which is the execution time of the suppressing process, is in accordance with a waiting time, and the waiting time is a time period from termination of execution of the macro task allocated to the subject core to termination of execution of the macro task allocated to the other core.The vehicle-mounted device according to claim 11, wherein, as the suppressing process, a prohibiting command for prohibiting the subject core from accessing the bus is added to the parallel program, and the number of prohibiting commands added corresponds to the suppressing time.The vehicle-mounted device according to claim 11, wherein the parallel program has inserted therein the suppressing process of preventing the subject core from accessing the bus from the completion of execution of the process allocated to the subject core until a preset condition is satisfied, thereby preventing the subject core from accessing the bus during the suppressing time.The vehicle-mounted device according to claim 13, wherein the parallel program has inserted therein the suppressing process of preventing the subject core from accessing the bus until a time elapsed from completion of execution of the process allocated for the subject core reaches a preset time as the condition, thereby preventing the subject core from accessing the bus during the suppressing time.The vehicle-mounted device according to claim 13, wherein the suppression process of preventing the subject core from accessing the bus until operation timings of the subject core since the completion of the execution of the process allocated for the subject core reach a predetermined number as the condition is added to the parallel program, thereby preventing the subject core from accessing the bus during the suppression time.
Citation Information
Patent Citations
Parallelization compilation method, parallelization compiler, parallelization compilation device and on-board device
DE102014211047A1
Flexible capacitive touch sensor
JP2008151807A
Parallelizing compile method, parallelizing compiler, parallelizing compile apparatus, and onboard apparatus
US20140372995A1
