JP2009110383A - Information processor, arithmetic processor, and branch prediction method - Google Patents

Information processor, arithmetic processor, and branch prediction method Download PDF

Info

Publication number
JP2009110383A
JP2009110383A JP2007283508A JP2007283508A JP2009110383A JP 2009110383 A JP2009110383 A JP 2009110383A JP 2007283508 A JP2007283508 A JP 2007283508A JP 2007283508 A JP2007283508 A JP 2007283508A JP 2009110383 A JP2009110383 A JP 2009110383A
Authority
JP
Japan
Prior art keywords
address
branch
instruction
branch destination
storage unit
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.)
Withdrawn
Application number
JP2007283508A
Other languages
Japanese (ja)
Inventor
Katsuki Uetoko
克樹 上床
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2007283508A priority Critical patent/JP2009110383A/en
Publication of JP2009110383A publication Critical patent/JP2009110383A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Advance Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an information processor, an arithmetic processor, and a branch prediction method capable of dynamically limiting reading of a part of a branch target address in performing branch prediction by using a branch target buffer. <P>SOLUTION: A recorder 10 as an information processor has a CPU 11 as an arithmetic processor, a DRAM 12, an NOR flash memory 13 as a first device, an HDD 14 as a second device, a display output part 15, an operation input part 16, and a tuner 17. Either the NOR flash memory 13 or the HDD 14 is selectively connected to a chip select signal line (chip select hereafter) of the CPU 11 via a switch 50. The CPU 11 has a branch prediction part 21 and a command acquisition part 22. Also, the CPU 11 functions as a function performance part including at least a switch part and a buffer change part by either an OS or a video recording program. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、分岐先バッファを用いて分岐命令に応じた分岐予測を行う情報処理装置、演算処理装置および分岐予測方法に関する。   The present invention relates to an information processing apparatus, an arithmetic processing apparatus, and a branch prediction method that perform branch prediction according to a branch instruction using a branch destination buffer.

CPUやマイクロプロセッサなどのプロセッサ(演算処理装置)には、パイプライン方式を用いたものがある。パイプライン方式を用いるプロセッサにおいては、分岐命令によるパイプラインの乱れが性能向上を阻む要因のひとつとなる。   Some processors (arithmetic processing units) such as a CPU and a microprocessor use a pipeline system. In a processor using a pipeline system, pipeline disturbance due to a branch instruction is one of the factors that hinders performance improvement.

この分岐命令によるパイプラインの乱れを抑制する技術のひとつに、動的な分岐予測を利用する技術がある。動的な分岐予測機能を有するプロセッサは、分岐命令を実行する際に、過去の分岐方向の履歴にもとづいて分岐を予測する。過去の分岐方向の履歴(分岐命令のアドレス(分岐元アドレス)と分岐先アドレスの履歴)は、分岐先バッファに記憶される。   One technique for suppressing pipeline disruption due to this branch instruction is to use dynamic branch prediction. A processor having a dynamic branch prediction function predicts a branch based on a history of past branch directions when executing a branch instruction. The past branch direction history (branch instruction address (branch source address) and branch destination address history) is stored in the branch destination buffer.

この種の分岐先バッファを用いて分岐命令に応じた分岐予測を行う技術によれば、プロセッサが分岐先バッファにもとづいてあらかじめ分岐する方向を予測し、この予測にもとづいたアドレスの命令をパイプラインに詰めていくことで、パイプラインの乱れが発生する確率を低くすることができる(たとえば特許文献1参照)。
特開昭62−224829号公報
According to the technique of performing branch prediction according to a branch instruction using this type of branch destination buffer, the processor predicts the branch direction in advance based on the branch destination buffer, and the instruction at the address based on this prediction is pipelined. As a result, the probability of occurrence of pipeline disturbance can be reduced (see, for example, Patent Document 1).
JP-A-62-224829

ところで、特に、HDD記録装置、携帯電話機、デジタルカメラなどの組み込みシステムでは、アドレス空間全体の広さに対してオペレーティングシステム(以下、OSという)が必要とするアドレス空間の割合が高く、ハードディスクドライブなどのデバイスに割り当てられるアドレス空間に制限がある場合がある。この場合、複数のデバイスで同一のアドレス空間を共有し、このアドレス空間に割り当てられるデバイスを動的に変更すれば、アドレス空間を効率的に利用することができる。   By the way, in particular, in an embedded system such as an HDD recording device, a mobile phone, or a digital camera, the ratio of the address space required by the operating system (hereinafter referred to as OS) is high with respect to the entire address space. There may be restrictions on the address space allocated to certain devices. In this case, if the same address space is shared by a plurality of devices and the devices allocated to the address space are dynamically changed, the address space can be used efficiently.

しかし、特許文献1に開示された技術をはじめとする従来の技術では、同一のアドレス空間が複数のデバイスに動的に切り替えられて割り当てられる場合について全く考慮されていない。   However, in the conventional technique including the technique disclosed in Patent Document 1, no consideration is given to the case where the same address space is dynamically switched and allocated to a plurality of devices.

デバイスには、プロセッサからの読み込み(リード)により状態変化が起きてしまうものが存在する。たとえば、この種のデバイスに、NOR型フラッシュメモリなどの実行可能なデバイスに割り当てられていたアドレス空間が切り替えられて割り当てられた場合を考える。分岐先バッファに記憶された分岐先アドレスにこのアドレス空間に所属するものがある場合、このデバイスを利用するプログラムが実行されると、分岐予測により、このデバイスに対してプログラムが意図しない読み込みが行われてしまう場合がある。この場合、このデバイスは、このデバイスを利用するプログラムが意図しない状態変化を起こしてしまい、誤動作などの不都合が生じてしまう。   Some devices have a state change caused by reading (reading) from the processor. For example, consider a case where the address space assigned to an executable device such as a NOR flash memory is assigned to this type of device by switching. If there is a branch destination address stored in the branch destination buffer that belongs to this address space, when a program that uses this device is executed, an unintended read is performed on this device by branch prediction. It may be broken. In this case, this device causes a state change unintended by a program that uses the device, resulting in inconvenience such as malfunction.

本発明は、上述した事情を考慮してなされたもので、分岐先バッファを用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限することができる情報処理装置、演算処理装置および分岐予測方法を提供することを目的とする。   The present invention has been made in consideration of the above-described circumstances, and when performing branch prediction using a branch destination buffer, an information processing apparatus capable of dynamically restricting reading of a part of a branch destination address, An object is to provide an arithmetic processing unit and a branch prediction method.

本発明に係る情報処理装置は、上述した課題を解決するために、あらかじめ分岐命令を実行することにより得られた前記分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を記憶する分岐先バッファと、前記分岐先バッファを有し、前記分岐先バッファに記憶された前記分岐予測情報を用いて分岐予測を行う分岐予測部と、前記分岐予測により予測された前記分岐先アドレスの命令を読み出す際に参照される所要のアドレスを記憶する参照アドレス記憶部と、前記参照アドレス記憶部を必要に応じて参照して命令を読み出す命令取得部と、第1のデバイスに割り当てられたアドレス空間を、第2のデバイスに割り当てられるように切替える切替部と、前記アドレス空間に属するアドレスの情報を利用して前記参照アドレス記憶部に記憶された前記所要のアドレスを変更する参照アドレス変更部と、を備えたことを特徴とするものである。   In order to solve the above-described problem, an information processing apparatus according to the present invention stores branch prediction information in which an address of a branch instruction obtained by executing a branch instruction in advance and a branch destination address are associated with each other. A branch prediction unit having a buffer, the branch destination buffer, and performing branch prediction using the branch prediction information stored in the branch destination buffer; and reading an instruction of the branch destination address predicted by the branch prediction A reference address storage unit for storing a required address to be referred to at the time, an instruction acquisition unit for reading an instruction by referring to the reference address storage unit as necessary, and an address space allocated to the first device, A switching unit for switching so as to be assigned to the second device, and the reference address storage using information on an address belonging to the address space It is characterized in that it comprises a reference address changing unit for changing the stored the required address, to.

