JP2020149597A - Control device and control method - Google Patents

Control device and control method Download PDF

Info

Publication number
JP2020149597A
JP2020149597A JP2019048767A JP2019048767A JP2020149597A JP 2020149597 A JP2020149597 A JP 2020149597A JP 2019048767 A JP2019048767 A JP 2019048767A JP 2019048767 A JP2019048767 A JP 2019048767A JP 2020149597 A JP2020149597 A JP 2020149597A
Authority
JP
Japan
Prior art keywords
cache
processing
time
real
memory
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.)
Pending
Application number
JP2019048767A
Other languages
Japanese (ja)
Inventor
由芳 杉山
Yuho Sugiyama
由芳 杉山
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.)
Denso Ten Ltd
Original Assignee
Denso Ten Ltd
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 Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP2019048767A priority Critical patent/JP2020149597A/en
Publication of JP2020149597A publication Critical patent/JP2020149597A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

To provide a control device ad a control method capable of suppressing processing delay due to switching of OSs.SOLUTION: A control device 1 comprises a processing part 2, a cash memory 4 common to a plurality of OSs, and a cache lock control part 5. The processing part performs processing corresponding to each OS while switching the plurality of OSs. The cash memory common to the plurality of OSs stores data read by the processing part from a memory storing data used by the processing part for processing. The cache lock control part controls cache lock for prohibiting rewrite to a region of the cash memory. In addition, the cache lock control part changes the region subjected to cache lock so that when the switching of the OSs processed by the processing part is performed, a region, from among the regions of the cash memory, including data read from the memory while the OS before switching is processed is cache locked.SELECTED DRAWING: Figure 1

Description

本発明は、制御装置および制御方法に関する。 The present invention relates to a control device and a control method.

近年、車両制御の複雑化に伴い、制御装置が実行する制御用プログラムは、増加する傾向にあり、動作するOS(Operating System)も制御用プログラム間で異なる場合がある。そして、制御装置には、1つのマイコンで異なるOSを実行する、いわゆるマルチOSの技術が導入されつつある(例えば、特許文献1参照)。 In recent years, with the increasing complexity of vehicle control, the number of control programs executed by the control device tends to increase, and the operating OS (Operating System) may also differ between the control programs. Then, a so-called multi-OS technology in which one microcomputer executes different OSs is being introduced into the control device (see, for example, Patent Document 1).

特開2018−013587号公報Japanese Unexamined Patent Publication No. 2018-013587

ところで、1つのマイコンでマルチOSを実現する場合、複数のOS間でキャッシュを共有する必要がある。かかる点について、従来技術では、対象OSの処理開始前に、事前に処理動作させてキャッシュに書き込んだデータをキャッシュロックさせることで、対象OSを動作させる際のキャッシュヒット率を向上させて処理速度を向上させるようにしている。 By the way, when realizing a multi-OS with one microcomputer, it is necessary to share a cache among a plurality of OSs. Regarding this point, in the prior art, the cache hit rate when operating the target OS is improved and the processing speed is increased by cache-locking the data written in the cache by performing the processing operation in advance before starting the processing of the target OS. I am trying to improve.

しかしながら、例えば車両制御のように、割り込み処理等によりOSを頻繁に切り替えなければならない場合には、従来技術のように、OSの切り替えを行う毎に事前に処理動作させるとなると、処理が間に合わず、処理遅延が生じるおそれがあった。 However, when the OS must be frequently switched by interrupt processing or the like, for example, in vehicle control, the processing cannot be completed in time if the processing operation is performed in advance each time the OS is switched as in the conventional technology. , There was a risk of processing delay.

本発明は、上記に鑑みてなされたものであって、OSの切り替えによる処理遅延を抑えることができる制御装置および制御方法を提供することを目的とする。 The present invention has been made in view of the above, and an object of the present invention is to provide a control device and a control method capable of suppressing a processing delay due to switching of an OS.

上述した課題を解決し、目的を達成するために、本発明に係る制御装置は、処理部と、複数のOS共通のキャッシュメモリと、キャッシュロック制御部とを備える。前記処理部は、複数のOS(Operating System)を切り替えながら各OSに対応する処理を行う。複数のOS共通の前記キャッシュメモリは、前記処理部が処理に用いるデータを記憶するメモリから前記処理部が読み出したデータを格納する。前記キャッシュロック制御部は、キャッシュメモリの領域に対する書き替えを禁止するキャッシュロックの制御を行う。また、前記キャッシュロック制御部は、前記処理部が処理するOSの切り替えが行われる場合に、前記キャッシュメモリの領域のうち、切替前のOSが処理されている際に前記メモリから読み出したデータを含む領域がキャッシュロックされるように、キャッシュロックする領域の変更を行う。 In order to solve the above-mentioned problems and achieve the object, the control device according to the present invention includes a processing unit, a cache memory common to a plurality of OSs, and a cache lock control unit. The processing unit performs processing corresponding to each OS while switching between a plurality of OSs (Operating Systems). The cache memory common to a plurality of OSs stores data read by the processing unit from a memory for storing data used by the processing unit for processing. The cache lock control unit controls the cache lock that prohibits rewriting of the cache memory area. Further, when the OS to be processed by the processing unit is switched, the cache lock control unit reads data read from the memory when the OS before switching is being processed in the cache memory area. Change the cache-locked area so that the included area is cache-locked.

本発明によれば、OSの切り替えによる処理遅延を抑えることができる。 According to the present invention, it is possible to suppress the processing delay due to the switching of the OS.

