CN108255744A - 一种全相联指令Cache - Google Patents

一种全相联指令Cache Download PDF

Info

Publication number
CN108255744A
CN108255744A CN201711281037.6A CN201711281037A CN108255744A CN 108255744 A CN108255744 A CN 108255744A CN 201711281037 A CN201711281037 A CN 201711281037A CN 108255744 A CN108255744 A CN 108255744A
Authority
CN
China
Prior art keywords
address
cache
control module
memory
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711281037.6A
Other languages
English (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.)
Xian Aeronautics Computing Technique Research Institute of AVIC
Original Assignee
Xian Aeronautics Computing Technique Research Institute of AVIC
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 Xian Aeronautics Computing Technique Research Institute of AVIC filed Critical Xian Aeronautics Computing Technique Research Institute of AVIC
Priority to CN201711281037.6A priority Critical patent/CN108255744A/zh
Publication of CN108255744A publication Critical patent/CN108255744A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • G06F12/0884Parallel mode, e.g. in parallel with main memory or CPU
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/123Replacement control using replacement algorithms with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list

Abstract

本发明涉及计算机硬件技术领域,公开了一种全相联指令Cache,包含:标签控制模块1,将取指地址与标签控制模块1保存的地址进行比较,若命中,则直接从存储器模块3相应地址中取出指令数据,返回给请求发起方;如果未命中,则对未命中Cache的取指请求进行缓存,并发起向内存的取指请求,待内存返回数据后,结合PLRU算法模块2产生的更新地址,更新存储器模块3相应地址中保存的指令数据,而后,标签控制模块1对缓存的未命中请求进行第二次比较;PLRU算法模块2,利用标签控制模块1将最长时间内没有被访问的Cache块地址作为更新地址返回给标签控制模块1;存储器模块3,用于保存内存映射到Cache中的指令数据。

Description

