Simulation device

During the software development process, the source code of the application software is adjusted at the time of function units and the delay processing is injected to adjust the execution timing, which solves the problem of difference in execution timing in the PC environment and the ECU environment, and achieves the effect of timing consistent with the actual ECU environment in the PC simulation environment.

CN112236754BActive Publication Date: 2025-04-22ASTEMO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201980031655.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-06-22
Filing Date
2019-04-24
Publication Date
2025-04-22
Estimated Expiration
2039-04-24

AI Technical Summary

Technical Problem

During the software development process, due to the difference in hardware performance between the personal computer PC and the ECU, the execution timing of application software in the PC environment and the actual ECU environment is different, which leads to adverse conditions.

Method used

By performing time adjustment processing based on function units in the source code of the application software, specifically injecting delay processing at the beginning or end of the function to adjust the execution timing in other computer devices to make it close to the timing of the actual ECU.

Benefits of technology

By injecting the delay processing in function call units, the processing timing can be adjusted subtly in the PC simulation environment, and thus close to the timing of the actual ECU, solving the problem of execution timing differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112236754B_ABST
    Figure CN112236754B_ABST
Patent Text Reader

Abstract

The object of the present invention is to provide a simulation device having a function of adding a delay processing for making the execution timing of a PC simulation environment close to that of an actual ECU. A simulation device for converting application software into an execution code for verification and transplanting the verified execution code to another computer device, the simulation device is characterized in that a time adjustment process is performed at the start or end of a function in a function unit of the source code of the application, and the execution timing in the other computer device is adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a simulation device having a function of aligning execution timings, and for example, to a simulation device used by a developer when developing software for an electronic control unit (ECU) of an automobile. Background Art

[0002] The development of software for ECU generally follows the following process: initially, the software is designed on a personal computer (PC), its operation is confirmed in a PC environment (simulation environment), and the software verified in the PC environment is transplanted to the actual ECU environment and its operation is confirmed.

[0003] In such a development process, due to the difference in HW (hardware) performance between a personal computer PC and an ECU, there often occurs a difference in the operating results of the application software in the PC environment and the actual ECU environment.

[0004] Due to the difference in the execution timing of the application software in the PC environment and the actual ECU environment, a problem may occur that occurs only in one of the environments.

[0005] In the upstream process of software development using a PC simulator, it is important to make the processing timing in the PC simulation environment close to the actual ECU processing timing in order to improve the quality of the software.

[0006] Regarding these contents, claim 2 of Patent Document 1 states that "a simulation of clock interruption in which only the time of a microprocessor unit of an actual development machine is measured can be realized in a simulated development environment."

[0007] Prior art literature

[0008] Patent Literature

[0009] Patent Document 1: Japanese Patent Application Laid-Open No. 5-282160 Summary of the invention

[0010] Problem that the invention aims to solve

[0011] In Patent Document 1, although the processing start timing can be made consistent based on the clock interrupt, since the subsequent processing timing cannot be adjusted, a difference due to HW performance occurs.

[0012] For example, when multiple applications are running on a multitasking operating system, the update timing of variables shared between tasks may differ between the simulation environment and the actual ECU environment. As a result, the timing of reference variables may change, and the behavior of the application software may differ.

[0013] Therefore, an object of the present invention is to provide a simulation device having a function of adding a delay process for bringing the execution timing of a PC simulation environment closer to that of an actual ECU.

[0014] Technical solutions to the problem

[0015] Therefore, in the present invention, it is set as "a simulation device, which is used to convert application software into execution code for verification, and transplant the verified execution code to other computer devices. The simulation device is characterized in that: time adjustment processing is performed at the beginning or end of the function in function units of the source code of the application, and the execution timing in other computer devices is adjusted."

[0016] Effects of the Invention

[0017] By injecting delay processing in function call units, it is possible to make the execution timing close to that of the actual ECU in fine processing units in the PC simulation environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a diagram showing the hardware configuration and main processing functions of a personal computer PC constituting the simulation device.

[0019] Figure 2 This is a diagram showing a generation process until software to be transplanted to an ECU device is created using a simulation device.

