[go: up one dir, main page]

CN103257850A - Instruction cache memory based on access trace of zone bit - Google Patents

Instruction cache memory based on access trace of zone bit Download PDF

Info

Publication number
CN103257850A
CN103257850A CN2013101596436A CN201310159643A CN103257850A CN 103257850 A CN103257850 A CN 103257850A CN 2013101596436 A CN2013101596436 A CN 2013101596436A CN 201310159643 A CN201310159643 A CN 201310159643A CN 103257850 A CN103257850 A CN 103257850A
Authority
CN
China
Prior art keywords
instruction
branch
address
trace information
trace
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2013101596436A
Other languages
Chinese (zh)
Other versions
CN103257850B (en
Inventor
张铁军
李泉泉
王东辉
洪缨
侯朝焕
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.)
Institute of Acoustics CAS
Original Assignee
Institute of Acoustics CAS
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 Institute of Acoustics CAS filed Critical Institute of Acoustics CAS
Priority to CN201310159643.6A priority Critical patent/CN103257850B/en
Publication of CN103257850A publication Critical patent/CN103257850A/en
Application granted granted Critical
Publication of CN103257850B publication Critical patent/CN103257850B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Advance Control (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention relates to an instruction cache memory (an instruction Cache) based on an access trace of a zone bit. The instruction cache memory comprises a trace information table, a trace information maintenance circuit and a control circuit, wherein the depth of the trace information table is equal to the line number of the instruction Cache, each line is used for storing a trace information bit which expresses whether the access trace of a corresponding line to a mark memorizer exists or not, the trace information maintenance circuit outputs an overflow control signal according to an input branch direction, an input branch target address, an instruction taking address and a program segment address range in the trace information maintenance circuit, the overflow control signal expresses whether the instruction taking address or the branch target address is in the program segment address range or not, and the control circuit is used for controlling the reading for the mark memorizer according to the trace information bit and conducting maintenance on the trace information table according to the overflow control signal. According to the instruction Cache, recorded mark bit access information is utilized to conduct hit detection on the instruction Cache in advance in a program executing process, unnecessary mark memorizer access is eliminated, and power consumption of the instruction Cache is effectively reduced.

Description

一种基于标志位访问踪迹的指令高速缓冲存储器An Instruction Cache Memory Based on Flag Bit Access Trace

技术领域technical field

本发明涉及一种基于标志位访问踪迹的指令高速缓冲存储器。The invention relates to an instruction cache memory based on flag bit access trace.

背景技术Background technique

随着半导体工艺技术的飞速发展,嵌入式处理器芯片的性能和集成度都得到了很大的提高,由此带来的功耗问题也日益严重。作为弥合处理器内核与主存储器之间速度差距的重要部件,指令高速缓冲存储器(指令Cache)由于具有很高的访问频率而功耗显著。因此,有效降低指令Cache的功耗对于低功耗嵌入式处理器的设计有着重要意义。With the rapid development of semiconductor process technology, the performance and integration of embedded processor chips have been greatly improved, and the resulting power consumption problem has become increasingly serious. As an important part to bridge the speed gap between the processor core and the main memory, the instruction cache memory (instruction cache) consumes a lot of power because of its high access frequency. Therefore, effectively reducing the power consumption of the instruction cache is of great significance for the design of low-power embedded processors.

传统的采用直接映射方式的指令Cache的结构如图1所示,它主要由标志(tag)存储器、数据(data)存储器和状态位(state)组成。当处理器内核访问指令Cache时,标志存储器根据取指地址中的索引位(Index)作为地址读出标志位tag,并与取指地址中的Tag位比较:如果比较结果为两者相等,则表示Cache命中,处理器内核直接从指令Cache的数据存储器中读取指令;如果比较结果为两者不相等,则表示Cache缺失,这时会启动一个访问主存储器的操作。处理器内核在取指令的过程中需要进行大量的读取标志存储器操作和比较操作,这些操作需要消耗大量的能量。如果能够减少访问标志存储器的次数,则可以有效降低指令Cache的功耗。The structure of the traditional direct-mapped instruction cache is shown in Figure 1. It mainly consists of a tag memory, a data memory and a state. When the processor core accesses the instruction cache, the tag memory reads out the tag bit tag according to the index bit (Index) in the fetch address as the address, and compares it with the Tag bit in the fetch address: if the comparison result is equal, then Indicates a Cache hit, and the processor core directly reads the instruction from the data memory of the instruction Cache; if the comparison result is not equal, it indicates that the Cache is missing, and an operation of accessing the main memory will be initiated at this time. In the process of fetching instructions, the processor core needs to perform a large number of read flag memory operations and comparison operations, and these operations consume a lot of energy. If the times of accessing the flag memory can be reduced, the power consumption of the instruction cache can be effectively reduced.

在2002年8月12-14号的低功耗电子学与设计(ISLPED)会议上,KojiInoue等人发表的文章《A History-Based I-Cache for Low-Energy MultimediaApplications》提出了一种基于程序执行历史信息的低功耗指令Cache设计方法,该方法与分支预测技术紧密结合。它的工作原理是:如果分支目标指令曾经执行过,并且执行这条分支目标指令与上次执行这条分支目标指令期间没有发生过指令Cache缺失,则可以停止访问标志存储器。At the Low-Power Electronics and Design (ISLPED) Conference on August 12-14, 2002, the article "A History-Based I-Cache for Low-Energy Multimedia Applications" published by KojiInoue et al. proposed a program-based execution A low-power instruction cache design method for historical information, which is closely combined with branch prediction technology. Its working principle is: if the branch target instruction has been executed, and there is no instruction cache miss between the execution of this branch target instruction and the last execution of this branch target instruction, then the access to the flag memory can be stopped.

然而,Koji Inoue等人提出的基于程序执行历史信息的低功耗指令Cache设计方法有如下缺点:However, the low-power instruction Cache design method based on program execution history information proposed by Koji Inoue et al. has the following disadvantages:

(1)这项技术是与分支目标缓冲器紧密结合的,当分支预测与程序执行历史信息更新同时发生时,处理器流水线会出现停顿,导致处理器性能下降;(1) This technology is closely combined with the branch target buffer. When the branch prediction and the update of the program execution history information occur at the same time, the processor pipeline will stall, resulting in a decrease in processor performance;

(2)当出现指令Cache缺失时,需要清除全部的程序执行历史信息,导致处理器在程序执行过程中无法利用本来已经记录的有效历史信息消除不必要的标志存储器访问,从而降低了程序执行历史信息的使用效率;(2) When the instruction cache is missing, all the program execution history information needs to be cleared, resulting in the processor being unable to use the already recorded effective history information to eliminate unnecessary flag memory access during program execution, thereby reducing the program execution history. Efficiency in the use of information;

(3)对于没有采用分支预测机制的嵌入式处理器,建立一个分支预测器需要增加很大的硬件代价,而且分支预测器本身也需要消耗一部分能量。(3) For an embedded processor that does not use a branch prediction mechanism, building a branch predictor needs to increase a lot of hardware costs, and the branch predictor itself also needs to consume a part of energy.

发明内容Contents of the invention

本发明的目的是提供一种能解决上述缺陷的基于标志位访问踪迹的指令高速缓冲存储器。The object of the present invention is to provide an instruction cache memory based on flag bit access trace which can solve the above defects.

本发明提供了一种基于标志位访问踪迹的指令高速缓冲存储器,包括踪迹信息维护电路、踪迹信息表、控制电路、标志存储器和数据存储器,其中:所述踪迹信息表的行数分别与所述标志存储器和所述数据存储器的行数相等,所述踪迹信息表的每一行用于存储一个踪迹信息位,所述踪迹信息位的有效与否分别表示是否存在对所述标志存储器的对应行的访问踪迹;所述踪迹信息维护电路用于根据输入的分支方向、分支目标地址、取指地址以及所述踪迹信息维护电路中的程序段地址范围来输出溢出控制信号,所述溢出控制信号的有效与否分别表示所述取指地址或所述分支目标地址是否处于所述程序段地址范围之内;控制电路,用于根据所述踪迹信息位来控制对所述标志存储器的读取,并且用于根据所述溢出控制信号对所述踪迹信息表进行维护。The present invention provides an instruction cache memory accessing traces based on flag bits, including a trace information maintenance circuit, a trace information table, a control circuit, a flag memory, and a data memory, wherein: the number of rows of the trace information table is respectively the same as the The number of rows of the flag memory and the data memory is equal, and each row of the trace information table is used to store a trace information bit, and whether the trace information bit is valid or not indicates whether there is a corresponding row of the flag memory. Access trace; the trace information maintenance circuit is used to output an overflow control signal according to the input branch direction, branch target address, fetch address and program segment address range in the trace information maintenance circuit, and the effective of the overflow control signal Whether or not respectively indicates whether the instruction fetch address or the branch target address is within the address range of the program segment; the control circuit is used to control the reading of the flag memory according to the trace information bit, and use and maintaining the trace information table according to the overflow control signal.

优选地,所述踪迹信息维护电路包括:控制寄存器,用于存储所述程序段地址范围的段首地址和段尾地址;比较单元,用于根据所述分支方向、所述分支目标地址、所述取指地址和所述程序段地址范围输出分支上溢信号、分支下溢信号和顺序下溢信号;或门,用于根据所述分支上溢信号、分支下溢信号和顺序下溢信号输出所述溢出控制信号。Preferably, the trace information maintenance circuit includes: a control register for storing the segment head address and segment tail address of the program segment address range; a comparison unit for according to the branch direction, the branch target address, the Said instruction fetch address and said program segment address range output branch overflow signal, branch underflow signal and sequence underflow signal; OR gate, for outputting according to said branch overflow signal, branch underflow signal and sequence underflow signal The overflow control signal.

优选地,所述控制寄存器包括:第一寄存器,用于存储所述程序段地址范围的段首地址;第二寄存器,用于存储所述程序段地址范围的段尾地址。Preferably, the control registers include: a first register for storing the segment start address of the program segment address range; a second register for storing the segment end address of the program segment address range.

优选地,所述比较单元包括:第一比较单元,其通过将所述分支目标地址与所述段首地址进行比较,输出所述分支上溢信号;第二比较单元,其通过将所述分支目标地址与所述段尾地址进行比较,输出所述分支下溢信号;第三比较单元,其通过将所述取指地址与所述段尾地址进行比较,输出所述顺序下溢信号。Preferably, the comparison unit includes: a first comparison unit, which outputs the branch overflow signal by comparing the branch target address with the segment head address; a second comparison unit, which outputs the branch overflow signal by comparing the branch The target address is compared with the segment end address to output the branch underflow signal; the third comparison unit compares the instruction fetch address with the segment end address to output the sequence underflow signal.

优选地,所述踪迹信息位有效,所述控制电路被配置用于:禁止对所述标志存储器进行读取,并且利用所述取指地址从所述数据存储器中读取指令。Preferably, the trace information bit is valid, and the control circuit is configured to: prohibit reading from the flag memory, and use the instruction fetch address to read instructions from the data memory.

优选地,所述溢出控制信号有效,所述控制电路还被配置用于:在所述分支上溢信号或所述分支下溢信号有效的情况下,清除所述踪迹信息表中的内容,并将所述分支目标地址作为所述段首地址存入所述第一寄存器中,同时将所述分支目标地址与指令高速缓冲存储器的容量值之和作为所述段尾地址存入所述第二寄存器中,所述容量值以字节为单位表示;在所述顺序下溢信号有效的情况下,清除所述踪迹信息表中的内容,并且将所述第一寄存器和所述第二寄存器清零。Preferably, the overflow control signal is valid, and the control circuit is further configured to: clear the content in the trace information table when the branch overflow signal or the branch underflow signal is valid, and storing the branch target address in the first register as the segment head address, and simultaneously storing the sum of the branch target address and the capacity value of the instruction cache memory in the second register as the segment tail address In the register, the capacity value is expressed in bytes; when the sequence underflow signal is valid, clear the contents in the trace information table, and clear the first register and the second register zero.

优选地,所述分支方向用于指示分支指令是后向分支指令还是前向分支指令,在所述分支方向指示分支指令是后向分支指令的情况下,所述第一比较单元工作,所述控制电路关闭第三比较单元;在所述分支方向指示分支指令是前向分支指令的情况下,所述第二比较单元工作;在所述分支方向指示分支指令是前向分支指令或者分支指令执行失败的情况下,所述控制电路启动所述第三比较单元。Preferably, the branch direction is used to indicate whether the branch instruction is a backward branch instruction or a forward branch instruction. When the branch direction indicates that the branch instruction is a backward branch instruction, the first comparison unit works, and the The control circuit closes the third comparison unit; when the branch direction indicates that the branch instruction is a forward branch instruction, the second comparison unit works; when the branch direction indicates that the branch instruction is a forward branch instruction or the branch instruction is executed In case of failure, the control circuit activates the third comparison unit.

优选地,所述踪迹信息位无效,所述控制电路还被配置用于:从所述数据存储器或主存储器中读取指令并将其返回给处理器内核;在读取的指令返回给处理器内核时,将所述踪迹信息表中对应行的所述踪迹信息位设置为有效。Preferably, the trace information bit is invalid, and the control circuit is further configured to: read an instruction from the data memory or the main memory and return it to the processor core; return the read instruction to the processor When the kernel is used, the trace information bit of the corresponding row in the trace information table is set to valid.

优选地,所述踪迹信息位无效,所述控制电路还被配置用于:利用所述取指地址从所述标志存储器中读取标志位;判断读取的标志位与所述取指地址中的标志位是否匹配;在匹配的情况下,利用所述取指地址从所述数据存储器的对应行中读取指令;在不匹配的情况下,利用所述取指地址从主存储器中读取指令,并且将读取的指令写入所述数据存储器的对应行。Preferably, the trace information bit is invalid, and the control circuit is further configured to: use the instruction fetch address to read the flag bit from the flag memory; judge the read flag bit from the instruction fetch address Whether the flag bits match; in the case of a match, use the instruction fetch address to read instructions from the corresponding row of the data memory; in the case of a mismatch, use the instruction fetch address to read from the main memory instruction, and write the read instruction into the corresponding row of the data memory.

优选地,所述控制电路还被配置用于:根据所述取指地址从所述踪迹信息表的对应行中读取所述踪迹信息位,以确定是否存在对所述标志存储器的对应行的访问踪迹。Preferably, the control circuit is further configured to: read the trace information bit from the corresponding row of the trace information table according to the instruction fetch address to determine whether there is a corresponding row of the flag memory Access trail.

本发明的基于标志位访问踪迹的指令Cache在程序执行过程中利用记录的标志位访问踪迹信息提前对指令Cache进行命中检测,消除了不必要的标志存储器访问,有效降低了指令Cache的功耗。The instruction Cache based on the flag bit access trace of the present invention uses the recorded flag bit access trace information to perform hit detection on the instruction Cache in advance during program execution, eliminates unnecessary flag memory access, and effectively reduces the power consumption of the instruction Cache.

附图说明Description of drawings

图1是传统的采用直接映射方式的指令Cache的结构示意图;Fig. 1 is a schematic structural diagram of a traditional instruction cache using direct mapping;

图2是根据本发明实施例的基于标志位访问踪迹的指令Cache的结构示意图;FIG. 2 is a schematic structural diagram of an instruction cache based on flag bit access traces according to an embodiment of the present invention;

图3是根据本发明实施例的基于标志位访问踪迹的指令Cache的工作流程图;以及Fig. 3 is the working flow diagram of the instruction cache based on the flag bit access trace according to an embodiment of the present invention; and

图4是一个具体的指令代码示意图。Fig. 4 is a schematic diagram of a specific instruction code.

具体实施方式Detailed ways

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

图2是根据本发明实施例的基于标志位访问踪迹的指令Cache的结构示意图。FIG. 2 is a schematic structural diagram of an instruction cache based on flag bit access traces according to an embodiment of the present invention.

图3是根据本发明实施例的基于标志位访问踪迹的指令Cache的工作流程图。Fig. 3 is a working flow chart of the instruction cache based on the flag bit access trace according to the embodiment of the present invention.

下面,结合图2和图3,对根据本发明实施例的基于标志位访问踪迹的指令Cache的工作原理进行介绍。Next, with reference to FIG. 2 and FIG. 3 , the working principle of the instruction cache based on the access trace of the flag bit according to the embodiment of the present invention will be introduced.

如图2所示,指令Cache主要由踪迹信息维护电路、踪迹信息表、标志存储器、数据存储器和控制电路(图中未示出)组成。As shown in Figure 2, the instruction Cache is mainly composed of trace information maintenance circuit, trace information table, flag memory, data memory and control circuit (not shown in the figure).

踪迹信息维护电路主要包括控制寄存器、比较单元和或门,其用于接受由处理器内核向其输入的分支方向、分支目标地址、取指地址,根据这些输入以及所述踪迹信息维护电路中的程序段地址范围来输出溢出控制信号,所述溢出控制信号的有效与否分别表示输入的取指地址或分支目标地址是否处于程序段地址范围之内。The trace information maintenance circuit mainly includes a control register, a comparison unit and an OR gate, which are used to accept the branch direction, branch target address, and instruction fetch address input by the processor core, and according to these inputs and the trace information in the maintenance circuit The address range of the program segment is used to output the overflow control signal, and whether the overflow control signal is valid or not indicates whether the input instruction fetch address or branch target address is within the address range of the program segment.

控制寄存器包括第一寄存器和第二寄存器,分别用于存储程序段地址范围的段首地址和段尾地址。比较单元包括第一比较单元、第二比较单元和第三比较单元。第一比较单元将输入的分支目标地址与第一寄存器中的段首地址进行比较,输出分支下溢信号;第二比较单元将输入的分支目标地址与第二寄存器中的段尾地址进行比较,输出分支下溢信号;第三比较单元将输入的取指地址与第二寄存器中的段尾地址进行比较,输出顺序下溢信号。或门根据分支上溢信号、分支下溢信号和顺序下溢信号输出溢出控制信号。The control register includes a first register and a second register, which are respectively used to store the segment head address and the segment end address of the address range of the program segment. The comparing unit includes a first comparing unit, a second comparing unit and a third comparing unit. The first comparison unit compares the input branch target address with the segment header address in the first register, and outputs a branch underflow signal; the second comparison unit compares the input branch target address with the segment tail address in the second register, Outputting a branch underflow signal; the third comparison unit compares the input instruction fetch address with the end-of-segment address in the second register, and outputs a sequence underflow signal. The OR gate outputs an overflow control signal according to the branch overflow signal, the branch underflow signal and the sequential underflow signal.

踪迹信息表的行数与标志存储器的行数和数据存储器的行数都相等,其每一行用于存储一个踪迹信息位,所述踪迹信息位的有效与否分别表示是否存在对所述标志存储器的对应行的访问踪迹。The number of rows of the trace information table is equal to the row number of the flag memory and the row number of the data memory, and each row is used to store a trace information bit. The access trace of the corresponding row.

控制电路用于根据踪迹信息位来控制对所述标志存储器的读取,并且用于根据所述溢出控制信号对踪迹信息表进行维护。所述控制电路既可以独立于指令Cache中的各部分存在,也可以被整合到踪迹信息维护电路中。本领域技术人员应当理解,用以根据各种控制信号来实现控制功能的控制电路的实现方法是各种各样的。在此,只描述控制电路的功能而不再赘述其具体实现方式,以免模糊本发明的主题。The control circuit is used for controlling the reading of the flag memory according to the trace information bit, and for maintaining the trace information table according to the overflow control signal. The control circuit can exist independently of each part in the instruction cache, and can also be integrated into the trace information maintenance circuit. Those skilled in the art should understand that there are various implementation methods of the control circuit used to implement the control function according to various control signals. Here, only the function of the control circuit is described without repeating its specific implementation, so as not to obscure the subject of the present invention.

另外,标志存储器和数据存储器与传统的指令Cache无异,不再赘述。In addition, the flag memory and the data memory are no different from the traditional instruction cache, and will not be repeated here.

本领域技术人员应当理解,对于容量为N字节的直接映射方式的指令Cache,如果主存储器中某个首尾地址分别为X和Y的程序段已经处于指令Cache中且Y-X<N,则当取指地址PC满足X≤PC<X+N时,该程序段中的指令一定不会被替换出去。Those skilled in the art should understand that for a direct mapping instruction cache with a capacity of N bytes, if a program segment whose first and last addresses are X and Y respectively in the main memory is already in the instruction cache and Y-X<N, then when fetching It means that when the address PC satisfies X≤PC<X+N, the instructions in this block will not be replaced.

下面结合图3的流程图对根据本发明实施例的指令Cache的工作过程进行说明。The working process of the instruction cache according to the embodiment of the present invention will be described below with reference to the flowchart of FIG. 3 .

在程序执行过程中,当遇到第一条分支指令时,踪迹信息维护电路会将该分支指令的分支目标地址作为段首地址写入控制寄存器的第一寄存器中,同时将该分支目标地址与指令Cache的容量值(Cache容量以字节为单位表示)之和作为段尾地址写入控制寄存器的第二寄存器中。通过段首地址和段尾地址确立一个程序段地址范围,表示现在开始执行地址处于该程序段地址范围之内的程序段。During program execution, when the first branch instruction is encountered, the trace information maintenance circuit will write the branch target address of the branch instruction as the first address of the segment into the first register of the control register, and simultaneously compare the branch target address with The sum of the capacity values of the instruction cache (the capacity of the cache is expressed in bytes) is written into the second register of the control register as the end address of the segment. A program segment address range is established through the segment head address and segment end address, which means that the program segment whose address is within the program segment address range is now started to be executed.

由于是第一次执行该分支指令,处理器内核在读取该分支指令的目标指令时会出现Cache缺失,从而需要从主存储器中读取该分支指令的目标指令。当从主存储器中返回的该分支指令的目标指令被写入指令Cache时,踪迹信息表中对应行的踪迹信息位被设置为有效。Since the branch instruction is executed for the first time, a cache miss occurs when the processor core reads the target instruction of the branch instruction, so that the target instruction of the branch instruction needs to be read from the main memory. When the target instruction of the branch instruction returned from the main memory is written into the instruction cache, the trace information bit of the corresponding row in the trace information table is set to be valid.

在接下来的程序执行过程中,需要对输入的取指地址进行判断,根据判断结果采用不同的处理方式,具体如下所述。In the following program execution process, it is necessary to judge the input instruction fetch address, and adopt different processing methods according to the judgment result, as described below.

一方面,在取指地址处于踪迹信息维护电路中的程序段地址范围之内的情况下:On the one hand, in the case where the instruction fetch address is within the address range of the program segment in the trace information maintenance circuit:

如果控制电路根据取指地址中的索引位读出的踪迹信息位为有效(禁能信号有效),则表示指令Cache命中,在控制电路的控制下,处理器内核直接从数据存储器中读取指令而不需要访问标志存储器;如果控制电路根据取指地址中的索引位读出的踪迹信息位为无效(禁能信号无效),则需要在控制电路的控制下访问标志存储器来判断指令Cache是否命中。If the trace information bit read by the control circuit according to the index bit in the fetch address is valid (the disable signal is valid), it means that the instruction cache hits, and under the control of the control circuit, the processor core directly reads the instruction from the data memory There is no need to access the flag memory; if the trace information bit read by the control circuit according to the index bit in the fetch address is invalid (the disable signal is invalid), it is necessary to access the flag memory under the control of the control circuit to determine whether the instruction Cache hits .

在踪迹信息位无效的情况下:如果指令Cache命中,则控制电路将从数据存储器中读取指令,将读取的指令返回给处理器内核并同时将踪迹信息表中对应行的踪迹信息位设置为有效;如果指令Cache缺失,则控制电路将从主存储器中读取指令,将读取的指令写入数据存储器中并同时将踪迹信息表中对应行的踪迹信息位设置为有效。In the case of invalid trace information bits: if the instruction Cache hits, the control circuit will read the instruction from the data memory, return the read instruction to the processor core and set the trace information bit of the corresponding row in the trace information table is valid; if the command cache is missing, the control circuit will read the command from the main memory, write the read command into the data memory and simultaneously set the trace information bit of the corresponding row in the trace information table to valid.

另一方面,如果输入的取指地址不处于踪迹信息维护电路中的程序段地址范围之内(取指地址溢出的情况),则需要在控制电路的控制下,对第一寄存器和第二寄存器进行修改或清零,并同时清除踪迹信息表,以确保踪迹信息维护电路中的程序段地址范围始终与踪迹信息表保持一个正确的对应关系。On the other hand, if the input fetch address is not within the address range of the program segment in the trace information maintenance circuit (in the case of overflow of the fetch address), it is necessary to control the first register and the second register under the control of the control circuit. Modify or clear, and clear the trace information table at the same time, to ensure that the program segment address range in the trace information maintenance circuit always maintains a correct correspondence with the trace information table.

在程序执行过程中,出现取指地址溢出的情况有下列三种:In the process of program execution, there are the following three situations where the instruction fetch address overflow occurs:

首先,本领域技术人员应当清楚,分支指令包括后向分支指令和前向分支指令:后向分支指令的分支偏移量符号位为负,其对应的分支方向为“1”;前向分支指令的分支偏移量符号位为正,其对应的分支方向为“0”。First of all, those skilled in the art should understand that branch instructions include backward branch instructions and forward branch instructions: the branch offset sign bit of the backward branch instruction is negative, and its corresponding branch direction is "1"; the forward branch instruction The branch offset sign bit of is positive, and its corresponding branch direction is "0".

(1)由分支指令导致的取指地址向上溢出的情况,其在遇到后向分支指令且该后向分支指令的分支目标地址小于第一寄存器的值(段首地址)时出现。当出现这种情况时,第一比较单元输出的分支上溢信号有效,或门输出的溢出控制信号有效。此时,控制电路根据有效的溢出控制信号,清除踪迹信息表,并将该后向分支指令的分支目标地址写入第一寄存器中,同时将该分支目标地址与指令Cache的容量值之和写入第二寄存器中。(1) The overflow of the instruction fetch address caused by the branch instruction occurs when a backward branch instruction is encountered and the branch target address of the backward branch instruction is smaller than the value of the first register (segment header address). When this happens, the branch overflow signal output by the first comparison unit is valid, and the overflow control signal output by the OR gate is valid. At this time, the control circuit clears the trace information table according to the effective overflow control signal, writes the branch target address of the backward branch instruction into the first register, and simultaneously writes the sum of the branch target address and the capacity value of the instruction Cache into into the second register.

(2)由分支指令导致的取指地址向下溢出的情况,其在遇到前向分支指令且该前向分支指令的分支目标地址大于或等于第二寄存器的值(段尾地址)时出现。当出现这种情况时,第二比较单元输出的分支下溢信号有效,或门输出的溢出控制信号有效。此时,控制电路根据有效的溢出控制信号,清除踪迹信息表,并将该前向分支指令的分支目标地址写入第一寄存器中,同时将该分支目标地址与指令Cache的容量值之和写入第二寄存器中。(2) The underflow of the instruction fetch address caused by the branch instruction occurs when a forward branch instruction is encountered and the branch target address of the forward branch instruction is greater than or equal to the value of the second register (segment end address) . When this happens, the branch underflow signal output by the second comparison unit is valid, and the overflow control signal output by the OR gate is valid. At this time, the control circuit clears the trace information table according to the effective overflow control signal, writes the branch target address of the forward branch instruction into the first register, and simultaneously writes the sum of the branch target address and the capacity value of the instruction Cache into the second register.

(3)由顺序指令导致的取指地址向下溢出的情况,其在遇到顺序指令且该顺序指令的取指地址等于第二寄存器的值时出现。当出现这种情况时,第三比较单元输出的顺序下溢信号有效,或门输出的溢出控制信号有效。此时,控制电路根据有效的溢出控制信号,清除踪迹信息表,并将第一寄存器和第二寄存器清零。接下来,当再次遇到分支指令时,再将该分支指令的分支目标地址写入第一寄存器中,同时将该分支目标地址与指令Cache的容量值之和写入第二寄存器中。(3) The underflow of the instruction fetch address caused by the sequential instruction occurs when a sequential instruction is encountered and the instruction fetch address of the sequential instruction is equal to the value of the second register. When this happens, the sequential underflow signal output by the third comparison unit is valid, and the overflow control signal output by the OR gate is valid. At this time, the control circuit clears the trace information table and clears the first register and the second register according to the effective overflow control signal. Next, when a branch instruction is encountered again, the branch target address of the branch instruction is written into the first register, and at the same time, the sum of the branch target address and the capacity value of the instruction cache is written into the second register.

根据分支方向以及指示分支指令执行成功与否的信号,控制电路可以对第一、第二和第三比较单元进行控制。具体地,第一比较单元在执行后向分支指令时工作,控制电路在遇到后向分支指令时关闭第三比较单元;第二比较单元在执行前向分支指令时工作;控制电路在分支方向指示分支指令是前向分支指令或者在分支指令执行失败的情况下,启动第三比较单元。According to the branch direction and the signal indicating whether the execution of the branch instruction is successful or not, the control circuit can control the first, second and third comparison units. Specifically, the first comparison unit works when executing a backward branch instruction, and the control circuit closes the third comparison unit when encountering a backward branch instruction; the second comparison unit works when executing a forward branch instruction; Indicating that the branch instruction is a forward branch instruction or in case the execution of the branch instruction fails, the third comparison unit is activated.

图4是一个具体的指令代码示意图。Fig. 4 is a schematic diagram of a specific instruction code.

下面通过图4的指令代码对根据本发明实施例的基于标志位访问踪迹的指令Cache的具体执行过程进行描述。The following describes the specific execution process of the instruction cache based on the flag access trace according to the embodiment of the present invention through the instruction code in FIG. 4 .

假设指令Cache容量为8KB,块大小为16B,采用直接映射方式。踪迹信息表深度为512,等于指令Cache的行数;踪迹信息表位宽为1bit,其值为“1”表示对应行的踪迹信息位有效,其值为“0”表示对应行的踪迹信息位无效。具体的指令代码如图4所示。Assume that the instruction cache capacity is 8KB, the block size is 16B, and the direct mapping method is adopted. The depth of the trace information table is 512, which is equal to the number of lines of the instruction cache; the bit width of the trace information table is 1 bit, and its value "1" means that the trace information bit of the corresponding line is valid, and its value of "0" means the trace information bit of the corresponding line invalid. The specific instruction code is shown in Figure 4.

踪迹信息维护电路中的第一寄存器和第二寄存器的初始值都为0,踪迹信息表的初始值为全0。The initial values of the first register and the second register in the trace information maintenance circuit are both 0, and the initial value of the trace information table is all 0.

当程序执行到0x00000080处的分支指令时,由于取值地址溢出,踪迹信息维护电路会将该分支指令的分支目标地址0x00000090写入第一寄存器中,同时将该分支目标地址与指令Cache的容量值之和(0x00000090+0x2000=0x00002090)写入第二寄存器中。第一寄存器和第二寄存器的值分别为段首地址和段尾地址,即表示现在开始执行地址处于0x00000090到0x00002090之间的程序段。由于是第一次执行该分支指令,因此处理器内核读取0x00000090处的指令时会出现Cache缺失,控制电路根据取指地址从主存储器中读取指令,并且将从主存储器中返回的指令写入指令Cache,同时将对应行的踪迹信息位设置为1。在接下来的取指过程中,若根据取指地址中的索引位读出的踪迹信息位为1,则控制电路关闭标志存储器,直接从数据存储器中读取指令;若根据取指地址中的索引位读出的踪迹信息位为0,则需要访问标志存储器来判断指令Cache是否命中。如果指令Cache命中,则控制电路从数据存储器中读取指令,并且在读取的指令返回给处理器内核的同时将对应行的踪迹信息位设置为1;如果指令Cache缺失,则控制电路从主存储器中读取指令,并且将读取的指令写入指令Cache中,同时将对应行的踪迹信息位设置为1。When the program executes to the branch instruction at 0x00000080, due to the value address overflow, the trace information maintenance circuit will write the branch target address 0x00000090 of the branch instruction into the first register, and at the same time combine the branch target address with the capacity value of the instruction cache The sum (0x00000090+0x2000=0x00002090) is written into the second register. The values of the first register and the second register are the segment head address and the segment end address respectively, which means that the program segment whose address is between 0x00000090 and 0x00002090 is started to be executed now. Since this branch instruction is executed for the first time, a cache miss will occur when the processor core reads the instruction at 0x00000090, and the control circuit reads the instruction from the main memory according to the instruction fetch address, and writes the instruction returned from the main memory to Enter the instruction Cache, and set the trace information bit of the corresponding row to 1. In the next instruction fetching process, if the trace information bit read according to the index bit in the instruction fetch address is 1, the control circuit closes the flag memory and reads the instruction directly from the data memory; If the trace information bit read by the index bit is 0, it is necessary to access the flag memory to determine whether the instruction Cache hits. If the instruction cache hits, the control circuit reads the instruction from the data memory, and the trace information bit of the corresponding line is set to 1 when the read instruction returns to the processor core; if the instruction cache misses, the control circuit reads the instruction from the main The instruction is read from the memory, and the read instruction is written into the instruction cache, and at the same time, the trace information bit of the corresponding row is set to 1.

当程序执行到0x00002090处的指令时,该指令的取指地址与第二寄存器的值相等。这时,第三比较单元输出的顺序下溢信号为1,或门输出的溢出控制信号为1。控制电路根据有效的溢出控制信号清除踪迹信息表,并将第一寄存器和第二寄存器清零。When the program executes to the instruction at 0x00002090, the fetch address of the instruction is equal to the value of the second register. At this time, the sequence underflow signal output by the third comparison unit is 1, and the overflow control signal output by the OR gate is 1. The control circuit clears the trace information table according to the valid overflow control signal, and clears the first register and the second register to zero.

当程序执行到0x00002190处的分支指令时,由于取指地址溢出,踪迹信息维护电路会将该分支指令的分支目标地址0x00004100写入第一寄存器中,同时将该分支目标地址与指令Cache的容量值之和(0x00004100+0x2000=0x00006100)写入第二寄存器中。在接下来的取指过程中,若根据取指地址中的索引位读出的踪迹信息位为1,则控制电路关闭标志存储器,直接从数据存储器中读取指令;若根据取指地址中的索引位读出的踪迹信息位为0,则需要访问标志存储器来判断指令Cache是否命中。如果指令Cache命中,则控制电路从数据存储器中读取指令,并且在读取的指令返回给处理器内核的同时将对应行的踪迹信息位设置为1;如果指令Cache缺失,则控制电路从主存储器中读取指令,并且将读取的指令写入指令Cache中,同时将对应行的踪迹信息位设置为1。When the program executes to the branch instruction at 0x00002190, due to overflow of the instruction fetch address, the trace information maintenance circuit will write the branch target address 0x00004100 of the branch instruction into the first register, and at the same time combine the branch target address with the capacity value of the instruction cache The sum (0x00004100+0x2000=0x00006100) is written into the second register. In the next instruction fetching process, if the trace information bit read according to the index bit in the instruction fetch address is 1, the control circuit closes the flag memory and reads the instruction directly from the data memory; If the trace information bit read by the index bit is 0, it is necessary to access the flag memory to determine whether the instruction Cache hits. If the instruction cache hits, the control circuit reads the instruction from the data memory, and the trace information bit of the corresponding line is set to 1 when the read instruction returns to the processor core; if the instruction cache misses, the control circuit reads the instruction from the main The instruction is read from the memory, and the read instruction is written into the instruction cache, and at the same time, the trace information bit of the corresponding line is set to 1.

当程序执行到0x00004200处的分支指令时,该分支指令的分支目标地址0x00006200大于第二寄存器的值。这时,第二比较单元输出的分支下溢信号为1,或门输出的溢出控制信号为1。控制电路根据有效的溢出控制信号清除踪迹信息表,并将0x00006200写入第一寄存器中,同时将(0x00006200+0x2000=0x00008200)写入第二寄存器中。在接下来的取指过程中,若根据取指地址中的索引位读出的踪迹信息位为1,则控制电路关闭标志存储器,直接从数据存储器中读取指令;若根据取指地址中的索引位读出的踪迹信息位为0,则需要访问标志存储器来判断指令Cache是否命中。如果指令Cache命中,则控制电路从数据存储器中读取指令,并且在读取的指令返回给处理器内核的同时将对应行的踪迹信息位设置为1;如果指令Cache缺失,则控制电路从主存储器中读取指令,并且将读取的指令写入指令Cache中,同时将对应行的踪迹信息位设置为1。When the program executes to the branch instruction at 0x00004200, the branch target address 0x00006200 of the branch instruction is greater than the value of the second register. At this time, the branch underflow signal output by the second comparison unit is 1, and the overflow control signal output by the OR gate is 1. The control circuit clears the trace information table according to the effective overflow control signal, writes 0x00006200 into the first register, and simultaneously writes (0x00006200+0x2000=0x00008200) into the second register. In the next instruction fetching process, if the trace information bit read according to the index bit in the instruction fetch address is 1, the control circuit closes the flag memory and reads the instruction directly from the data memory; If the trace information bit read by the index bit is 0, it is necessary to access the flag memory to determine whether the instruction Cache hits. If the instruction cache hits, the control circuit reads the instruction from the data memory, and the trace information bit of the corresponding line is set to 1 when the read instruction returns to the processor core; if the instruction cache misses, the control circuit reads the instruction from the main The instruction is read from the memory, and the read instruction is written into the instruction cache, and at the same time, the trace information bit of the corresponding row is set to 1.

当程序执行到0x00006260处的分支指令时,该分支指令的分支目标地址0x00004100小于第一寄存器的值。这时,第一比较单元输出的上溢信号为1,或门输出的溢出控制信号为1,控制电路根据有效的溢出控制信号清除踪迹信息表,并将0x00004100写入第一寄存器中,同时将(0x00004100+0x2000=0x00006100)写入第二寄存器中。在接下来的取指过程中,若根据取指地址中的索引位读出的踪迹信息位为1,则控制电路关闭标志存储器,直接从数据存储器中读取指令;若根据取指地址中的索引位读出的踪迹信息位为0,则需要访问标志存储器来判断指令Cache是否命中。如果指令Cache命中,则控制电路从数据存储器中读取指令,并且在读取的指令返回给处理器内核的同时将对应行的踪迹信息位设置为1;如果指令Cache缺失,则控制电路从主存储器中读取指令,并且将读取的指令写入指令Cache中,同时将对应行的踪迹信息位设置为1。接下来,当取指地址不处于踪迹信息维护电路中的程序段地址范围之内时,控制电路根据溢出控制信号清除踪迹信息表,并修改第一寄存器和第二寄存器的值,以确保踪迹信息维护电路中的程序段地址范围始终与踪迹信息表保持一个正确的对应关系。When the program executes to the branch instruction at 0x00006260, the branch target address 0x00004100 of the branch instruction is smaller than the value of the first register. At this time, the overflow signal output by the first comparison unit is 1, and the overflow control signal output by the OR gate is 1, and the control circuit clears the trace information table according to the effective overflow control signal, and writes 0x00004100 into the first register, and simultaneously (0x00004100+0x2000=0x00006100) is written into the second register. In the next instruction fetching process, if the trace information bit read according to the index bit in the instruction fetch address is 1, the control circuit closes the flag memory and reads the instruction directly from the data memory; If the trace information bit read by the index bit is 0, it is necessary to access the flag memory to determine whether the instruction Cache hits. If the instruction cache hits, the control circuit reads the instruction from the data memory, and the trace information bit of the corresponding line is set to 1 when the read instruction returns to the processor core; if the instruction cache misses, the control circuit reads the instruction from the main The instruction is read from the memory, and the read instruction is written into the instruction cache, and at the same time, the trace information bit of the corresponding row is set to 1. Next, when the instruction fetch address is not within the address range of the program segment in the trace information maintenance circuit, the control circuit clears the trace information table according to the overflow control signal, and modifies the values of the first register and the second register to ensure that the trace information Maintain a correct correspondence between the program segment address range in the maintenance circuit and the trace information table.

通过上面的例子可以发现本发明使用踪迹信息位提前对指令Cache进行命中检测,减少了不必要的标志存储器访问,从而有效降低了指令Cache的功耗。From the above example, it can be found that the present invention uses the trace information bit to perform hit detection on the instruction cache in advance, reducing unnecessary flag memory access, thereby effectively reducing the power consumption of the instruction cache.

专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals should further realize that the units and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the relationship between hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. Protection scope, within the spirit and principles of the present invention, any modification, equivalent replacement, improvement, etc., shall be included in the protection scope of the present invention.

Claims (10)

1.一种基于标志位访问踪迹的指令高速缓冲存储器,包括踪迹信息维护电路、踪迹信息表、控制电路、标志存储器和数据存储器,其中:1. A kind of instruction cache memory based on flag bit access trace, comprises trace information maintenance circuit, trace information table, control circuit, flag memory and data memory, wherein: 所述踪迹信息表的行数分别与所述标志存储器和所述数据存储器的行数相等,所述踪迹信息表的每一行用于存储一个踪迹信息位,所述踪迹信息位的有效与否分别表示是否存在对所述标志存储器的对应行的访问踪迹;The number of rows of the trace information table is respectively equal to the number of rows of the flag memory and the data memory, and each row of the trace information table is used to store a trace information bit, and the validity of the trace information bit is respectively Indicates whether there is an access trace to the corresponding row of the flag memory; 所述踪迹信息维护电路用于根据输入的分支方向、分支目标地址、取指地址以及所述踪迹信息维护电路中的程序段地址范围来输出溢出控制信号,所述溢出控制信号的有效与否分别表示所述取指地址或所述分支目标地址是否处于所述程序段地址范围之内;The trace information maintenance circuit is used to output the overflow control signal according to the input branch direction, branch target address, instruction fetch address and program segment address range in the trace information maintenance circuit, and whether the overflow control signal is valid or not is respectively Indicates whether the instruction fetch address or the branch target address is within the address range of the program segment; 控制电路,用于根据所述踪迹信息位来控制对所述标志存储器的读取,并且用于根据所述溢出控制信号对所述踪迹信息表进行维护。A control circuit, configured to control reading of the flag memory according to the trace information bit, and to maintain the trace information table according to the overflow control signal. 2.根据权利要求1所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述踪迹信息维护电路包括:2. The instruction cache based on the flag bit access trace according to claim 1, wherein the trace information maintenance circuit comprises: 控制寄存器,用于存储所述程序段地址范围的段首地址和段尾地址;The control register is used to store the segment head address and segment tail address of the address range of the program segment; 比较单元,用于根据所述分支方向、所述分支目标地址、所述取指地址和所述程序段地址范围输出分支上溢信号、分支下溢信号和顺序下溢信号;a comparison unit, configured to output a branch overflow signal, a branch underflow signal and a sequence underflow signal according to the branch direction, the branch target address, the instruction fetch address and the address range of the program segment; 或门,用于根据所述分支上溢信号、分支下溢信号和顺序下溢信号输出所述溢出控制信号。The OR gate is used for outputting the overflow control signal according to the branch overflow signal, the branch underflow signal and the sequence underflow signal. 3.根据权利要求2所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述控制寄存器包括:3. The instruction cache based on the flag bit access trace according to claim 2, wherein the control register comprises: 第一寄存器,用于存储所述程序段地址范围的段首地址;The first register is used to store the segment head address of the address range of the program segment; 第二寄存器,用于存储所述程序段地址范围的段尾地址。The second register is used for storing the end address of the address range of the program segment. 4.根据权利要求2所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述比较单元包括:4. The instruction cache memory based on the flag bit access trace according to claim 2, wherein the comparison unit comprises: 第一比较单元,其通过将所述分支目标地址与所述段首地址进行比较,输出所述分支上溢信号;a first comparison unit that outputs the branch overflow signal by comparing the branch target address with the segment head address; 第二比较单元,其通过将所述分支目标地址与所述段尾地址进行比较,输出所述分支下溢信号;a second comparison unit that outputs the branch underflow signal by comparing the branch target address with the segment tail address; 第三比较单元,其通过将所述取指地址与所述段尾地址进行比较,输出所述顺序下溢信号。A third comparing unit, which compares the instruction fetch address with the end-of-segment address, and outputs the sequence underflow signal. 5.根据权利要求1所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述踪迹信息位有效,所述控制电路被配置用于:5. The instruction cache based on flag bit access trace according to claim 1, wherein the trace information bit is effective, and the control circuit is configured to: 禁止对所述标志存储器进行读取,并且利用所述取指地址从所述数据存储器中读取指令。Reading of the flag memory is prohibited, and an instruction is read from the data memory by using the instruction fetch address. 6.根据权利要求2所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述溢出控制信号有效,所述控制电路还被配置用于:6. The instruction cache memory based on the flag bit access trace according to claim 2, wherein the overflow control signal is effective, and the control circuit is also configured to: 在所述分支上溢信号或所述分支下溢信号有效的情况下,清除所述踪迹信息表中的内容,并将所述分支目标地址作为所述段首地址存入所述第一寄存器中,同时将所述分支目标地址与指令高速缓冲存储器的容量值之和作为所述段尾地址存入所述第二寄存器中,所述容量值以字节为单位表示;When the branch overflow signal or the branch underflow signal is valid, clear the content in the trace information table, and store the branch target address in the first register as the segment header address , simultaneously storing the sum of the branch target address and the capacity value of the instruction cache memory as the segment tail address into the second register, the capacity value expressed in bytes; 在所述顺序下溢信号有效的情况下,清除所述踪迹信息表中的内容,并且将所述第一寄存器和所述第二寄存器清零。When the sequential underflow signal is valid, clear the content in the trace information table, and clear the first register and the second register to zero. 7.根据权利要求4所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述分支方向用于指示分支指令是后向分支指令还是前向分支指令,7. The instruction cache memory based on the flag bit access trace according to claim 4, wherein the branch direction is used to indicate whether the branch instruction is a backward branch instruction or a forward branch instruction, 在所述分支方向指示分支指令是后向分支指令的情况下,所述第一比较单元工作,所述控制电路关闭第三比较单元;When the branch direction indicates that the branch instruction is a backward branch instruction, the first comparison unit works, and the control circuit turns off the third comparison unit; 在所述分支方向指示分支指令是前向分支指令的情况下,所述第二比较单元工作;In the case where the branch direction indicates that the branch instruction is a forward branch instruction, the second comparison unit works; 在所述分支方向指示分支指令是前向分支指令或者分支指令执行失败的情况下,所述控制电路启动所述第三比较单元。If the branch direction indicates that the branch instruction is a forward branch instruction or the execution of the branch instruction fails, the control circuit activates the third comparison unit. 8.根据权利要求1所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述踪迹信息位无效,所述控制电路还被配置用于:8. The instruction cache based on flag bit access trace according to claim 1, wherein the trace information bit is invalid, and the control circuit is further configured to: 从所述数据存储器或主存储器中读取指令并将其返回给处理器内核;reading instructions from said data store or main memory and returning them to a processor core; 在读取的指令返回给处理器内核时,将所述踪迹信息表中对应行的所述踪迹信息位设置为有效。When the read instruction is returned to the processor core, the trace information bit of the corresponding row in the trace information table is set to valid. 9.根据权利要求1所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述踪迹信息位无效,所述控制电路还被配置用于:9. The instruction cache memory based on flag bit access trace according to claim 1, wherein the trace information bit is invalid, and the control circuit is further configured to: 利用所述取指地址从所述标志存储器中读取标志位;reading a flag bit from the flag memory by using the instruction fetch address; 判断读取的标志位与所述取指地址中的标志位是否匹配;judging whether the flag bit read matches the flag bit in the fetch address; 在匹配的情况下,利用所述取指地址从所述数据存储器的对应行中读取指令;In the case of a match, using the instruction fetch address to read an instruction from a corresponding row of the data memory; 在不匹配的情况下,利用所述取指地址从主存储器中读取指令,并且将读取的指令写入所述数据存储器的对应行。In the case of a mismatch, an instruction is read from the main memory using the instruction fetch address, and the read instruction is written into a corresponding row of the data memory. 10.根据权利要求1所述的基于标志位访问踪迹的指令高速缓冲存储器,其中,所述控制电路还被配置用于:10. The instruction cache memory based on flag bit access trace according to claim 1, wherein the control circuit is further configured to: 根据所述取指地址从所述踪迹信息表的对应行中读取所述踪迹信息位,以确定是否存在对所述标志存储器的对应行的访问踪迹。Reading the trace information bit from a corresponding row of the trace information table according to the instruction fetch address to determine whether there is an access trace to the corresponding row of the flag memory.
CN201310159643.6A 2013-05-03 2013-05-03 A kind of instruction cache based on zone bit access trace Expired - Fee Related CN103257850B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310159643.6A CN103257850B (en) 2013-05-03 2013-05-03 A kind of instruction cache based on zone bit access trace

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310159643.6A CN103257850B (en) 2013-05-03 2013-05-03 A kind of instruction cache based on zone bit access trace

Publications (2)

Publication Number Publication Date
CN103257850A true CN103257850A (en) 2013-08-21
CN103257850B CN103257850B (en) 2015-10-07

Family

ID=48961789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310159643.6A Expired - Fee Related CN103257850B (en) 2013-05-03 2013-05-03 A kind of instruction cache based on zone bit access trace

Country Status (1)

Country Link
CN (1) CN103257850B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765698A (en) * 2015-03-17 2015-07-08 中国科学院声学研究所 High-speed buffer memory and road predicating method
US9354885B1 (en) 2016-01-08 2016-05-31 International Business Machines Corporation Selective suppression of instruction cache-related directory access
CN105677583A (en) * 2015-12-31 2016-06-15 华为技术有限公司 Cache management method and device
CN105868126A (en) * 2016-03-23 2016-08-17 中国电子科技集团公司第三十八研究所 Apparatus and method for improving hit rate of instruction cache
US9898296B2 (en) 2016-01-08 2018-02-20 International Business Machines Corporation Selective suppression of instruction translation lookaside buffer (ITLB) access

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5699551A (en) * 1989-12-01 1997-12-16 Silicon Graphics, Inc. Software invalidation in a multiple level, multiple cache system
WO1999032980A1 (en) * 1997-12-19 1999-07-01 Sun Microsystems, Inc. Cache with reduced tag information storage
CN1445661A (en) * 2003-04-21 2003-10-01 杭州中天微系统有限公司 Control logic for lowering power consumption of cache instructions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5699551A (en) * 1989-12-01 1997-12-16 Silicon Graphics, Inc. Software invalidation in a multiple level, multiple cache system
WO1999032980A1 (en) * 1997-12-19 1999-07-01 Sun Microsystems, Inc. Cache with reduced tag information storage
CN1445661A (en) * 2003-04-21 2003-10-01 杭州中天微系统有限公司 Control logic for lowering power consumption of cache instructions

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LI QUANQUAN等: "Low Power Optimization of Instruction Cache Baesd on Tag Check Reduction", 《SOLID-STATE AND INTEGRATED CIRCUIT TECHNOLOGY (ICSICT), 2012 IEEE 11TH INTERNATIONAL CONFERENCE ON》, 1 November 2012 (2012-11-01), pages 1 - 3 *
龚帅帅等: "基于历史链接关系的指令高速缓存低功耗方法", 《浙江大学学报》, vol. 45, no. 3, 15 March 2011 (2011-03-15), pages 467 - 502 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765698B (en) * 2015-03-17 2018-02-13 中国科学院声学研究所 A kind of cache memory and road Forecasting Methodology
CN104765698A (en) * 2015-03-17 2015-07-08 中国科学院声学研究所 High-speed buffer memory and road predicating method
US10482027B2 (en) 2015-12-31 2019-11-19 Huawei Technologies Co., Ltd. Cache management method and apparatus
CN105677583A (en) * 2015-12-31 2016-06-15 华为技术有限公司 Cache management method and device
CN105677583B (en) * 2015-12-31 2019-01-08 华为技术有限公司 A kind of buffer memory management method and device
US10346169B2 (en) 2016-01-08 2019-07-09 International Business Machines Corporation Selective suppression of instruction cache-related directory access
US9898296B2 (en) 2016-01-08 2018-02-20 International Business Machines Corporation Selective suppression of instruction translation lookaside buffer (ITLB) access
US9851974B2 (en) 2016-01-08 2017-12-26 International Business Machines Corporation Selective suppression of instruction cache-related directory access
US9354885B1 (en) 2016-01-08 2016-05-31 International Business Machines Corporation Selective suppression of instruction cache-related directory access
US10592249B2 (en) 2016-01-08 2020-03-17 International Business Machines Corporation Selective suppression of instruction translation lookaside buffer (ITLB) access
US11144320B2 (en) 2016-01-08 2021-10-12 International Business Machines Corporation Selective suppression of instruction cache-related directory access
US11194580B2 (en) 2016-01-08 2021-12-07 International Business Machines Corporation Selective suppression of instruction translation lookaside buffer (ITLB) access
CN105868126B (en) * 2016-03-23 2018-09-18 中国电子科技集团公司第三十八研究所 A kind of device and method improving instruction-cache hit rate
CN105868126A (en) * 2016-03-23 2016-08-17 中国电子科技集团公司第三十八研究所 Apparatus and method for improving hit rate of instruction cache

Also Published As

Publication number Publication date
CN103257850B (en) 2015-10-07

Similar Documents

Publication Publication Date Title
CN102662868B (en) For the treatment of dynamic group associative cache device and the access method thereof of device
US9697140B2 (en) Encryption integrity check with CRC encryption in memory using a word count- and address-derived nonce
CN101694613B (en) Unaligned memory access prediction
US9396117B2 (en) Instruction cache power reduction
US20140208075A1 (en) Systems and method for unblocking a pipeline with spontaneous load deferral and conversion to prefetch
US20140019823A1 (en) Content-aware caches for reliability
US20150186278A1 (en) Runtime persistence
CN103257850B (en) A kind of instruction cache based on zone bit access trace
CN103019959B (en) A kind of instruction cache
TWI382426B (en) System and method for predicting cache access
US8631207B2 (en) Cache memory power reduction techniques
KR102268601B1 (en) Processor for data forwarding, operation method thereof and system including the same
CN104834483A (en) Implementing method for improving property of embedded MCU (microprogrammed control unit)
US11847053B2 (en) Apparatuses, methods, and systems for a duplication resistant on-die irregular data prefetcher
CN105095104A (en) Method and device for data caching processing
CN100370440C (en) Processor system and data manipulation method thereof
US6823430B2 (en) Directoryless L0 cache for stall reduction
CN110737612A (en) A processor with in-memory computing
CN104424132B (en) High performance instruction cache system and method
Bardizbanyan et al. Speculative tag access for reduced energy dissipation in set-associative L1 data caches
CN100428200C (en) A realization method of on-chip instruction cache
CN111209043B (en) Method for realizing instruction prefetching in front-end pipeline by using look-ahead pointer method
CN105786758B (en) A processor device with data cache function
CN104765698B (en) A kind of cache memory and road Forecasting Methodology
CN102789428B (en) Instruction cache device and control method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151007

Termination date: 20200503

CF01 Termination of patent right due to non-payment of annual fee