一种全相联指令Cache
技术领域
本发明涉及计算机硬件技术领域,尤其涉及一种全相联指令Cache。
背景技术
随着计算机系统的迅速发展,现代计算机系统越来越受主存储器性能的限制。处理器的性能以每年60%的速度在增长,而主存储器芯片带宽仅仅以每年10%的速度在增长。在速度方面,主存储器和处理器一直保持了大约一个数量级的差距。由于CPU和存储器的速度差距越来越大,于是出现了Cache,存在于CPU与主存之间,他的存取速度接近于CPU速度,但是容量小,价格高昂。
Cache的出现是一种无奈的妥协,也成为了影响系统性能的关键因素之一。如今嵌入式系统正成为计算机工业中的重要组成部分,在汽车电子、音视频处理、工业自动化等领域都有着广泛的应用。嵌入式系统的一个重要特征就是它的实时性,需要对数据进行实时的传输和处理,因此对于cache结构的组织和设计也有着更高的要求。如果一次访存的数据在cache中命中,那么只需要1或2个处理器周期就能够得到数据;但如果所需要的数据不在cache中,那么往往需要高一个数量级的处理器周期来得到数据。
所以,设计实现高性能指令Cache,提升Cache命中率有着深远意义。
发明内容
本发明公开了一种全相联指令Cache,不但能够显著提升Cache命中效率,还能在保证性能的情况下,简化指令Cache设计难度。
本发明的技术解决方案是:
一种全相联指令Cache,包含标签控制模块1、PLRU算法模块2和存储器模块3,
标签控制模块1,将取指地址与标签控制模块1内的标签寄存器中保存的地址进行比较,若命中,则直接从存储器模块3相应地址中取出指令数据,返回给请求发起方;如果未命中,则对未命中Cache的取指请求进行缓存,并发起向内存的取指请求,待内存返回数据后,结合PLRU算法模块2产生的更新地址,更新存储器模块3相应地址中保存的指令数据,而后,标签控制模块1对缓存的未命中请求进行第二次比较,若命中,则直接从存储器模块3相应地址中取出指令数据,返回给请求发起方;如果未命中,则发起向内存的取指请求,待内存返回数据后,标签控制模块1返回指令给请求发起方;
PLRU算法模块2,利用来自标签控制模块1对取指地址命中与否的判断情况来预测未来的数据使用情况,将最长时间内没有被访问的Cache块地址作为更新地址返回给标签控制模块1;
存储器模块3,用于保存内存映射到Cache中的指令数据。
全相联指令Cache采用全相联的地址映射方式。
本发明的技术效果是:
通常来讲,已有的指令Cache设计实现方案多是通过增大Cache的容量或者优化替换算法等以减小Cache的缺失率。考虑到Cache容量增加带来的成本问题,以及指令Cache在整个处理器运行中所处的重要地位,本发明通过优化替换算法、优化标签控制逻辑、采用全相联的地址映射方式,实现了在不增加Cache容量的前提下提升性能,不仅有利于控制成本,还一定程度上降低了设计难度。
附图说明
图1是本发明结构示意图。
图2是本发明一种全相联指令Cache的设计实现结构图。
具体实施方式
下面结合附图和具体实施例,对本发明的技术方案进行清楚、完整地表述。显然,所表述的实施例仅是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提所获得的所有其它实施例,都属于本发明的保护范围。
一种全相联指令Cache,如图1所示,包含标签控制模块1、PLRU算法模块2和存储器模块3,
标签控制模块1,将取指地址与标签控制模块1内的标签寄存器中保存的地址进行比较,若命中,则直接从存储器模块3相应地址中取出指令数据,返回给请求发起方;如果未命中,则对未命中Cache的取指请求进行缓存,并发起向内存的取指请求,待内存返回数据后,结合PLRU算法模块2产生的更新地址,更新存储器模块3相应地址中保存的指令数据,而后,标签控制模块1对缓存的未命中请求进行第二次比较,若命中,则直接从存储器模块3相应地址中取出指令数据,返回给请求发起方;如果未命中,则发起向内存的取指请求,待内存返回数据后,标签控制模块1返回指令给请求发起方;这种两次比较的策略,增加了命中概率,提升了Cache性能。
PLRU算法模块2,利用来自标签控制模块1对取指地址命中与否的判断情况来预测未来的数据使用情况,将最长时间内没有被访问的Cache块地址作为更新地址返回给标签控制模块1。相较于LRU算法,PLRU预测算法相对简单,但几乎不影响Cache缺失率,大大简化了设计复杂度。
存储器模块3,用于保存内存映射到Cache中的指令数据。
全相联指令Cache采用全相联的地址映射方式。可以让主存中任何一个块都能映射到Cache中任何一个块的位置上。这种映射方式比较灵活,Cache块冲突概率最低、空间利用率最高。
实施例
如图2所示,当指令Cache接收到取指请求,标签控制模块1会将取指地址与标签寄存器中存放的地址相比较,如若命中,则直接从存储器模块3中取出指令,返回给上一级。如若未命中,则将此次取指请求缓存下来,紧接着标签控制模块1发起对主存的读操作,待主存响应并且返回数据后,先根据PLRU模块产生的替换地址,更新相应Cache块中的内容,以及相应的标签寄存器。然后在将缓存的指令进行一次比较,此时命中,从存储器中取出指令数据,返回给上一级。
而对于PLRU模块,通过使用MRU(most recently used)位,组中每个cache块都有自己的MRU位,对组中任何一个cache块的访问都将对应的MRU位设为1,而当需要进行cache替换时,选择MRU位为零且索引地址最低的块进行更新。
最后应说明的是,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解;其依然可以对前述各实施例记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (2)

1.一种全相联指令Cache,其特征在于:包含标签控制模块(1)、PLRU算法模块(2)和存储器模块(3),
标签控制模块(1),将取指地址与标签控制模块(1)内的标签寄存器中保存的地址进行比较,若命中,则直接从存储器模块(3)相应地址中取出指令数据,返回给请求发起方;如果未命中,则对未命中Cache的取指请求进行缓存,并发起向内存的取指请求,待内存返回数据后,结合PLRU算法模块(2)产生的更新地址,更新存储器模块(3)相应地址中保存的指令数据,而后,标签控制模块(1)对缓存的未命中请求进行第二次比较,若命中,则直接从存储器模块(3)相应地址中取出指令数据,返回给请求发起方;如果未命中,则发起向内存的取指请求,待内存返回数据后,标签控制模块(1)返回指令给请求发起方;
PLRU算法模块(2),利用来自标签控制模块(1)对取指地址命中与否的判断情况来预测未来的数据使用情况,将最长时间内没有被访问的Cache块地址作为更新地址返回给标签控制模块(1);
存储器模块(3),用于保存内存映射到Cache中的指令数据。
2.根据权利要求1所述的全相联指令Cache,其特征在于:全相联指令Cache采用全相联的地址映射方式。
CN201711281037.6A 2017-12-06 2017-12-06 一种全相联指令Cache Pending CN108255744A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711281037.6A CN108255744A (zh) 2017-12-06 2017-12-06 一种全相联指令Cache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711281037.6A CN108255744A (zh) 2017-12-06 2017-12-06 一种全相联指令Cache