図1は、実施形態に係る制御装置の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a control device according to an embodiment. 図2は、実施形態に係る制御方法の概要を示す図である。FIG. 2 is a diagram showing an outline of a control method according to an embodiment. 図3は、実施形態に係る制御方法を示す図である。FIG. 3 is a diagram showing a control method according to the embodiment. 図4は、実施形態に係る制御装置が実行する処理の処理手順を示すフローチャートである。FIG. 4 is a flowchart showing a processing procedure of processing executed by the control device according to the embodiment. 図5は、変形例に係る制御方法を示す図である。FIG. 5 is a diagram showing a control method according to a modified example.

以下、添付図面を参照して、本願の開示する制御装置および制御方法の実施形態を詳細に説明する。なお、以下に示す実施形態により本発明が限定されるものではない。 Hereinafter, embodiments of the control device and control method disclosed in the present application will be described in detail with reference to the accompanying drawings. The present invention is not limited to the embodiments shown below.

まず、図1および図2を用いて、実施形態に係る制御方法の概要について説明する。図1は、実施形態に係る制御装置の構成を示すブロック図である。図2は、実施形態に係る制御方法の概要を示す図である。 First, the outline of the control method according to the embodiment will be described with reference to FIGS. 1 and 2. FIG. 1 is a block diagram showing a configuration of a control device according to an embodiment. FIG. 2 is a diagram showing an outline of a control method according to an embodiment.

図1に示すように、実施形態に係る制御装置1は、処理部2と、主メモリ3と、キャッシュメモリ4と、キャッシュロック制御部5とを備える。 As shown in FIG. 1, the control device 1 according to the embodiment includes a processing unit 2, a main memory 3, a cache memory 4, and a cache lock control unit 5.

ここで、制御装置1は、たとえば、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)などを有するコンピュータや各種の回路を含む。 Here, the control device 1 includes, for example, a computer having a CPU (Central Processing Unit), a ROM (Read Only Memory), a RAM (Random Access Memory), and various circuits.

コンピュータのCPUは、たとえば、主メモリ3であるRAMやROM等で構成される大容量な記憶媒体に記憶されたプログラムを読み出して実行することによって、処理部2およびキャッシュロック制御部5として機能する。 The CPU of a computer functions as a processing unit 2 and a cache lock control unit 5 by reading and executing a program stored in a large-capacity storage medium composed of RAM, ROM, etc., which is the main memory 3, for example. ..

なお、処理部2およびキャッシュロック制御部5の機能のうち、一部または全部をASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等のハードウェアで構成することもできる。 It should be noted that some or all of the functions of the processing unit 2 and the cache lock control unit 5 can be configured by hardware such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array).

また、キャッシュメモリ4は、たとえば、RAMで構成され、主メモリ3を構成する記憶媒体よりも高速でデータの読み出しや書き込みが可能であるが主メモリ3よりも低容量な記憶部である。RAMは、処理部2の作業領域として機能し、処理部2が実行する各種プログラムの情報等を一時的に記憶することができる。 Further, the cache memory 4 is, for example, a storage unit composed of RAM, capable of reading and writing data at a higher speed than the storage medium constituting the main memory 3, but having a lower capacity than the main memory 3. The RAM functions as a work area of the processing unit 2, and can temporarily store information and the like of various programs executed by the processing unit 2.

ここで、処理部2には、仮想化支援機能が実装されている。仮想化支援機能とは、1つのCPU(もしくはコア)をハードウェア的な仮想化技術によって論理的に二つ以上に分割することで、ユーザからは、あたかも二つのCPU(コア)が異なるOSで動作しているように見える機能である。これにより、1つのCPUで構成される処理部2は、複数のOSを切り替えながら各OSに対応する処理を行う、マルチOSを実現することができる。 Here, the virtualization support function is implemented in the processing unit 2. The virtualization support function is to logically divide one CPU (or core) into two or more by hardware virtualization technology, so that the user can see that the two CPUs (cores) are different OSs. It's a feature that seems to work. As a result, the processing unit 2 composed of one CPU can realize a multi-OS in which processing corresponding to each OS is performed while switching a plurality of OSs.

図1に示す例では、処理部2は、リアルタイム処理を行うリアルタイムOSと、非リアルタイム処理を行う非リアルタイムOSとを切り替えて処理を行う。リアルタイムOSは、例えば、車載ネットワークであるCAN(Controller Area Network)の通信ドライバを使用し、車載バッテリを制御するためのセンサ信号の受信や制御信号の送信等を行なうことで、車載バッテリにおける充放電制御処理をリアルタイム処理として実行させる。 In the example shown in FIG. 1, the processing unit 2 switches between a real-time OS that performs real-time processing and a non-real-time OS that performs non-real-time processing to perform processing. The real-time OS uses, for example, a communication driver of CAN (Controller Area Network), which is an in-vehicle network, and charges / discharges the in-vehicle battery by receiving a sensor signal for controlling the in-vehicle battery and transmitting a control signal. The control process is executed as a real-time process.

また、非リアルタイムOSは、例えば、無線LAN(Local Area Network)の通信ドライバを使用し、車両外部(例えば、車外から車載バッテリへの充電や、車載バッテリから車外への電力供給を行う際の車外電源設備)との通信処理を非リアルタイム処理として実行させる。 In addition, the non-real-time OS uses, for example, a wireless LAN (Local Area Network) communication driver to charge the vehicle outside the vehicle (for example, from outside the vehicle to the vehicle battery, or to supply power from the vehicle battery to the outside of the vehicle). The communication process with the power supply facility) is executed as a non-real-time process.