一方、本発明に係る演算処理装置は、上述した課題を解決するために、あらかじめ分岐命令を実行することにより得られた前記分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を記憶する分岐先バッファと、前記分岐先バッファを有し、前記分岐先バッファに記憶された前記分岐予測情報を用いて分岐予測を行う分岐予測部と、前記分岐予測により予測された前記分岐先アドレスの命令を読み出す際に参照される所要のアドレスを記憶する参照アドレス記憶部と、前記参照アドレス記憶部を必要に応じて参照して命令を読み出す命令取得部と、第1のデバイスに割り当てられたアドレス空間を、第2のデバイスに割り当てられるように切替える切替部と、外部からの指示により、前記アドレス空間に属するアドレスの情報を利用して前記参照アドレス記憶部に記憶された前記所要のアドレスを変更する参照アドレス変更部と、を備えたことを特徴とするものである。   On the other hand, the arithmetic processing unit according to the present invention stores branch prediction information in which the address of the branch instruction obtained by executing the branch instruction in advance and the branch destination address are associated in order to solve the above-described problem. A branch target buffer, a branch prediction unit that has the branch target buffer and performs branch prediction using the branch prediction information stored in the branch target buffer, and an instruction of the branch destination address predicted by the branch prediction A reference address storage unit that stores a required address to be referred to when reading data, a command acquisition unit that reads the command by referring to the reference address storage unit as necessary, and an address space allocated to the first device And a switching unit for switching to be assigned to the second device, and information on addresses belonging to the address space according to an instruction from the outside. A reference address changing unit for changing the predetermined address stored in the reference address storage unit and use, is characterized in that it comprises a.

一方、本発明に係る分岐予測方法は、上述した課題を解決するために、あらかじめ分岐命令を実行することにより得られた前記分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を分岐先バッファに記憶するステップと、前記分岐予測により予測された前記分岐先アドレスの命令を読み出す際に参照される所要のアドレスを参照アドレス記憶部に記憶するステップと、第1のデバイスに割り当てられたアドレス空間を、第2のデバイスに割り当てられるように切替えるステップと、前記アドレス空間に属するアドレスの情報を利用して前記参照アドレス記憶部に記憶された前記所要のアドレスを変更するステップと、前記参照アドレス記憶部を必要に応じて参照して命令を読み出すステップと、を有することを特徴とする方法である。   On the other hand, in order to solve the above-described problem, the branch prediction method according to the present invention provides branch prediction information in which the branch instruction address and the branch destination address obtained by executing the branch instruction in advance are associated with each other. A step of storing in a buffer, a step of storing in a reference address storage unit a required address to be referred to when an instruction at the branch destination address predicted by the branch prediction is read, and an address assigned to the first device A step of switching a space so as to be assigned to a second device, a step of changing the required address stored in the reference address storage unit using information on an address belonging to the address space, and the reference address And a step of referring to the storage unit as necessary to read out the instruction. A.

本発明に係る情報処理装置、演算処理装置および分岐予測方法によれば、分岐先バッファを用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限することができる。   According to the information processing device, the arithmetic processing device, and the branch prediction method according to the present invention, when branch prediction is performed using a branch destination buffer, it is possible to dynamically limit reading of a part of the branch destination address.

本発明に係る情報処理装置、演算処理装置および分岐予測方法の実施の形態について、添付図面を参照して説明する。   Embodiments of an information processing apparatus, an arithmetic processing apparatus, and a branch prediction method according to the present invention will be described with reference to the accompanying drawings.

演算処理装置としては、分岐先バッファを用いて分岐命令に応じた分岐予測を行う分岐予測機能を有するCPUやマイクロプロセッサなどのプロセッサを用いることができる。以下の説明では、演算処理装置として、CPUを用いる場合の一例について示す。   As the arithmetic processing unit, a processor such as a CPU or a microprocessor having a branch prediction function for performing branch prediction according to a branch instruction using a branch destination buffer can be used. In the following description, an example in which a CPU is used as the arithmetic processing device will be described.

また、情報処理装置としては、分岐予測機能を有する演算処理装置を備えた組み込みシステムなどを用いることができる。以下の説明では、情報処理装置として、分岐予測機能を有するCPUを備えたHDD記録装置(以下、記録装置という)を用いる場合の一例について示す。   As the information processing apparatus, an embedded system including an arithmetic processing apparatus having a branch prediction function can be used. In the following description, an example in which an HDD recording apparatus (hereinafter referred to as a recording apparatus) including a CPU having a branch prediction function is used as the information processing apparatus will be described.

図1は、本発明に係る情報処理装置(演算処理装置を含む)の第1実施形態を示す概略的な全体構成図である。   FIG. 1 is a schematic overall configuration diagram showing a first embodiment of an information processing apparatus (including an arithmetic processing apparatus) according to the present invention.

情報処理装置としての記録装置10は、演算処理装置としてのCPU11、DRAM12(Dynamic Random access memory)、第1のデバイスとしてのNOR型フラッシュメモリ(以下、NOR Flash13という)、第2のデバイスとしてのHDD14(Hard disk drive)、表示出力部15、操作入力部16およびチューナ17を有する。   The recording apparatus 10 as an information processing apparatus includes a CPU 11 as an arithmetic processing unit, a DRAM 12 (Dynamic Random access memory), a NOR flash memory (hereinafter referred to as NOR Flash 13) as a first device, and an HDD 14 as a second device. (Hard disk drive), display output unit 15, operation input unit 16, and tuner 17.

CPU11は、図1に示すように、分岐予測部21および命令取得部22を有する。   As shown in FIG. 1, the CPU 11 includes a branch prediction unit 21 and an instruction acquisition unit 22.

分岐予測部21は、分岐先バッファとしてのBTB23(Branch Target Buffer)を有し、BTB23を参照して分岐命令に応じた分岐予測を行う。より詳細には、分岐予測部21は、命令取得部22から通知された命令のアドレスと、BTB23に記憶されている分岐命令のアドレス(分岐元アドレス)が一致するかどうかを判定し、一致した場合には、一致した分岐命令のアドレスに関連付けられた分岐先アドレスの情報をBTB23から読み出して、命令取得部22に与える。   The branch prediction unit 21 has a BTB 23 (Branch Target Buffer) as a branch target buffer, and performs branch prediction according to the branch instruction with reference to the BTB 23. More specifically, the branch prediction unit 21 determines whether or not the address of the instruction notified from the instruction acquisition unit 22 matches the address of the branch instruction (branch source address) stored in the BTB 23. In this case, information on the branch destination address associated with the address of the matched branch instruction is read from the BTB 23 and given to the instruction acquisition unit 22.

分岐先バッファとしてのBTB23は、CPU11があらかじめ分岐命令を実行することにより得た、分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を分岐命令ごとに記憶する。   The BTB 23 serving as a branch destination buffer stores, for each branch instruction, branch prediction information obtained by associating the branch instruction address with the branch destination address obtained by the CPU 11 executing the branch instruction in advance.

命令取得部22は、各種プログラムの命令を順次読み出してCPU11の命令デコードに与える。また、命令取得部22はこの読み出しと同時に分岐予測部21に命令のアドレスを通知する。分岐予測部21から分岐先アドレスが与えられた場合は、命令取得部22は、この分岐先アドレスから命令を取得する。   The instruction acquisition unit 22 sequentially reads instructions of various programs and gives them to the instruction decode of the CPU 11. The instruction acquisition unit 22 notifies the instruction address to the branch prediction unit 21 simultaneously with the reading. When a branch destination address is given from the branch prediction unit 21, the instruction acquisition unit 22 acquires an instruction from this branch destination address.

分岐予測部21、命令取得部22およびBTB23は、回路などのハードウエアロジックにより構成される。   The branch prediction unit 21, the instruction acquisition unit 22, and the BTB 23 are configured by hardware logic such as a circuit.

また、CPU11は、NOR Flash13内に記憶されたプログラムに従って、記録装置10を制御する。CPU11は、NOR Flash13に割り当てられたアドレスに直接アクセスすることにより、NOR Flash13に記憶されたBIOS(Basic Input Output System)に記述された命令を直接実行し(execute in place)、記録装置10を起動する。   Further, the CPU 11 controls the recording device 10 according to a program stored in the NOR Flash 13. The CPU 11 directly executes an instruction described in a BIOS (Basic Input Output System) stored in the NOR Flash 13 by directly accessing an address assigned to the NOR Flash 13 and starts the recording apparatus 10. .

さらに、CPU11は、NOR Flash13に記憶されたOS(Operating system)、録画プログラムおよびプログラムの実行のために必要なデータを、DRAM12へロードし、OSおよび録画プログラムに従って記録装置10を制御する。   Further, the CPU 11 loads an operating system (OS), a recording program, and data necessary for executing the program stored in the NOR Flash 13 into the DRAM 12, and controls the recording device 10 according to the OS and the recording program.

DRAM12は、NOR Flash13に記憶されたOSおよび録画プログラムをロードされてCPU11の作業用記憶領域として用いられ、演算すべきデータや命令、演算結果などが一時的に保持される。   The DRAM 12 is loaded with the OS and the recording program stored in the NOR Flash 13 and used as a working storage area of the CPU 11, and temporarily stores data to be calculated, instructions, calculation results, and the like.