[0020] Figure 3 This is a diagram showing the processing related to the first stage of application development according to the first embodiment of the present invention.

[0021] Figure 4 It is a diagram showing an example of a C language program used in the present invention.

[0022] Figure 5 It is a diagram showing a table setting example of the timing adjustment information table 123.

[0023] Figure 6 The diagram shows execution timing examples in the simulator for an actual ECU, a case where the timing adjustment is not performed, and a case where the timing adjustment is performed.

[0024] Figure 7 This is a diagram showing a flowchart of the timing adjustment process in the first embodiment.

[0025] Figure 8 This is a diagram showing a timing example when the processing speed of the ECU is faster than the processing speed of the personal computer.

[0026] Fig. 9 This is a diagram showing the relationship between the priorities of tasks A and B.

[0027] Fig.10 This is a diagram showing a scheme of timing adjustment in the case of interrupt processing in multitasking.

[0028] Fig.11 This is a graph showing the ratio of the CPU clock number of the actual ECU to the clock number of the personal computer PC on which the simulator is running.

[0029] Fig.12 This is a diagram showing the processing timing when the actual ECU executes and the processing timing when the PC simulator executes. DETAILED DESCRIPTION

[0030] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.

[0031] In the following description, before entering the description of the embodiment of the present invention, the hardware structure and main processing functions of the personal computer PC constituting the simulation device are described. In addition, the generation process until the software transplanted to the ECU device is produced using the simulation device is described.

[0032] First, use Figure 1 , explaining the hardware structure and main processing functions of the personal computer PC that constitutes the simulation device.

[0033] Figure 1 The simulation device is composed of a general personal computer PC. As the hardware structure of the personal computer PC, a CPU 102, a main storage device (RAM) 103, a hard disk drive (HDD) 104, a keyboard 105, a mouse 106 and a display 107 are connected to a system bus 101 of the personal computer PC.

[0034] In addition, if we look at the processing function Figure 1 The simulation device can be expressed as various functions or products formed in the hard disk drive 104. Specifically, the hard disk drive 104 stores or forms an ECU source code 111 related to the ECU application software, a cross compiler 112 for generating an execution file for the actual ECU, a compiler 113 for generating an execution file for PC simulation, an actual ECU execution file 114 generated by building the ECU application software 121 using the cross compiler 112, and a PC simulator execution file 115 generated by building the ECU application software 121 using the compiler 113.

[0035] according to Figure 1There is a process F1 for forming a PC simulator execution file 115 based on the ECU source code 111 of the ECU application software, and a process F2 for forming an actual ECU execution file 114 based on the ECU source code 111 of the ECU application software. These process F1 and F2 are based on Figure 2 The following sequence is shown and executed.

[0036] The ECU source code 111 also includes ECU application software 121 that runs in both the actual ECU and the PC simulator, a delay injection function 122 that runs only in the PC simulator environment, and a timing adjustment information table 123 that runs only in the PC simulator environment.

[0037] The PC simulator compiler 113 has a compile option 131 for hooking the delay injection function call process into the ECU software. When the compiler 113 specifies the compile option 131 to compile the ECU source code 111, the PC simulator executable file 115 includes the delay injection executable code 141.

[0038] In addition, through the compilation process in processing flow F1, the ECU application execution code 142 and the delay injection execution code 141 are generated and stored in the PC simulator execution file 115, and through the compilation process in processing flow F2, the ECU application execution code 143 is generated and stored in the actual ECU execution file 114.

[0039] In addition, the structure and process described herein are described as an embodiment, and it should be understood that the technical scope of the present invention is not intended to be limited to the embodiment for interpretation.

[0040] Figure 2 This is a diagram showing a conventional generation process until software to be ported to an ECU is created using a simulator.

[0041] Figure 2 (a) shows the first stage of application development, for example, ECU application software 121 regarding brake operation in the ECU is converted by the PC simulator compiler 113, and ECU application execution code 142 is generated in the PC simulator execution file 115. The flow of this process is shown in process flow F1.

[0042] In this stage, various simulations using the ECU application execution code 142 are executed in the personal computer PC, and the results are appropriately displayed on the display 107, etc. The designer M receives the simulation results displayed on the display 107, and appropriately changes the ECU application software 121 using input means such as the mouse 106 and the keyboard 105, and finally obtains the application software 121A. Finally, the ECU application execution file code 142A (not shown) is obtained.