なお、リアルタイム処理は、充放電制御処理に限定されず、例えば、エンジン制御処理等であってもよく、リアルタイム性が要求される処理であればよい。また、非リアルタイム処理は、通信処理に限定されず、例えば、マルチメディア機器の処理等であってもよく、リアルタイム性が要求されない処理であればよい。 The real-time processing is not limited to the charge / discharge control processing, and may be, for example, an engine control processing or the like, as long as it is a processing that requires real-time performance. Further, the non-real-time processing is not limited to the communication processing, and may be, for example, processing of a multimedia device, and may be any processing that does not require real-time performance.

例えば、処理部2は、リアルタイムOSで動作している場合、主メモリ3からリアルタイム処理用のデータの読み出しを行うが、この際、まずキャッシュメモリ4に読み出したいデータがあるか確認し、キャッシュメモリ4に読み出したいデータがあった場合には、キャッシュメモリ4のデータを読み出すことで、主メモリ3へのアクセスが省略され、処理部2の処理時間が短縮される。また、キャッシュメモリ4に読み出したいデータがなかった場合には、主メモリ3にアクセスしてデータの読み出しを行うとともに、読み出したいデータをキャッシュメモリ4におけるキャッシュロックがされていない領域(リアルタイムOSで動作している場合にはリアルタイム処理用のデータを記憶するための領域)の空き領域に記憶する。主メモリ3およびキャッシュメモリ4に記憶されるデータには、リアルタイム処理を実行するためのコードや、リアルタイム処理により生成されたデータ等が含まれる。 For example, the processing unit 2 reads data for real-time processing from the main memory 3 when operating in a real-time OS. At this time, first confirms whether there is data to be read in the cache memory 4 and then cache memory. When there is data to be read in 4, by reading the data in the cache memory 4, access to the main memory 3 is omitted, and the processing time of the processing unit 2 is shortened. When there is no data to be read in the cache memory 4, the main memory 3 is accessed to read the data, and the data to be read is cache-locked in the cache memory 4 (operates in a real-time OS). If it is, it is stored in the free area of the area for storing the data for real-time processing). The data stored in the main memory 3 and the cache memory 4 includes a code for executing real-time processing, data generated by real-time processing, and the like.

同様に、処理部2は、非リアルタイムOSで動作している場合、主メモリ3やキャッシュメモリ4から非リアルタイム処理用のデータを読み出す処理やキャッシュメモリ4の書き替えを行う。なお、この際の処理は、前述したリアルタイムOSでの処理内容と同じである。主メモリ3およびキャッシュメモリ4に記憶されるデータには、非リアルタイム処理を実行するためのコードや、リアルタイム処理により生成されたデータ等が含まれる。 Similarly, when operating on a non-real-time OS, the processing unit 2 performs a process of reading data for non-real-time processing from the main memory 3 and the cache memory 4 and rewriting the cache memory 4. The processing at this time is the same as the processing content in the real-time OS described above. The data stored in the main memory 3 and the cache memory 4 includes a code for executing non-real-time processing, data generated by real-time processing, and the like.

なお、キャッシュメモリ4にデータを記憶する際に、キャッシュメモリ4に空き領域が無い場合には、キャッシュメモリ4の領域における古いデータ(直近で読み出しが行われた時間が古いデータ、もしくは、書き込みされた時間が古いデータ)が記憶された領域に上書き記憶(書き替え)が行われ、上書き記憶された領域の元データは、キャッシュメモリ4から追い出されることになる。 When the data is stored in the cache memory 4, if there is no free area in the cache memory 4, the old data in the area of the cache memory 4 (data whose most recently read time is old or written). Overwrite storage (rewriting) is performed in the area in which the old data) is stored, and the original data in the overwritten area is expelled from the cache memory 4.

キャッシュロック制御部5は、キャッシュメモリ4の領域に対する書き換えを禁止するキャッシュロックの制御を行う。なお、キャッシュロック制御部5が行うキャッシュロックの詳細については後述する。 The cache lock control unit 5 controls the cache lock that prohibits rewriting of the area of the cache memory 4. The details of the cache lock performed by the cache lock control unit 5 will be described later.

ここで、従来技術では、対象OSの処理開始前に、事前に処理動作させてキャッシュメモリに書き込んだ処理データをキャッシュロックさせることで、対象OSの処理データが他のOSの処理データによりキャッシュメモリから追い出されないようにしている。 Here, in the prior art, the processing data of the target OS is cache-locked by the processing data of another OS by performing the processing operation in advance and cache-locking the processing data written in the cache memory before the processing of the target OS is started. I try not to be kicked out of.

しかしながら、車両制御のように、割り込み処理等によりOSを頻繁に切り替えなければならない場合には、従来技術のように事前に処理動作させると、処理が間に合わず、処理遅延が生じるおそれがあった。また、キャッシュロックを行わなければ、一方のOSを動作させている際に、キャッシュメモリの領域はデータの読み出しがある毎にそのOSのデータに書き替えられてしまうので、他方のOSに切り替えた際には、切替後のOSのデータはキャッシュメモリに残っておらず、キャッシュヒット率が低下することから、処理が間に合わずに、処理遅延が生じるおそれがあった。 However, when it is necessary to frequently switch the OS by interrupt processing or the like as in vehicle control, if the processing operation is performed in advance as in the conventional technology, the processing may not be in time and a processing delay may occur. Also, if cache lock is not performed, when one OS is operating, the cache memory area will be rewritten to the data of that OS every time data is read, so it was switched to the other OS. In that case, the OS data after switching does not remain in the cache memory, and the cache hit rate decreases, so that the processing may not be in time and a processing delay may occur.