第1のデバイスとしてのNOR Flash13は、図1に示すように、BIOS、OSおよび録画プログラムなどのCPU11が実行するプログラムおよびこれらのプログラムを実行するために必要な各種データを記憶する。   As shown in FIG. 1, the NOR Flash 13 as the first device stores programs executed by the CPU 11 such as BIOS, OS, and recording program, and various data necessary for executing these programs.

第2のデバイスとしてのHDD14は、CPU11が録画プログラムを実行することにより、チューナ17を介して入力される放送された番組の映像データなどを、この録画データとして格納する。   The HDD 14 as the second device stores the video data of the broadcasted program input via the tuner 17 as the recording data when the CPU 11 executes the recording program.

NOR Flash13およびHDD14の一方は、スイッチ50を介して、CPU11のチップセレクト信号線(以下、チップセレクトという)に選択的に接続される。記録装置10の起動時には、チップセレクトにはNOR Flash13が接続されるものとする。NOR Flash13に記憶されたBIOSを起動時に利用するためである。このスイッチ50は、CPU11により制御されて、必要に応じて、チップセレクトの接続先をNOR Flash13からHDD14に切り替える。   One of the NOR Flash 13 and the HDD 14 is selectively connected to a chip select signal line (hereinafter referred to as a chip select) of the CPU 11 via the switch 50. It is assumed that the NOR Flash 13 is connected to the chip select when the recording apparatus 10 is activated. This is because the BIOS stored in the NOR Flash 13 is used at startup. The switch 50 is controlled by the CPU 11 to switch the chip select connection destination from the NOR Flash 13 to the HDD 14 as necessary.

図2は、チップセレクトの接続先を切り替えることにより、同一のアドレス空間に対する割り当てデバイスがNOR Flash13からHDD14に変更される様子を示す簡単な説明図である。   FIG. 2 is a simple explanatory diagram showing a state where the allocation device for the same address space is changed from the NOR Flash 13 to the HDD 14 by switching the connection destination of the chip select.

このチップセレクトは、1つのアドレス空間に対応する。このため、図2に示すように、記録装置10の起動時にNOR Flash13に割り当てられていたアドレス空間は、チップセレクトの接続がNOR Flash13からHDD14に切替わると、そのまま、HDD14に割り当てられたアドレス空間となる。   This chip select corresponds to one address space. For this reason, as shown in FIG. 2, the address space allocated to the NOR Flash 13 when the recording apparatus 10 is started is the same as the address space allocated to the HDD 14 when the chip select connection is switched from the NOR Flash 13 to the HDD 14. It becomes.

なお、1つのチップセレクトに対してスイッチ50を介して選択的に接続されるデバイスの数は2つに限定されず、3つ以上であってもよい。以下の説明では、1つのチップセレクトに対してスイッチ50を介してNOR Flash13およびHDD14が選択的に接続される場合の一例について示す。   Note that the number of devices selectively connected to one chip select via the switch 50 is not limited to two, and may be three or more. In the following description, an example in which the NOR Flash 13 and the HDD 14 are selectively connected to one chip select via the switch 50 will be described.

CPU11は、DRAM12およびNOR Flash13に対し、あらかじめ割り当てられたアドレス空間のアドレスを指定してアクセスすることでデータを読み出すことができる。このため、DRAM12およびNOR Flash13は、割り当てられたアドレス空間上で命令を直接実行可能なデバイスである。   The CPU 11 can read data by accessing the DRAM 12 and the NOR Flash 13 by designating an address in an address space assigned in advance. For this reason, the DRAM 12 and the NOR Flash 13 are devices that can directly execute instructions in the assigned address space.

DRAM12およびNOR Flash13は、CPU11による読み出しで状態が変化することはない。一方、HDD14は、割り当てられたアドレス空間上のアドレスに対して、プログラムに従ってCPU11から読み出し命令がなされると、状態が変化しうる(読み出し(リード)に意味がある)デバイスである。   The state of the DRAM 12 and the NOR Flash 13 is not changed by reading by the CPU 11. On the other hand, the HDD 14 is a device that can change its state when a read command is issued from the CPU 11 according to a program to an address in the allocated address space (the read (read) has meaning).

たとえばHDD14からデータを読み出す場合、読み出すデータのサイズ(たとえば512バイト)により、HDD14から読み出しを行うべき回数がきまる(たとえばデータ幅が8ビットなら512回)。HDD14コントローラは読み出しが行われた回数をカウントするため、読み出しが行われるごとにこのカウントしている回数が変化する。   For example, when data is read from the HDD 14, the number of times data should be read from the HDD 14 is determined by the size of the read data (for example, 512 bytes) (for example, 512 times if the data width is 8 bits). Since the HDD 14 controller counts the number of times of reading, the number of times of counting changes every time reading is performed.

操作受付部は、たとえばキーボード、タッチパネル、テンキーなどの一般的な入力装置により構成され、ユーザの操作に対応した操作入力信号をCPU11に出力する。   The operation receiving unit is configured by a general input device such as a keyboard, a touch panel, or a numeric keypad, and outputs an operation input signal corresponding to a user operation to the CPU 11.

表示出力部15は、たとえば液晶ディスプレイやCRTディスプレイなどの一般的な表示出力装置により構成され、CPU11の制御に従って各種情報を表示する。   The display output unit 15 is configured by a general display output device such as a liquid crystal display or a CRT display, for example, and displays various information according to the control of the CPU 11.

チューナ17は、テレビジョン放送信号を受信し、放送される番組の映像データ、音声データおよびEPG(Electronic Program Guide)データなどを受信する。   The tuner 17 receives a television broadcast signal and receives video data, audio data, EPG (Electronic Program Guide) data, and the like of a broadcast program.

図3は、図1に示すCPU11による機能実現部20の構成例を示す概略的なブロック図である。なお、この機能実現部20は、CPU11を用いることなく回路などのハードウエアロジックによって構成してもよい。   FIG. 3 is a schematic block diagram illustrating a configuration example of the function realizing unit 20 by the CPU 11 illustrated in FIG. Note that the function realization unit 20 may be configured by hardware logic such as a circuit without using the CPU 11.

CPU11は、少なくともOSおよび録画プログラムの一方によって、少なくとも切替部31およびバッファ変更部32を含む機能実現部20として機能する。なお、この機能実現部20は、CPU11を用いることなく回路などのハードウエアロジックによって構成してもよい。   The CPU 11 functions as the function realizing unit 20 including at least the switching unit 31 and the buffer changing unit 32 by at least one of the OS and the recording program. Note that the function realization unit 20 may be configured by hardware logic such as a circuit without using the CPU 11.

次に、CPU11の機能実現部20について説明する。   Next, the function realization part 20 of CPU11 is demonstrated.

切替部31は、スイッチ50を制御し、必要に応じてチップセレクトの接続先をNOR Flash13からHDD14に切り替える機能を有する。この切り替えが行われると、記録装置10の起動時にNOR Flash13に割り当てられていたアドレス空間は、HDD14に割り当てられる。   The switching unit 31 has a function of controlling the switch 50 and switching the chip select connection destination from the NOR Flash 13 to the HDD 14 as necessary. When this switching is performed, the address space allocated to the NOR Flash 13 when the recording apparatus 10 is started is allocated to the HDD 14.

バッファ変更部32は、HDD14に割り当てられたアドレス空間に属するアドレスを含む分岐予測情報を、分岐予測部21のBTB23から削除する機能を有する。   The buffer changing unit 32 has a function of deleting, from the BTB 23 of the branch prediction unit 21, branch prediction information including addresses belonging to the address space allocated to the HDD 14.

次に、本実施形態に係る記録装置10の動作の一例について説明する。   Next, an example of the operation of the recording apparatus 10 according to the present embodiment will be described.

図4は、図1に示す記録装置10のCPU11により、BTB23を用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限する際の手順を示すフローチャートである。図4において、Sに数字を付した符号は、フローチャートの各ステップを示す。   FIG. 4 is a flowchart showing a procedure for dynamically restricting reading of a part of the branch destination address when the CPU 11 of the recording apparatus 10 shown in FIG. 1 performs branch prediction using the BTB 23. In FIG. 4, reference numerals with numbers added to S indicate steps in the flowchart.

この手順は、記録装置10の電源が投入されチップセレクトにNOR Flash13が接続されてスタートとなる。   This procedure starts when the recording apparatus 10 is turned on and the NOR Flash 13 is connected to the chip select.