[0043] Figure 2 (b) indicates the second stage of application development, where the ECU application software 121A finally generated in the first stage of application development is converted by the actual ECU cross compiler 112, thereby generating an ECU application execution code 143 in the actual ECU execution file 114. The flow of this process is shown as process flow F2.

[0044] Figure 2 (c) represents the ECU confirmation stage, in which the ECU application execution code 143 finally obtained in the second stage of application development is transplanted into the ECU, and various checks are performed by the actual machine.

[0045] Figure 2 The above steps shown represent the previous generation process until the software to be transplanted to the ECU is produced using a simulation device, but the problem in this case is that due to the HW performance difference (hardware performance difference) between the first computer constituting the simulation device, namely the personal computer PC, and the second computer constituting the ECU, there will be differences in the action results of the application software in the personal computer PC environment and the ECU environment.

[0046] In addition, as a difference in HW performance between the first computer and the second computer, the difference in clock frequency is used as an example in the following examples. In addition, in Example 1, an example is shown in which the clock frequency fe of the ECU is 1000 Hz, the clock frequency fp of the personal computer PC is 3000 Hz, and the performance of the personal computer PC is higher than that of the ECU. In addition, in Example 2, an example is shown in which the performance of the ECU is higher than that of the personal computer PC.

[0047] Example 1

[0048] Embodiment 1 of the present invention improves Figure 2 (a) Processing associated with the first phase of application development. Figure 3 The process related to the first stage of application development according to the first embodiment of the present invention is shown.

[0049] exist Figure 3 In the first phase of application development, Figure 2The following functions and processes are further added in the first stage of application development (a). These functions and processes are a delay injection function 122 added to the ECU source code 111, a timing adjustment information table 123, a function combination option 131 added to the PC simulator compiler 113, and a delay injection execution code 141 added to the PC simulator execution file 115.

[0050] In addition, according to Figure 3 The configuration may be such that the timing adjustment processing is executed additionally or separately depending on whether or not a compile option is specified.

[0051] These additional functions are functions of "setting a predetermined delay time at a predetermined timing" in the final program (ECU application execution code 142 generated in the PC simulator execution file 115), so the programming language in the computer of the present invention is preferably C language, C++ language, or JAVA (registered trademark). In addition, these languages ​​are referred to as C language in the following text.

[0052] Figure 4 1 is a diagram showing an example of a C language program used in the present invention. In a C language program, Figure 4 The example is a simple program that calls the func1 function in the Main function and executes the remaining Main functions after the func1 function ends. In addition, in the Main function, multiple func functions can be called to perform processing. In addition, the Main function is sometimes called the mother function and the func function is called the child function.

[0053] Figure 1 The delay injection function 122 added to the ECU source code 111 is a function in the C language func function, which is used to implement the function of "setting a predetermined delay time at a predetermined timing". The prologue function is used for the purpose of setting the delay time at the beginning of the program, and the epilogue function is used for the purpose of setting the delay time at the end of the program.

[0054] In addition, ECU is a so-called control computer used in a vehicle. Therefore, for example, a single-task ECU is started with a 10 (ms) cycle, and is used in such a way that a series of processes described in the Main function are fully completed within the period each time it is started. Therefore, a personal computer PC as a simulation device is also used on the premise of processing as a control computer. In addition, in the case of a multi-task ECU, for example, there are control cycles of other systems that are started with a 5 (ms) cycle, and they are used with appropriate priority.

[0055] exist Figure 5 In Figure 1 The timing adjustment information table 123 defined in the embodiment is an example of table setting in this embodiment. Here, for the Main function, func function, and Default, the difference in the delay time setting position, the call source function name, the delay coefficient (delay time), the requirements of the remarks, etc. are described.

[0056] For example, in row 201 related to Default, as the default setting in this example, a delay coefficient of 3 is set. In Default, unless otherwise specified, the delay coefficient is set based on the actual CPU clock ratio between the ECU and the PC.

