JP2018041130A - Method for acquiring execution time data on on-vehicle control program and on-vehicle control device - Google Patents

Method for acquiring execution time data on on-vehicle control program and on-vehicle control device Download PDF

Info

Publication number
JP2018041130A
JP2018041130A JP2016172544A JP2016172544A JP2018041130A JP 2018041130 A JP2018041130 A JP 2018041130A JP 2016172544 A JP2016172544 A JP 2016172544A JP 2016172544 A JP2016172544 A JP 2016172544A JP 2018041130 A JP2018041130 A JP 2018041130A
Authority
JP
Japan
Prior art keywords
dma transfer
data
channel
dma
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2016172544A
Other languages
Japanese (ja)
Other versions
JP6188895B1 (en
Inventor
石原 健太郎
Kentaro Ishihara
健太郎 石原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2016172544A priority Critical patent/JP6188895B1/en
Application granted granted Critical
Publication of JP6188895B1 publication Critical patent/JP6188895B1/en
Publication of JP2018041130A publication Critical patent/JP2018041130A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Information Transfer Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To minimize an amount of increase in a CPU load and an amount of change in original processing timing caused by processing itself especially when execution time data on short-cycle processing is created/transmitted in order for operation verification of an on-vehicle control program.SOLUTION: An on-vehicle control device includes: a CPU for executing an on-vehicle control program including a plurality of processes; and a DMAC including a plurality of channels and capable of DMA transfer, without using the CPU, of data in an address space which the CPU can access. The on-vehicle device executes at least one of creation of execution time data and transmission of the execution time data by DMA transfer without using the CPU.SELECTED DRAWING: Figure 1

Description

本発明は、複数の処理を有する車載制御プログラムの動作検証を行う目的で、複数の処理のそれぞれの実行タイミングあるいは実行内容をモニタリングするための実行時データを取得する、車載制御プログラムの実行時データ取得方法および車載制御装置に関する。   The present invention obtains runtime data for monitoring the execution timing or execution content of each of the plurality of processes for the purpose of performing operation verification of the in-vehicle control program having a plurality of processes. The present invention relates to an acquisition method and an in-vehicle control device.

昨今の車載制御装置では、その制御プログラムの規模が増加しており、その構造も複雑化し、多様化している。これに伴って、制御プログラムを実行するCPUも、高機能化および高速化のために、アーキテクチャが複雑化し、また、キャッシュメモリを備える等の構成を採用している。このことにより、制御プログラムの実行結果の予測が容易でなくなっている。   In recent vehicle-mounted control devices, the scale of the control program has increased, and the structure has become complicated and diversified. Along with this, the CPU that executes the control program also adopts a configuration in which the architecture is complicated and a cache memory is provided for higher functionality and higher speed. This makes it difficult to predict the execution result of the control program.

このようなハードウェアの変化に加え、ソフトウェアの変化もある。制御プログラムの開発費用を削減するために、ソフトウェアの再利用性を向上させる必要がある。そして、その一手段として、制御プログラムの基本部分にリアルタイムオペレーティングシステム(以下、「RTOS」と記す)を採用することで、ソフトウェアの再利用性の向上が図られている。   In addition to these hardware changes, there are also software changes. In order to reduce the development cost of the control program, it is necessary to improve the reusability of the software. As one means, the software reusability is improved by adopting a real-time operating system (hereinafter referred to as “RTOS”) as a basic part of the control program.

RTOSにおける基本的な実行単位は、タスクであり、通常は、RTOS上で複数動作するように作成され、各タスクは、優先度に基づいて動作するように設定される。タスクの優先度は、RTOS内のスケジューラによって評価され、より優先度の高いタスクにCPUが割り当てられる。   A basic execution unit in the RTOS is a task, which is normally created so as to operate in plural on the RTOS, and each task is set to operate based on the priority. The task priority is evaluated by a scheduler in the RTOS, and a CPU is assigned to a task with a higher priority.

このような優先度に基づいたRTOSのスケジューラの挙動は、RTOSを使用しない従来のスケジューラの挙動と異なることが多い。従って、新規にRTOSを採用した場合、例えば、処理が開始および終了するタイミングなど、制御プログラム内の各処理の実行タイミングが変化することがある。その結果、制御プログラムが正しく動作しなくなることがある。   The behavior of an RTOS scheduler based on such priorities is often different from the behavior of a conventional scheduler that does not use RTOS. Therefore, when RTOS is newly adopted, the execution timing of each process in the control program may change, for example, the timing at which the process starts and ends. As a result, the control program may not operate correctly.

また、新規にRTOSを使用せず、同一のRTOSを継続使用して製品の差分開発を行う場合においても、マイコンの変更、制御プログラムの仕様変更、機能の追加等の要因で、制御プログラム内の各処理の実行タイミング等が変化する。   In addition, even in the case of differential development of products using the same RTOS without using a new RTOS, due to factors such as changing the microcomputer, changing the specifications of the control program, adding functions, etc. The execution timing of each process changes.

上述したようなハードウェアおよびソフトウェアの変化の中で、制御プログラム内の各処理の挙動または実行タイミングをあらかじめ十分な精度で予測することは難しい。また、高い精度で予測できていると考えられる場合であっても、その予測が妥当であることを確認する必要がある。   In the hardware and software changes as described above, it is difficult to predict the behavior or execution timing of each process in the control program with sufficient accuracy in advance. Even if it is considered that the prediction can be made with high accuracy, it is necessary to confirm that the prediction is appropriate.

このため、制御プログラムの挙動や実行タイミング等に問題がないことを、車載制御装置およびその制御プログラムを実際の使用条件の下で動作させながら確認する手段が必要になる。   For this reason, it is necessary to confirm that there is no problem in the behavior and execution timing of the control program while operating the in-vehicle control device and the control program under actual use conditions.

確認のために用いられる手段の一例としては、リアルタイムトレース機能が知られている。具体例としては、例えば、Green Hills Software社により製品化されている「Super Trace Probe」が挙げられ、以下の説明では、この「Super Trace Probe」に相当する技術を、従来技術1と称することとする。   As an example of means used for confirmation, a real-time trace function is known. As a specific example, for example, “Super Trace Probe” commercialized by Green Hills Software is cited, and in the following description, the technology corresponding to “Super Trace Probe” is referred to as Conventional Technology 1. To do.

この従来技術1は、マイコンに備えられているオンチップデバッガと専用ピンを介して接続することで、制御プログラム実行中にオンチップデバッガから各処理の実行タイミングや、処理実行時の実行内容を示す変数の値等を取得することで、リアルタイムトレース機能を実現している。ここで、各処理の実行タイミングや、処理実行時の実行内容を示す変数の値等のことを、以下の説明では、「実行時データ」と称することとする。   This prior art 1 shows the execution timing of each process from the on-chip debugger during execution of the control program and the execution contents at the time of the process execution by connecting to an on-chip debugger provided in the microcomputer via a dedicated pin. Real-time trace function is realized by acquiring variable values. Here, the execution timing of each process, the value of a variable indicating the execution content at the time of executing the process, and the like will be referred to as “execution time data” in the following description.

従来技術1によれば、例えば、CPUが実行するアドレスおよびその時刻など、マイコンのCPUの実行時データを取得可能である。従って、実行時データをPCに転送し、PC上で解析して可視化することにより、プログラムのどの処理がいつ実行されたかを知ることができる。   According to the prior art 1, it is possible to obtain execution data of the CPU of the microcomputer, such as an address executed by the CPU and its time. Therefore, by transferring the runtime data to the PC and analyzing and visualizing it on the PC, it is possible to know which process of the program was executed when.

従来技術1は、実行時データを、オンチップデバッガに備えられているトレースメモリまたはトレースバッファと呼ばれるRAMに蓄積する。さらに、従来技術1は、このRAMが満杯となった時点で、実行時データの蓄積を終了するか、あるいは新しいデータを古いデータに上書きしながら実行時データの取得を継続することになる。   The prior art 1 stores runtime data in a RAM called a trace memory or a trace buffer provided in an on-chip debugger. Further, in the prior art 1, when the RAM becomes full, the accumulation of the runtime data is terminated, or the acquisition of the runtime data is continued while overwriting the old data with the new data.

例えば、モータ駆動用インバータや照明駆動用コンバータの制御を行う車載制御装置では、その制御のために数十〜数百μ秒といった短い周期の処理が複数必要になることがある。なお、以下の説明では、このような制御を行う車載制御装置を単に「ECU」と称し、上述した短い周期の処理を、「短周期処理」と称することとする。   For example, an in-vehicle control device that controls a motor drive inverter or a lighting drive converter may require a plurality of short cycle processes such as several tens to several hundreds of microseconds for the control. In the following description, the in-vehicle control device that performs such control is simply referred to as “ECU”, and the short cycle processing described above is referred to as “short cycle processing”.

このような短周期処理の実行時データを従来技術1で取得すると、制御プログラムの挙動の確認ができる量のデータが得られないうちに、トレースバッファが満杯になってしまうという課題がある。   When such short-cycle processing execution data is acquired by the prior art 1, there is a problem that the trace buffer becomes full before the amount of data that can confirm the behavior of the control program is obtained.

例えば、100μ秒周期で20バイトの実行時データをPCに送信する場合を考える。この場合には、毎秒200kバイトのトレースバッファを消費することとなり、一般に、オンチップデバッガに備えられているトレースバッファでは、容量が不足する。このため、大容量のトレースバッファをオンチップデバッガの外部に追加し、オンチップデバッガと高速に通信しながらデータを蓄積する機能を備えた、高価なデバッグ装置を使用する必要がある。   For example, consider a case in which 20 bytes of runtime data are transmitted to a PC at a cycle of 100 μs. In this case, a trace buffer of 200 kbytes per second is consumed, and generally the capacity of the trace buffer provided in the on-chip debugger is insufficient. For this reason, it is necessary to use an expensive debugging device having a function of storing data while adding a large-capacity trace buffer outside the on-chip debugger and communicating with the on-chip debugger at high speed.

また、従来技術1を用いる場合には、マイコンのオンチップデバッガと通信を行うために、配線を行う必要がある。しかしながら、ECUの開発において、テスト実施の際のECUは、装置の中に組み込まれており、高速な通信を行う信号線を装置の外まで延長することが困難な場合も多い。   Further, when using the prior art 1, it is necessary to perform wiring in order to communicate with the on-chip debugger of the microcomputer. However, in the development of the ECU, the ECU at the time of performing the test is incorporated in the apparatus, and it is often difficult to extend the signal line for performing high-speed communication to the outside of the apparatus.

そこで、制御プログラムを実際の使用条件の下で動作させながら確認する別の手段としては、例えば、Tracealyzer for FreeRTOSがある(例えば、非特許文献1参照)。このTracealyzer for FreeRTOSは、実行時データを提供する手段を制御プログラム内の必要な箇所に組み込み、制御プログラム実行時に、マイコンが備える外部通信インターフェイスを用いて実行時データをPCへ転送し、PC上で可視化するものである。   Therefore, as another means for confirming the control program while operating under actual use conditions, there is, for example, Tracerizer for FreeRTOS (see, for example, Non-Patent Document 1). This Tracealizer for FreeRTOS incorporates means for providing runtime data into the required location in the control program, and transfers the runtime data to the PC using the external communication interface provided in the microcomputer when the control program is executed. It is to be visualized.

図10は、非特許文献1における従来の実行時データ取得手法を適用した場合の各処理の開始および終了の際に実行時データを作成する手順を示したフローチャートである。また、図11は、非特許文献1における従来の実行時データ取得手法を適用した場合の実行時データを外部通信インターフェイスに転送する手順を示したフローチャートである。   FIG. 10 is a flowchart showing a procedure for creating runtime data at the start and end of each process when the conventional runtime data acquisition method in Non-Patent Document 1 is applied. FIG. 11 is a flowchart showing a procedure for transferring runtime data to the external communication interface when the conventional runtime data acquisition method in Non-Patent Document 1 is applied.

非特許文献1によれば、図10および図11に例示したように、マイコン内に備えられたRAMに実行時データ蓄積用のバッファを設け、このRAMバッファにデータが満たされたところで、マイコンからPCへデータを送信する手段が提供されている。   According to Non-Patent Document 1, as illustrated in FIG. 10 and FIG. 11, a buffer for storing data at the time of execution is provided in a RAM provided in the microcomputer, and when the RAM buffer is filled with data, the microcomputer Means are provided for transmitting data to a PC.

図11を実行する処理は、通常、図10を実行する処理とは別のタイミングで、CPUの空き時間を利用して実行するものである。従って、RTOSを使用する場合には、図11を実行する処理は、本来の制御処理にできるだけ影響を及ぼさないように、優先度が最も低いタスクとして実行される。   The process for executing FIG. 11 is usually executed using the CPU idle time at a timing different from the process for executing FIG. Therefore, when the RTOS is used, the process shown in FIG. 11 is executed as a task having the lowest priority so as not to affect the original control process as much as possible.

マイコンから提供する実行時データを一部に限定することで、単位時間あたりに実行時データをRAMバッファに蓄積する量を外部通信インターフェイスのデータ転送量よりも少なくすることができる。このような場合には、実行時データを蓄積するRAMバッファを2つの領域に分け、図11の処理が片方の領域を転送している間に、これに並行して図10の処理が次のデータを蓄積することが可能となる。このような並行した処理を行うことで、実行時データを滞りなく提供し続けることができる。   By limiting the runtime data provided from the microcomputer to a part, the amount of runtime data stored in the RAM buffer per unit time can be made smaller than the data transfer amount of the external communication interface. In such a case, the RAM buffer for accumulating runtime data is divided into two areas, and while the process in FIG. 11 is transferring one area, the process in FIG. Data can be accumulated. By performing such parallel processing, it is possible to continue to provide runtime data without delay.

Tracealyzer for FreeRTOS、インターネット <URL : http://percepio.com/docs/FreeRTOS/manual>Traceryzer for FreeRTOS, Internet <URL: http://percepio.com/docs/FreeRTOS/manual>

しかしながら、従来技術には、以下のような課題がある。
モータ制御用のインバータやコンバータの制御を行うECUにおいて、非特許文献1を用いて実行タイミングを確認する場合を考える。この場合、例えば、実行時データとして、ある処理が開始および終了する際には、図10のステップS1003〜ステップS1005で示したように、その処理の開始を識別可能な番号およびその処理の終了を識別可能な番号を、それぞれの処理を実行した際の時刻とともにRAMバッファに記憶する必要がある。
However, the prior art has the following problems.
Consider a case in which the execution timing is confirmed using Non-Patent Document 1 in an ECU that controls an inverter and converter for motor control. In this case, for example, when a certain process starts and ends as runtime data, as shown in steps S1003 to S1005 in FIG. 10, a number that can identify the start of the process and the end of the process are displayed. It is necessary to store the identifiable number in the RAM buffer together with the time when each process is executed.

なお、以下の説明では、どの処理が開始したかを識別可能とする番号のことを、「処理開始識別番号」と称し、どの処理が終了したかを識別可能とする番号のことを、「処理終了識別番号」と称することとする。   In the following description, a number that can identify which process has started is referred to as a “process start identification number”, and a number that can identify which process has ended is referred to as “process It will be referred to as an “end identification number”.

実行時データは、制御プログラムの各処理が開始および終了する際に作成する必要がある。ステップS1003のような、実行時データにおける処理実行時刻を取得する処理の例として、制御プログラムは、マイコン内に備えられているハードウェアタイマを、十分な時間分解能が得られる周期でカウントするように常時動作させておく。   The runtime data needs to be created when each process of the control program starts and ends. As an example of the process of acquiring the process execution time in the execution time data as in step S1003, the control program counts the hardware timer provided in the microcomputer at a period at which sufficient time resolution is obtained. Keep it running at all times.

その上で、制御プログラムは、各処理を開始または終了する際に、その時点のハードウェアタイマのカウント値を読み出し、この値に処理開始識別番号または処理終了識別番号を付加し、これをRAMバッファに追記する処理を、各タスクまたは処理の先頭および末尾で実施する。   In addition, when starting or ending each process, the control program reads the count value of the hardware timer at that time, adds a process start identification number or a process end identification number to this value, and stores it in the RAM buffer. The process to be added to is performed at the beginning and end of each task or process.

上述したデータ作成処理例によれば、制御プログラムは、作成したハードウェアタイマのカウント値と処理開始識別番号または処理終了識別番号をRAMバッファに追加する必要がある。このような作成処理を、例えば、割り込み許可状態で実行されるタスク、およびこのタスクを割り込むことが可能なタスクの両方に適用した場合を考える。   According to the data creation processing example described above, the control program needs to add the count value of the created hardware timer and the processing start identification number or the processing end identification number to the RAM buffer. Consider a case where such a creation process is applied to, for example, both a task executed in an interrupt enabled state and a task capable of interrupting this task.

このような場合には、前者のタスクが実行時データをRAMバッファの先頭に記憶する直前に、つまり、ステップS1004を実行する直前に、後者のタスクがこれに割り込んで開始され、その実行時データをRAMバッファの先頭に追加するといった状態が発生する。   In such a case, immediately before the former task stores the runtime data at the head of the RAM buffer, that is, immediately before executing step S1004, the latter task is started by interrupting it. Is added to the top of the RAM buffer.

このような状態が発生した場合には、後者のタスクが終了した後、前者のタスクが処理を再開し、その実行時データをRAMバッファの先頭に追加することで、後者のタスクの実行時データが上書きされ、消失する。   When such a situation occurs, after the latter task ends, the former task resumes processing, and the execution time data of the latter task is added to the top of the RAM buffer. Is overwritten and disappears.

このような上書きによる実行時データの消失を回避するために、実行時データをRAMバッファに追加するタスク処理は、同じように実行時データをバッファに追加する別のタスク処理に割り込まれないように、実行時データをRAMバッファに追加する前に割り込みを禁止し(ステップS1001に相当)、RAMバッファにデータを追加した後割り込み禁止を解除する操作(ステップS1006に相当)が必要である。   In order to avoid such loss of runtime data due to overwriting, task processing that adds runtime data to the RAM buffer should not be interrupted by other task processing that similarly adds runtime data to the buffer. An operation for disabling the interrupt is required before adding the run-time data to the RAM buffer (corresponding to step S1001), and after the data is added to the RAM buffer, the interrupt prohibition is canceled (corresponding to step S1006).

特に、RTOSを使用した制御プログラムのタスク処理は、CPUの動作モードをユーザモードとする場合が多い。従って、この場合の割り込み禁止および禁止解除の処理は、CPUの動作モードをユーザモードからスーパバイザモードに切り替えてから実行し、その後、再びユーザモードに戻す必要がある。このため、割り込み禁止および禁止解除が実行時データ取得にかかるCPU時間の多くを占めてしまうことがある。   In particular, the task processing of a control program using RTOS often sets the CPU operation mode to the user mode. Accordingly, it is necessary to execute the interrupt prohibition and prohibition cancel processing in this case after switching the operation mode of the CPU from the user mode to the supervisor mode, and then return to the user mode again. For this reason, interrupt prohibition and prohibition cancellation may occupy much of the CPU time required for execution-time data acquisition.

上述したような、割り込み禁止処理および禁止解除処理を伴う実行時データの追加処理は、それ自体が、CPUに一定の処理時間を追加することになる。このため、非特許文献1の方法で実行タイミングを取得すると、制御プログラム本来の処理タイミングを大幅に変化させてしまうという課題がある。   As described above, the process of adding data at the time of execution accompanied by the interrupt prohibition process and the prohibition cancellation process itself adds a certain processing time to the CPU. For this reason, when the execution timing is acquired by the method of Non-Patent Document 1, there is a problem that the original processing timing of the control program is significantly changed.

特に、ECUに必要な短周期処理に、上述した実行時データの追加処理を行う場合には、本来実行される処理に対して、実行時データの取得処理の割合が大きくなる。このため、この課題は、深刻である。   In particular, when the above-described execution time data addition process is performed in the short-cycle process necessary for the ECU, the ratio of the execution time data acquisition process to the originally executed process increases. For this reason, this problem is serious.

また、制御プログラム本来の処理がすでに高いCPU負荷の下で動作していた場合には、実行時データの取得のために追加消費されるCPU時間のために、低優先度の処理を実行するためのCPU時間が確保できなくなり、制御プログラムが正しく動作しなくなることが生じるおそれがある。   Further, when the original processing of the control program is already operating under a high CPU load, low priority processing is executed for the CPU time that is additionally consumed for acquisition of runtime data. The CPU time cannot be secured, and the control program may not operate correctly.

さらに、高いCPU負荷の下では、図11の実行時データ送信処理を実行する時間が十分に確保できないという課題がある。   Furthermore, under a high CPU load, there is a problem that a sufficient time cannot be secured for executing the runtime data transmission process of FIG.

本発明は、上記のような課題を解決するためになされたものであり、特に、短周期処理の実行時データを作成および送信する際に、その処理自体によって生じるCPU負荷の増加量と本来の処理タイミングの変化量を最小に抑え、ECUの挙動および動作タイミングを確認するために必要なデータを、最小限のRAMバッファで継続的に取得することのできる車載制御プログラムの実行時データ取得方法および車載制御装置を得ることを目的とする。   The present invention has been made to solve the above-described problems. In particular, when creating and transmitting execution data of short-cycle processing, the amount of increase in CPU load caused by the processing itself and the original amount are reduced. In-vehicle control program execution-time data acquisition method capable of continuously acquiring data necessary for confirming ECU behavior and operation timing with a minimum RAM buffer while minimizing the amount of change in processing timing It aims at obtaining a vehicle-mounted control apparatus.

本発明に係る車載制御プログラムの実行時データ取得方法は、複数の処理を有する車載制御プログラムを実行するCPUと、複数のチャネルを有し、CPUがアクセス可能なアドレス空間内のデータを、CPUを使用せずにDMA転送することができるダイレクトアクセスメモリコントローラであるDMACと、DMA転送でカウント値を取得可能なハードウェアタイマと、車載制御プログラムを格納するとともに、DMA転送でアクセス可能なROMと、DMA転送でアクセス可能なRAMと、外部機器とデータ通信を行う外部通信インターフェイスとを備えた車載制御装置において、車載制御プログラムを実行する際に、複数の処理のそれぞれの実行タイミングあるいは実行内容をモニタリングするための実行時データの作成および送信を行うための、車載制御プログラムの実行時データ取得方法であって、実行時データの作成、および実行時データの送信の少なくともいずれか一方を、CPUを介さずにDMA転送により実行するに当たり、DMACは、実行時データの作成をDMA転送により実行する場合には、実行時データを取得する時点で、第1のチャネルによる第1のDMA転送によりハードウェアタイマのカウント値を読み出すことで時刻データを収集し、時刻データの収集後、第2のチャネルによる第2のDMA転送により、複数の処理の実行順序に従ってあらかじめROM内に格納された、複数の処理を識別するための識別番号を読み出し、時刻データに対応した識別番号を収集することで、実行時データを作成し、実行時データの送信をDMA転送により実行する場合には、あらかじめ決められた制御1周期分に相当する実行時データが作成された後に、第1のチャネルおよび第2のチャネル以外のチャネルによるDMA転送により、制御1周期分の実行時データを、外部通信インターフェイスを介して外部機器に送信するものである。   An in-vehicle control program runtime data acquisition method according to the present invention includes a CPU for executing an in-vehicle control program having a plurality of processes, and data in an address space having a plurality of channels and accessible by the CPU. DMAC that is a direct access memory controller that can perform DMA transfer without using it, a hardware timer that can acquire a count value by DMA transfer, an in-vehicle control program, and a ROM that can be accessed by DMA transfer; When executing an in-vehicle control program in an in-vehicle control device equipped with a RAM accessible by DMA transfer and an external communication interface for data communication with an external device, the execution timing or execution contents of each of a plurality of processes are monitored. And sending runtime data to do An in-vehicle control program execution time data acquisition method for performing at least one of creation of execution time data and transmission of execution time data by DMA transfer without using a CPU. When the execution time data is created by DMA transfer, the time data is collected by reading the count value of the hardware timer by the first DMA transfer by the first channel when the execution time data is acquired. Then, after collecting the time data, the second DMA transfer by the second channel reads out the identification number for identifying the plurality of processes stored in the ROM in advance according to the execution order of the plurality of processes, and the time data By collecting the identification numbers corresponding to each, the runtime data is created and the runtime data is transmitted by DMA transfer. In this case, after execution time data corresponding to a predetermined control cycle is created, the execution time data for one control cycle is obtained by DMA transfer using a channel other than the first channel and the second channel. Is transmitted to the external device via the external communication interface.

また、本発明に係る車載制御装置は、複数の処理を有する車載制御プログラムを実行するCPUと、複数のチャネルを有し、CPUがアクセス可能なアドレス空間内のデータを、CPUを使用せずにDMA転送することができるダイレクトアクセスメモリコントローラであるDMACと、DMA転送でカウント値を取得可能なハードウェアタイマと、車載制御プログラムを格納するとともに、DMA転送でアクセス可能なROMと、DMA転送でアクセス可能なRAMと、外部機器とデータ通信を行う外部通信インターフェイスとを備え、車載制御プログラムを実行する際に、複数の処理のそれぞれの実行タイミングあるいは実行内容をモニタリングするための実行時データの作成および送信を行う車載制御装置であって、DMACは、実行時データの作成、および実行時データの送信の少なくともいずれか一方を、CPUを介さずにDMA転送により実行するに当たり、実行時データの作成をDMA転送により実行する場合には、実行時データを取得する時点で、第1のチャネルによる第1のDMA転送によりハードウェアタイマのカウント値を読み出すことで時刻データを収集し、時刻データの収集後、第2のチャネルによる第2のDMA転送により、複数の処理の実行順序に従ってあらかじめROM内に格納された、複数の処理を識別するための識別番号を読み出し、時刻データに対応した識別番号を収集することで、実行時データを作成し、実行時データの送信をDMA転送により実行する場合には、あらかじめ決められた制御1周期分に相当する実行時データが作成された後に、第1のチャネルおよび第2のチャネル以外のチャネルによるDMA転送により、制御1周期分の実行時データを、外部通信インターフェイスを介して外部機器に送信するものである。   In addition, the in-vehicle control device according to the present invention includes a CPU that executes an in-vehicle control program having a plurality of processes, and a plurality of channels, and data in an address space that can be accessed by the CPU without using the CPU. DMAC, which is a direct access memory controller that can perform DMA transfer, a hardware timer that can acquire a count value by DMA transfer, an in-vehicle control program, a ROM that can be accessed by DMA transfer, and access by DMA transfer And an external communication interface that performs data communication with an external device. When executing an in-vehicle control program, creation of runtime data for monitoring the execution timing or execution content of each of a plurality of processes In-vehicle control device that performs transmission, and DMAC executes When executing at least one of data creation and execution-time data transmission by DMA transfer without going through the CPU, the execution-time data is acquired when the execution-time data creation is performed by DMA transfer. At this point, time data is collected by reading the count value of the hardware timer by the first DMA transfer by the first channel, and after collecting the time data, a plurality of times are obtained by the second DMA transfer by the second channel. Reading the identification number for identifying a plurality of processes stored in the ROM in advance according to the execution order of the processes, collecting the identification numbers corresponding to the time data, and creating the runtime data, When transmission is executed by DMA transfer, runtime data corresponding to one predetermined control cycle is created. Later, the DMA transfer by the first channel and a second channel other than the channel, the run-time data of the control one cycle, and transmits to the external device via the external communication interface.

本発明によれば、実行時データの作成、および実行時データの送信の少なくともいずれか一方を、CPUを介さずにDMA転送により実行する構成を備えている。このような構成を備えることで、実行時データの作成にDMA転送を適用した場合には、CPUによる実行時データの作成処理が一切不要となり、実行時データの作成に必要なCPU時間が最小に抑えられる。また、実行時データの送信にDMA転送を適用した場合には、CPUが実行時データを外部通信インターフェイスに転送する処理が不要となり、データ転送に必要なCPU時間を最小に抑えられる。この結果、特に、短周期処理の実行時データを作成/送信する際に、その処理自体によって生じるCPU負荷の増加量と本来の処理タイミングの変化量を最小に抑え、ECUの挙動および動作タイミングを確認するために必要なデータを、最小限のRAMバッファで継続的に取得することのできる車載制御プログラムの実行時データ取得方法および車載制御装置を得ることができる。   According to the present invention, at least one of creation of runtime data and transmission of runtime data is performed by DMA transfer without using a CPU. With such a configuration, when DMA transfer is applied to the creation of runtime data, the creation of runtime data by the CPU becomes unnecessary, and the CPU time required for creating runtime data is minimized. It can be suppressed. Further, when DMA transfer is applied to transmission of runtime data, the CPU does not need to transfer runtime data to the external communication interface, and the CPU time required for data transfer can be minimized. As a result, especially when creating / transmitting execution data for short-cycle processing, the amount of increase in CPU load caused by the processing itself and the amount of change in the original processing timing are minimized, and the behavior and operation timing of the ECU are reduced. It is possible to obtain an on-vehicle control program execution time data acquisition method and an on-vehicle control device capable of continuously acquiring data necessary for confirmation with a minimum RAM buffer.

本発明の実施の形態1の車載制御装置において、制御対象の制御を実行するとともに、実行時データの作成および送信を実行するECUの構成の一例を示す図である。In the vehicle-mounted control apparatus of Embodiment 1 of this invention, it is a figure which shows an example of a structure of ECU which performs control of control object, and produces and transmits transmission data at the time of execution. 本発明の実施の形態1におけるROMに格納されたプログラムの各処理を例示した図である。It is the figure which illustrated each process of the program stored in ROM in Embodiment 1 of this invention. 本発明の実施の形態1におけるROMに記憶された処理の実行タイミングを例示した図である。It is the figure which illustrated the execution timing of the process memorize | stored in ROM in Embodiment 1 of this invention. 本発明の実施の形態1におけるROMに設けられた識別番号表を例示した図である。It is the figure which illustrated the identification number table | surface provided in ROM in Embodiment 1 of this invention. 本発明の実施の形態1におけるRAMに設けられた実行時データ記憶部を例示した図である。It is the figure which illustrated the runtime data storage part provided in RAM in Embodiment 1 of this invention. 本発明の実施の形態1に係るECUにおける初期化処理の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the initialization process in ECU which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係るECUにおける第1のDMAチャネルおよび第2のDMAチャネルの初期設定の一例を表形式にまとめたものである。FIG. 4 is a table showing an example of initial settings of the first DMA channel and the second DMA channel in the ECU according to the first embodiment of the present invention. 本発明の実施の形態1に係るECUにおける第3のDMAチャネル〜第6のDMAチャネルの初期設定の一例を表形式にまとめたものである。FIG. 4 is a table showing an example of initial settings of the third to sixth DMA channels in the ECU according to the first embodiment of the present invention. 本発明の実施の形態1に係るECUにおける実行時データ取得の際の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence in the time of the data acquisition at the time of execution in ECU which concerns on Embodiment 1 of this invention. 非特許文献1における従来の実行時データ取得手法を適用した場合の各処理の開始および終了の際に実行時データを作成する手順を示したフローチャートである。It is the flowchart which showed the procedure which produces runtime data at the time of the start and completion | finish of each process at the time of applying the conventional runtime data acquisition method in a nonpatent literature 1. 非特許文献1における従来の実行時データ取得手法を適用した場合の実行時データを外部通信インターフェイスに転送する手順を示したフローチャートである。It is the flowchart which showed the procedure which transfers the runtime data at the time of applying the conventional runtime data acquisition method in a nonpatent literature 1 to an external communication interface.

以下、本発明の車載制御プログラムの実行時データ取得方法および車載制御装置の好適な実施の形態につき図面を用いて説明する。より具体的には、以下の実施の形態では、制御プログラム内の4つの周期処理が開始および終了するタイミングを実行時データとして取得する例について詳述する。なお、全ての図において、図中、同一、相当部分には、同一符号を付している。     Hereinafter, preferred embodiments of an in-vehicle control program execution data acquisition method and an in-vehicle control device according to the present invention will be described with reference to the drawings. More specifically, in the following embodiment, an example in which the timings at which the four periodic processes in the control program start and end are acquired as runtime data will be described in detail. In all the drawings, the same reference numerals are given to the same and corresponding parts in the drawings.

実施の形態1.
図1は、本発明の実施の形態1の車載制御装置において、制御対象の制御を実行するとともに、実行時データの作成および送信を実行するECUの構成の一例を示す図である。図1に示すECU1は、入力回路2、マイコン3、駆動回路11を備えて構成され、モータ12を制御するとともに、外部通信線13と接続されている。
Embodiment 1 FIG.
FIG. 1 is a diagram illustrating an example of a configuration of an ECU that executes control of a control target and executes creation and transmission of runtime data in the in-vehicle control device according to the first embodiment of the present invention. The ECU 1 shown in FIG. 1 includes an input circuit 2, a microcomputer 3, and a drive circuit 11. The ECU 1 controls the motor 12 and is connected to an external communication line 13.

ECU1内のマイコン3は、I/O(入出力インターフェイス)4、CPU5、ROM6、RAM7、タイマ8、DMAC(Direct Memory Access Controller)9、および外部通信インターフェイス10を含んで構成されている。   The microcomputer 3 in the ECU 1 includes an I / O (input / output interface) 4, a CPU 5, a ROM 6, a RAM 7, a timer 8, a DMAC (Direct Memory Access Controller) 9, and an external communication interface 10.

入力回路2は、外部からの信号、あるいは制御対象であるモータ12からのセンサ信号を電圧として読み取る。そして、I/O4は、入力回路2で読み取られた電圧をマイコン3内に取り込み、また、駆動回路11への制御信号出力も行う。   The input circuit 2 reads an external signal or a sensor signal from the motor 12 to be controlled as a voltage. The I / O 4 takes in the voltage read by the input circuit 2 into the microcomputer 3 and outputs a control signal to the drive circuit 11.

駆動回路11は、本実施の形態1においては、モータ12を駆動する。また、外部通信インターフェイス10は、CAN、CAN FD、FlexRay、Ethernet(登録商標)等の、ECUで使用される一般的な通信線に接続されている。   The drive circuit 11 drives the motor 12 in the first embodiment. The external communication interface 10 is connected to a general communication line used in the ECU, such as CAN, CAN FD, FlexRay, Ethernet (registered trademark), or the like.

なお、本実施の形態1では、ECU1がモータ12を駆動する例を示しているが、本発明を適用し得るECU1の構成は、この例に限定されるものではない。例えば、駆動回路11をコンバータとし、制御対象をモータ12からLEDに代えて、LEDの照度制御を行う際にも、短周期処理が必要になることがあり、このような構成に対しても、本実施の形態1に係る発明を効果的に適用し得る。   In the first embodiment, an example in which the ECU 1 drives the motor 12 is shown, but the configuration of the ECU 1 to which the present invention can be applied is not limited to this example. For example, when the drive circuit 11 is a converter and the object to be controlled is changed from the motor 12 to the LED and the illuminance control of the LED is performed, short cycle processing may be necessary. The invention according to the first embodiment can be effectively applied.

また、外部通信インターフェイス10についても、上述したいずれかに限定されることはない。例えば、上述した構成の組み合わせを適用する場合、あるいは同一の通信方式を複数個使用する場合も考えられる。また、ECU1に配線を追加することが可能な場合には、マイコン3が備える各種シリアル通信(UART、SPI等)や汎用デジタル入出力(GPIO)等も、外部通信インターフェイス10として適用し得る。   Further, the external communication interface 10 is not limited to any one described above. For example, a case where a combination of the above-described configurations is applied or a case where a plurality of the same communication methods are used may be considered. When wiring can be added to the ECU 1, various serial communications (UART, SPI, etc.) included in the microcomputer 3, general-purpose digital input / output (GPIO), etc. can be applied as the external communication interface 10.

本実施の形態1では、モータを制御する例を示している。このため、図1では省略しているが、I/O4において、センサ電圧をマイコン3内に取り込む際には、AD変換器を使用し、駆動回路11へ制御出力を行う際には、PWMを使用することを仮定している。   In the first embodiment, an example of controlling a motor is shown. For this reason, although omitted in FIG. 1, in the I / O 4, when the sensor voltage is taken into the microcomputer 3, the AD converter is used, and when the control output is performed to the drive circuit 11, the PWM is performed. It is assumed to be used.

しかしながら、本発明は、本実施の形態1のみに適用可能とするものではない。例えば、制御処理の要因が、単なるタイマ割込みであったとしても、その処理周期がマイコンの処理能力からみて短ければ短いほど、本発明を効果的に適用することができる。   However, the present invention is not applicable only to the first embodiment. For example, even if the factor of the control processing is a simple timer interrupt, the present invention can be effectively applied as the processing cycle is shorter in view of the processing capability of the microcomputer.

CPU5は、周知のアーキテクチャを用いたマイクロプロセッサであり、ROM6に記憶される制御プログラム60を実行可能である。また、CPU5は、RAM7、タイマ8、DMAC9にアクセスすることができれば、単一コアでも複数コアでもよい。   The CPU 5 is a microprocessor using a known architecture, and can execute a control program 60 stored in the ROM 6. The CPU 5 may be a single core or a plurality of cores as long as it can access the RAM 7, the timer 8, and the DMAC 9.

ROM6は、CPU5およびDMAC9の各チャネルから読み出し可能であり、制御プログラム60を含んでいる。図2は、本発明の実施の形態1におけるROM6に格納されたプログラム60の各処理を例示した図である。制御プログラム60の処理としては、図2に例示したように、初期化処理61、周期割り込み処理62〜63、短い周期で実行する短周期処理64、および短周期処理64よりも長い周期で実行する長周期処理65が記憶されている。なお、以下の説明において、特に処理の形態に拘らない場合には、単に「処理61〜65」のように表記することとする。   The ROM 6 can be read from each channel of the CPU 5 and the DMAC 9 and includes a control program 60. FIG. 2 is a diagram illustrating each process of the program 60 stored in the ROM 6 according to the first embodiment of the present invention. As the processing of the control program 60, as illustrated in FIG. 2, the initialization processing 61, the periodic interrupt processing 62 to 63, the short cycle processing 64 executed in a short cycle, and the cycle longer than the short cycle processing 64 are executed. Long cycle processing 65 is stored. In the following description, unless otherwise specified, the processing is simply expressed as “processing 61 to 65”.

また、制御プログラム60の固定値データとしては、図2に例示したように、識別番号表66、第6DMA許可値67、および送信要求指示値68が記憶されている。   As the fixed value data of the control program 60, as exemplified in FIG. 2, an identification number table 66, a sixth DMA permission value 67, and a transmission request instruction value 68 are stored.

図3は、本発明の実施の形態1におけるROM6に記憶された処理62〜65の実行タイミングを例示した図である。本実施の形態1において、処理62〜65は、図3に例示したタイミングチャートのように動作するように、静的に設計されているものとする。また、処理の優先度は、処理62>処理63>処理64>処理65とする。   FIG. 3 is a diagram illustrating the execution timing of the processes 62 to 65 stored in the ROM 6 according to the first embodiment of the present invention. In the first embodiment, it is assumed that the processes 62 to 65 are statically designed so as to operate like the timing chart illustrated in FIG. Further, the priority of the processing is processing 62> processing 63> processing 64> processing 65.

図3において、各処理62〜65のタイミングチャートの立ち上がりが、処理の開始または続行を意味し、立ち下がりが、処理の中断または終了を意味している。また、それぞれの処理周期は、処理62〜63が50μ秒、短周期処理64が100μ秒、長周期処理65が1ミリ秒であるとする。   In FIG. 3, the rising edge of the timing chart of each of the processes 62 to 65 means the start or continuation of the process, and the falling edge means the interruption or end of the process. Also, assume that the processing cycles are 50 μsec for processing 62 to 63, 100 μsec for short cycle processing 64, and 1 ms for long cycle processing 65.

図3において、処理62〜65の挙動を時間の経過に沿って説明する。処理62が開始し、処理62が終了し、処理64が開始する。次に、処理64は、実行中において処理63の開始のため中断され、処理63が開始する。次に、処理63が終了し、処理64が再開し、処理64が終了し、処理65が開始する。   In FIG. 3, the behavior of the processes 62 to 65 will be described along the passage of time. The process 62 starts, the process 62 ends, and the process 64 starts. Next, the process 64 is interrupted due to the start of the process 63 during execution, and the process 63 starts. Next, the process 63 ends, the process 64 resumes, the process 64 ends, and the process 65 starts.

次に、処理65は、実行中において処理62の開始のため中断され、処理62が開始する。次に、処理62が終了し、処理65が再開する。次に、処理65、は実行中において処理63の開始のため中断され、処理63が開始し、処理63が終了し、処理65が再開し、処理65が終了する。   Next, the process 65 is interrupted to start the process 62 during execution, and the process 62 starts. Next, the process 62 ends, and the process 65 resumes. Next, the process 65 is interrupted because the process 63 starts during execution, the process 63 starts, the process 63 ends, the process 65 resumes, and the process 65 ends.

処理62〜64については、上述した処理62の2サイクル分を実行した後、すなわち、100μ秒経過後に、再び処理62が開始するところから、上述した挙動を繰り返すものとする。一方、処理65については、処理周期が1ミリ秒であることから、処理62〜64が図3に示した100μ秒の挙動を10回繰り返す毎に、図3に示すタイミングで開始および終了するものとする。   Regarding the processing 62 to 64, after the two cycles of the above-described processing 62 are executed, that is, after 100 μsec has elapsed, the above-described behavior is repeated from the point where the processing 62 starts again. On the other hand, since the processing period of the processing 65 is 1 millisecond, the processing 62 to 64 starts and ends at the timing shown in FIG. 3 every time the behavior of 100 μs shown in FIG. 3 is repeated 10 times. And

本実施の形態1では、例として、処理62の最初の開始時刻を起点とする1ミリ秒の期間を、制御の1周期とみなすこととする。ただし、制御の1周期を前記のようにとる必要はなく、例えば、処理62の最初の開始時刻を起点として100μ秒の期間を処理62〜64による制御の1周期とみなしてもよい。   In the first embodiment, as an example, a 1-millisecond period starting from the first start time of the process 62 is regarded as one cycle of control. However, it is not necessary to take one cycle of control as described above. For example, a period of 100 μs starting from the first start time of the process 62 may be regarded as one cycle of control by the processes 62 to 64.

次に、識別番号表66について説明する。図4は、本発明の実施の形態1におけるROM6に設けられた識別番号表66を例示した図である。本実施の形態1における識別番号表66は、図4に例示したように、処理62〜65についての識別番号表660〜663と、無効な識別番号664とを含んでいる。   Next, the identification number table 66 will be described. FIG. 4 is a diagram illustrating an identification number table 66 provided in the ROM 6 according to the first embodiment of the present invention. As illustrated in FIG. 4, the identification number table 66 according to the first embodiment includes an identification number table 660 to 663 for the processes 62 to 65 and an invalid identification number 664.

識別番号表660は、処理62の開始であることを識別可能な処理開始識別番号と、処理62の終了であることを識別可能な処理終了識別番号とを交互に保持している。なお、図4では省略しているが、識別番号表661〜663は、記憶される処理開始識別番号および処理終了識別番号の値が異なることを除き、識別番号表660と同様の構成を有している。   The identification number table 660 alternately holds a process start identification number that can identify the start of the process 62 and a process end identification number that can identify the end of the process 62. Although omitted in FIG. 4, the identification number tables 661 to 663 have the same configuration as the identification number table 660 except that the stored processing start identification numbers and processing end identification numbers are different. ing.

処理62〜65は、それぞれの周期毎に処理を開始および終了する。このため、一対の処理開始識別番号および処理終了識別番号が、各処理の1周期中に参照される。   The processes 62 to 65 start and end for each cycle. For this reason, a pair of process start identification numbers and process end identification numbers are referred to during one cycle of each process.

各処理の識別番号表の長さは、上述した制御の1周期と、それぞれの処理62〜65の処理周期との関係から決まり、固定長である。例えば、本実施の形態1では、処理62の周期を50μ秒とし、制御プログラムの制御の1周期を1ミリ秒とした。従って、処理62は、1ミリ秒の間に20回処理を実行することとなり、その開始と終了を合わせた数は40回となる。従って、識別番号表660の長さは、40になる。   The length of the identification number table for each process is determined from the relationship between the above-described control period and the process periods of the processes 62 to 65, and is a fixed length. For example, in the first embodiment, the period of the process 62 is 50 μs, and one period of control of the control program is 1 millisecond. Accordingly, the process 62 is executed 20 times within 1 millisecond, and the total number of the start and end is 40 times. Therefore, the length of the identification number table 660 is 40.

処理63〜65に対応する識別番号表661〜663の長さについても、同様に、制御の1周期と、それぞれの処理の処理周期との関係から算出され、それぞれ固定長である。   Similarly, the lengths of the identification number tables 661 to 663 corresponding to the processes 63 to 65 are also calculated from the relationship between one control cycle and each process cycle, and each has a fixed length.

RAM7は、CPU5、およびDMAC9の各DMAチャネルからアクセス可能である。図5は、本発明の実施の形態1におけるRAM7に設けられた実行時データ記憶部を例示した図である。本実施の形態1では、実行時データ記憶部として、図5に例示したように、割り込み処理62の識別番号記憶配列711と、これに対応する時刻記憶配列712、さらに、周期処理63〜65の識別番号記憶配列721、731、741と、これらのそれぞれに対応する時刻記憶配列722、732、742を確保した場合を示している。   The RAM 7 can be accessed from each of the DMA channels of the CPU 5 and the DMAC 9. FIG. 5 is a diagram illustrating a runtime data storage unit provided in the RAM 7 according to the first embodiment of the present invention. In the first embodiment, as illustrated in FIG. 5, as the execution time data storage unit, as shown in FIG. 5, the identification number storage array 711 of the interrupt process 62, the corresponding time storage array 712, and the periodic processes 63 to 65 In this example, identification number storage arrays 721, 731, and 741 and time storage arrays 722, 732, and 742 corresponding to these are secured.

処理62〜65のそれぞれに対応する実行時データ記憶部71〜74は、図4を用いて説明した識別番号表660〜663と同様に、制御の1周期と処理62〜65のそれぞれの処理周期との関係から決まり、固定長である。   Similar to the identification number tables 660 to 663 described with reference to FIG. 4, the runtime data storage units 71 to 74 corresponding to the processes 62 to 65 each have one control cycle and each processing cycle of the processes 62 to 65. The fixed length.

例えば、本実施の形態1では、処理64の周期を100μ秒とし、制御プログラムの制御の1周期を1ミリ秒とした。このため、処理64は、1ミリ秒の間に10回処理を実行することとなり、識別番号記憶配列731および時刻記憶配列732の要素数は、それぞれ10になる。   For example, in the first embodiment, the period of the process 64 is 100 μs, and one period of control of the control program is 1 millisecond. Therefore, the process 64 is executed 10 times within 1 millisecond, and the number of elements in the identification number storage array 731 and the time storage array 732 is 10 respectively.

実行時データ記憶部71、72、74の各記憶配列711、721、741についても、同様に、制御の1周期と、それぞれの処理の処理周期との関係から、それぞれ、20、20、2と算出される。従って、実行時データ記憶部70の各配列の要素数の合計は、本実施の形態では、104になる。本実施の形態1では、各要素に1バイトを割り当てることとし、104バイトとする。   Similarly, the storage arrays 711, 721, and 741 of the runtime data storage units 71, 72, and 74 are respectively 20, 20, and 2 from the relationship between one control cycle and the processing cycle of each processing. Calculated. Therefore, the total number of elements in each array in the runtime data storage unit 70 is 104 in this embodiment. In the first embodiment, 1 byte is assigned to each element, which is 104 bytes.

実行時データ記憶部70内の各配列単位の配置の順序は、任意である。ただし、実行時データ記憶部70が複数の領域に分割されないように、各配列単位が互いに隣接するように配置する。   The arrangement order of the array units in the runtime data storage unit 70 is arbitrary. However, the arrangement units are arranged adjacent to each other so that the runtime data storage unit 70 is not divided into a plurality of regions.

タイマ8は、複数のチャネルからなるハードウェアタイマである。そして、タイマ8は、RTOSのスケジューラまたは従来型のスケジューラが処理を開始する時刻を検知するために使用するほか、本実施の形態1では、実行時データ取得の際の時刻を示すタイムスタンプを生成するためにも使用する。   The timer 8 is a hardware timer composed of a plurality of channels. The timer 8 is used to detect the time when the RTOS scheduler or the conventional scheduler starts processing. In the first embodiment, the timer 8 generates a time stamp indicating the time when the runtime data is acquired. Also used to do.

DMAC9は、複数のDMAチャネルからなるハードウェア機能であり、CPU5がアクセス可能なアドレス空間内のデータを、CPU5を使用せずに転送することができる。さらに、DMAC9は、その転送の実行を開始するタイミングとして、マイコン3の内部または外部のハードウェアの要因か、ソフトウェアの指示か、をあらかじめ設定することができる。   The DMAC 9 is a hardware function composed of a plurality of DMA channels, and can transfer data in an address space accessible by the CPU 5 without using the CPU 5. Further, the DMAC 9 can set in advance whether the internal or external hardware factor of the microcomputer 3 or a software instruction is the timing for starting the execution of the transfer.

ハードウェアの要因を設定する場合には、さらにDMAC9が対応可能なハードウェア要因の中から指定可能である。DMAC9が対応可能なハードウェアの要因として、マイコンが内部に備える周辺機能からの各種割込み要求が設定可能であることに加え、DMAC9内の別のDMAチャネルのDMA転送処理完了を設定することも可能である。   When setting the hardware factor, it is possible to specify from among the hardware factors that the DMAC 9 can handle. In addition to being able to set various interrupt requests from peripheral functions provided in the microcomputer, it is possible to set completion of DMA transfer processing for another DMA channel in the DMAC 9 as a cause of hardware that the DMAC 9 can handle. It is.

各DMAチャネルは、転送回数を指定することができ、その最終回のDMA転送を完了した際に、転送元のアドレスと、転送先のアドレスと、転送回数を、あらかじめ指定した値に設定し直すリロード機能を有している。   Each DMA channel can specify the transfer count, and when the final DMA transfer is completed, the transfer source address, transfer destination address, and transfer count are reset to the values specified in advance. Has a reload function.

各DMAチャネルは、それぞれシングル転送モードとブロック転送モードを有しており、いずれかを選択・設定可能である。シングル転送モードは、1回のDMAサイクル(つまり、転送元からのデータ読み出しと転送先へのデータ書き込み)につき、転送回数を1とする転送モードである。また、ブロック転送モードは、あらかじめ設定された、連続したデータ領域(ブロック転送サイズ)の転送が完了するまでDMAサイクルを繰り返し、データ領域内のすべてのデータの転送完了をもって、転送回数を1とする転送モードである。なお、本実施の形態1では、ブロック転送モードで使用するDMAチャネルについてのみ、その旨を明記し、転送モードについて指定のないDMAチャネルは、シングル転送モードで使用することとする。   Each DMA channel has a single transfer mode and a block transfer mode, and either one can be selected and set. The single transfer mode is a transfer mode in which the number of transfers is 1 per DMA cycle (that is, data read from the transfer source and data write to the transfer destination). In the block transfer mode, the DMA cycle is repeated until transfer of a preset continuous data area (block transfer size) is completed, and the transfer count is set to 1 when transfer of all data in the data area is completed. Transfer mode. In the first embodiment, only the DMA channel that is used in the block transfer mode is clearly indicated, and the DMA channel that is not specified for the transfer mode is used in the single transfer mode.

各DMAチャネルは、DMA転送を許可または禁止するレジスタを有しており、CPU5およびDMAC9から許可状態または禁止状態を設定することができる。また、各DMAチャネルは、最終回のDMA転送を完了した際に、以後のDMA転送を禁止状態にするか、許可状態を継続するかを設定することができる。   Each DMA channel has a register for permitting or prohibiting DMA transfer, and a permission state or a prohibition state can be set by the CPU 5 and the DMAC 9. In addition, each DMA channel can set whether to prohibit the subsequent DMA transfer or continue the permitted state when the last DMA transfer is completed.

外部通信インターフェイス10は、マイコン3と外部との情報の送受信を行うものである。そして、外部通信インターフェイス10は、データの送受信が完了した際に、CPU5への割り込み要因として、この送受信が完了したことを通知することができる。また、外部通信インターフェイス10は、送受信の完了をハードウェアの要因としてDMAC9に通知し、各DMAチャネルの転送を開始させることができる。   The external communication interface 10 transmits and receives information between the microcomputer 3 and the outside. When the data transmission / reception is completed, the external communication interface 10 can notify that the transmission / reception is completed as an interrupt factor to the CPU 5. Further, the external communication interface 10 can notify the DMAC 9 of completion of transmission / reception as a hardware factor, and can start transfer of each DMA channel.

次に、ECU1で実行される制御プログラム60のうち、本発明に係る初期化処理61の処理手順例について説明する。図6は、本発明の実施の形態1に係るECU1における初期化処理61の処理手順を示したフローチャートである。   Next, a processing procedure example of the initialization processing 61 according to the present invention in the control program 60 executed by the ECU 1 will be described. FIG. 6 is a flowchart showing a processing procedure of initialization processing 61 in ECU 1 according to Embodiment 1 of the present invention.

先ず、ステップS601において、ECU1は、処理時刻を取得するためのタイマ8を初期化し、カウントを開始する。ここで、ハードウェアタイマのカウント周期は、処理時間に対して十分な時間分解能が得られるように設定する。   First, in step S601, the ECU 1 initializes the timer 8 for acquiring the processing time and starts counting. Here, the count period of the hardware timer is set so as to obtain a sufficient time resolution with respect to the processing time.

次に、ステップS603〜ステップS605を繰り返すことで、処理ごとに必要となる第1のDMAチャネルおよび第2のDMAチャネルを初期化する。図7は、本発明の実施の形態1に係るECU1における第1のDMAチャネルおよび第2のDMAチャネルの初期設定の一例を表形式にまとめたものである。ECU1は、図7に例示したように、処理62〜65のそれぞれに対して各DMAチャネルを設定する。   Next, Steps S603 to S605 are repeated to initialize the first DMA channel and the second DMA channel necessary for each process. FIG. 7 summarizes an example of the initial setting of the first DMA channel and the second DMA channel in the ECU 1 according to the first embodiment of the present invention in a table format. As illustrated in FIG. 7, the ECU 1 sets each DMA channel for each of the processes 62 to 65.

第1のDMAチャネルおよび第2のDMAチャネルは、常に許可状態の設定で使用する。また、処理62〜65に対応するそれぞれの第1のDMAチャネルは、転送元アドレスを、タイマ8のカウント値を読み出し可能なアドレスに設定し、各転送の完了の際にインクリメントせずに、固定とする。   The first DMA channel and the second DMA channel are always used for setting the permission state. Further, each first DMA channel corresponding to the processing 62 to 65 sets the transfer source address to an address from which the count value of the timer 8 can be read, and is fixed without being incremented when each transfer is completed. And

転送先アドレスは、各処理に対応する時刻記憶配列712、722、732、742の先頭に設定し、各DMAチャネルの転送が完了する毎にインクリメントするように、つまり、転送先アドレスが次の配列要素を指し示すように、設定する。   The transfer destination address is set at the head of the time storage arrays 712, 722, 732, and 742 corresponding to each process, and incremented each time transfer of each DMA channel is completed, that is, the transfer destination address is set to the next array. Set to point to the element.

本実施の形態1では、処理62、処理63の処理周期を50μ秒、処理64の処理周期を100μ秒、処理65の処理周期を1m秒、制御の1周期を1ミリ秒としている。このことから、処理62、処理63の転送回数は、制御の1周期に20回処理が開始および終了するため、その開始回数と終了回数の合計である40回を設定する。同様の計算を行い、処理64の第1のDMAの転送回数は、20を設定し、処理65の第1のDMAの転送回数は、2を設定する。   In the first embodiment, the processing cycle of processing 62 and processing 63 is 50 μsec, the processing cycle of processing 64 is 100 μsec, the processing cycle of processing 65 is 1 msec, and the control cycle is 1 msec. From this, the transfer count of the process 62 and the process 63 is set to 40 times, which is the sum of the start count and the end count, because the process starts and ends 20 times in one control cycle. The same calculation is performed, and the number of first DMA transfers in process 64 is set to 20, and the number of first DMA transfers in process 65 is set to 2.

各処理の第1のDMAチャネルが転送を完了する毎に、各処理に対応する第2のDMAチャネルを開始する。また、上記転送回数の最終の転送が完了した際に、転送先アドレスおよび転送回数をリロードする。   Each time the first DMA channel of each process completes the transfer, the second DMA channel corresponding to each process is started. Further, when the final transfer of the above transfer count is completed, the transfer destination address and the transfer count are reloaded.

処理62〜処理65に対応するそれぞれの第2のDMAチャネルは、転送元アドレスを、各処理の識別番号表660〜663の先頭に設定し、各DMA転送の完了の際にインクリメントするように設定する。   Each of the second DMA channels corresponding to the processes 62 to 65 sets the transfer source address to the head of the identification number table 660 to 663 of each process, and is set to increment when each DMA transfer is completed. To do.

転送先アドレスは、各処理に対応する識別番号記憶配列711、721、731、741の先頭に設定し、各DMA転送の完了の際にインクリメントするように設定する。   The transfer destination address is set at the head of the identification number storage arrays 711, 721, 731 and 741 corresponding to each process, and is set to be incremented when each DMA transfer is completed.

転送回数は、各処理に対応する第1のDMAと同一の値を設定する。   The number of transfers is set to the same value as the first DMA corresponding to each process.

各処理の第2のDMAチャネルの最終のDMA転送が完了した際に、転送元アドレスと、転送先アドレスと、転送回数をリロードする。   When the final DMA transfer of the second DMA channel of each process is completed, the transfer source address, the transfer destination address, and the transfer count are reloaded.

本実施の形態1においては、制御の1周期の最後の処理63の終了が、実行時データ記憶部70に記憶される最後の実行時データとなる。このため、処理63に対応する第2のDMAの最終転送が完了した際に、第3のDMAチャネルを開始するように、処理63に対応する第2のDMAチャネルを設定する。   In the first embodiment, the end of the last process 63 in one cycle of control is the last execution time data stored in the execution time data storage unit 70. Therefore, the second DMA channel corresponding to the process 63 is set so that the third DMA channel is started when the final transfer of the second DMA corresponding to the process 63 is completed.

先の図6のフローチャートの説明に戻り、ステップS605の次に、ステップS606において、第3〜第6のDMAチャネルを初期化する。図8は、本発明の実施の形態1に係るECU1における第3のDMAチャネル〜第6のDMAチャネルの初期設定の一例を表形式にまとめたものである。各DMAチャネルは、例えば、図8に例示したように設定する。   Returning to the description of the flowchart of FIG. 6, the third to sixth DMA channels are initialized in step S606 after step S605. FIG. 8 summarizes an example of the initial setting of the third DMA channel to the sixth DMA channel in the ECU 1 according to the first embodiment of the present invention in a table format. Each DMA channel is set, for example, as illustrated in FIG.

第6のDMAチャネルのみ、転送完了後、チャネルを禁止するように設定し、他のチャネルは、常に許可状態の設定で使用する。   Only the sixth DMA channel is set to prohibit the channel after the transfer is completed, and the other channels are always used for setting the permission state.

第3のDMAチャネルは、制御の1周期分の実行時データ記憶部70の内容を外部通信インターフェイス10に転送する最初のDMAチャネルである。そこで、第3のDMAチャネルの転送元アドレスは、実行時データ記憶部70に設定し、第3のDMAチャネルの転送先アドレスは、外部通信インターフェイス10の送信バッファに設定する。   The third DMA channel is the first DMA channel that transfers the contents of the runtime data storage unit 70 for one cycle of control to the external communication interface 10. Therefore, the transfer source address of the third DMA channel is set in the runtime data storage unit 70, and the transfer destination address of the third DMA channel is set in the transmission buffer of the external communication interface 10.

第3のDMAチャネルは、ブロック転送を1回行う。そこで、ブロック転送サイズを外部通信インターフェイス10の送信バッファ長に設定し、転送回数を1に設定する。   The third DMA channel performs block transfer once. Therefore, the block transfer size is set to the transmission buffer length of the external communication interface 10 and the transfer count is set to 1.

例えば、外部通信インターフェイス10がCAN FDで、送信フレームのデータ長を最大にとることができる場合には、ブロック転送サイズを64バイトに設定する。また、各転送が完了した際には、転送元アドレスおよび転送先アドレスは、インクリメントするように設定する。   For example, when the external communication interface 10 is CAN FD and the data length of the transmission frame can be maximized, the block transfer size is set to 64 bytes. When each transfer is completed, the transfer source address and the transfer destination address are set to be incremented.

第3のDMA転送が完了した際に、転送元アドレスと転送先アドレスを初期化の値にリロードし、第4のDMAチャネルを開始するように設定する。   When the third DMA transfer is completed, the transfer source address and the transfer destination address are reloaded to initialization values, and the fourth DMA channel is set to start.

第4のDMAチャネルは、第6のDMAチャネルを許可状態に設定するために、その転送を許可する値を第6のDMAチャネルに設定するためのDMA転送を実行するものである。   The fourth DMA channel executes DMA transfer for setting a value permitting the transfer to the sixth DMA channel in order to set the sixth DMA channel to the permitted state.

転送元アドレスは、第6DMA許可値67に設定し、転送先アドレスは、第6のDMAチャネルの転送許可レジスタに設定する。各転送完了の際の転送元および転送先アドレスは、固定に設定する。   The transfer source address is set to the sixth DMA permission value 67, and the transfer destination address is set to the transfer permission register of the sixth DMA channel. The transfer source and transfer destination addresses at the completion of each transfer are set to be fixed.

第4のDMAチャネルの転送回数は、1回に設定し、DMA転送が完了した際に、転送回数をリロードし、第5のDMAチャネルを開始するように設定する。   The transfer number of the fourth DMA channel is set to one, and when the DMA transfer is completed, the transfer number is reloaded and the fifth DMA channel is started.

第5のDMAチャネルは、第3のDMA転送によって外部通信インターフェイス10の送信バッファに転送されたデータに対して、送信を要求するためのDMA転送を実行するものである。   The fifth DMA channel performs DMA transfer for requesting transmission of data transferred to the transmission buffer of the external communication interface 10 by the third DMA transfer.

転送元アドレスは、送信要求指示値68に設定し、転送先アドレスは、外部通信インターフェイス10の送信要求レジスタに設定する。各転送完了の際の転送元および転送先アドレスは、固定に設定する。   The transfer source address is set in the transmission request instruction value 68 and the transfer destination address is set in the transmission request register of the external communication interface 10. The transfer source and transfer destination addresses at the completion of each transfer are set to be fixed.

第5のDMAチャネルの転送回数は、1回に設定し、DMA転送が完了した際に、転送回数をリロードするように設定する。   The number of transfers of the fifth DMA channel is set to one, and the number of transfers is set to be reloaded when the DMA transfer is completed.

第6のDMAチャネルは、第5のDMA転送によって外部通信インターフェイス10へ要求されたデータ送信が完了した際に、そのハードウェア要因によって開始し、第3のDMAチャネルが未送信の実行時データ記憶部70のデータを転送するものである。   The sixth DMA channel is started by the hardware factor when the data transmission requested to the external communication interface 10 by the fifth DMA transfer is completed, and the third DMA channel is not yet transmitted to the runtime data storage. The data of the unit 70 is transferred.

第6のDMAチャネルの開始は、ハードウェア要因とし、その要因を、外部通信インターフェイス10の送信完了に設定する。   The start of the sixth DMA channel is a hardware factor, and the factor is set to completion of transmission of the external communication interface 10.

第6のDMAチャネルの転送元アドレスは、第3のDMAチャネルで転送されていない、実行時データ記憶部70のデータ箇所に設定する。例えば、上述した第3のDMAチャネルの設定例にならえば、実行時データ記憶部70の先頭+64である。   The transfer source address of the sixth DMA channel is set in the data location of the runtime data storage unit 70 that is not transferred by the third DMA channel. For example, according to the setting example of the third DMA channel described above, it is the top +64 of the runtime data storage unit 70.

第6のDMAチャネルの転送先アドレスは、外部通信インターフェイス10の送信バッファに設定する。また、転送元および転送先アドレスは、インクリメントするように設定する。   The transfer destination address of the sixth DMA channel is set in the transmission buffer of the external communication interface 10. The transfer source and transfer destination addresses are set to be incremented.

第6のDMAチャネルは、ブロック転送モードで使用する。そこで、ブロック転送サイズを外部通信インターフェイス10の送信バッファ長に設定する。また、転送回数には、実行時データ記憶部70の未送信データを全て送信完了するのに必要なブロック転送回数を設定する。本実施の形態1では、実行時データ記憶部70は、104バイトであり、上述した第3のDMAチャネルの設定例にならえば、本DMAチャネル開始の時点で、そのうちの64バイトは転送が完了している。このため、残りは、40バイトであり、外部通信インターフェイス10の送信バッファに入るサイズであるため、転送回数は、1に設定する。   The sixth DMA channel is used in the block transfer mode. Therefore, the block transfer size is set to the transmission buffer length of the external communication interface 10. In addition, as the number of transfers, the number of block transfers required to complete transmission of all untransmitted data in the runtime data storage unit 70 is set. In the first embodiment, the runtime data storage unit 70 is 104 bytes, and according to the above setting example of the third DMA channel, transfer of 64 bytes of the DMA channel is completed at the start of the DMA channel. doing. For this reason, the remaining is 40 bytes, which is a size that can be included in the transmission buffer of the external communication interface 10, so the number of transfers is set to 1.

第6のDMA転送が完了した際に、転送回数をリロードし、第5のDMAチャネルを開始し、チャネルが禁止状態になるように設定する。   When the sixth DMA transfer is completed, the number of transfers is reloaded, the fifth DMA channel is started, and the channel is set to the prohibited state.

次に、上述した本実施の形態1における第1のDMAチャネル〜第6のDMAチャネルの各処理の開始および終了に対する動作について、詳細に説明する。   Next, operations for the start and end of each process of the first to sixth DMA channels in the first embodiment will be described in detail.

処理62が割り込み要因で開始した際に、ソフトウェアで第1のDMAチャネルによる転送を開始する。第1のDMAチャネルによる転送が開始され、タイマ8のカウンタの値を読み出し、時刻格納配列712の第1要素に記憶した後、転送先アドレスをインクリメントして時刻格納配列712の第2要素の箇所とし、第2のDMAチャネルを開始させる。   When the process 62 is started due to an interrupt factor, the transfer by the first DMA channel is started by software. The transfer by the first DMA channel is started, the value of the counter of the timer 8 is read and stored in the first element of the time storage array 712, and then the transfer destination address is incremented and the location of the second element of the time storage array 712 To start the second DMA channel.

第2のDMAチャネルは、割り込み処理62の識別番号表660の先頭に記憶されている処理62開始番号を読み出し、識別番号格納配列711の第1要素に記憶する。その後、転送元アドレスをインクリメントして、割り込み処理62の識別番号表660の第2要素である処理62終了識別番号の箇所とし、転送先アドレスをインクリメントして、識別番号格納配列711の第2要素の箇所とする。   The second DMA channel reads the process 62 start number stored at the head of the identification number table 660 of the interrupt process 62 and stores it in the first element of the identification number storage array 711. Thereafter, the transfer source address is incremented to be the location of the process 62 end identification number which is the second element of the identification number table 660 of the interrupt process 62, the transfer destination address is incremented, and the second element of the identification number storage array 711 is obtained. It is assumed that

処理62の終了の際に、ソフトウェアから第1のDMAチャネルを開始する。第1のDMA転送は、処理62の開始の場合と同様に、タイマ8のカウンタの値を読み出し、時刻格納配列712の第2要素に記憶する。その後、転送先アドレスをインクリメントして時刻格納配列712の第3要素の箇所とし、第2のDMAチャネルを開始させる。   At the end of process 62, the first DMA channel is started from software. In the first DMA transfer, the value of the counter of the timer 8 is read out and stored in the second element of the time storage array 712, as in the case of starting the process 62. Thereafter, the transfer destination address is incremented to be the third element location of the time storage array 712, and the second DMA channel is started.

第2のDMAチャネルは、割り込み処理62の識別番号表660の第2要素である処理62終了識別番号を読み出し、識別番号格納配列711の第2要素に記憶する。その後、転送元アドレスをインクリメントして割り込み処理62の識別番号表660の第3要素である処理62開始識別番号の箇所とし、転送先アドレスをインクリメントして識別番号格納配列711の第3要素の箇所とする。   The second DMA channel reads the process 62 end identification number, which is the second element of the identification number table 660 of the interrupt process 62, and stores it in the second element of the identification number storage array 711. Thereafter, the transfer source address is incremented to be the location of the process 62 start identification number, which is the third element of the identification number table 660 of the interrupt processing 62, and the transfer destination address is incremented to be the location of the third element of the identification number storage array 711. And

上記の処理62の開始および終了の際の第1のDMA転送および第2のDMA転送は、それぞれのDMAチャネルに設定された回数の転送が完了するまで繰り返される。そして、最終回のDMA転送完了後に、第1のDMAチャネルの転送先アドレスおよび転送回数は、それぞれ時刻格納配列712の第1要素のアドレスおよび40回に、つまり初期化完了時の値に、DMAチャネルのリロード機能によって自動的に再設定される。   The first DMA transfer and the second DMA transfer at the start and end of the processing 62 are repeated until the number of transfers set for each DMA channel is completed. After the completion of the final DMA transfer, the transfer destination address and the transfer count of the first DMA channel are set to the address of the first element of the time storage array 712 and 40 times, that is, to the value at the completion of initialization. It is automatically reset by the channel reload function.

また、第2のDMAチャネルについても第1のDMAチャネルと同様に、最終回のDMA転送完了後に、転送元アドレス、転送先アドレス、転送回数がそれぞれDMAチャネルのリロード機能によって自動的に初期化完了時の値に再設定される。   Similarly to the first DMA channel, the second DMA channel is automatically initialized by the DMA channel reload function after the final DMA transfer, and the transfer source address, transfer destination address, and transfer count are each completed. Reset to hour value.

処理63〜65についても、第1のDMA転送および第2のDMA転送の開始および終了方法は、処理62の場合と同様である。本実施の形態1では、処理63の終了の際に実行される最終回の第2のDMA転送が、制御の1周期の中で最後に実行される第2のDMA転送となる。このため、このDMAの転送の完了が、第3のDMA転送を開始するように設定している。   In the processes 63 to 65, the start and end methods of the first DMA transfer and the second DMA transfer are the same as those in the process 62. In the first embodiment, the final second DMA transfer executed at the end of the process 63 is the second DMA transfer executed last in one cycle of control. Therefore, the completion of the DMA transfer is set to start the third DMA transfer.

処理62、処理63のように、割り込み要因で処理を開始する場合であり、かつ割り込み要因で第1のDMA転送を開始することが可能な場合には、第1のDMA転送開始の要因をハードウェアに設定し、処理62、処理63の処理開始の割り込み要因を設定することで、ソフトウェアで第1のDMA転送の開始を指示することなく、第1のDMA転送を開始することができる。   When processing is started by an interrupt factor as in processing 62 and processing 63 and the first DMA transfer can be started by an interrupt factor, the first DMA transfer start factor is The first DMA transfer can be started without instructing the start of the first DMA transfer by software by setting the interrupt factor for starting the processes 62 and 63.

第1のDMAチャネルにDMA転送開始の要因としてソフトウェアとハードウェアの両方を設定できない場合には、ソフトウェアで開始する第1のDMAに加え、ハードウェア要因で開始する第1’のDMAを別に用意し、処理開始の際には、第1’のDMA転送および第2のDMA転送を実行し、処理終了の際には、第1のDMA転送および第2のDMA転送を実行してもよい。   If both software and hardware cannot be set for the DMA transfer start factor in the first DMA channel, a first 1 'DMA start by hardware factor is prepared in addition to the first DMA started by software. However, the first ′ DMA transfer and the second DMA transfer may be executed at the start of the process, and the first DMA transfer and the second DMA transfer may be executed at the end of the process.

第3のDMAチャネルは、実行時データ70の先頭から、外部通信インターフェイス10が持つ送信バッファの長さのデータを、その送信バッファにブロック転送する。   The third DMA channel performs block transfer of data of the length of the transmission buffer possessed by the external communication interface 10 from the head of the runtime data 70 to the transmission buffer.

第3のDMA転送が完了すると、第3のDMAチャネルの転送元アドレス、転送先アドレス、転送回数は、DMAチャネルのリロード機能によって自動的に初期化完了時の値に再設定され、さらに、第4のDMAチャネルの転送を開始する。   When the third DMA transfer is completed, the transfer source address, transfer destination address, and transfer count of the third DMA channel are automatically reset to the values at the completion of initialization by the reload function of the DMA channel. 4 DMA channel transfer is started.

第4のDMAチャネルは、後に開始する第6のDMAチャネルを許可状態に変更する第6DMA許可値67をROM6から第6のDMAチャネルのチャネル転送許可レジスタに転送する。   The fourth DMA channel transfers a sixth DMA permission value 67 for changing the sixth DMA channel to be started later to a permission state from the ROM 6 to the channel transfer permission register of the sixth DMA channel.

第4のDMA転送完了が完了すると、第4のDMAチャネルの転送回数は、DMAチャネルのリロード機能によって自動的に初期化完了時の値に再設定され、第5のDMAチャネルの転送を開始する。   When the completion of the fourth DMA transfer is completed, the number of transfers of the fourth DMA channel is automatically reset to the value at the completion of initialization by the reload function of the DMA channel, and the transfer of the fifth DMA channel is started. .

第5のDMAチャネルは、外部通信インターフェイス10への送信要求指示値68をROM6から外部通信インターフェイス10の送信要求レジスタに転送する。   The fifth DMA channel transfers the transmission request instruction value 68 to the external communication interface 10 from the ROM 6 to the transmission request register of the external communication interface 10.

第5のDMA転送が完了すると、第5のDMAチャネルの転送回数は、DMAチャネルのリロード機能によって自動的に初期化完了時の値に再設定される。   When the fifth DMA transfer is completed, the transfer number of the fifth DMA channel is automatically reset to the value at the completion of initialization by the reload function of the DMA channel.

第6のDMAチャネルは、外部通信インターフェイス10のデータ送信完了のハードウェア要因で開始する。第6のDMAチャネルは、実行時データ記憶部70の、第3のDMA転送で未転送のアドレスからデータ転送を引き継ぎ、外部通信インターフェイス10が持つ送信バッファの長さのデータをその送信バッファにブロック転送する。   The sixth DMA channel starts with a hardware factor of completion of data transmission of the external communication interface 10. The sixth DMA channel takes over the data transfer from the untransferred address in the third DMA transfer of the runtime data storage unit 70, and blocks the data of the length of the transmission buffer of the external communication interface 10 in the transmission buffer. Forward.

第6のDMA転送が1回完了する毎に、第5のDMAチャネルの転送を開始し、外部通信インターフェイス10に対して送信要求を行う。第6のDMA転送が指定の回数だけ完了すると、第6のDMAチャネルは、禁止状態になる。このため、この回の外部通信インターフェイス10からの送信完了の要因で第6のDMAチャネルを開始しない。   Each time the sixth DMA transfer is completed once, transfer of the fifth DMA channel is started and a transmission request is made to the external communication interface 10. When the sixth DMA transfer is completed a specified number of times, the sixth DMA channel is disabled. Therefore, the sixth DMA channel is not started due to the completion of the transmission from the external communication interface 10 this time.

以上のように、処理62〜処理65が各処理を開始および終了するタイミングで、処理毎に用意した第1のDMA転送および第2のDMA転送を実行する。このことにより、各処理の開始および終了の際に、実行時データ記憶部70の内容をプログラムの処理で作成および蓄積する必要がなくなり、かわりに第1のDMAを開始するだけでよくなる。   As described above, the first DMA transfer and the second DMA transfer prepared for each process are executed at the timing when the processes 62 to 65 start and end the processes. This eliminates the need to create and store the contents of the runtime data storage unit 70 by program processing at the start and end of each process, and it is only necessary to start the first DMA instead.

ここで、処理の開始がハードウェアの要因の場合には、その要因を第1のDMAの開始条件に設定することで、処理開始の際にプログラムで第1のDMAの開始の指示を行う処理も不要になる。   Here, when the start of the process is a hardware factor, the factor is set as the first DMA start condition so that the program instructs the start of the first DMA at the start of the process. Is also unnecessary.

図9は、本発明の実施の形態1に係るECU1における実行時データ取得の際の処理手順を示したフローチャートである。非特許文献1では必要であった図10に例示の処理は、本実施の形態1では、図9に例示したように、ステップS901による第1のDMA転送を開始する指示一つになるか、あるいは省略可能になる。   FIG. 9 is a flowchart showing a processing procedure for obtaining runtime data in ECU 1 according to Embodiment 1 of the present invention. The processing illustrated in FIG. 10 that is necessary in Non-Patent Document 1 is one instruction to start the first DMA transfer in step S901 in Embodiment 1, as illustrated in FIG. Or it can be omitted.

また、本実施の形態1は、実行時データ記憶部70に最後にデータを転送する第2のDMA転送が完了した際に、第3のDMAチャネルを開始する。このことにより、実行時データ記憶部70の内容を送信するためにプログラムの処理で外部通信インターフェイス10に実行時データ記憶部70の内容を転送する必要がなくなる。その結果、非特許文献1では必要であった図11に例示の処理は、本実施の形態1では不要になる。   In the first embodiment, the third DMA channel is started when the second DMA transfer for finally transferring data to the runtime data storage unit 70 is completed. This eliminates the need to transfer the contents of the runtime data storage unit 70 to the external communication interface 10 by program processing in order to transmit the contents of the runtime data storage unit 70. As a result, the processing illustrated in FIG. 11 that is necessary in Non-Patent Document 1 is not necessary in the first embodiment.

以上のように、実施の形態1によれば、処理の中で、実行時データの取得が必要な箇所に追加する、先の図10のようなソフトウェア処理を最小とすることができる。この結果、実行時データを取得する処理自体によるCPU時間を最小に抑え、本来の制御プログラムの処理タイミングの変化を最小に抑えることができる。   As described above, according to the first embodiment, it is possible to minimize the software processing as shown in FIG. 10 to be added to the portion where the execution time data needs to be acquired. As a result, it is possible to minimize the CPU time due to the process itself for acquiring the execution time data and to minimize the change in the processing timing of the original control program.

特に、短い処理周期で処理を実行する、例えば車載インバータ制御装置のような制御装置において、処理の開始時刻および終了時刻をはじめとする実行タイミングを取得する際に、その取得処理自体に掛かるCPU時間に起因する実行タイミングの変化を低く抑える対処策として利用することができる。   In particular, in a control device such as an in-vehicle inverter control device that executes processing in a short processing cycle, when acquiring execution timing including processing start time and end time, CPU time required for the acquisition processing itself It can be used as a countermeasure to keep the change in the execution timing due to.

また、実施の形態1によれば、実行時データを転送する、先の図11のようなソフトウェア処理を不要とすることができる。この結果、本来の制御プログラムのCPU負荷が高く、データ転送処理を実行のためのCPU時間が確保できない場合にも、実行時データの転送が可能になる。   Further, according to the first embodiment, the software processing as shown in FIG. 11 for transferring the runtime data can be eliminated. As a result, even when the CPU load of the original control program is high and the CPU time for executing the data transfer process cannot be secured, it is possible to transfer the runtime data.

なお、上述した実施の形態1では、実行時データの作成、および実行時データの送信の両方に対して、CPUを介さずにDMA転送を適用する場合について説明した。しかしながら、作成、送信のいずれか一方にだけDMA転送を適用することも可能である。   In the first embodiment described above, the case where the DMA transfer is applied without using the CPU for both the creation of the runtime data and the transmission of the runtime data has been described. However, it is also possible to apply DMA transfer only to either creation or transmission.

例えば、マイコンが備えるDMAチャネル数が実施の形態1で使用する数よりも少ない場合は、第1〜2のDMAチャネルによる実行時データの作成部または第3〜第6のDMAチャネルによる実行時データの送信部において、一部のDMAチャネルをソフトウェアによる転送処理で代替することができる。   For example, when the number of DMA channels provided in the microcomputer is smaller than the number used in the first embodiment, the runtime data creation unit using the first and second DMA channels or the runtime data using the third to sixth DMA channels In the transmission section, some DMA channels can be replaced by a transfer process by software.

また、上述した実施の形態1では、処理62〜処理65は、全て周期処理としている場合について説明した。一方、マイコン外部で発生する事象や制御プログラム内で特定条件が成立する等の要因で非周期的に開始する非周期処理の実行時データを、周期処理に加えて取得する場合には、非周期処理に対応する第7のDMAチャネルを追加し、第6のDMA転送が完了した際に、第7のDMAチャネルを開始させる。   Moreover, in Embodiment 1 mentioned above, the process 62-the process 65 demonstrated the case where it was set as all the periodic processes. On the other hand, if you want to acquire in addition to the periodic processing the execution data of the aperiodic processing that starts aperiodically due to an event that occurs outside the microcomputer or a specific condition in the control program is satisfied, A seventh DMA channel corresponding to the processing is added, and when the sixth DMA transfer is completed, the seventh DMA channel is started.

第7のDMAは、非周期処理の実行時データ記憶部の識別番号記憶配列の第1要素に、無効な識別番号664を転送する。これにより、制御の1周期の期間に非周期処理が実行されなかった場合には、非周期処理の識別番号格納配列の第1要素が無効な識別番号664が記憶されたままとなる。このため、この期間内に非周期処理が一度も実行されなかったことを判別することができる。   The seventh DMA transfers the invalid identification number 664 to the first element of the identification number storage array of the aperiodic process execution data storage unit. As a result, when the non-periodic process is not executed in the period of one cycle of control, the invalid identification number 664 remains stored in the first element of the identification number storage array of the non-periodic process. For this reason, it can be determined that the non-periodic processing has never been executed within this period.

このような非周期処理への対策は、例えば、周期処理が時々その周期通りに実行されないことがある不具合を調査する際にも、適用することができる。   Such countermeasures for non-periodic processing can be applied, for example, when investigating a problem in which periodic processing is sometimes not executed according to the cycle.

また、本実施の形態1では、本発明に係る実行時データ取得手法の適用の一例を示すために、処理の開始および終了のタイミングを取得している。しかしながら、本発明に係る実行時データ取得手法で取得可能なデータは、これに限らず、例えば、処理開始の時点におけるセンサのAD変換値やデジタルI/Oの入力レベルを取得する場合にも、適用可能である。   In the first embodiment, in order to show an example of application of the runtime data acquisition method according to the present invention, the start and end timings of the process are acquired. However, the data that can be acquired by the runtime data acquisition method according to the present invention is not limited to this. For example, when acquiring an AD conversion value of a sensor or an input level of digital I / O at the time of starting processing, Applicable.

また、データを取得する箇所も処理開始および終了の時点に限らない。制御プログラム処理内の任意の箇所で、第1のDMAチャネルを開始させることで、その時点のデータを取得することが可能であり、その時点でのデータの取得およびデータ転送に掛かるCPUの処理時間を、最小限に抑えることができる。   Further, the location where data is acquired is not limited to the time when processing starts and ends. By starting the first DMA channel at an arbitrary point in the control program process, it is possible to acquire data at that time, and the CPU processing time for data acquisition and data transfer at that time Can be minimized.

1 車載制御装置(ECU)、2 入力回路、3 マイコン、4 I/O、5 CPU、6 ROM、7 RAM、8 タイマ、9 DMAC、10 外部通信インターフェイス、11 駆動回路、12 モータ、13 外部通信線、60 制御プログラム(車載制御プログラム)、61 初期化処理、62、63 周期割り込み処理、64 短周期処理、65 長周期処理、66 識別番号表、67 第6DMA許可値、68 送信要求指示値、70 実行時データ記憶部、71 処理62実行時データ記憶部、72 処理63実行時データ記憶部、73 処理64実行時データ記憶部、74 処理65実行時データ記憶部、660 処理62の識別番号表、661 処理63の識別番号表、662 処理64の識別番号表、663 処理65の識別番号表、664 無効な識別番号、711、721、731、741 識別番号記憶配列、712、722、732、742 時刻記憶配列。   DESCRIPTION OF SYMBOLS 1 In-vehicle control apparatus (ECU), 2 input circuit, 3 microcomputer, 4 I / O, 5 CPU, 6 ROM, 7 RAM, 8 timer, 9 DMAC, 10 external communication interface, 11 drive circuit, 12 motor, 13 external communication Line, 60 control program (in-vehicle control program), 61 initialization process, 62, 63 period interrupt process, 64 short period process, 65 long period process, 66 identification number table, 67 sixth DMA permission value, 68 transmission request instruction value, 70 execution time data storage unit, 71 process 62 execution data storage unit, 72 process 63 execution data storage unit, 73 process 64 execution data storage unit, 74 process 65 execution data storage unit, 660 process 62 identification number table 661, identification number table of processing 63, 662, identification number table of processing 64, 663 identification number table of processing 65, 6 4 invalid identification number, 711,721,731,741 identification number storage array, 712, 722, 732, 742 time storage array.

Claims (6)

複数の処理を有する車載制御プログラムを実行するCPUと、
複数のチャネルを有し、前記CPUがアクセス可能なアドレス空間内のデータを、前記CPUを使用せずにDMA転送することができるダイレクトアクセスメモリコントローラであるDMACと、
前記DMA転送でカウント値を取得可能なハードウェアタイマと、
前記車載制御プログラムを格納するとともに、前記DMA転送でアクセス可能なROMと、
前記DMA転送でアクセス可能なRAMと、
外部機器とデータ通信を行う外部通信インターフェイスと
を備えた車載制御装置において、前記車載制御プログラムを実行する際に、前記複数の処理のそれぞれの実行タイミングあるいは実行内容をモニタリングするための実行時データの作成および送信を行うための、車載制御プログラムの実行時データ取得方法であって、
前記実行時データの作成、および前記実行時データの送信の少なくともいずれか一方を、前記CPUを介さずに前記DMA転送により実行するに当たり、前記DMACは、
前記実行時データの作成を前記DMA転送により実行する場合には、
実行時データを取得する時点で、第1のチャネルによる第1のDMA転送により前記ハードウェアタイマのカウント値を読み出すことで時刻データを収集し、
前記時刻データの収集後、第2のチャネルによる第2のDMA転送により、前記複数の処理の実行順序に従ってあらかじめ前記ROM内に格納された、前記複数の処理を識別するための識別番号を読み出し、前記時刻データに対応した前記識別番号を収集することで、前記実行時データを作成し、
前記実行時データの送信を前記DMA転送により実行する場合には、
あらかじめ決められた制御1周期分に相当する実行時データが作成された後に、前記第1のチャネルおよび前記第2のチャネル以外のチャネルによるDMA転送により、前記制御1周期分の前記実行時データを、前記外部通信インターフェイスを介して前記外部機器に送信する
車載制御プログラムの実行時データ取得方法。
A CPU for executing an in-vehicle control program having a plurality of processes;
A DMAC which is a direct access memory controller having a plurality of channels and capable of performing DMA transfer of data in an address space accessible by the CPU without using the CPU;
A hardware timer capable of obtaining a count value by the DMA transfer;
ROM storing the in-vehicle control program and accessible by the DMA transfer;
RAM accessible by the DMA transfer;
In an in-vehicle control device provided with an external communication interface that performs data communication with an external device, when executing the in-vehicle control program, the execution time data for monitoring each execution timing or execution content of the plurality of processes An in-vehicle control program runtime data acquisition method for creating and transmitting,
In executing at least one of the creation of the runtime data and the transmission of the runtime data by the DMA transfer without passing through the CPU, the DMAC
When creating the runtime data by the DMA transfer,
At the time of obtaining the runtime data, the time data is collected by reading the count value of the hardware timer by the first DMA transfer by the first channel,
After collecting the time data, the second DMA transfer by the second channel reads out the identification number for identifying the plurality of processes stored in the ROM in advance according to the execution order of the plurality of processes. By collecting the identification number corresponding to the time data, create the runtime data,
When executing the execution time data transmission by the DMA transfer,
After execution time data corresponding to a predetermined control cycle is created, the execution time data for the control cycle is transferred by DMA transfer using a channel other than the first channel and the second channel. An in-vehicle control program runtime data acquisition method for transmitting to the external device via the external communication interface.
前記DMACは、
前記車載制御プログラムの処理が実行時データを取得する時点で前記第1のチャネルによる前記第1のDMA転送を開始する第1ステップと、
前記第1のDMA転送により前記ハードウェアタイマのカウント値を読み出し、読み出し結果を前記RAM内に設けられた実行時データ記憶領域内の時刻記憶配列へ転送する第2ステップと、
前記第1のDMA転送の完了により、前記第2のチャネルによる前記第2のDMA転送を開始する第3ステップと、
前記第2のDMA転送により、実行時データの前記識別番号を前記ROMから読み出し、前記RAM内に設けられた前記実行時データ記憶領域内の識別番号記憶配列へ転送する第4ステップと
を実行することで、前記時刻記憶配列および前記識別番号記憶配列からなる前記実行時データを、前記DMA転送を実行することにより作成する
請求項1に記載の車載制御プログラムの実行時データ取得方法。
The DMAC is
A first step of starting the first DMA transfer by the first channel when the processing of the in-vehicle control program acquires runtime data;
A second step of reading the count value of the hardware timer by the first DMA transfer, and transferring the read result to a time storage array in a runtime data storage area provided in the RAM;
A third step of initiating the second DMA transfer over the second channel upon completion of the first DMA transfer;
A fourth step of reading the identification number of the runtime data from the ROM by the second DMA transfer and transferring it to the identification number storage array in the runtime data storage area provided in the RAM; The execution time data acquisition method of the in-vehicle control program according to claim 1, wherein the execution time data including the time storage array and the identification number storage array is created by executing the DMA transfer.
前記DMACは、
前記制御1周期分の実行時データが作成された後に、第3のチャネルによる第3のDMA転送を開始する第5ステップと、
前記第3のDMA転送により、前記制御1周期分の実行時データをその先頭から前記外部通信インターフェイスが持つ送信バッファの分だけ転送する第6ステップと、
前記第3のDMA転送の完了により第4のチャネルによる第4のDMA転送を開始する第7ステップと、
前記第4のDMA転送により、前記ROM内にあらかじめ記憶された第6のチャネルを許可状態にする値を、前記第6のチャネルのレジスタに転送する第8ステップと、
前記第4のDMA転送の完了により、第5のチャネルによる第5のDMA転送を開始する第9ステップと、
前記第5のDMA転送により、前記ROM内にあらかじめ記憶された前記外部通信インターフェイスへの送信要求値を、前記ROMから転送する第10ステップと、
前記外部通信インターフェイスが前記送信バッファの分のデータ送信を完了した際に前記第6のチャネルによる第6のDMA転送を開始する第11ステップと、
前記第6のDMA転送により、前記制御1周期分の実行時データのうち、前記第3のDMA転送で未転送のデータを引き継いで前記外部通信インターフェイスへ転送する第12ステップと、
前記第6のDMA転送の完了により、前記第5のチャネルによる前記第5のDMA転送を開始する第13ステップと、
以後、前記外部通信インターフェイスに対して前記制御1周期分の実行時データの全ての提供が完了するまで、前記第5のDMA転送および前記第6のDMA転送を繰り返す第14ステップと、
前記第6のDMA転送により前記制御1周期分の実行時データの全てを転送完了した際に、前記第6のチャネルを禁止状態にする第15ステップと
を有する請求項1に記載の車載制御プログラムの実行時データ取得方法。
The DMAC is
A fifth step of starting the third DMA transfer by the third channel after the execution time data for one period of the control is created;
A sixth step of transferring execution data for one control cycle from the beginning of the third DMA transfer by an amount corresponding to the transmission buffer of the external communication interface;
A seventh step of initiating a fourth DMA transfer over a fourth channel upon completion of the third DMA transfer;
An eighth step of transferring, by the fourth DMA transfer, a value for enabling the sixth channel stored in advance in the ROM to a register of the sixth channel;
A ninth step of starting a fifth DMA transfer over a fifth channel upon completion of the fourth DMA transfer;
A tenth step of transferring, from the ROM, a transmission request value to the external communication interface stored in advance in the ROM by the fifth DMA transfer;
An eleventh step of starting a sixth DMA transfer by the sixth channel when the external communication interface has completed data transmission of the transmission buffer;
A twelfth step of transferring the untransferred data in the third DMA transfer to the external communication interface among the execution data for the one control cycle by the sixth DMA transfer;
A thirteenth step of initiating the fifth DMA transfer over the fifth channel upon completion of the sixth DMA transfer;
Thereafter, the fourteenth step of repeating the fifth DMA transfer and the sixth DMA transfer until the provision of all of the execution time data for the one control period to the external communication interface is completed.
The in-vehicle control program according to claim 1, further comprising: a fifteenth step of setting the sixth channel to a prohibited state when all of the execution time data for the one control cycle is completed by the sixth DMA transfer. Runtime data acquisition method.
前記DMACは、
前記第4ステップによる前記第2のDMA転送の完了により、前記制御1周期分の実行時データが作成された後に、第3のチャネルによる第3のDMA転送を開始する第5ステップと、
前記第3のDMA転送により、前記制御1周期分の実行時データを先頭から前記外部通信インターフェイスが持つ送信バッファの分だけ転送する第6ステップと、
前記第3のDMA転送の完了により第4のチャネルによる第4のDMA転送を開始する第7ステップと、
前記第4のDMA転送により、前記ROM内にあらかじめ記憶された第6のチャネルを許可状態にする値を、前記第6のチャネルのレジスタに転送する第8ステップと、
前記第4のDMA転送の完了により、第5のチャネルによる第5のDMA転送を開始する第9ステップと、
前記第5のDMA転送により、前記ROM内にあらかじめ記憶された前記外部通信インターフェイスへの送信要求値を、前記ROMから転送する第10ステップと、
前記外部通信インターフェイスが前記送信バッファの分のデータ送信を完了した際に前記第6のチャネルによる第6のDMA転送を開始する第11ステップと、
前記第6のDMA転送により、前記制御1周期分の実行時データのうち、前記第3のDMA転送で未転送のデータを引き継いで前記外部通信インターフェイスへ転送する第12ステップと、
前記第6のDMA転送の完了により、前記第5のチャネルによる前記第5のDMA転送を開始する第13ステップと、
以後、前記外部通信インターフェイスに対して前記制御1周期分の実行時データの全ての提供が完了するまで、前記第5のDMA転送および前記第6のDMA転送を繰り返す第14ステップと、
前記第6のDMA転送により前記制御1周期分の実行時データの全てを転送完了した際に、前記第6のチャネルを禁止状態にする第15ステップと
を有する請求項2に記載の車載制御プログラムの実行時データ取得方法。
The DMAC is
A fifth step of starting the third DMA transfer by the third channel after the execution time data for the one control period is created by the completion of the second DMA transfer by the fourth step;
A sixth step of transferring execution-time data for one control cycle from the top by the third DMA transfer by an amount corresponding to the transmission buffer of the external communication interface;
A seventh step of initiating a fourth DMA transfer over a fourth channel upon completion of the third DMA transfer;
An eighth step of transferring, by the fourth DMA transfer, a value for enabling the sixth channel stored in advance in the ROM to a register of the sixth channel;
A ninth step of starting a fifth DMA transfer over a fifth channel upon completion of the fourth DMA transfer;
A tenth step of transferring, from the ROM, a transmission request value to the external communication interface stored in advance in the ROM by the fifth DMA transfer;
An eleventh step of starting a sixth DMA transfer by the sixth channel when the external communication interface has completed data transmission of the transmission buffer;
A twelfth step of transferring the untransferred data in the third DMA transfer to the external communication interface among the execution data for the one control cycle by the sixth DMA transfer;
A thirteenth step of initiating the fifth DMA transfer over the fifth channel upon completion of the sixth DMA transfer;
Thereafter, the fourteenth step of repeating the fifth DMA transfer and the sixth DMA transfer until the provision of all of the execution time data for the one control period to the external communication interface is completed.
The vehicle-mounted control program according to claim 2, further comprising: a fifteenth step of setting the sixth channel to a prohibited state when all of the execution-time data for the one control cycle is completed by the sixth DMA transfer. Runtime data acquisition method.
前記DMACは、非周期的に開始する非周期処理の実行時データを作成する場合には、
前記第6のDMA転送が完了した際に、前記非周期処理に対応する第7のチャネルによる第7のDMA転送を開始させ、前記実行時データ記憶領域内の非周期処理に対応する識別番号記憶配列の第1要素に、無効な識別番号を転送する第16ステップ
を有する請求項4に記載の車載制御プログラムの実行時データ取得方法。
When the DMAC creates runtime data for aperiodic processing that starts aperiodically,
When the sixth DMA transfer is completed, the seventh DMA transfer by the seventh channel corresponding to the aperiodic process is started, and the identification number storage corresponding to the aperiodic process in the runtime data storage area The in-vehicle control program runtime data acquisition method according to claim 4, further comprising a sixteenth step of transferring an invalid identification number to the first element of the array.
複数の処理を有する車載制御プログラムを実行するCPUと、
複数のチャネルを有し、前記CPUがアクセス可能なアドレス空間内のデータを、前記CPUを使用せずにDMA転送することができるダイレクトアクセスメモリコントローラであるDMACと、
前記DMA転送でカウント値を取得可能なハードウェアタイマと、
前記車載制御プログラムを格納するとともに、前記DMA転送でアクセス可能なROMと、
前記DMA転送でアクセス可能なRAMと、
外部機器とデータ通信を行う外部通信インターフェイスと
を備え、前記車載制御プログラムを実行する際に、前記複数の処理のそれぞれの実行タイミングあるいは実行内容をモニタリングするための実行時データの作成および送信を行う車載制御装置であって、
前記DMACは、前記実行時データの作成、および前記実行時データの送信の少なくともいずれか一方を、前記CPUを介さずに前記DMA転送により実行するに当たり、
前記実行時データの作成を前記DMA転送により実行する場合には、
実行時データを取得する時点で、第1のチャネルによる第1のDMA転送により前記ハードウェアタイマのカウント値を読み出すことで時刻データを収集し、
前記時刻データの収集後、第2のチャネルによる第2のDMA転送により、前記複数の処理の実行順序に従ってあらかじめ前記ROM内に格納された、前記複数の処理を識別するための識別番号を読み出し、前記時刻データに対応した前記識別番号を収集することで、前記実行時データを作成し、
前記実行時データの送信を前記DMA転送により実行する場合には、
あらかじめ決められた制御1周期分に相当する実行時データが作成された後に、前記第1のチャネルおよび前記第2のチャネル以外のチャネルによるDMA転送により、前記制御1周期分の前記実行時データを、前記外部通信インターフェイスを介して前記外部機器に送信する
車載制御装置。
A CPU for executing an in-vehicle control program having a plurality of processes;
A DMAC which is a direct access memory controller having a plurality of channels and capable of performing DMA transfer of data in an address space accessible by the CPU without using the CPU;
A hardware timer capable of obtaining a count value by the DMA transfer;
ROM storing the in-vehicle control program and accessible by the DMA transfer;
RAM accessible by the DMA transfer;
An external communication interface that performs data communication with an external device, and when executing the in-vehicle control program, creates and transmits runtime data for monitoring the execution timing or execution content of each of the plurality of processes. An in-vehicle control device,
The DMAC executes at least one of creation of the runtime data and transmission of the runtime data by the DMA transfer without using the CPU.
When creating the runtime data by the DMA transfer,
At the time of obtaining the runtime data, the time data is collected by reading the count value of the hardware timer by the first DMA transfer by the first channel,
After collecting the time data, the second DMA transfer by the second channel reads out the identification number for identifying the plurality of processes stored in the ROM in advance according to the execution order of the plurality of processes. By collecting the identification number corresponding to the time data, create the runtime data,
When executing the execution time data transmission by the DMA transfer,
After execution time data corresponding to a predetermined control cycle is created, the execution time data for the control cycle is transferred by DMA transfer using a channel other than the first channel and the second channel. A vehicle-mounted control device that transmits to the external device via the external communication interface.
JP2016172544A 2016-09-05 2016-09-05 In-vehicle control program execution time data acquisition method and in-vehicle control device Active JP6188895B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016172544A JP6188895B1 (en) 2016-09-05 2016-09-05 In-vehicle control program execution time data acquisition method and in-vehicle control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016172544A JP6188895B1 (en) 2016-09-05 2016-09-05 In-vehicle control program execution time data acquisition method and in-vehicle control device

Publications (2)

Publication Number Publication Date
JP6188895B1 JP6188895B1 (en) 2017-08-30
JP2018041130A true JP2018041130A (en) 2018-03-15

Family

ID=59720327

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016172544A Active JP6188895B1 (en) 2016-09-05 2016-09-05 In-vehicle control program execution time data acquisition method and in-vehicle control device

Country Status (1)

Country Link
JP (1) JP6188895B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7072697B1 (en) * 2021-03-12 2022-05-20 三菱電機株式会社 Electronic control device, test device for electronic control device, and test method for electronic control device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62232055A (en) * 1986-04-02 1987-10-12 Hitachi Ltd Method for preparing event trace data
JP4282390B2 (en) * 2003-07-04 2009-06-17 富士通テン株式会社 Microcomputer logic development equipment
JP6041749B2 (en) * 2013-04-19 2016-12-14 三菱電機株式会社 Trace collection circuit and trace collection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7072697B1 (en) * 2021-03-12 2022-05-20 三菱電機株式会社 Electronic control device, test device for electronic control device, and test method for electronic control device

Also Published As

Publication number Publication date
JP6188895B1 (en) 2017-08-30

Similar Documents

Publication Publication Date Title
JP4598858B2 (en) Device and method for arbitrating direct memory access task requests
US9400617B2 (en) Hardware-assisted DMA transfer with dependency table configured to permit-in parallel-data drain from cache without processor intervention when filled or drained
KR101045475B1 (en) Real-time debug support for a dma device and method thereof
US8874959B2 (en) Information processing apparatus, image forming apparatus, and information processing program
US9727497B2 (en) Resolving contention between data bursts
EP1899825B1 (en) Device and method for controlling multiple dma tasks
JP4652394B2 (en) Multiburst protocol device controller
JP2008523456A (en) Data processing system with trace coprocessor
JP2009510543A (en) Device and method for controlling execution of a DMA task
US7013357B2 (en) Arbiter having programmable arbitration points for undefined length burst accesses and method
JP4834362B2 (en) Memory controller.
KR100868395B1 (en) Readdressable virtual dma control and status registers
JP6188895B1 (en) In-vehicle control program execution time data acquisition method and in-vehicle control device
EP1899827A1 (en) Device and method for executing a dma task
KR20100060375A (en) Direct memory access device and direct memory access method
JP2005242806A (en) Data processor
JP5982845B2 (en) Trace control apparatus and trace control method
KR100633742B1 (en) Direct memory access controller for updating data transmission size automatically from peripheral, and control method thereof
JP2005141532A (en) System debugging device
US20120011295A1 (en) Method and apparatus for wireless broadband systems direct data transfer
Visconti et al. Operation principle, advanced procedures and validation of a new Flex-SPI communication Protocol for smart IoT devices
JP2003167756A5 (en)
JP2009230425A (en) Information processor
JP6142182B2 (en) Integrated circuit device
CN111143141B (en) State machine setting method and system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170628

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170704

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170801

R150 Certificate of patent or registration of utility model

Ref document number: 6188895

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250