なお、以下のステップS1からS4の説明においては、BIOSが起動した後、OSの初期起動時にBTB23を変更する場合の例について説明する。   In the following description of steps S1 to S4, an example in which the BTB 23 is changed at the initial startup of the OS after the BIOS has started will be described.

まず、ステップS1において、CPU11は、NOR Flash13に割り当てられたアドレスに直接アクセスすることにより、NOR Flash13に記憶されたBIOSに記述された命令を直接実行し、記録装置10を起動する。   First, in step S <b> 1, the CPU 11 directly executes an instruction described in the BIOS stored in the NOR Flash 13 by directly accessing an address assigned to the NOR Flash 13, and starts the recording apparatus 10.

図5は、BTB23に記憶された分岐予測情報のリストの一例を示す説明図である。   FIG. 5 is an explanatory diagram illustrating an example of a list of branch prediction information stored in the BTB 23.

ステップS1では、NOR Flash13に割り当てられたアドレス空間上でBIOSが直接実行される。NOR Flash13はアクセス速度が遅いものの、BIOSの実行は記録装置10の起動時のみであるため、NOR Flash13のアドレス空間上で直接実行してもよい。   In step S1, the BIOS is directly executed on the address space assigned to the NOR Flash 13. Although the NOR Flash 13 has a low access speed, since the BIOS is executed only when the recording apparatus 10 is activated, it may be directly executed on the address space of the NOR Flash 13.

ステップS1を実行すると、BIOSに記述された命令に含まれる分岐命令を実行した結果として、図5の左図に示すように、BTB23のリストに、NOR Flash13のアドレス空間に属するアドレスを含む分岐予測情報が追加される。   When step S1 is executed, as a result of executing the branch instruction included in the instruction described in the BIOS, as shown in the left diagram of FIG. 5, the branch prediction including the address belonging to the address space of NOR Flash 13 in the list of BTB 23 Information is added.

次に、ステップS2において、CPU11は、OSをDRAM12に展開する。OSは、記録装置10の起動中、頻繁に利用される。NOR Flash13はDRAM12よりアクセス速度が遅いため、NOR Flash13のアドレス空間上で直接実行するよりも、DRAM12にロードしてからこのDRAM12のアドレス空間上で実行するほうが好ましい。   Next, in step S <b> 2, the CPU 11 develops the OS in the DRAM 12. The OS is frequently used while the recording apparatus 10 is activated. Since the NOR Flash 13 has a slower access speed than the DRAM 12, it is preferable that the NOR Flash 13 is loaded on the DRAM 12 and then executed on the DRAM 12 address space rather than directly on the NOR Flash 13 address space.

次に、ステップS3において、CPU11は、OSを実行することにより切替部31として機能し、スイッチ50を制御してチップセレクト信号線の接続先をNOR Flash13からHDD14に切替える。この結果、NOR Flash13に割り当てられたアドレス空間は、HDD14に割り当てられる。   Next, in step S <b> 3, the CPU 11 functions as the switching unit 31 by executing the OS and controls the switch 50 to switch the connection destination of the chip select signal line from the NOR Flash 13 to the HDD 14. As a result, the address space assigned to the NOR Flash 13 is assigned to the HDD 14.

しかし、BTB23には、すでにHDD14に割り当てられたアドレス空間に属するアドレスを含む分岐予測情報が記憶されている。このため、このままでは、たとえば録画プログラムが実行されるなどしてHDD14ドライバによるHDD14に対する読み出しが行われている途中で、読み出しているアドレスがBTB23の分岐元アドレスと一致してしまうと、分岐先アドレスに対する読み出し(先読み)が行われてしまう場合がある。   However, the BTB 23 stores branch prediction information including an address belonging to the address space already assigned to the HDD 14. For this reason, if the read address matches the branch source address of the BTB 23 while the recording program is executed, for example, while the HDD 14 driver is reading from the HDD 14, the branch destination address May be read (pre-read).

この先読みは、HDD14からの読み出しをCPU11に実行させているプログラムは意図しない読み出しである。プログラムが意図しないこのような先読みが1回でも割り込むと、HDD14コントローラがカウントする回数がずれ、読み出されるデータに不具合が起きてしまう。   This prefetching is unintentional reading by the program that causes the CPU 11 to execute reading from the HDD 14. If such prefetching, which is not intended by the program, interrupts even once, the number of times that the HDD 14 controller counts shifts, causing a problem in the read data.

したがって、割り当てられたアドレス空間上のアドレスに対して読み出し命令がなされると状態が変化しうるHDD14などのデバイスには、プログラムが意図しない読み出しが行われないように注意する必要がある。   Therefore, it is necessary to be careful not to perform unintentional reading by a program on a device such as the HDD 14 whose state can change when a read command is issued to an address in the allocated address space.

状態が変化しうるHDD14などのデバイスに対してプログラムが意図しない読み出しが行われないようにする方法として、たとえば、BTB23に記憶されている分岐予測情報のうち、HDD14に割り当てられたアドレス空間に属するアドレスを含む分岐予測情報を削除する方法が考えられる。   As a method for preventing unintentional reading from being performed on a device such as the HDD 14 whose state may change, for example, branch prediction information stored in the BTB 23 belongs to the address space assigned to the HDD 14. A method of deleting branch prediction information including an address is conceivable.

ステップS4において、CPU11は、OSを実行することによりバッファ変更部32として機能し、BTB23からHDD14に割り当てられたアドレス空間に属するアドレスを含む分岐予測情報を削除する(図5右図参照)。この結果、HDD14に対してプログラムが意図しない先読みが行われないようにすることができる。   In step S4, the CPU 11 functions as the buffer changing unit 32 by executing the OS, and deletes branch prediction information including addresses belonging to the address space assigned to the HDD 14 from the BTB 23 (see the right diagram in FIG. 5). As a result, it is possible to prevent the HDD 14 from performing prefetching that is not intended by the program.

以上の手順により、BTB23を用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限することができる。   With the above procedure, when branch prediction is performed using the BTB 23, it is possible to dynamically limit reading of a part of the branch destination address.

なお、ステップS4で実行されるBTB23の変更(分岐予測情報の一部削除)は、OSの起動直後に実行される必要はなく、たとえば録画プログラムがHDD14にアクセスする直前など、プログラムがHDD14にアクセスする前に完了していればよい。また、ステップS4で実行されるBTB23の変更は、ステップS3で行われる切り替えの直後または直前に行うと、プログラムが予期しない先読みの発生を効率よく防ぐことができる。   Note that the BTB 23 change (partial deletion of branch prediction information) executed in step S4 does not need to be executed immediately after the OS is started. For example, the program accesses the HDD 14 immediately before the recording program accesses the HDD 14. It only needs to be completed before doing. Further, if the BTB 23 changed in step S4 is performed immediately after or immediately before the switching performed in step S3, it is possible to efficiently prevent the occurrence of prefetching unexpected by the program.

さらに、切替部31およびバッファ変更部32の機能は、CPU11がOS以外のプログラムを実行することにより実現されてもよい。切替部31の機能を有するプログラムは、当然に切り替えられるアドレス空間の情報を有しているため、切替部31およびバッファ変更部32の機能は、同一のプログラムにもとづいて実現されるようにするとよい。   Furthermore, the functions of the switching unit 31 and the buffer changing unit 32 may be realized by the CPU 11 executing a program other than the OS. Since the program having the function of the switching unit 31 has information on the address space to be switched as a matter of course, the functions of the switching unit 31 and the buffer changing unit 32 may be realized based on the same program. .

図6は、第1実施形態における命令取得部22の動作について簡単に説明したフローチャートである。図6において、Sに数字を付した符号は、フローチャートの各ステップを示す。   FIG. 6 is a flowchart briefly explaining the operation of the instruction acquisition unit 22 in the first embodiment. In FIG. 6, reference numerals with numbers added to S indicate steps in the flowchart.

この手順は、命令取得部22が命令のアドレスを取得してスタートとなる。   This procedure starts when the instruction acquisition unit 22 acquires the address of the instruction.

ステップS11において、分岐予測部21は、命令取得部22から命令のアドレスを通知され、この命令のアドレスと一致するアドレスが、BTB23に記憶されている分岐命令のアドレス(分岐元アドレス)にあるかどうか判定する。この命令のアドレスと一致する分岐命令のアドレスがある場合は、ステップS12に進む。一方、ない場合は、ステップS13に進む。   In step S11, the branch prediction unit 21 is notified of the address of the instruction from the instruction acquisition unit 22, and whether the address that matches the address of this instruction is the address of the branch instruction (branch source address) stored in the BTB 23. Judge whether. If there is an address of a branch instruction that matches the address of this instruction, the process proceeds to step S12. On the other hand, if not, the process proceeds to step S13.