[0057] In row 202 of the Main function, a delay coefficient executed in the Prologue function of the Main function (hereinafter, the processing of this function is referred to as the prologue processing) is set to 0. The reason for setting the delay coefficient to 0 is that no timing adjustment is required when the execution of the Main function starts.

[0058] In row 203 of the func function, 5 is set as the timing adjustment coefficient in the Prologue function of the func1 function. Such individual setting is performed when the timing adjustment time needs to be set other than the default value. In addition, in this example, since there are many accesses to the external RAM in the processing at the beginning of the Main function, the delay coefficient for the func function is increased.

[0059] In addition, Default means that standard settings are made for parts that are not defined in the Main function or func function, etc. For example, in line 202 about the Main function, 0 is set as the delay coefficient executed in the Prologue function of the Main function, but no setting is made for the Epilogue function (hereinafter, the processing of this function is referred to as the epilogue processing). In this case, if the delay coefficient is not set, the delay coefficient is set to 3 according to the setting in Default.

[0060] Figure 6 Examples of the execution timing in the actual ECU, the execution timing in the PC simulator without timing adjustment, and the execution timing in the PC simulator with timing adjustment are shown.

[0061] First of all, Figure 6 The execution timing in the ECU on the left is described. As described above, this timing processing is the timing when the ECU is executed at a control cycle of 10 (ms) and a clock frequency of 1000 Hz. It is assumed here that the control cycle of 10 (ms) starts at time t0.

[0062] In this example, the program requires ΔtE1 for the pre-processing of the Main function, ΔtE2 for the processing of the func1 function, and ΔtE3 for the post-processing of the Main function, and the total time is sufficient to be completed within the 10 (ms) control cycle of the ECU. In addition, the time when the pre-processing of the Main function is completed is recorded as t1, the time when the processing of the func1 function is completed is recorded as t2, and the time when the post-processing of the Main function is completed is recorded as t3.

[0063] On the other hand, it is desired to realize the same timing as the execution timing in the ECU inside a simulation device using a personal computer PC.

[0064] In this regard, according to Figure 2 The existing method ( Figure 6 Center), the execution start time point is the same time t0 in both the actual ECU and the PC simulation environment, but the clock frequency of the personal computer PC is sometimes 3000Hz, and a series of processes are completed in a short time. Specifically, the pre-processing of the Main function takes Δt1 time, the processing of the func1 function takes Δt2 time, and the post-processing of the Main function takes Δt3 time, but these times are very fast compared to the actual ECU's respective times, so the execution timing is completely different from the execution timing of the actual ECU.

[0065] Therefore, in the present invention, by appropriately setting the delay time before and after the function, the same Figure 6 The execution timing in the left ECU is close to the execution timing. Figure 6 In the example with timing adjustment on the right, the start time point of the control cycle is t0, as in other cases.

[0066] At this point, the program starts from the Main function. Figure 5 The timing adjustment information table 123 executes the prologue processing of the Main function of line 202, but Figure 5 In the timing adjustment table 123, since the delay time of the prologue process of the main function is 0, the process of the Main function is entered without delay. When the main function is executed, the func1 function is called after the time Δt1.

[0067] The program then refers to Figure 5 The timing adjustment information table 123 performs the preamble processing of the func1 function in row 203, but since 5 is set as the delay coefficient here, the processing of the func1 function is performed after the delay time Δt5. Thus, the processing start time of the func1 function can be made consistent with the processing start time t1 of the func1 function in the ECU.

[0068] The execution time of the func1 function is the same as that without timing adjustment, which is Δt2. In addition, according to the settings in the Default function, the delay coefficient 3 is set as the epilogue adjustment processing of the func1 function. By setting the delay time Δt6 determined by the delay coefficient 3, the start time of the post-processing of the main function can be made consistent with the start time t2 of the processing of the main function in the ECU.

[0069] Similarly, according to the settings in the Default function, the delay coefficient 3 is set as the ending adjustment processing of the main function. By setting the delay time Δt7 determined by the delay coefficient 3, the end time of the post-processing of the main function can be made consistent with the end time t3 of the post-processing of the main function in the ECU.