そこで、実施形態に係る制御方法では、処理部2が処理するOSの切り替えが行われる場合に、キャッシュメモリ4の領域のうち、切替前のOSが処理される際に主メモリ3から読み出したデータを含む領域がキャッシュロックされるように、キャッシュロックする領域の変更を行う。ここで、図2を用いて、実施形態に係る制御方法について説明する。 Therefore, in the control method according to the embodiment, when the OS to be processed by the processing unit 2 is switched, the data read from the main memory 3 when the OS before the switching is processed in the area of the cache memory 4. The area to be cache-locked is changed so that the area including is cache-locked. Here, the control method according to the embodiment will be described with reference to FIG.

図2では、リアルタイムOSから非リアルタイムOSに切り替わる場合のキャッシュロックについて説明する。また、図2では、キャッシュメモリ4の領域は、4つの領域D1〜D4に分割され、各領域D1〜D4には、1つのデータが格納されることとする。 FIG. 2 describes a cache lock when switching from a real-time OS to a non-real-time OS. Further, in FIG. 2, the area of the cache memory 4 is divided into four areas D1 to D4, and one data is stored in each area D1 to D4.

図2に示すように、実施形態に係る制御方法では、キャッシュロック制御部5は、処理部2が処理するOSの切り替えが行われる場合、具体的には、リアルタイムOSから非リアルタイムOSに切り替わる場合、キャッシュメモリ4の領域D1〜D4のうち、リアルタイムOSが処理される際に主メモリ3から読み出したデータを含む領域D1および領域D2をキャッシュロックする。 As shown in FIG. 2, in the control method according to the embodiment, the cache lock control unit 5 switches from the real-time OS to the non-real-time OS when the OS processed by the processing unit 2 is switched. Of the areas D1 to D4 of the cache memory 4, the areas D1 and D2 including the data read from the main memory 3 when the real-time OS is processed are cache-locked.

これにより、非リアルタイム処理のデータをキャッシュメモリ4に記憶したとしても、リアルタイム処理のデータがキャッシュメモリ4から追い出されることを防止できる。 As a result, even if the non-real-time processing data is stored in the cache memory 4, it is possible to prevent the real-time processing data from being expelled from the cache memory 4.

このため、車両制御等の割り込みにより、非リアルタイムOSからリアルタイムOSに切り替わった場合に、キャッシュロックされた領域D1および領域D2には、リアルタイム処理のデータが残っているため、キャッシュヒット率が向上し、リアルタイム処理を高速に行うことができる。 Therefore, when the non-real-time OS is switched to the real-time OS due to an interrupt such as vehicle control, real-time processing data remains in the cache-locked areas D1 and D2, so that the cache hit rate is improved. , Real-time processing can be performed at high speed.

換言すれば、実施形態に係る制御方法では、従来技術のように、処理開始前に事前に処理動作させてキャッシュメモリにデータを書き込む必要が無い。このため、OSを頻繁に切り替えなければならない場合であっても、処理遅延が生じにくくなる。従って、実施形態に係る制御方法によれば、OSの切替による処理遅延を抑えることができる。 In other words, in the control method according to the embodiment, it is not necessary to perform the processing operation in advance and write the data to the cache memory before the start of the processing, unlike the conventional technique. Therefore, even when the OS must be switched frequently, processing delay is less likely to occur. Therefore, according to the control method according to the embodiment, it is possible to suppress the processing delay due to the switching of the OS.

次に、図3を用いて、実施形態に係る制御方法について具体的に説明する。図3は、実施形態に係る制御方法を示す図である。図3では、時刻t1において、リアルタイムOSから非リアルタイムOSに切り替わり、時刻t2において、非リアルタイムOSからリアルタイムOSへ切り替わることとする。 Next, the control method according to the embodiment will be specifically described with reference to FIG. FIG. 3 is a diagram showing a control method according to the embodiment. In FIG. 3, it is assumed that the real-time OS is switched to the non-real-time OS at time t1 and the non-real-time OS is switched to the real-time OS at time t2.

また、図3に示すように、キャッシュメモリ4は、リアルタイム処理のデータが格納される専用領域D10と、非リアルタイム処理のデータが格納される専用領域D20とに予め分割されていることとする。さらに、専用領域D10は、4つの領域D11〜D14に分割され、各領域D11〜D14には1つのリアルタイム処理のデータが格納される。また、専用領域D20は、4つの領域D21〜D24に分割され、各領域D21〜D24には1つの非リアルタイム処理のデータが格納される。 Further, as shown in FIG. 3, the cache memory 4 is divided in advance into a dedicated area D10 in which real-time processing data is stored and a dedicated area D20 in which non-real-time processing data is stored. Further, the dedicated area D10 is divided into four areas D11 to D14, and one real-time processing data is stored in each area D11 to D14. Further, the dedicated area D20 is divided into four areas D21 to D24, and one non-real-time processing data is stored in each area D21 to D24.