次に、ステップS12において、命令取得部22は、分岐予測部21から分岐先アドレスを与えられ、この分岐先アドレスから命令を取得する。   Next, in step S12, the instruction acquisition unit 22 is given a branch destination address from the branch prediction unit 21, and acquires an instruction from this branch destination address.

一方、ステップS13において、命令取得部22は、次の命令のアドレスから命令を取得する。   On the other hand, in step S13, the instruction acquisition unit 22 acquires an instruction from the address of the next instruction.

以上の手順を繰り返すことにより、CPU11はデバイスから命令を順次読み出して実行することができる。   By repeating the above procedure, the CPU 11 can sequentially read and execute instructions from the device.

図6に示すように、命令取得部22は、分岐予測部21から分岐先アドレスを与えられた場合は、この分岐先アドレスに対する読み出しを行ってしまう。あらかじめ、BTB23に記憶されている分岐予測情報からHDD14に割り当てられたアドレス空間に属するアドレスを含む分岐予測情報を削除しておけば、プログラムが意図しない先読みを命令取得部22に行わせないようにすることができる。   As illustrated in FIG. 6, when a branch destination address is given from the branch prediction unit 21, the instruction acquisition unit 22 reads the branch destination address. If the branch prediction information including addresses belonging to the address space assigned to the HDD 14 is deleted from the branch prediction information stored in the BTB 23 in advance, the instruction acquisition unit 22 is prevented from performing prefetching that is not intended by the program. can do.

本実施形態に係る情報処理装置としての記録装置10は、HDD14に割り当てられたアドレス空間に属するアドレスを含む分岐予測情報をBTB23から削除するバッファ変更部32を備える。このため、分岐予測機能を有する演算処理装置を備えた情報処理装置において、1つのアドレス空間を複数のデバイスに切り替えて割り当てて利用する場合に、プログラムが意図しない先読みを防ぐことができる。   The recording apparatus 10 as the information processing apparatus according to the present embodiment includes a buffer changing unit 32 that deletes branch prediction information including addresses belonging to an address space allocated to the HDD 14 from the BTB 23. For this reason, in an information processing apparatus including an arithmetic processing unit having a branch prediction function, prefetching unintended by a program can be prevented when one address space is switched to a plurality of devices for use.

したがって、本実施形態に係る情報処理装置によれば、分岐予測機能を有する演算処理装置を備えた情報処理装置において、プログラムの意図しない先読みを発生させずに1つのアドレス空間を複数のデバイスで切り替えながら利用することができ、アドレス空間を効率的に利用することができるため、アドレス空間全体のサイズを抑制することができる。   Therefore, according to the information processing apparatus according to the present embodiment, in an information processing apparatus including an arithmetic processing unit having a branch prediction function, one address space is switched between a plurality of devices without causing unintentional prefetching of a program. Since the address space can be used efficiently, the size of the entire address space can be suppressed.

次に、本発明に係る情報処理装置(演算処理装置を含む)の第2実施形態について説明する。   Next, a second embodiment of the information processing apparatus (including the arithmetic processing apparatus) according to the present invention will be described.

この第2実施形態に示す情報処理装置は、バッファ変更部32を持たず、分岐予測により予測された分岐先アドレスの命令を命令取得部22が読み出す際に所要のアドレスを参照して読み出しを実行するか否かを決める点で第1実施形態に示す情報処理装置と異なる。他の構成および作用については図1に示す情報処理装置と実質的に異ならないため、同じ構成には同一符号を付して説明を省略する。   The information processing apparatus shown in the second embodiment does not have the buffer changing unit 32, and executes the reading with reference to the required address when the instruction acquiring unit 22 reads the instruction at the branch destination address predicted by the branch prediction. It differs from the information processing apparatus shown in the first embodiment in that it is determined whether or not to do so. Since other configurations and operations are not substantially different from those of the information processing apparatus shown in FIG. 1, the same components are denoted by the same reference numerals and description thereof is omitted.

本実施形態に係る情報処理装置は、アドレス空間の割り当てがNOR Flash13からHDD14に変更されてもBTB23は全く変更されず、命令取得部22が読み出すアドレスに制限をかけることでプログラムが予期しない先読みの発生を防ぐ。   In the information processing apparatus according to the present embodiment, the BTB 23 is not changed at all even when the address space allocation is changed from the NOR Flash 13 to the HDD 14, and the program is not expected to be read ahead by limiting the addresses read by the instruction acquisition unit 22. Prevent occurrence.

図7は、本発明に係る情報処理装置(演算処理装置を含む)の第2実施形態を示す概略的な全体構成図である。   FIG. 7 is a schematic overall configuration diagram showing a second embodiment of the information processing apparatus (including the arithmetic processing apparatus) according to the present invention.

情報処理装置としての記録装置10Aは、演算処理装置としてのCPU11、DRAM12、第1のデバイスとしてのNOR Flash13、第2のデバイスとしてのHDD14、表示出力部15、操作入力部16およびチューナ17を有する。   A recording apparatus 10A as an information processing apparatus includes a CPU 11 as an arithmetic processing unit, a DRAM 12, a NOR Flash 13 as a first device, an HDD 14 as a second device, a display output unit 15, an operation input unit 16, and a tuner 17. .

CPU11は、図7に示すように、分岐予測部21、命令取得部22および参照アドレス記憶部41を有する。   As shown in FIG. 7, the CPU 11 includes a branch prediction unit 21, an instruction acquisition unit 22, and a reference address storage unit 41.

命令取得部22は、各種プログラムの命令を順次読み出してCPU11の命令デコードに与える。また、命令取得部22はこの読み出しと同時に分岐予測部21に命令のアドレスを通知する。分岐予測部21から分岐先アドレスが与えられた場合には、命令取得部22は、参照アドレス記憶部41を参照して、必要に応じて分岐先アドレスから命令を取得する。   The instruction acquisition unit 22 sequentially reads instructions of various programs and gives them to the instruction decode of the CPU 11. The instruction acquisition unit 22 notifies the instruction address to the branch prediction unit 21 simultaneously with the reading. When a branch destination address is given from the branch prediction unit 21, the instruction acquisition unit 22 refers to the reference address storage unit 41 and acquires an instruction from the branch destination address as necessary.

参照アドレス記憶部41は、分岐予測により予測された分岐先アドレスの命令を読み出す際に命令取得部22により参照される所要のアドレスを記憶する。   The reference address storage unit 41 stores a required address that is referred to by the instruction acquisition unit 22 when the instruction at the branch destination address predicted by the branch prediction is read.

以下の説明では、参照アドレス記憶部41に記憶された所要のアドレスが、NOR Flash13からHDD14に割り当てられたアドレス空間に属する、命令取得部22が先読みしてはならない無効なアドレスである場合の例について説明する。   In the following description, an example in which the required address stored in the reference address storage unit 41 is an invalid address that belongs to the address space allocated from the NOR Flash 13 to the HDD 14 and should not be prefetched by the instruction acquisition unit 22. Will be described.

図8は、図7に示すCPU11による機能実現部20の構成例を示す概略的なブロック図である。なお、この機能実現部20は、CPU11を用いることなく回路などのハードウエアロジックによって構成してもよい。   FIG. 8 is a schematic block diagram illustrating a configuration example of the function realization unit 20 by the CPU 11 illustrated in FIG. 7. Note that the function realization unit 20 may be configured by hardware logic such as a circuit without using the CPU 11.

CPU11は、少なくともOSおよび録画プログラムの一方によって、少なくとも切替部31および参照アドレス変更部42を含む機能実現部20として機能する。なお、この機能実現部20は、CPU11を用いることなく回路などのハードウエアロジックによって構成してもよい。   The CPU 11 functions as the function realizing unit 20 including at least the switching unit 31 and the reference address changing unit 42 by at least one of the OS and the recording program. Note that the function realization unit 20 may be configured by hardware logic such as a circuit without using the CPU 11.

次に、CPU11の機能実現部20について説明する。   Next, the function realization part 20 of CPU11 is demonstrated.

切替部31は、スイッチ50を制御し、必要に応じてチップセレクトの接続先をNOR Flash13からHDD14に切り替える機能を有する。この切り替えが行われると、記録装置10Aの起動時にNOR Flash13に割り当てられていたアドレス空間は、HDD14に割り当てられる。   The switching unit 31 has a function of controlling the switch 50 and switching the chip select connection destination from the NOR Flash 13 to the HDD 14 as necessary. When this switching is performed, the address space allocated to the NOR Flash 13 when the recording apparatus 10A is activated is allocated to the HDD 14.