[0070] In addition, Figure 5 In the timing adjustment table 123, the delay coefficient of the func1 function is 5. This means that the actual ECU needs 5 times the processing time, which means that the timing adjustment time in the func1 preamble is Δt1×(5-1).

[0071] When the waiting time (time elapsed by infinite loop processing, etc.) in the prologue processing of the func1 function has elapsed, the func1 prologue processing is terminated and the actual processing of func1 is started. The timing adjustment in the prologue processing can make the actual processing timing of the func1 function close to the processing timing in the actual ECU.

[0072] Let Δt2 be the time from the end of the func1 prologue to the beginning of the func1 epilogue. Figure 5 In the timing adjustment table 123, the delay coefficient of the epilogue processing of the func1 function is 3. This is set based on the fact that the actual ECU takes three times the time, and the timing adjustment time in the epilogue of func1 is Δt2×(3-1).

[0073] After waiting for 2×Δt2 in the epilogue of func1, the epilogue of func1 ends and the processing after the execution of func1 in the Main function begins. By adjusting the timing in the epilogue of func1, the execution timing after the func1 call in the Main function can be made close to the processing timing in the actual ECU.

[0074] After executing the rest of the Main function, the epilogue of the main function is called.

[0075] exist Figure 5In the timing adjustment table 123, the delay coefficient of the main function epilogue is the default 3. The time from the implementation of the func1 epilogue processing to the start of the main epilogue is set to Δt3. It shows that the actual ECU takes 3 times the processing time, and the timing adjustment time in the Main epilogue is Δt3×(3-1). After waiting for 2×Δt3 time in the Main epilogue processing, the Main function ends.

[0076] By adjusting the timing in the Main epilogue process, the timing at which the Main function ends can be brought close to the processing timing in the actual ECU.

[0077] exist Figure 7 The flowchart of the timing adjustment process in the first embodiment of the present example is shown in FIG. Figure 7 In the first processing step S401, the current time is obtained at the start time of the prologue function or the epilogue function. Then, in the processing step S402, the elapsed time from the last timing adjustment processing execution is calculated. Figure 5 The timing adjustment time is calculated in step S403 by using the delay coefficient obtained from the timing adjustment table shown in FIG. 1 . In addition, there are various methods for the delay coefficient, such as a method for obtaining it based on the actual CPU performance ratio of the ECU and the PC. In step S404, the timing adjustment process for the timing adjustment time obtained in step S403 is executed. Finally, in step S405, the time after the timing adjustment is executed is obtained and saved as the time after the last timing adjustment process is executed.

[0078] In addition, when setting the delay time in each function, the delay time can be appropriately set according to the time from the absolute time (such as the start time of the control cycle), or according to the time from the occurrence of the last event (such as the start and end time of each function).

[0079] As described above, in the present invention, by realizing a structure capable of installing and adding a delay process that is executed only in a PC simulation environment, the processing timing in the PC simulation environment can be made close to that of an actual ECU.

[0080] In addition, the place to add the delay processing is set to "the prologue processing called at the beginning of the function" or "the epilogue processing called at the end of the function". You can install the delay processing in one or both.

[0081] In addition, the call processing of the delay injection function can be implemented by adding a compile option. It is preferable to use the function that can specify the function to be run in the prologue and epilogue, such as the "-finstrument-functions" option of GCC. There is no need to add the process of calling the test code in the application software for testing in the PC simulation environment.

[0082] As described above, the present invention is a simulation device for converting application software into execution code for verification and transplanting the verified execution code into other computer devices. The simulation device is characterized in that time adjustment processing is performed at the beginning or end of the function in function units of the application's source code to adjust the execution timing in the other computer devices.

[0083] Example 2

[0084] In the first embodiment, the processing speed of the ECU is slower than that of the personal computer, and a delay time is set before or after each function to make it consistent with the timing between the ECUs. That is, a delay process is performed as a time adjustment process.

[0085] On the other hand, the processing speed of the ECU may be faster than that of the personal computer. Figure 8 This is a diagram showing a timing example when the processing speed of the ECU is faster than that of the personal computer. It shows the response to this situation. For example, it is assumed that the ECU takes ΔtE1 to process the Main function, but the personal computer takes longer than this. In this case, it is preferable to adjust the time required for processing the Main function in the personal computer by multiplying it by an appropriate coefficient so that it is the processing time ΔtE1 in the ECU. This is a time shortening process as a timing adjustment process.