キャッシュロック制御部5は、切替前のOSが処理される際に主メモリ3から読み出したデータを含む専用領域D10,D20をキャッシュロックする。具体的には、図3に示すように、時刻t1では、キャッシュロック制御部5は、切替前のOSであるリアルタイムOSに対応する専用領域D10をキャッシュロックする。また、時刻t1において、キャッシュロック制御部5は、切替後のOSである非リアルタイムOSに対応する専用領域D20のキャッシュロックを解除する。 The cache lock control unit 5 cache locks the dedicated areas D10 and D20 including the data read from the main memory 3 when the OS before switching is processed. Specifically, as shown in FIG. 3, at time t1, the cache lock control unit 5 cache locks the dedicated area D10 corresponding to the real-time OS which is the OS before switching. Further, at time t1, the cache lock control unit 5 releases the cache lock of the dedicated area D20 corresponding to the non-real-time OS which is the OS after switching.

これにより、非リアルタイム処理時において、リアルタイム処理のデータが主メモリ3に追い出されることを防止でき、専用領域D20に非リアルタイム処理のデータを書き込むことができる。 As a result, it is possible to prevent the real-time processing data from being expelled to the main memory 3 during the non-real-time processing, and it is possible to write the non-real-time processing data to the dedicated area D20.

次に、時刻t2において、キャッシュロック制御部5は、切替前のOSである非リアルタイムOSに対応する専用領域D20をキャッシュロックする。また、時刻t2において、キャッシュロック制御部5は、切替後のOSであるリアルタイムOSに対応する専用領域D10のキャッシュロックを解除する。 Next, at time t2, the cache lock control unit 5 cache locks the dedicated area D20 corresponding to the non-real-time OS which is the OS before switching. Further, at time t2, the cache lock control unit 5 releases the cache lock of the dedicated area D10 corresponding to the real-time OS which is the OS after switching.

これにより、リアルタイム処理時において、非リアルタイム処理のデータが主メモリ3に追い出されることを防止でき、専用領域D10に非リアルタイム処理のデータを書き込むことができる。また、時刻t1以前のリアルタイム処理のデータが、時刻t2において、専用領域D10に残っているので、時刻t2以降のリアルタイム処理を高速化できる。 As a result, it is possible to prevent the non-real-time processing data from being expelled to the main memory 3 during real-time processing, and it is possible to write the non-real-time processing data to the dedicated area D10. Further, since the real-time processing data before the time t1 remains in the dedicated area D10 at the time t2, the real-time processing after the time t2 can be speeded up.

なお、時刻t1から時刻t2の期間のうち、非リアルタイム処理終了後のアイドル期間については、時刻t2までの間、専用領域D10のキャッシュロックを維持する。 In the period from time t1 to time t2, the cache lock of the dedicated area D10 is maintained until time t2 during the idle period after the end of non-real-time processing.

あるいは、時刻t1からの非リアルタイム処理終了後に非リアルタイムOSからリアルタイムOSに事前に切り替えておいてもよい。かかる場合には、切替時に、専用領域D10のキャッシュロックを解除して、専用領域D20をキャッシュロックする。 Alternatively, the non-real-time OS may be switched to the real-time OS in advance after the non-real-time processing is completed from time t1. In such a case, at the time of switching, the cache lock of the dedicated area D10 is released and the dedicated area D20 is cache-locked.

このように、キャッシュロック制御部5は、事前に分割した専用領域D10,D20を単位としてキャッシュロックを切り替えることで、キャッシュメモリ4に記憶されたデータを確実、かつ、低負荷でキャッシュロックすることができる。 In this way, the cache lock control unit 5 switches the cache lock in units of the dedicated areas D10 and D20 divided in advance, so that the data stored in the cache memory 4 can be cache-locked reliably and with a low load. Can be done.

なお、図3では、専用領域D10および専用領域D20を略同じ数の領域D11〜D14,D21〜D24としたが、各専用領域D10,D20の領域の数は、異なってもよく、さらに、任意の領域の数を設定可能である。 In FIG. 3, the dedicated areas D10 and the dedicated areas D20 are set to substantially the same number of areas D11 to D14 and D21 to D24, but the number of areas of the dedicated areas D10 and D20 may be different, and further, it is arbitrary. The number of areas can be set.

なお、キャッシュロック制御部5は、次回周期の処理負荷を予測してキャッシュロックする領域を動的に変更してもよいが、かかる点については、図5で後述する。 The cache lock control unit 5 may predict the processing load of the next cycle and dynamically change the cache lock area, which will be described later in FIG.

次に、図4を用いて、実施形態に係る制御装置1が実行する処理の処理手順について説明する。図4は、実施形態に係る制御装置1が実行する処理の処理手順を示すフローチャートである。 Next, the processing procedure of the processing executed by the control device 1 according to the embodiment will be described with reference to FIG. FIG. 4 is a flowchart showing a processing procedure of processing executed by the control device 1 according to the embodiment.

図4に示すように、まず、制御装置1の処理部2は、OSの切替タイミングが到来したか否かを判定し(S101)、切替タイミングが到来していない場合(S101:No)、到来するまでステップS101を実行する。 As shown in FIG. 4, first, the processing unit 2 of the control device 1 determines whether or not the switching timing of the OS has arrived (S101), and if the switching timing has not arrived (S101: No), it has arrived. Step S101 is executed until

処理部2は、OSの切替タイミングが到来した場合(S101:Yes)、切替前のOSに対応するレジスタ退避処理を行う(S102)。 When the OS switching timing arrives (S101: Yes), the processing unit 2 performs register save processing corresponding to the OS before switching (S102).