参照アドレス変更部42は、HDD14に割り当てられたアドレス空間に属するアドレスを全て参照アドレス記憶部41に追記して記憶させる機能を有する。   The reference address changing unit 42 has a function of adding and storing all addresses belonging to the address space assigned to the HDD 14 in the reference address storage unit 41.

次に、本実施形態に係る記録装置10Aの動作の一例について説明する。   Next, an example of the operation of the recording apparatus 10A according to the present embodiment will be described.

図9は、図7に示す記録装置10AのCPU11により、BTB23を用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限する際の他の手順を示すフローチャートである。図9において、Sに数字を付した符号は、フローチャートの各ステップを示す。図4と同等のステップには同一符号を付し、重複する説明を省略する。   FIG. 9 is a flowchart showing another procedure for dynamically restricting reading of a part of the branch destination address when the CPU 11 of the recording apparatus 10A shown in FIG. 7 performs branch prediction using the BTB 23. . In FIG. 9, the code | symbol which attached | subjected the number to S shows each step of a flowchart. Steps equivalent to those in FIG. 4 are denoted by the same reference numerals, and redundant description is omitted.

状態が変化しうるHDD14などのデバイスに対してプログラムが意図しない読み出しが行われないようにする他の方法として、たとえば、あらかじめ先読みしてもよいアドレス(先読み可能な有効アドレス)または先読みしてはいけないアドレス(先読み不可な無効アドレス)を参照アドレス記憶部41に記憶しておき、命令取得部22が分岐予測部21から分岐先アドレスを与えられた場合には、必ず参照アドレス記憶部41を参照して、分岐先アドレスからの読出しを実行してもよいかどうか判定するようにする方法が考えられる。   As another method for preventing the program from unintentionally reading from a device such as the HDD 14 whose state may change, for example, an address that may be prefetched (a prefetchable effective address) or prefetching may be used. An address that should not be read (an invalid address that cannot be prefetched) is stored in the reference address storage unit 41, and when the instruction acquisition unit 22 is given a branch destination address from the branch prediction unit 21, the reference address storage unit 41 must be referred to. Thus, a method of determining whether or not reading from the branch destination address may be executed is conceivable.

ステップS20において、CPU11は、OSを実行することにより参照アドレス変更部42として機能し、HDD14に割り当てられたアドレス空間に属するアドレスを全て参照アドレス記憶部41に追記して記憶させる。   In step S <b> 20, the CPU 11 functions as the reference address changing unit 42 by executing the OS, and additionally stores all addresses belonging to the address space allocated to the HDD 14 in the reference address storage unit 41.

以上の手順によっても、BTB23を用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限することができる。   According to the above procedure, when branch prediction is performed using the BTB 23, it is possible to dynamically limit reading of a part of the branch destination address.

図10は、第2実施形態における命令取得部22の動作について簡単に説明したフローチャートである。図10において、Sに数字を付した符号は、フローチャートの各ステップを示す。   FIG. 10 is a flowchart for briefly explaining the operation of the instruction acquisition unit 22 in the second embodiment. In FIG. 10, reference numerals with numbers added to S indicate steps in the flowchart.

ステップS21において、分岐予測部21は、命令取得部22から命令のアドレスを通知され、この命令のアドレスと一致するアドレスが、BTB23に記憶されている分岐命令のアドレス(分岐元アドレス)にあるかどうか判定する。この命令のアドレスと一致する分岐命令のアドレスがある場合は、ステップS22に進む。一方、ない場合は、ステップS24に進む。   In step S <b> 21, the branch prediction unit 21 is notified of the instruction address from the instruction acquisition unit 22, and is the address that matches the instruction address included in the branch instruction address (branch source address) stored in the BTB 23? Judge whether. If there is an address of a branch instruction that matches the address of this instruction, the process proceeds to step S22. On the other hand, if not, the process proceeds to step S24.

次に、ステップS22において、命令取得部22は、無効アドレスが記憶された参照アドレス記憶部41を参照し、分岐予測部21から与えられた分岐先アドレスと一致するアドレスがあるかどうか判定する。分岐先アドレスと一致する無効アドレスがある場合は、分岐先アドレスに対する読み出しを実行せず、一連の手順は終了となる。一方、ない場合は、ステップS23に進む。   Next, in step S22, the instruction acquisition unit 22 refers to the reference address storage unit 41 in which the invalid address is stored, and determines whether there is an address that matches the branch destination address given from the branch prediction unit 21. If there is an invalid address that matches the branch destination address, reading from the branch destination address is not executed, and the series of procedures ends. On the other hand, if not, the process proceeds to step S23.

次に、ステップS23において、命令取得部22は、分岐先アドレスから命令を取得する。   Next, in step S23, the instruction acquisition unit 22 acquires an instruction from the branch destination address.

一方、ステップS24において、命令取得部22は、次の命令のアドレスから命令を取得する。   On the other hand, in step S24, the instruction acquisition unit 22 acquires an instruction from the address of the next instruction.

以上の手順を繰り返すことにより、CPU11はデバイスから命令を順次読み出して実行する際に、BTB23に命令取得部22が先読みを行うべきでないアドレスが登録されたままであっても、この先読みを行うべきでないアドレスに対する読み込みを制限することができる。   By repeating the above procedure, when the CPU 11 sequentially reads out and executes instructions from the device, the prefetching should not be performed even if the address that should not be prefetched by the instruction acquiring unit 22 remains registered in the BTB 23. You can restrict reading to addresses.

なお、参照アドレス記憶部41に記憶された所要のアドレスは、NOR Flash13からHDD14に割り当てられたアドレス空間に属する命令取得部22が先読みしてはならない無効なアドレスを、全アドレス空間に属するアドレスから削除した、命令取得部22が先読みしてもよい有効なアドレスであってもよい。この場合、参照アドレス変更部42は、あらかじめ参照アドレス記憶部41に記憶された全アドレス空間に属するアドレスの情報から、HDD14に割り当てられたアドレス空間に属するアドレスを削除する機能を有する。   The required address stored in the reference address storage unit 41 is an invalid address that should not be prefetched by the instruction acquisition unit 22 belonging to the address space allocated from the NOR Flash 13 to the HDD 14 from the address belonging to the entire address space. The deleted valid address may be prefetched by the instruction acquisition unit 22. In this case, the reference address changing unit 42 has a function of deleting addresses belonging to the address space allocated to the HDD 14 from information on addresses belonging to all address spaces stored in the reference address storage unit 41 in advance.

図7に示した情報処理装置によっても、図1に示した情報処理装置と同様の作用効果を奏する。   The information processing apparatus shown in FIG. 7 also has the same effects as the information processing apparatus shown in FIG.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせても良い。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, the constituent elements over different embodiments may be appropriately combined.

また、本発明の実施形態では、フローチャートの各ステップは、記載された順序に沿って時系列的に行われる処理の例を示したが、必ずしも時系列的に処理されなくとも、並列的あるいは個別実行される処理をも含むものである。   Further, in the embodiment of the present invention, each step of the flowchart shows an example of processing that is performed in time series in the order described. The process to be executed is also included.

また、本発明は、分岐予測機能を有するプロセッサを備えた情報処理装置に対して適用可能である。特に本発明は、アドレス空間がそれほど広大でない情報処理装置に適している。したがって、本発明は、上記実施形態で説明したHDD記録装置のほかにも、特に、携帯電話機、デジタルカメラ、自動車、自動販売機、ゲーム機、PDA(Personal Digital Assistant)などの組み込みシステムに適用することが可能である。   In addition, the present invention is applicable to an information processing apparatus including a processor having a branch prediction function. In particular, the present invention is suitable for an information processing apparatus whose address space is not so large. Therefore, the present invention is applied to an embedded system such as a mobile phone, a digital camera, an automobile, a vending machine, a game machine, and a PDA (Personal Digital Assistant) in addition to the HDD recording apparatus described in the above embodiment. It is possible.