[0086] Example 3

[0087] Embodiment 3 also assumes a countermeasure when the processing speed of the ECU is faster than the processing speed of the personal computer PC.

[0088] For Example 3, use Fig.11 and Fig.12 The following describes an example of a case where the simulation speed is lower than that of the actual ECU environment. The following describes an example of a case where the timing adjustment function is applied when the actual ECU is running at a higher speed by comparing the actual ECU with a personal computer PC running the simulator.

[0089] Execute periodically Figure 4 The ratio of the CPU clock number of the actual ECU to the clock number of the personal computer PC running the simulator is as follows: Fig.11This embodiment takes the environment where the performance of the actual ECU is twice that of a personal computer PC as an example.

[0090] exist Fig.12 In the example, the processing timing when the actual ECU executes the program and the processing timing when the PC simulator executes the program are described.

[0091] The periodic processing is started by starting the main function with the occurrence of the periodic processing timer events 601 and 602. The func1 function is called from the Main function (603 and 604). After executing the Func1 function, the main function is returned, and the periodic processing is completed at the end time of the main function (605 and 606). The next periodic processing timer event is dispatched (607 and 608), so that the next periodic processing starts from the main function. However, in the case of this embodiment, it can be confirmed that the previous periodic processing has not ended due to the low CPU performance in the PC simulator environment based on the timing exchange of 606 and 608.

[0092] In the PC simulator environment, since processing cannot be performed with the same timing as the ECU when executed at the same speed, the interval between timer events in the PC simulation environment is doubled by 1 / 2 speed based on the CPU ratio, so that the processing timing in the PC simulation environment can be executed in a form close to that of the actual ECU.

[0093] exist Fig.12 On the right side, the processing timing when executing at 1 / 2 speed in the PC simulation environment is recorded. The occurrence of the timer event (609), the start of execution of the func1 function (610), and the end of the main function (611) are the same as the execution timing when reproducing at the same speed in the PC simulation environment, but the next cycle processing timer event occurrence timing (612) is 2 times later than the same speed reproduction, thereby enabling the cycle processing in the PC simulation environment to be controlled within the cycle. In addition, when the execution time of the function in the PC is shorter than twice the execution time in the ECU, the correction method in the prologue and epilogue is the same as that in Example 1.

[0094] The change in the cycle of generating timer events is implemented in the prologue process or epilogue process of a function executed in the program initialization process or the like.

[0095] As a variation of this embodiment, the following method can also be adopted, that is, a virtual time is provided instead of the actual time in the PC, and in the prologue and epilogue, the virtual time is corrected to the time when the ECU reaches the time. In this method, the virtual time is corrected instead of inserting the wait, so the simulation time can be reduced.

[0096] Example 4

[0097] In the first to third embodiments, the timing adjustment function is applied to a program in which only one task is executed on one CPU (so-called single task). In contrast, in a multi-task ECU, the timing adjustment function needs to be applied to a program in which multiple tasks A and B are executed on one CPU.

[0098] In this multitasking method, the following switching process occurs, that is, during the execution of one task, a processing request of another task with a higher priority is entered, the former is interrupted and the latter is processed, and after the processing is completed, the remaining part of the former task is executed again.

[0099] Fig. 9 The relationship between the task priorities of tasks A and B is shown. Task A is started at a control cycle of, for example, 10 (ms), and task B is started at a control cycle of, for example, 5 (ms), and task B has a higher priority.

[0100] Fig.10 A scheme for adjusting the timing of interrupt processing in multitasking is shown. Fig.10 The left side in the middle shows the actual processing in the ECU, and task A and task B are executed in different control cycles. Here, the start time of the periodic processing timer of task A is represented by t0A1 and t0A2, and the start time of the periodic processing timer of task B is represented by t0B. In addition, in this example, the time between t0A1 and t0A2 is the control cycle of task A. Due to the interrupt processing of task B, the restart time of task A becomes t1, and the end time of task A becomes t2.

