The present invention relates to a simulation device having a function of adjusting an execution timing, a simulation method, and an ECU device, for example, a simulation device used by a developer during development of software of an electronic control unit (ECU) of an automobile, a simulation method, and an ECU device.
In the development of software for ECUs, there are few cases where a hardware prototype is prepared at an early stage of the development. Therefore, in general, after designing software on a personal computer (PC), operation checking is performed in a PC environment (simulation environment), the software verified in the PC environment is ported to an actual ECU environment that is a hardware prototype, and then operation checking is performed.
Further, even after a hardware prototype is prepared, the number of hardware prototypes assigned to a software developer is often small. For example, one hardware prototype may be shared by ten software developers.
In such a case, operation checking of software (SW) or the like is performed in both the actual ECU environment that is a hardware prototype, and the PC environment.
In such a development flow, due to a difference in hardware (HW) performance between the PC and the ECU, an operation result of application software often differs between the PC environment and the actual ECU environment.
Due to a difference in execution timing of the application software between the PC environment and the actual ECU environment, malfunction that occurs only in one of the environments occurs.
In addition to the difference between the PC environment and the actual ECU environment, the specification of the PC used in development often differs between developers, which causes a situation that occurs only in an actual ECU and a specific PC.
In order to improve the quality of software in the upstream process of software development where a PC simulator is used, it is important to adjust a processing timing in the PC simulation environment to be closer to an actual ECU processing timing for each PC used.
In this regard, claim 2 of PTL 1 states that “a clock interrupt simulation in which only a time for which a simulation development environment actually uses a microprocessor unit of a development machine is measured can be executed”.
PTL 1: JP H05-282160 A
In PTL 1, a processing start timing by the clock interrupt can be adjusted, but subsequent processing timings cannot be adjusted. Therefore, a difference due to the HW performance occurs.
For example, when operating multiple applications on a multitasking operating system, an update timing of a variable shared between tasks may differ between the simulation environment and the actual ECU environment. As a result, a timing of referring to the variable may change, which may cause a difference in operation of the application software.
Even in a case where a mechanism for timing adjustment is provided in order to improve the reproducibility in the PC simulator, since there is a difference in performance (clock frequency or the like) between PCs used by developers, a parameter for the timing adjustment needs to be individually adjusted for each PC.
Therefore, a CPU clock ratio is used as information for determining the parameter for the timing adjustment, but it is difficult to calculate an effective parameter only with a fixed formula due to a factor such as a difference in external memory access performance or an influence of another process running on the PC.
Therefore, an object of the present invention is to provide a simulation device that can adjust an execution timing in a PC simulation environment to be closer to an execution timing in an actual ECU by using a simple method, a simulation method, and an ECU device.
In view of the above, according to the present invention, “a simulation device includes: a first computer including a first performance measurement function that obtains a first processing timing when the first computer executes application software, and a timing adjustment function that performs timing adjustment of an execution time of the application software in the first computer based on a time difference between the first processing timing and a second processing timing when a second computer executes the application software”.
According to the present invention, “a simulation device includes: a first computer including a first performance measurement function that obtains a first processing timing when the first computer executes an application software, and a timing adjustment function that performs timing adjustment of an execution time of the application software in the first computer based on a time difference between the first processing timing and a second processing timing when a second computer executes the application software; the second computer including a second performance measurement function that obtains, as the second processing timing, a processing timing when the application software is executed; and a communication device via which the first computer and the second computer are connected to each other”.
According to a preset invention, “an ECU device includes: a performance measurement function for obtaining a second processing timing when application software is executed; a measurement result storing unit that stores the second processing timing; and a communication device for transmitting the second processing timing to the outside”.
According to the present invention, “a simulation method includes: performing timing adjustment of an execution time of application software in a first computer based on a time difference between a first processing timing when the first computer executes the application software and a second processing timing when a second computer executes the application software”.
According to the present invention, the execution timing in the PC simulation environment can be adjusted to be closer to the execution timing in the actual ECU. Since the timing adjustment can be performed for each PC, the delay amount can be adjusted for each PC environment of a developer.
Further, according to the embodiments of the present invention, software can be verified in an environment in which a processing timing that is close to a processing timing in an actual ECU is realized even when the number of actual ECU prototypes during development is small, and thus it is possible to assist in ensuring the quality of software in the upstream process.
Hereinafter, a simulation device according to the present invention will be described in detail with reference to the drawings. Note that embodiments of the present invention are diversified. Embodiment 1 mainly and particularly describes a hardware configuration of the simulation device, Embodiments 2 to 5 describe that delay processing for adjusting an execution timing in a personal computer (PC) simulation environment to be closer to an execution timing in an actual electronic control unit (ECU) is executed, and Embodiment 6 and subsequent embodiments describe that a delay amount for adjusting the execution timing in the PC simulation environment to be close to the execution timing in the actual ECU is determined for each PC, and timing adjustment is performed while executing delay processing at a predetermined position at the time of execution in the PC simulation environment.
In Embodiment 1, particularly, the hardware configuration of the simulation device will be mainly described.
The right side of
Since the actual environment machine S and the PC are both implemented by a computer system, in hardware configurations thereof, as well known, a central processing unit (CPU) 102, a main storage device (random access memory (RAM)) 103, a hard disk drive (HDD) 104 or a read only memory (ROM) 108, and the like are connected to a system bus 101. Further, a keyboard 105, a mouse 106, and a display 107 for a developer to perform a simulation operation or verification of a simulation result are connected to the PC.
The hardware configurations of the actual environment machine S and the PC are as described above, and the hard disk drive 104 or the ROM 108 is equipped with main functions realized here.
First, the hard disk drive 104 of the PC that realizes the PC environment stores, as software Sw operated in the PC simulation environment, ECU application software Sw1, performance comparison software Sw2, and communication software Sw3 that performs communication with the ECU. Note that the ECU application software Sw1 includes a delay injection function Sw11 and a performance measurement function Sw12, the performance comparison software Sw2 includes a measurement result comparison/delay parameter setting unit Sw21 and a comparison result display unit Sw22, and the communication software Sw3 includes a measurement result receiving unit Sw31. Note that the ECU application software Sw1 represents simulation software (PC simulation software) on the PC.
In addition, the hard disk drive 104 of the PC that realizes the PC environment stores, as data files Fi for various data used at the time of operation in the PC simulation environment, an ECU measurement result file Fi1 in which an ECU measurement result is stored, a PC measurement result file Fi2 in which a PC measurement result is stored, and a delay parameter file Fi3 in which a delay parameter determined by comparing the contents of both measurement results is stored.
On the other hand, the ROM 108 of the actual environment machine S that realizes the actual ECU environment stores ECU application software Sw4. The ECU application software Sw4 includes a performance measurement function Sw41 and a measurement result transmitting unit Sw42. The main storage device (RAM) 103 of the actual environment machine S that realizes the actual ECU environment stores, as a data file Fi for various data used at the time of operation in the actual ECU environment, an ECU measurement result file Fi4 in which an ECU measurement result is stored.
It should be understood that the configuration and processing described in
Among various processing described with reference to
In the description of Embodiments 2 to 5 of the present invention, the hardware configuration and main processing functions of the PC that implements the simulation device, the hardware configuration and main processing functions being particularly related to the delay injection function Sw11, will be described. In addition, a generation process in which software to be ported to the ECU device is created by using the simulation device will be described.
First, the hardware configuration and main processing functions of the PC that implements the simulation device will be described with reference to
As described in
In the simulation device of
Referring to
Note that the ECU source code 111 includes ECU application software 121 that is operated in both the actual ECU and the PC simulator, and functions 122 for delay injection that are operated only in the PC simulator environment.
Further, the hard disk drive 104 of the PC stores the delay parameter file Fi3 that stores delay information used only in the PC simulator environment.
The compiler 113 for the PC simulator includes a compiling option 131 for hooking, into ECU software, processing of calling the functions for delay injection. When the ECU source code 111 is compiled by the compiler 113 with the compiling option 131 specified, the execution code 141 for delay injection is included in the execution file 115 for the PC simulator. The execution code 141 for delay injection has a function of executing delay processing for a delay amount described in the delay parameter file Fi3.
Note that the ECU application execution code 142 and the execution code 141 for delay injection are generated and stored in the execution file 115 for the PC simulator by the compiling processing in the processing flow F1, and an ECU application execution code 143 is generated and stored in the execution file 114 for the actual ECU by compiling processing in the processing flow F2.
It should be understood that the configuration and processing described here are described as an embodiment, and there is no intention to limit the technical scope of the present invention to this embodiment.
(a) of
The flow of this processing is shown as the processing flow F1.
Further, at this stage, various simulations using the ECU application execution code 142 are executed in the PC, and results thereof are appropriately displayed on the display 107 or the like. A developer M receives the simulation results displayed on the display 107 and appropriately modifies the ECU application software 121 by using an input means such as the mouse 106 or the keyboard 105, thereby finally obtaining application software 121A. Finally, ECU application execution file code 142A (not illustrated) is obtained.
(b) of
(c) of
The above-described procedure illustrated in
Note that, as the difference in HW performance between the first computer and the second computer, a difference in clock frequency will be described as an example in the following example. Note that, in Embodiment 2, a case where a clock frequency fe of the ECU is 1000 Hz, a clock frequency fp of the PC is 3000 Hz, and the PC has a higher performance than the ECU is described as an example. In Embodiment 3, a case where the ECU has a higher performance than the PC is described.
Embodiment 2 of the present invention is an improvement of the processing related to the first stage of the application development in (a) of
In the first stage of the application development in
With the configuration of
In short, these added functions are to “set a predetermined delay time for a predetermined timing” in a program (the ECU application execution code 142 generated in the execution file 115 for the PC simulator) that is finally formed. Therefore, it is preferable to adopt a C language, a C++ language, or JAVA (registered trademark) as a programming language in the computer of the present invention. In addition, these languages will be simply referred to as the C language hereinafter.
The functions 122 for delay injection added to the ECU source code 111 of
Note that the ECU is a so-called control computer used by being incorporated in a vehicle. Therefore, for example, a single-tasking ECU is activated in a period of 10 (ms), and each time the ECU is activated, a series of processing described in the Main function are operated so as to sufficiently complete the processing within this period. Therefore, the PC, which is the simulation device, is configured and operated on the assumption that it is also treated as a control computer. Note that a multitasking ECU has a control period of a different system, for example, the ECU is activated in a period of 5 (ms), and is operated according to an appropriate priority.
For example, in a row 201 for the Main function, At4 is set as a delay amount to be applied in a Prologue function (hereinafter, processing by this function is referred to as prologue processing) of the Main function.
In a row 202 for the func1 function, At7 is set as a delay amount in an epilogue function (hereinafter, processing by this function is referred to as epilogue processing) of the func1 function. Note that Default means that standard settings are made for parts that are not defined by the Main function or func function. In this example, a delay amount to be applied is 0 (no delay processing is executed) in the prologue processing and the epilogue processing of a function that is not described.
An adjustment group 203 illustrated in
First, the execution timing in the ECU on the left side of
Here, it is assumed that the control period of 10 (ms) is started at a time to.
In this example, the program requires a time of AtE1 for processing of a front part of the Main function, requires a time of AtE2 for processing of the func1 function, and requires a time of AtE3 for a rear part of the Main function, and the total time is within the control period of the ECU of 10 (ms) such that the processing are sufficiently completed. Note that a time at which the processing of the front part of the Main function is completed is represented by t1, a time at which the processing of the func1 is completed function is represented by t2, and a time at which the processing of the rear part of the Main function is completed is represented by t3.
On the other hand, it is desirable that the same timing as the execution timing in the ECU can be realized inside the simulation device using the PC.
In this regard, according to the conventional method (the center of
In the present invention, by appropriately setting a delay time at a front part and a rear part of a function, it is possible to realize a timing close to the execution timing in the ECU on the left side of
At this time, the program starts from the Main function. First, referring to the delay parameter file Fi3 in
Next, the program refers to the delay parameter file Fi3 in
A time for which the func1 function is executed is At2, which is the same as a case where the timing adjustment is not performed. By the setting in the delay parameter file Fi3 in
Similarly, by the setting in the delay parameter file Fi3 in
In setting the delay time in each function, whether to set a time from an absolute time (for example, a start time of the control period) or to set a time from an occurrence time of a previous event (for example, a start time and an end time of each function) can be appropriately selected.
As described above, according to the present invention, a processing timing in the PC simulation environment can be adjusted to be closer to a processing timing in the actual ECU by implementing a mechanism capable of implementing and adding the delay processing operated only in the PC simulation environment.
A position where the delay processing is applied is “prologue processing called at the start of the function” or “epilogue processing called at the end of the function”. It is possible to implement the delay processing at any one of those or both of those.
Furthermore, processing of calling a delay injection function can be implemented by adding a compiling option. It is preferable to use a function to specify a function operated in prologue and epilogue, such as a “-finstrument-functions” option of a GNU compiler collection (GCC). It is not necessary to add processing of calling a test code in application software for the test in the PC simulation environment.
As described above, the present invention is a simulation device for converting application software into an execution code, verifying the execution code, and porting the verified execution code to another computer device, in which time adjustment processing is executed with a function of a source code of an application as a unit at the start or end of the function to adjust an execution timing in another computer device.
In Embodiment 2, the delay time is set at the front part or rear part of each function to perform timing matching with the ECU on the assumption that a processing speed of the ECU is lower than a processing speed of the PC. That is, the delay processing is performed as the time adjustment processing.
On the other hand, the processing speed of the ECU may be higher than the processing speed of the PC.
Embodiment 4 also assumes a countermeasure when the processing speed of the ECU is higher than the processing speed of the PC.
In Embodiment 4, an example of a case of executing the simulation at a speed lower than that in the actual ECU environment will be described with reference to
An embodiment in which the main function illustrated in
Periodic processing timer events 601 and 602 occur, and periodic processing is started by starting the main function. The func1 function is called from the Main function (603 and 604). After the Func1 function is executed, the process returns to the main function, and the periodic processing is completed when the main function ends (605 and 606). As the next periodic processing timer event is issued (607 and 608), the next periodic processing is started in the main function. However, in the present embodiment, it can be confirmed from timings of 606 and 608 in a reverse order that the previous periodic processing is not ended due to the low CPU performance in the PC simulator environment.
In the PC simulator environment, it is not possible to execute processing at the same timing as that in the ECU in a case of execution at a 1× speed. Therefore, a timer event occurrence interval in the PC simulation environment can be increased by twice by halving the speed based on the CPU ratio, such that it is possible to execute processing at the processing timing in the PC simulation environment that is close to the processing timing in the actual ECU.
The right side of
A period in which the timer event occurs is changed in prologue processing or epilogue processing of a function executed in program initialization processing or the like.
As a variation of the present embodiment, it is also possible to provide a virtual time instead of the real time in the PC and correct the virtual time to a time reaching thereto in the ECU, in prologue/epilogue. In this method, since the correction of the virtual time is performed instead of inserting a waiting time, the simulation time can be reduced.
In Embodiments 2 to 4, the embodiments in which the timing adjustment function is applied to the program in which only one task is operated on one CPU (so-called single-tasking) have been described. On the other hand, in a multitasking ECU, it is necessary to apply the timing adjustment function to a program in which a plurality of tasks A and B are operated on one CPU.
In such a multitasking method, switching processing, in which a processing request for another task with a high priority is input during execution of one task, the one task is interrupted and processing of the other task is executed, and after the processing is completed, the remaining part of the one task is executed again, is performed.
In this example of
According to an event occurrence timing of this example, in the actual ECU, the execution processing of the task A does not end before the task B starts, and switching to the task B occurs. After the processing of the task B ends, the execution of the task A is resumed.
On the other hand, according to the conventional processing illustrated at the center of
The operation of the present invention in a case where timing adjustment is made in prologue and epilogue processing of a function in the PC simulation environment is illustrated on the right side of
As such, since the timing adjustment processing is finely made with a function as a unit as in Embodiment 2, when the timer events of the task A and the task B occur at the same timing in the actual ECU and the PC simulator, the task switching occurs even in the PC simulator. That is, in a case of the multitasking method in which tasks are operated with different control period, the simulation device can perform time adjustment processing for each of a plurality of tasks and implement interrupt processing.
In the multitasking method, an execution time stored to adjust the timing may be managed for each task, and processing to stop counting up an execution time of a task whose resource is taken by the timing adjustment processing after the task switching is performed may be executed.
In this example, the execution of the task A is stopped in a prologue function at the start of periodical processing of the task B. The counting of the processing time of the task A is stopped in the prologue function at the start of the task B, and the counting-up of the execution time of the task A is resumed in an epilogue function at the end of the processing of the task B. After that, when a timing adjustment timing comes, timing adjustment is performed by calculating a timing adjustment time based on an execution time before the resource is taken by the task B and after the resource is restored.
Embodiment 6 and subsequent embodiments describe determining, for each PC, a delay amount for adjusting the execution timing in the PC simulation environment to be closer to the execution timing in the actual ECU, and performing timing adjustment while executing the delay processing at a predetermined position at the time of execution in the PC simulation environment.
Referring to
Then, as the measurement result transmitting unit Sw42 in the ECU application software Sw4 is operated, the ECU measurement result file Fi4 is stored as the ECU measurement result file Fi1 in the PC via the measurement result receiving unit Sw31 which is communication software in the PC.
On the other hand, the performance test of the simulator in the PC environment is performed on the PC. Here, in the ECU application software Sw1 in the hard disk drive 104 of the PC that implements the simulator, the performance measurement function Sw12 is operated to obtain a measurement result in the simulator in the hard disk drive 104 and the measurement result is stored as the PC measurement result file Fi2.
In the above-described processing in the PC, a start time tsP and an end time teP of the simulation are measured as results (PC measurement result file Fi2) of the performance test of the simulator in the PC (without adjustment) illustrated at the center of
Referring back to
Thereafter, the performance test of the simulator is performed again on the PC by using the stored delay parameter file Fi3. As a result, the PC measurement result file Fi2 is updated.
The measurement result comparison/delay parameter setting unit Sw21 in the performance comparison software SW2 is operated, and the ECU measurement result file Fi1 and the PC measurement result file Fi2 are compared and verified. An adjustment time is recalculated based on a difference between the measurement results, and the delay parameter file Fi3 for implementing an operation closer to that in the actual machine is created.
Although the simulator after the timing adjustment is reflected and stored in the PC measurement result file Fi2 in the example of
The right side of
The above-described flow is summarized in
Next, when the PC simulator is executed, updated delay parameter information is read, delay processing is executed at the start and end of the function, and then the ECU application software SW1 is executed. A processing timing when the delay processing is executed is illustrated on the right side of
In Embodiment 6 described above, the execution time and timing measured in the actual ECU are stored in the ECU measurement result file Fi1. Here, the execution time and timing stored in the ECU measurement result file Fi1 can be said to be target data for matching the execution time and the timing stored in the PC measurement result file Fi2. In Embodiment 6, the procedure in which the measurement and comparison are performed on the PC after measuring the target data in the actual environment machine S has been described, but it is a matter of course that it is not necessary to perform the measurement in the actual environment machine S every time in a case where the target data is obtained in advance and stored in the ECU measurement result file Fi1.
Further, in the above-described embodiment, a case where the processing speed in the PC is higher than that in the actual environment machine S, and thus the timing adjustment processing is delay time processing is assumed. However, as described in Embodiment 3 and the like, the present invention can also be applied to a case where the processing speed in the PC is lower than that in the actual environment machine S. In the sense including both cases, it is appropriate that the delay processing is timing adjustment processing. In a broad sense, the present invention is to perform timing adjustment.
Note that the timing adjustment in the present invention does not necessarily intend complete matching with the ECU. For example, in a case where matching of about 90% is possible, it can be said that there is no great disadvantage in simulation.
Further, in the present invention, the actual environment machine S is, for example, the ECU, and the present invention has a characteristic that the ECU has a performance measurement function for measuring the timing when the application software is executed, and holds the ECU measurement result file that stores the measurement result.
In Embodiment 7, a specific processing example in a case where the timing adjustment function is applied to a single-tasking program will be described with reference to
The processing in the PC and the actual environment machine S in the embodiment of the present invention is executed by the above-described C language program.
The right side of
In a processing flow of
Next, on the PC, in Process Step S144, the program is executed in the PC simulation environment, and the execution timing is recorded. The execution timing is recorded by executing the performance measurement code described in the program using a setting value of the delay parameter file Fi3 present in the PC. Further, in Processing Step S145, the execution timing recorded in the PC simulation environment is stored in the PC measurement result file Fi2.
As horizontal axis items of the files Fi1 and Fi2 in
The ECU measurement result file Fi1 indicates that, for the task A, a start time of the Main function 171 (10 ms_func) is to, a start time of the func1 function 172 (eeprom_read) is t2, an end time of the func1 function 172 (eeprom_read) is t6, a start time of the func2 function 173 (nw_send) is t9, an end time of the func2 function 173 (nw_send) is t11, a start time of the func3 function 174 (eeprom_write) is t12, an end time of the func3 function 174 (eeprom_write) is t13, an end time of the Main function 171 (10 ms_func) is t14, and data is generated in the above order.
Similarly, the PC measurement result file Fi2 indicates that, for the task A, a start time of the Main function 171 (10 ms_func) is t0, a start time of the func1 function 172 (eeprom_read) is t1, an end time of the func1 function 172 (eeprom_read) is t3, a start time of the func2 function 173 (nw_send) is t4, an end time of the func2 function 173 (nw_send) is t5, a start time of the func3 function 174 (eeprom_write) is t7, an end time of the func3 function 174 (eeprom_write) is t8, an end time of the Main function 171 (10 ms_func) is t10, and data is generated in the above order.
After measurement results of the ECU and the PC are obtained, the performance comparison software SW2 is used to compare the measurement results, a delay amount to be injected in the PC simulation environment is determined, and the delay parameter file Fi3 is updated.
A delay amount is obtained from the delay parameter file Fi3 in Processing Step S151 which is the first processing in the processing flow of
In Processing Step S154, the ECU measurement result and the PC measurement result are compared to calculate a performance difference, and a specific processing content thereof will be described. In this case, there are multiple functions (Main function and a plurality of Func functions) by the C language program, whose execution times are to be compared, and there is a calling relationship between the respective functions. Therefore, the functions are executed from performance comparison and a group with small pieces of processing (functions that are not called by others).
The adjustment in Processing Step S154 is performed in order from the smallest adjustment group 181 described in the delay parameter table of
Describing the time relationship illustrated in
In Processing Step S155 of the processing flow of
In Processing Step S157, the delay amount is updated for each function. First, the delay amount is updated for the child function (eeprom_read). Here, that delay processing is executed in the PC simulation environment by the difference in execution time, which makes it possible to adjust the processing time in the PC simulation environment to be closer to the processing time in the actual ECU. Since the delay amount adjustment is performed at two points, that is, when the function starts and when the function ends, an amount obtained by dividing the difference in execution time into two is written as the delay amount in the delay parameter file Fi3.
Note that the differences in the execution time of the (nw_send) and (eeprom_write) functions obtained by the subsequent repetitive processing are ((t11−t9)−(t5−t4)) and ((t13−t12)−(t8−t7)), respectively.
Also for these, Processing Step S156 and Processing Step S157 are sequentially performed, and the delay amount for each child function is determined.
Note that examples of the delay processing include processing of performing a wasteful operation is performed for the delay time or processing of unnecessarily executing a while loop, instead of putting the task to sleep.
Next, in Processing Step S158 of
A time relationship of processing in the simulator at a state where child function adjustment ends is illustrated as an example in “Step 1” which is the second from the right in
In a second step (Step 2), execution timing adjustment is performed for the function (10 ms_func) which is the function (the parent function calling the child functions described above) described in the adjustment group “2” described in the delay parameter table in
An execution timing when the processing from Processing Step S151 in
Therefore, in the PC environment, a timing after a time corresponding to the half of the time length 432 elapses from an execution end timing of the parent function should match an end timing in the ECU environment.
According to the series of processing in
Note that, in the series of processing, it is preferable to additionally perform the following processing. First, in Processing Step S161, the number of times of repetition of the delay processing of the function is within a predetermined upper limit (in the example of
It is also preferable to assume a case where the delay amount adjustment processing using the performance comparison software SW2 does not end. A performance adjustment flow at this time will be described with reference to
In
With the above, the delay amount adjustment processing for one PC in the PC simulation environment ends. Generally, the type (HW specification) of PC used by each developer is different, but the execution timing in the PC simulation environment for each developer can be adjusted to be closer to that in the actual ECU by performing the delay amount adjustment for each PC.
Although Embodiment 7 has described a case where the delay amount determination and the timing adjustment are performed in the single-tasking environment, the ECU application software is often operated in the multitasking environment.
In the multitasking environment, context switching occurs based on task priority. An end time of a function changes depending on whether or not the context switching occurs.
In Embodiment 8, at the time of calculation of an execution time of a function in the performance comparison software Sw2, even when the context switching occurs, an actual processing time can be calculated by considering operation task information.
Information on two tasks used in the present embodiment is illustrated in
In this example, there are tasks A and B, and both A and B are tasks that are activated by a timer event and execute processing periodically. However, the task B has a higher priority, and the task B with a higher priority is activated during the execution of the task A.
In time series, the task A starts processing triggered by a timer event 201 from a time t0. When a timer event 202 of the task B is issued at a time t1 during the execution of the processing of the task A, the execution of the task A is interrupted and the processing of the task B starts in accordance with the priority. Then, the processing of the task B ends at a time t2, the processing of the task A is resumed, and finally the task A ends at a time t3.
Here, a start time and an end time stored for adjusting a timing are managed for each task, and each task stores the start time and the end time.
For example, an execution time of the task A interrupted by the task B can be calculated by ((t3−t0)−(t2−t1)), in which a start time and an end time of a function (func_a) of the task A are t0 and t3, respectively, and a start time and an end time of a function (func_b) of the task B are t1 and t2, respectively.
In the present invention described above, the ECU software has a time measurement function and a delay injection function. The software is executed in the actual ECU and the PC simulation environment, and an execution timing (an elapsed time after activation) is recorded.
Performance comparison software having a function of comparing contents of processing timing data that store execution timings in the actual ECU and the PC simulator, determining the amount of delay injected in the PC simulator based on a difference in processing time, and storing the determined delay amount in a file is prepared.
Using information in a delay parameter file updated by executing the performance comparison software, the ECU application software is executed again in the PC simulation environment. By executing delay processing with an adjusted delay amount in the PC simulation environment, the execution timing in the PC simulation environment can be adjusted to be closer to that in the actual ECU.
In time measurement, recording is performed at the start and end of a function whose execution timing is to be adjusted. Further, the delay processing is executed immediately after the time measurement at the start of the function and immediately before the time measurement immediately before the end of the function. It is possible to execute the delay processing at any one of those or both of those.
When the HW prototype of the ECU is not prepared, a CPU evaluation board or ECU hardware that is the basis of the development can be used, an execution timing therein can be stored as information on an execution timing in the ECU, and the information can be used as an execution timing in the actual ECU.
Number | Date | Country | Kind |
---|---|---|---|
2018-135829 | Jul 2018 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2019/025303 | 6/26/2019 | WO | 00 |