つづいて、キャッシュロック制御部5は、切替前のOSがリアルタイムOSであるか否かを判定する(S103)。キャッシュロック制御部5は、切替前のOSがリアルタイムOSである場合(S103:Yes)、リアルタイム用の専用領域D10をキャッシュロックする(S104)。 Subsequently, the cache lock control unit 5 determines whether or not the OS before switching is a real-time OS (S103). When the OS before switching is a real-time OS (S103: Yes), the cache lock control unit 5 cache-locks the dedicated area D10 for real time (S104).

つづいて、キャッシュロック制御部5は、切替後のOSに対応するレジスタ復元処理を行い(S105)、処理を終了する。つまり、キャッシュロック制御部5は、切替前のOSに対応するレジスタ退避処理および切替後のOSに対応するレジスタ復元処理の間に、キャッシュメモリ4の領域をキャッシュロックする。これにより、確実にキャッシュロックの切替処理を行うことができる。 Subsequently, the cache lock control unit 5 performs a register restoration process corresponding to the OS after switching (S105), and ends the process. That is, the cache lock control unit 5 cache locks the area of the cache memory 4 between the register save process corresponding to the OS before switching and the register restore process corresponding to the OS after switching. As a result, the cache lock switching process can be reliably performed.

一方、ステップS104において、キャッシュロック制御部5は、切替前のOSが非リアルタイムOSである場合(S103:No)、非リアルタイム用の専用領域D20をキャッシュロックする(S106)。 On the other hand, in step S104, when the OS before switching is a non-real-time OS (S103: No), the cache lock control unit 5 cache-locks the non-real-time dedicated area D20 (S106).

上述してきたように、実施形態に係る制御装置1は、処理部2と、複数のOS共通のキャッシュメモリ4と、キャッシュロック制御部5とを備える。処理部2は、複数のOS(Operating System)を切り替えながら各OSに対応する処理を行う。複数のOS共通のキャッシュメモリ4は、処理部2が処理に用いるデータを記憶する主メモリ3から処理部2が読み出したデータを格納する。キャッシュロック制御部5は、キャッシュメモリ4の領域に対する書き替えを禁止するキャッシュロックの制御を行う。また、キャッシュロック制御部5は、処理部2が処理するOSの切り替えが行われる場合に、キャッシュメモリの領域のうち、切替前のOSが処理されている際に主メモリ3から読み出したデータを含む領域がキャッシュロックされるように、キャッシュロックする領域の変更を行う。これにより、OSの切り替えによる処理遅延を抑えることができる。 As described above, the control device 1 according to the embodiment includes a processing unit 2, a cache memory 4 common to a plurality of OSs, and a cache lock control unit 5. The processing unit 2 performs processing corresponding to each OS while switching between a plurality of OSs (Operating Systems). The cache memory 4 common to the plurality of OSs stores the data read by the processing unit 2 from the main memory 3 that stores the data used by the processing unit 2 for processing. The cache lock control unit 5 controls the cache lock that prohibits rewriting of the area of the cache memory 4. Further, when the OS to be processed by the processing unit 2 is switched, the cache lock control unit 5 reads the data read from the main memory 3 in the area of the cache memory when the OS before the switching is being processed. Change the cache-locked area so that the included area is cache-locked. As a result, it is possible to suppress the processing delay due to the switching of the OS.

次に、図5を用いて、キャッシュロックする領域を動的に変更する場合について説明する。図5は、変形例に係る制御方法を示す図である。 Next, a case where the cache lock area is dynamically changed will be described with reference to FIG. FIG. 5 is a diagram showing a control method according to a modified example.

キャッシュロック制御部5は、OSの切替時において、切替後のOSに対応する処理の周期に基づいて切替後のOSにおける処理負荷を予測し、予測した処理負荷に応じた範囲の領域をキャッシュロックする。なお、処理の周期は、制御内容等から把握可能である。 At the time of OS switching, the cache lock control unit 5 predicts the processing load in the switched OS based on the processing cycle corresponding to the switched OS, and cache locks the area in the range corresponding to the predicted processing load. To do. The processing cycle can be grasped from the control contents and the like.

例えば、時刻t11において、処理部2は、非リアルタイムOSからリアルタイムOSに切り替える時に、時刻t11から時刻t12までのリアルタイム処理の処理負荷を予測する。 For example, at time t11, the processing unit 2 predicts the processing load of real-time processing from time t11 to time t12 when switching from the non-real-time OS to the real-time OS.

そして、キャッシュロック制御部5は、予測したリアルタイム処理の処理負荷が大きいほど、キャッシュロックの領域(D37,D38)の範囲を少なくする。これにより、リアルタイム処理のデータを格納する領域(D31〜D36)を大きくできるため、処理遅延が生じることを抑えることができる。 Then, the cache lock control unit 5 reduces the range of the cache lock area (D37, D38) as the processing load of the predicted real-time processing increases. As a result, the areas (D31 to D36) for storing the real-time processing data can be increased, so that it is possible to suppress the occurrence of processing delay.

また、時刻t12において、キャッシュロック制御部5は、リアルタイムOSから非リアルタイムOSに切り替える時に、時刻t12からの非リアルタイム処理の処理負荷を予測する。 Further, at time t12, the cache lock control unit 5 predicts the processing load of non-real-time processing from time t12 when switching from the real-time OS to the non-real-time OS.