[0101] In this Fig.10 In the example, task A starts processing at the timer event at time t0A1. Then, at time t0B during the execution of task A, the timer event of task B is dispatched. At this time, the execution of task A is interrupted according to the priority relationship, and the processing of task B starts.

[0102] According to the event occurrence timing of this example, in the actual ECU, the execution of task A does not end until task B starts, and switching to task B occurs. After the processing of task B ends, the execution of task A starts again.

[0103] On the other hand, according to Fig.10In the conventional processing of the center, since the PC simulator environment is faster than the ECU, the execution of task A is completed before task B starts, so task switching does not occur. In other words, in the existing method, task switching in multi-tasking cannot be reproduced. As a result, even if it can be executed and operated correctly in one cycle in the PC simulator environment, when the operation is confirmed in the actual ECU environment, problems such as processing not being completed during one cycle often occur.

[0104] exist Fig.10 On the right side of the figure, the operation of the present invention is described in the case where timing adjustment is added to the prologue and epilogue processing of the function in the PC simulation environment. According to this description example, by taking an appropriate delay time, the front-end processing part of task A can be formed, and the back-end processing part of task B and task A can also be formed, and interrupt processing can be realized.

[0105] Thus, similar to the first embodiment, since the timing adjustment process is carefully added in the function unit, when the timer events of task A and task B occur at the same timing in the actual ECU and the PC simulator, the task switching also occurs in the PC simulator. That is, in the case of a multi-task mode that runs in different control cycles, the simulation device can perform the timing adjustment process on each of the multiple tasks, thereby reproducing the interrupt processing.

[0106] In the multitasking method, the execution time stored for timing adjustment is managed for each task, and in the timing adjustment process after switching tasks, it is preferable to perform a process of stopping the count-up of the execution time of the task that has seized resources.

[0107] In this example, the prologue function at the start of the periodic processing of task B stops the execution of task A. The prologue function at the start of task B stops the processing time count of task A, and the epilogue function at the end of the processing of task B starts the count of the execution time of task A again. Thereafter, when the timing adjustment timing arrives, the timing adjustment time is calculated based on the execution time of task B before and after the resource is seized, and the timing adjustment is performed.

[0108] Explanation of symbols

[0109] 101: System Bus

[0110] 102: CPU

[0111] 103: Main storage device (RAM)

[0112] 104: Hard disk drive (HDD)

[0113] 105: Keyboard

[0114] 106: Mouse

[0115] 107: Display

[0116] 111: ECU source code

[0117] 112: Cross-compiler

[0118] 113: Compiler

[0119] 114: Actual ECU execution file

[0120] 115: PC simulator executable file

[0121] 121: ECU application software

[0122] 122: Delay injection function

[0123] 123: Timing adjustment information table

[0124] 131: Compile options

[0125] 141: Delayed injection with execution code

[0126] 142, 143: ECU application execution code

[0127] F1, F2: Processing flow.

Claims

1. A simulation device for converting application software into an execution code for verification and transplanting the verified execution code into an ECU of a vehicle, wherein the simulation device is characterized in that: The timing adjustment process is performed at the start or end of a function in a function unit of the source code of the application to adjust the execution timing in the ECU. When the simulation device is slower than the ECU, a calculation at a slower speed is performed to change the interval between occurrences of timer events in the simulation device based on the speed ratio between the simulation device and the ECU as the timing adjustment process.

2. The simulation device according to claim 1, characterized in that As a programming language capable of performing the time adjustment process, any one of C language, C++ language, and JAVA is adopted.

3. The simulation device according to claim 1, characterized in that The ECU is a multi-tasking computer device that operates in different control cycles, and the simulation device performs the timing adjustment process on each of the plurality of tasks to reproduce the interruption process.

4. The simulation device according to any one of claims 1 to 3, characterized in that The timing adjustment process can be executed additionally or separately depending on whether a compile option is specified.

Citation Information

Patent Citations

  • Real time simulation development mechanism

    JP1993282160A

  • System having portable device and program execution apparatus, and the portable device and program execution apparatus used for the system

    JP2012203845A

  • Method and system for variable scale time management for simulation environments

    US20080154559A1