本発明に係る情報処理装置(演算処理装置を含む)の第1実施形態を示す概略的な全体構成図。1 is a schematic overall configuration diagram showing a first embodiment of an information processing apparatus (including an arithmetic processing apparatus) according to the present invention. チップセレクトの接続先を切替えることにより、同一のアドレス空間に対する割り当てデバイスがNOR FlashからHDDに変更される様子を示す簡単な説明図。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a simple explanatory diagram showing a state where an allocation device for the same address space is changed from NOR Flash to HDD by switching the connection destination of chip select. 図1に示すCPUによる機能実現部の構成例を示す概略的なブロック図。FIG. 2 is a schematic block diagram illustrating a configuration example of a function realizing unit by a CPU illustrated in FIG. 1. 図1に示す記録装置のCPUにより、BTBを用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限する際の手順を示すフローチャート。3 is a flowchart showing a procedure for dynamically restricting reading of a part of a branch destination address when the CPU of the recording apparatus shown in FIG. 1 performs branch prediction using BTB. BTBに記憶された分岐予測情報のリストの一例を示す説明図。Explanatory drawing which shows an example of the list of the branch prediction information memorize | stored in BTB. 第1実施形態における命令取得部の動作について簡単に説明したフローチャート。The flowchart which demonstrated briefly the operation | movement of the command acquisition part in 1st Embodiment. 本発明に係る情報処理装置(演算処理装置を含む)の第2実施形態を示す概略的な全体構成図。FIG. 3 is a schematic overall configuration diagram showing a second embodiment of an information processing apparatus (including an arithmetic processing apparatus) according to the present invention. 図7に示すCPUによる機能実現部の構成例を示す概略的なブロック図。FIG. 8 is a schematic block diagram illustrating a configuration example of a function implementing unit by a CPU illustrated in FIG. 7. 図7に示す記録装置のCPUにより、BTBを用いて分岐予測を行う際に、分岐先アドレスの一部に対する読み込みを動的に制限する際の他の手順を示すフローチャート。The flowchart which shows the other procedure at the time of restrict | limiting dynamically reading with respect to a part of branch destination address, when performing branch prediction using BTB by CPU of the recording device shown in FIG. 第2実施形態における命令取得部の動作について簡単に説明したフローチャート。The flowchart which demonstrated briefly the operation | movement of the command acquisition part in 2nd Embodiment.

符号の説明Explanation of symbols

10、10A 記録装置
11 CPU
12 DRAM
13 NOR Flash
14 HDD
15 表示出力部
16 操作入力部
17 チューナ
20 機能実現部
21 分岐予測部
22 命令取得部
23 BTB
31 切替部
32 バッファ変更部
41 参照アドレス記憶部
42 参照アドレス変更部
50 スイッチ
10, 10A Recording device 11 CPU
12 DRAM
13 NOR Flash
14 HDD
15 Display Output Unit 16 Operation Input Unit 17 Tuner 20 Function Realization Unit 21 Branch Prediction Unit 22 Instruction Acquisition Unit 23 BTB
31 switching unit 32 buffer changing unit 41 reference address storage unit 42 reference address changing unit 50 switch

Claims (11)