Publications (1)

Publication Number Publication Date
CN108255744A true CN108255744A (zh) 2018-07-06

Family

ID=62722363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711281037.6A Pending CN108255744A (zh) 2017-12-06 2017-12-06 一种全相联指令Cache

Country Status (1)

Country Link
CN (1) CN108255744A (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189484A (zh) * 2018-08-03 2019-01-11 深圳忆联信息系统有限公司 一种快速启动固态硬盘的方法及其系统
CN111078592A (zh) * 2019-12-27 2020-04-28 无锡中感微电子股份有限公司 一种低功耗片上系统的多级指令缓存

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1882923A (zh) * 2003-11-18 2006-12-20 松下电器产业株式会社 高速缓冲存储器及其控制方法
CN102662860A (zh) * 2012-03-15 2012-09-12 天津国芯科技有限公司 用于进程切换的旁路转换缓冲器(tlb)及在其中地址匹配的方法
CN103488461A (zh) * 2012-06-12 2014-01-01 国际商业机器公司 使用快速索引树实现加速分支预测的系统和方法
US9064124B1 (en) * 2012-12-19 2015-06-23 Amazon Technologies, Inc. Distributed caching system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1882923A (zh) * 2003-11-18 2006-12-20 松下电器产业株式会社 高速缓冲存储器及其控制方法
CN102662860A (zh) * 2012-03-15 2012-09-12 天津国芯科技有限公司 用于进程切换的旁路转换缓冲器(tlb)及在其中地址匹配的方法
CN103488461A (zh) * 2012-06-12 2014-01-01 国际商业机器公司 使用快速索引树实现加速分支预测的系统和方法
US9064124B1 (en) * 2012-12-19 2015-06-23 Amazon Technologies, Inc. Distributed caching system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
温泉: "16位高性能CPU的Cache设计", 《中国优秀硕士论文电子期刊网 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189484A (zh) * 2018-08-03 2019-01-11 深圳忆联信息系统有限公司 一种快速启动固态硬盘的方法及其系统
CN111078592A (zh) * 2019-12-27 2020-04-28 无锡中感微电子股份有限公司 一种低功耗片上系统的多级指令缓存

Similar Documents

Publication Publication Date Title
US11314647B2 (en) Methods and systems for managing synonyms in virtually indexed physically tagged caches
US10268588B2 (en) Methods of cache preloading on a partition or a context switch
CN108132893A (zh) 一种支持流水的常量Cache
TWI684099B (zh) 剖析快取替代
US8095734B2 (en) Managing cache line allocations for multiple issue processors
US8583874B2 (en) Method and apparatus for caching prefetched data
US10007615B1 (en) Methods and apparatus for performing fast caching
US7020748B2 (en) Cache replacement policy to mitigate pollution in multicore processors
EP1532531A1 (en) Method and apparatus for multithreaded cache with simplified implementation of cache replacement policy
CN108459975B (zh) 用于有效使用地址转换缓存的技术
US10423534B2 (en) Cache memory
US20200065257A1 (en) Apparatus and method for performing address translation
CN113407119B (zh) 数据预取方法、数据预取装置、处理器
US6973547B2 (en) Coherence message prediction mechanism and multiprocessing computer system employing the same
WO2015004422A1 (en) Data store and method of allocating data to the data store
CN110389911A (zh) 一种设备内存管理单元的预取方法、装置及系统
WO2023055486A1 (en) Re-reference interval prediction (rrip) with pseudo-lru supplemental age information
US11151039B2 (en) Apparatus and method for maintaining cache coherence data for memory blocks of different size granularities using a snoop filter storage comprising an n-way set associative storage structure
CN108255744A (zh) 一种全相联指令Cache
US6643743B1 (en) Stream-down prefetching cache
JP2005509204A (ja) 下位レベルのキャッシュを含むアクセスを促進するためのリバースディレクトリ
KR20100005539A (ko) 캐시 메모리 시스템 및 캐시의 프리페칭 방법
US20110202727A1 (en) Apparatus and Methods to Reduce Duplicate Line Fills in a Victim Cache
US20010032297A1 (en) Cache memory apparatus and data processing system
US11494300B2 (en) Page table walker with page table entry (PTE) physical address prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180706

RJ01 Rejection of invention patent application after publication