そして、図5に示すように、キャッシュロック制御部5は、予測した非リアルタイム処理の処理負荷が比較的小さいため、リアルタイム処理のキャッシュロックの領域(D31〜D36)の範囲を大きくする。例えば、キャッシュロック制御部5は、非リアルタイム処理が比較的小さい場合、リアルタイム処理のデータがすべて残るように、キャッシュロックする。これにより、リアルタイム処理のデータを多く残すができるため、次回動作時におけるリアルタイム処理を高速化できる。 Then, as shown in FIG. 5, since the predicted processing load of the non-real-time processing is relatively small, the cache lock control unit 5 increases the range of the cache lock area (D31 to D36) of the real-time processing. For example, when the non-real-time processing is relatively small, the cache lock control unit 5 cache-locks so that all the data of the real-time processing remains. As a result, a large amount of real-time processing data can be left, so that real-time processing can be speeded up at the next operation.

このように、処理負荷に応じてキャッシュロックする範囲を動的に変更することで、制御装置1における処理全体の性能を向上させることができる。 In this way, by dynamically changing the cache lock range according to the processing load, the performance of the entire processing in the control device 1 can be improved.

さらなる効果や変形例は、当業者によって容易に導き出すことができる。このため、本発明のより広範な態様は、以上のように表しかつ記述した特定の詳細および代表的な実施形態に限定されるものではない。したがって、添付の特許請求の範囲およびその均等物によって定義される総括的な発明の概念の精神または範囲から逸脱することなく、様々な変更が可能である。 Further effects and variations can be easily derived by those skilled in the art. For this reason, the broader aspects of the invention are not limited to the particular details and representative embodiments expressed and described as described above. Therefore, various modifications can be made without departing from the spirit or scope of the general concept of the invention as defined by the appended claims and their equivalents.

1 制御装置
2 処理部
3 主メモリ
4 キャッシュメモリ
5 キャッシュロック制御部
1 Control device 2 Processing unit 3 Main memory 4 Cache memory 5 Cache lock control unit

Claims (7)

複数のOS(Operating System)を切り替えながら各OSに対応する処理を行う処理部と、
前記処理部が処理に用いるデータを記憶するメモリから前記処理部が読み出したデータを格納する、複数のOS共通のキャッシュメモリと、
前記キャッシュメモリの領域に対する書き替えを禁止するキャッシュロックの制御を行うキャッシュロック制御部と、
を備え、
前記キャッシュロック制御部は、
前記処理部が処理するOSの切り替えが行われる場合に、前記キャッシュメモリの領域のうち、切替前のOSが処理されている際に前記メモリから読み出したデータを含む領域がキャッシュロックされるように、キャッシュロックする領域の変更を行うこと
を特徴とする制御装置。
A processing unit that performs processing corresponding to each OS while switching between multiple OSs (Operating System),
A cache memory common to a plurality of OSs that stores data read by the processing unit from a memory that stores data used by the processing unit for processing, and
A cache lock control unit that controls a cache lock that prohibits rewriting of the cache memory area,
With
The cache lock control unit
When the OS processed by the processing unit is switched, the area of the cache memory including the data read from the memory when the OS before switching is being processed is cache-locked. , A control device characterized by changing the cache-locked area.
前記キャッシュメモリは、
前記複数のOSそれぞれに割り当てられる複数の専用領域に予め分割され、
前記キャッシュロック制御部は、
切替前のOSが処理される際に前記メモリから読み出したデータを含む前記専用領域をキャッシュロックすること
を特徴とする請求項1に記載の制御装置。
The cache memory is
It is divided in advance into a plurality of dedicated areas allocated to each of the plurality of OSs.
The cache lock control unit
The control device according to claim 1, wherein when the OS before switching is processed, the dedicated area including the data read from the memory is cache-locked.
前記キャッシュロック制御部は、
前記OSの切替時において、切替後の前記OSに対応する前記処理の周期に基づいて前記切替後の前記OSにおける処理負荷を予測し、予測した前記処理負荷に応じた範囲の領域をキャッシュロックすること
を特徴とする請求項1に記載の制御装置。
The cache lock control unit
At the time of switching the OS, the processing load in the OS after switching is predicted based on the processing cycle corresponding to the OS after switching, and the area in the range corresponding to the predicted processing load is cache-locked. The control device according to claim 1, wherein the control device is characterized by the above.
前記複数のOSには、
リアルタイム処理を行うリアルタイムOSが含まれ、
前記キャッシュロック制御部は、
前記リアルタイムOSから他の前記OSへ切り替える場合に、前記リアルタイムOSが処理される際に前記メモリから読み出したデータを含む領域をキャッシュロックすること
を特徴とする請求項1〜3のいずれか1つに記載の制御装置。
For the plurality of OSs
Includes a real-time OS that performs real-time processing,
The cache lock control unit
One of claims 1 to 3, wherein when switching from the real-time OS to another OS, an area including data read from the memory is cache-locked when the real-time OS is processed. The control device described in.
前記複数のOSは、
リアルタイム処理を行うリアルタイムOSおよび非リアルタイム処理を行う非リアルタイムOSであって、
前記キャッシュロック制御部は、
一方のOSから他方のOSへ切り替える場合に、一方のOSが処理される際に前記メモリから読み出した前記データを含む領域をキャッシュロックするとともに、他方のOSが処理される際に前記メモリから読み出した前記データを含む領域のキャッシュロックを解除すること
を特徴とする請求項1〜4のいずれか1つに記載の制御装置。
The plurality of OSs
A real-time OS that performs real-time processing and a non-real-time OS that performs non-real-time processing.
The cache lock control unit
When switching from one OS to the other OS, the area containing the data read from the memory when one OS is processed is cache-locked, and is read from the memory when the other OS is processed. The control device according to any one of claims 1 to 4, wherein the cache lock of the area containing the data is released.
前記キャッシュロック制御部は、
切替前の前記OSに対応するレジスタ退避処理および切替後の前記OSに対応するレジスタ復元処理の間に、前記領域をキャッシュロックすること
を特徴とする請求項1〜5のいずれか1つに記載の制御装置。
The cache lock control unit
The invention according to any one of claims 1 to 5, wherein the area is cache-locked between the register save process corresponding to the OS before switching and the register restore process corresponding to the OS after switching. Control device.
複数のOS(Operating System)の処理に用いるデータを記憶するメモリから読み出されたデータが格納される、複数のOS共通のキャッシュメモリを備える制御装置の制御方法であって、
前記複数のOSを切り替えながら各OSに対応する前記処理を行う処理工程と、
前記キャッシュメモリの領域に対する書き換えを禁止するキャッシュロックの制御を行うキャッシュロック制御工程と、
を含み、
前記キャッシュロック制御工程は、
前記処理工程で処理されるOSの切り替えが行われる場合に、前記キャッシュメモリの領域のうち、切替前のOSが処理されている際に前記メモリから読み出したデータを含む領域がキャッシュロックされるように、キャッシュロックする領域の変更を行うこと
を特徴とする制御方法。
A control method for a control device having a cache memory common to a plurality of OSs, in which data read from a memory for storing data used for processing of a plurality of OSs (Operating System) is stored.
A processing step of performing the processing corresponding to each OS while switching the plurality of OSs,
A cache lock control step that controls a cache lock that prohibits rewriting of the cache memory area, and
Including
The cache lock control step is
When the OS processed in the processing step is switched, the area of the cache memory including the data read from the memory when the OS before switching is processed is cache-locked. In addition, a control method characterized in that the area to be cache-locked is changed.
JP2019048767A 2019-03-15 2019-03-15 Control device and control method Pending JP2020149597A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019048767A JP2020149597A (en) 2019-03-15 2019-03-15 Control device and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019048767A JP2020149597A (en) 2019-03-15 2019-03-15 Control device and control method