あらかじめ分岐命令を実行することにより得られた前記分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を記憶する分岐先バッファと、
前記分岐先バッファを有し、前記分岐先バッファに記憶された前記分岐予測情報を用いて分岐予測を行う分岐予測部と、
前記分岐予測により予測された前記分岐先アドレスの命令を読み出す際に参照される所要のアドレスを記憶する参照アドレス記憶部と、
前記参照アドレス記憶部を必要に応じて参照して命令を読み出す命令取得部と、
第1のデバイスに割り当てられたアドレス空間を、第2のデバイスに割り当てられるように切替える切替部と、
前記アドレス空間に属するアドレスの情報を利用して前記参照アドレス記憶部に記憶された前記所要のアドレスを変更する参照アドレス変更部と、
を備えたことを特徴とする情報処理装置。
A branch destination buffer for storing branch prediction information in which an address of the branch instruction and a branch destination address obtained by executing a branch instruction in advance are associated;
A branch prediction unit having the branch destination buffer and performing branch prediction using the branch prediction information stored in the branch destination buffer;
A reference address storage unit that stores a required address that is referred to when an instruction of the branch destination address predicted by the branch prediction is read;
An instruction acquisition unit that reads the instruction by referring to the reference address storage unit as necessary;
A switching unit that switches the address space allocated to the first device so as to be allocated to the second device;
A reference address changing unit that changes the required address stored in the reference address storage unit using information on addresses belonging to the address space;
An information processing apparatus comprising:
前記第1のデバイスは、
割り当てられた前記アドレス空間上で命令を直接実行可能なデバイスであり、
前記第2のデバイスは、
割り当てられた前記アドレス空間上のアドレスに読み出し命令がなされると、状態が変化しうるデバイスである、
請求項1記載の情報処理装置。
The first device is:
A device capable of directly executing instructions on the assigned address space;
The second device is:
A device whose state can change when a read command is made to an address on the allocated address space.
The information processing apparatus according to claim 1.
前記第1のデバイスおよび前記第2のデバイスの一方を1つのチップセレクト信号線に選択的に接続するスイッチをさらに備え、
前記切替部は、
前記第1のデバイスに割り当てられた前記アドレス空間が前記第2のデバイスに割り当てられるように、前記スイッチを制御して前記チップセレクト信号線の接続先を前記第1のデバイスから前記第2のデバイスに切替える、
請求項1記載の情報処理装置。
A switch that selectively connects one of the first device and the second device to one chip select signal line;
The switching unit is
The switch is controlled so that the connection destination of the chip select signal line is changed from the first device to the second device so that the address space assigned to the first device is assigned to the second device. Switch to
The information processing apparatus according to claim 1.
前記参照アドレス記憶部に記憶された所要のアドレスは、
前記命令取得部が読み込み不可なアドレスであり、
前記参照アドレス変更部は、
前記切替えられたアドレス空間に属するアドレスを全て前記参照アドレス記憶部に追記して記憶させ、
前記命令取得部は、
前記命令取得部が読み出した前記命令のアドレスが前記分岐先バッファに記憶された前記分岐命令のアドレスと一致すると、前記一致したアドレスに関連付けられた前記分岐先アドレスの情報を前記分岐先バッファから取得し、この分岐先バッファから取得した前記分岐先アドレスと前記参照アドレス記憶部に記憶された前記読み込み不可なアドレスとが異なる場合のみ、前記分岐先アドレスからさらに命令を読み出す、
請求項1記載の情報処理装置。
The required address stored in the reference address storage unit is:
The instruction acquisition unit is an unreadable address,
The reference address changing unit
Add and store all addresses belonging to the switched address space in the reference address storage unit,
The command acquisition unit
When the address of the instruction read by the instruction acquisition unit matches the address of the branch instruction stored in the branch destination buffer, information on the branch destination address associated with the matched address is acquired from the branch destination buffer. Then, only when the branch destination address acquired from the branch destination buffer is different from the unreadable address stored in the reference address storage unit, further instructions are read from the branch destination address.
The information processing apparatus according to claim 1.
前記参照アドレス記憶部に記憶された所要のアドレスは、
前記命令取得部が読み込み可能なアドレスであり、
前記参照アドレス変更部は、
前記切替えられたアドレス空間に属するアドレスを全て前記参照アドレス記憶部から削除し、
前記命令取得部は、
前記命令取得部が読み出した前記命令のアドレスが前記分岐先バッファに記憶された前記分岐命令のアドレスと一致すると、前記一致したアドレスに関連付けられた前記分岐先アドレスの情報を前記分岐先バッファから取得し、この分岐先バッファから取得した前記分岐先アドレスと前記参照アドレス記憶部に記憶された前記読み込み可能なアドレスとが一致する場合のみ、前記分岐先アドレスからさらに命令を読み出す、
請求項1記載の情報処理装置。
The required address stored in the reference address storage unit is:
An address that can be read by the instruction acquisition unit,
The reference address changing unit
Delete all addresses belonging to the switched address space from the reference address storage unit,
The command acquisition unit
When the address of the instruction read by the instruction acquisition unit matches the address of the branch instruction stored in the branch destination buffer, information on the branch destination address associated with the matched address is acquired from the branch destination buffer. Then, only when the branch destination address acquired from the branch destination buffer matches the readable address stored in the reference address storage unit, further instructions are read from the branch destination address.
The information processing apparatus according to claim 1.
あらかじめ分岐命令を実行することにより得られた前記分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を記憶する分岐先バッファと、
前記分岐先バッファを有し、前記分岐先バッファに記憶された前記分岐予測情報を用いて分岐予測を行う分岐予測部と、
前記分岐予測により予測された前記分岐先アドレスの命令を読み出す際に参照される所要のアドレスを記憶する参照アドレス記憶部と、
前記参照アドレス記憶部を必要に応じて参照して命令を読み出す命令取得部と、
第1のデバイスに割り当てられたアドレス空間を、第2のデバイスに割り当てられるように切替える切替部と、
外部からの指示により、前記アドレス空間に属するアドレスの情報を利用して前記参照アドレス記憶部に記憶された前記所要のアドレスを変更する参照アドレス変更部と、
を備えたことを特徴とする演算処理装置。
A branch destination buffer for storing branch prediction information in which an address of the branch instruction and a branch destination address obtained by executing a branch instruction in advance are associated;
A branch prediction unit having the branch destination buffer and performing branch prediction using the branch prediction information stored in the branch destination buffer;
A reference address storage unit that stores a required address that is referred to when an instruction of the branch destination address predicted by the branch prediction is read;
An instruction acquisition unit that reads the instruction by referring to the reference address storage unit as necessary;
A switching unit that switches the address space allocated to the first device so as to be allocated to the second device;
A reference address changing unit that changes the required address stored in the reference address storage unit using information of an address belonging to the address space according to an instruction from the outside;
An arithmetic processing apparatus comprising:
あらかじめ分岐命令を実行することにより得られた前記分岐命令のアドレスと分岐先アドレスとを関連付けた分岐予測情報を分岐先バッファに記憶するステップと、
前記分岐予測により予測された前記分岐先アドレスの命令を読み出す際に参照される所要のアドレスを参照アドレス記憶部に記憶するステップと、
第1のデバイスに割り当てられたアドレス空間を、第2のデバイスに割り当てられるように切替えるステップと、
前記アドレス空間に属するアドレスの情報を利用して前記参照アドレス記憶部に記憶された前記所要のアドレスを変更するステップと、
前記参照アドレス記憶部を必要に応じて参照して命令を読み出すステップと、
を有することを特徴とする分岐予測方法。
Storing branch prediction information in which the branch instruction address and the branch destination address obtained by executing the branch instruction in advance are associated with each other in a branch destination buffer;
Storing a required address referred to when reading an instruction of the branch destination address predicted by the branch prediction in a reference address storage unit;
Switching the address space assigned to the first device to be assigned to the second device;
Changing the required address stored in the reference address storage unit using information on addresses belonging to the address space;
Reading the instruction by referring to the reference address storage unit as necessary;
A branch prediction method characterized by comprising:
前記第1のデバイスは、
割り当てられた前記アドレス空間上で命令を直接実行可能なデバイスであり、
前記第2のデバイスは、
割り当てられた前記アドレス空間上のアドレスに読み込み命令がなされると、状態が変化しうるデバイスである、
請求項7記載の分岐予測方法。
The first device is:
A device capable of directly executing instructions on the assigned address space;
The second device is:
A device whose state can change when a read instruction is made to an address on the assigned address space;
The branch prediction method according to claim 7.
前記第1のデバイスおよび前記第2のデバイスの一方を1つのチップセレクトに選択的に接続するステップをさらに有し、
前記アドレス空間を切替えるステップは、
前記第1のデバイスに割り当てられた前記アドレス空間が前記第2のデバイスに割り当てられるように、前記第1のデバイスと接続された前記チップセレクトが前記第2のデバイスと接続されるよう前記チップセレクトの接続先を切替えるステップである、
請求項7記載の分岐予測方法。
Selectively connecting one of the first device and the second device to a chip select;
The step of switching the address space includes:
The chip select so that the chip select connected to the first device is connected to the second device so that the address space assigned to the first device is assigned to the second device. Is a step of switching the connection destination of
The branch prediction method according to claim 7.
前記参照アドレス記憶部に記憶された所要のアドレスは、
前記読み込み不可なアドレスであり、
前記所要のアドレスを変更するステップは、
前記切替えられたアドレス空間に属するアドレスを全て前記参照アドレス記憶部に追記して記憶させるステップであり、
前記命令を読み出すステップは、
前記読み出した前記命令のアドレスが前記分岐先バッファに記憶された前記分岐命令のアドレスと一致すると、前記一致したアドレスに関連付けられた前記分岐先アドレスの情報を前記分岐先バッファから取得し、この分岐先バッファから取得した前記分岐先アドレスと前記参照アドレス記憶部に記憶された前記読み込み不可なアドレスとが異なる場合のみ、前記分岐先アドレスからさらに命令を読み出すステップである、
請求項7記載の分岐予測方法。
The required address stored in the reference address storage unit is:
The unreadable address,
The step of changing the required address includes:
Adding and storing all addresses belonging to the switched address space in the reference address storage unit;
Reading the instructions includes
When the address of the read instruction matches the address of the branch instruction stored in the branch destination buffer, the branch destination address information associated with the matched address is obtained from the branch destination buffer, and this branch Only when the branch destination address acquired from the destination buffer is different from the unreadable address stored in the reference address storage unit, further instructions are read from the branch destination address.
The branch prediction method according to claim 7.
前記参照アドレス記憶部に記憶された所要のアドレスは、
前記読み込み可能なアドレスであり、
前記所要のアドレスを変更するステップは、
前記切替えられたアドレス空間に属するアドレスを全て前記参照アドレス記憶部から削除するステップであり、
前記命令を読み出すステップは、
前記読み出した前記命令のアドレスが前記分岐先バッファに記憶された前記分岐命令のアドレスと一致すると、前記一致したアドレスに関連付けられた前記分岐先アドレスの情報を前記分岐先バッファから取得し、この分岐先バッファから取得した前記分岐先アドレスと前記参照アドレス記憶部に記憶された前記読み込み可能なアドレスとが一致する場合のみ、前記分岐先アドレスからさらに命令を読み出すステップである、
請求項7記載の分岐予測方法。
The required address stored in the reference address storage unit is:
The readable address,
The step of changing the required address includes:
Deleting all addresses belonging to the switched address space from the reference address storage unit,
Reading the instructions includes
When the address of the read instruction matches the address of the branch instruction stored in the branch destination buffer, the branch destination address information associated with the matched address is obtained from the branch destination buffer, and this branch Only when the branch destination address acquired from the destination buffer matches the readable address stored in the reference address storage unit, further instructions are read from the branch destination address.
The branch prediction method according to claim 7.
JP2007283508A 2007-10-31 2007-10-31 Information processor, arithmetic processor, and branch prediction method Withdrawn JP2009110383A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007283508A JP2009110383A (en) 2007-10-31 2007-10-31 Information processor, arithmetic processor, and branch prediction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007283508A JP2009110383A (en) 2007-10-31 2007-10-31 Information processor, arithmetic processor, and branch prediction method

Publications (1)

Publication Number Publication Date
JP2009110383A true JP2009110383A (en) 2009-05-21

Family

ID=40778793

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007283508A Withdrawn JP2009110383A (en) 2007-10-31 2007-10-31 Information processor, arithmetic processor, and branch prediction method

Country Status (1)

Country Link
JP (1) JP2009110383A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10781081B2 (en) 2014-12-09 2020-09-22 Wobben Properties Gmbh Tower crane for erecting a wind turbine, and method for erecting said tower crane

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10781081B2 (en) 2014-12-09 2020-09-22 Wobben Properties Gmbh Tower crane for erecting a wind turbine, and method for erecting said tower crane

Similar Documents

Publication Publication Date Title
US10114865B2 (en) Tile cache
KR101782313B1 (en) Apparatus and method for handling exception events
US9043806B2 (en) Information processing device and task switching method
JP5388864B2 (en) Clock control apparatus, clock control method, clock control program, and integrated circuit
JP2007219581A (en) Memory controller, and electronic equipment mounted therewith
US9910598B2 (en) Host interface controller and control method for storage device
JP2021527248A (en) Storage of accidental branch predictions to reduce the waiting time for misprediction recovery
JP4334598B1 (en) Information processing apparatus and error correction method
JP2008186233A (en) Instruction cache pre-fetch control method and device thereof
JP5159258B2 (en) Arithmetic processing unit
JP3890910B2 (en) Instruction execution result prediction device
JP2009110383A (en) Information processor, arithmetic processor, and branch prediction method
US7934073B2 (en) Method for performing jump and translation state change at the same time
US20160210109A1 (en) Method for controlling audio playing of an electronic device, and associated apparatus and associated computer program product
JP2008140124A (en) Data processor
JP2008257508A (en) Cache control method, cache device, and microcomputer
KR100744057B1 (en) Embedded system and a graphic user interface displaying method thereof
JP2010186411A (en) Device, method and program for executing program
JP2006039604A (en) Device and method for information processing, and program
JP3558481B2 (en) Data processing device
JP5949330B2 (en) Information processing apparatus and information processing method
JPH06266623A (en) Cache memory and cache memory control method
KR101691997B1 (en) Image processing apparatus and control method thereof
JPH06295263A (en) Memory system
CN113168328A (en) Processor and pipeline processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100317

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100426

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20111104