Publications (1)

Publication Number Publication Date
JP2020149597A true JP2020149597A (en) 2020-09-17

Family

ID=72429708

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019048767A Pending JP2020149597A (en) 2019-03-15 2019-03-15 Control device and control method

Country Status (1)

Country Link
JP (1) JP2020149597A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08147218A (en) * 1994-11-24 1996-06-07 Fujitsu Ltd Cache controller
WO2009075070A1 (en) * 2007-12-10 2009-06-18 Panasonic Corporation Common cache control device, common cache control method, and integrated circuit
WO2012117465A1 (en) * 2011-03-02 2012-09-07 パナソニック株式会社 Virtual computer system, virtual computer control method, virtual computer control program, and semiconductor integrated circuit
JP2014130644A (en) * 2014-04-03 2014-07-10 Fujitsu Ltd Multiprocessor system, control method and control program
JP2017511926A (en) * 2014-03-21 2017-04-27 インテル コーポレイション Virtualization computing apparatus and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08147218A (en) * 1994-11-24 1996-06-07 Fujitsu Ltd Cache controller
WO2009075070A1 (en) * 2007-12-10 2009-06-18 Panasonic Corporation Common cache control device, common cache control method, and integrated circuit
WO2012117465A1 (en) * 2011-03-02 2012-09-07 パナソニック株式会社 Virtual computer system, virtual computer control method, virtual computer control program, and semiconductor integrated circuit
JP2017511926A (en) * 2014-03-21 2017-04-27 インテル コーポレイション Virtualization computing apparatus and method
JP2014130644A (en) * 2014-04-03 2014-07-10 Fujitsu Ltd Multiprocessor system, control method and control program

Similar Documents

Publication Publication Date Title
US6948034B2 (en) Method for use of stack
US9292447B2 (en) Data cache prefetch controller
WO2006117950A1 (en) Power controller in information processor
US20130036426A1 (en) Information processing device and task switching method
US6700582B2 (en) Method and system for buffer management
US20050028159A1 (en) Memory managing system and task controller in multitask system
JP2000276404A (en) Method and device for virtual storage and recording medium
WO2015081889A1 (en) Caching system and method
US20070294599A1 (en) Method for patching a read-only memory and a data processing system comprising a means of patching the read-only memory based on patch contexts
JP3970609B2 (en) Processor system
US20030177328A1 (en) Method and apparatus for controlling stack area in memory space
EP1599803B1 (en) Reducing cache trashing of certain pieces
JP2001075866A (en) Method for operating storage device, and storage device
JP2020149597A (en) Control device and control method
US7934073B2 (en) Method for performing jump and translation state change at the same time
JP4056768B2 (en) Microcomputer, cache memory control method, and clock control method
JP2001290704A (en) Device and method for controlling multiprocess
US10120819B2 (en) System and method for cache memory line fill using interrupt indication
JP7141977B2 (en) Control device and control method
CN116049033B (en) Cache read-write method, system, medium and device for Cache
JPH06266619A (en) Page saving/restoring device
JP5577518B2 (en) Memory management method, computer and memory management program
WO2009144383A1 (en) Memory management method and apparatus
JP3772003B2 (en) Memory management system and data management method
JP2002328841A (en) System and method for demand paging swap out of kernel space

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210930

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220728

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220802

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20230214