[go: up one dir, main page]

CN116166186A - Cache controller based on dual-port Sram and working method - Google Patents

Cache controller based on dual-port Sram and working method Download PDF

Info

Publication number
CN116166186A
CN116166186A CN202211590058.7A CN202211590058A CN116166186A CN 116166186 A CN116166186 A CN 116166186A CN 202211590058 A CN202211590058 A CN 202211590058A CN 116166186 A CN116166186 A CN 116166186A
Authority
CN
China
Prior art keywords
data
read
cache controller
sram
address
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
CN202211590058.7A
Other languages
Chinese (zh)
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.)
China Key System and Integrated Circuit Co Ltd
Original Assignee
China Key System and Integrated Circuit Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Key System and Integrated Circuit Co Ltd filed Critical China Key System and Integrated Circuit Co Ltd
Priority to CN202211590058.7A priority Critical patent/CN116166186A/en
Publication of CN116166186A publication Critical patent/CN116166186A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明涉及一种基于双端口Sram的Cache控制器及工作方法,Cache控制器由双端口Sram及其相关控制电路组成,使用双端口Sram来缓存存储器的数据,读端口用于匹配处理器的读传输,写端口用于加载总线的读数据,两套端口互不影响;Cache控制器在从存储器载入数据的同时可继续匹配处理器的读操作地址,如果命中Sram或者Bus则可立即反馈数据;Cache控制器中的双端口Sram的宽度是总线宽度的2n倍数。本发明Cache控制器及工作方法,处理器可以通过双端口的Sram的读取端口继续访问命中的数据。因此加载操作和访问命中的数据之间互不干扰,用一定的逻辑面积来换取整个系统的效率。

Figure 202211590058

The invention relates to a dual-port Sram-based Cache controller and a working method thereof. The Cache controller is composed of a dual-port Sram and related control circuits. The dual-port Sram is used to cache data in the memory, and the read port is used to match the reading of the processor. The transmission and write ports are used to load the read data of the bus, and the two sets of ports do not affect each other; the Cache controller can continue to match the read operation address of the processor while loading data from the memory, and can immediately feedback the data if it hits the Sram or Bus ; The width of the dual-port Sram in the Cache controller is 2 n multiples of the bus width. According to the Cache controller and the working method of the present invention, the processor can continue to access the hit data through the reading port of the dual-port Sram. Therefore, there is no mutual interference between the loading operation and the access hit data, and a certain logic area is exchanged for the efficiency of the entire system.

Figure 202211590058

Description

一种基于双端口Sram的Cache控制器及工作方法A kind of Cache controller and working method based on dual-port SRAM

技术领域technical field

本发明涉及控制器领域,尤其是指一种基于双端口Sram的Cache控制器及工作方法。The invention relates to the field of controllers, in particular to a dual-port Sram-based Cache controller and a working method.

背景技术Background technique

在微控制器中,处理器的时钟频率相对于存储器来说比较快,一般有数倍到数十倍的差距。为了减少处理器读取数据的等待,提高系统执行效率,可在处理器和存储器之间增加一级Cache。Cache是基于Sram实现的存储器,容量相对于系统存储器小但是速度高很多,可以与处理器的频率相同。In microcontrollers, the clock frequency of the processor is faster than that of the memory, and there is generally a gap of several to tens of times. In order to reduce the processor's waiting for reading data and improve system execution efficiency, a level of Cache can be added between the processor and the memory. Cache is a memory implemented based on SRAM. Its capacity is smaller than that of system memory but its speed is much higher, which can be the same as the frequency of the processor.

当处理器读取数据时,如果在Cache中可以找到需要的数据,我们称之为命中(Hit)。反之没有找到数据,我们称之为缺失(Miss),这时候就需要控制器从外部存储器加载一小块数据(包含但不限于本次传输需要的数据),并且存放在Sram中,以便于处理器将来可以及时访问到。When the processor reads data, if the required data can be found in the Cache, we call it a hit (Hit). On the contrary, if no data is found, we call it missing (Miss). At this time, the controller needs to load a small piece of data (including but not limited to the data required for this transmission) from the external memory and store it in Sram for easy processing. The server can be accessed in time in the future.

而对于现有的Cache控制器,处理器得到当前访问地址的数据以后,Cache控制器可能处于数据加载阶段,此时Sram的端口被写入操作占用,处理器需要等到所有的数据全部加载完成以后才能继续下一个地址的访问。For the existing Cache controller, after the processor obtains the data of the current access address, the Cache controller may be in the data loading stage. At this time, the port of Sram is occupied by the write operation, and the processor needs to wait until all the data is loaded. In order to continue the visit to the next address.

发明内容Contents of the invention

为解决上述技术问题,本发明的一种基于双端口Sram的Cache控制器,Cache控制器由双端口Sram及其相关控制电路组成,使用双端口Sram来缓存存储器的数据,读端口用于匹配处理器的读传输,写端口用于加载总线的读数据,两套端口互不影响;Cache控制器在从存储器载入数据的同时可继续匹配处理器的读操作地址,如果命中Sram或者Bus则可立即反馈数据;Cache控制器中的双端口Sram的宽度是总线宽度的2n倍数,每次未命中的时候可从存储器载入2n个数据;Cache控制器可匹配Sram中的数据,或可匹配正在传输的总线上的数据。For solving the problems of the technologies described above, a kind of Cache controller based on dual-port Sram of the present invention, Cache controller is made up of dual-port Sram and relevant control circuit thereof, uses dual-port Sram to cache the data of storage memory, read port is used for matching processing The read and transfer of the device, the write port is used to load the read data of the bus, and the two sets of ports do not affect each other; the Cache controller can continue to match the read operation address of the processor while loading data from the memory. If it hits the Sram or Bus, it can Feedback data immediately; the width of the dual-port Sram in the Cache controller is 2 n multiples of the bus width, and each miss can load 2 n data from the memory; the Cache controller can match the data in the Sram, or can Match data on the bus being transmitted.

在本发明的一个实施例中,所述Sram包括TagSram和DataSram,其中的TagSram用于存储标志位,V(x)用0或者1来表示该条缓存中某个偏移地址的数据是否有效,V的位数可是2n个;T的值取自地址的高多位,位数的多少取决于Sram的容量,它可用来匹配以后的读地址;DataSram用于存储数据,其宽度可是Bus宽度的2n倍。In one embodiment of the present invention, the Sram includes TagSram and DataSram, wherein TagSram is used to store flag bits, and V(x) uses 0 or 1 to indicate whether the data of a certain offset address in the cache is valid, The number of digits of V can be 2 n ; the value of T is taken from the high-order digits of the address, and the number of digits depends on the capacity of Sram, which can be used to match the future read address; DataSram is used to store data, and its width can be Bus width 2 n times of .

在本发明还提供另外Cache控制器的工作方法,基于权利要求1-2所述双端口Sram的Cache控制器设计,其特征在于:包括如下步骤:The present invention also provides the working method of Cache controller in addition, based on the Cache controller design of dual-port Sram described in claim 1-2, it is characterized in that: comprise the steps:

步骤S1:处理器在总线上发起一次读传输,Cache控制器接收该请求,跳转到步骤S7;Step S1: The processor initiates a read transfer on the bus, the Cache controller receives the request, and jumps to step S7;

步骤S2:处理器可直接读取Sram里的数据并且跳转到步骤S1执行下一次读传输;Step S2: The processor can directly read the data in Sram and jump to step S1 to perform the next read transfer;

步骤S3:处理器可直接读取Bus上的数据并且跳转到步骤S1执行下一次读传输;Step S3: The processor can directly read the data on the Bus and jump to step S1 to perform the next read transfer;

步骤S4:等待总线加载工作完成然后跳转到步骤S8;Step S4: wait for the bus loading work to be completed and then jump to step S8;

步骤S5:处理器当前的读数据不存在Cache控制器中,控制器需要从存储器加载数据;若当前已经有加载的操作正在执行中,则跳转到步骤S4,如果没有则跳转到步骤S8;Step S5: The current read data of the processor does not exist in the Cache controller, and the controller needs to load data from the memory; if there is currently a loading operation being executed, then jump to step S4, if not, then jump to step S8 ;

步骤S6:Cache控制器匹配当前处理器的读地址以及当前总线正在加载的读地址,如果两者地址相同,则数据命中并跳转到步骤S3;如果未命中则跳转到步骤S5;Step S6: The Cache controller matches the read address of the current processor and the read address being loaded by the current bus. If the two addresses are the same, the data hits and jumps to step S3; if it does not hit, jumps to step S5;

步骤S7:Cache控制器通过地址高位来搜索TagSram,如果Sram中已经存在该地址对应的数据,则数据命中并跳转到步骤S2;如果未命中则跳转到步骤S6;Step S7: The Cache controller searches the TagSram through the high bit of the address. If the data corresponding to the address already exists in the Sram, the data hits and jumps to step S2; if it does not hit, jumps to step S6;

步骤S8:Cache控制器开始本次数据加载,把总线上读取的第一个数据反馈给处理器,并且跳转到步骤S1执行下一次读传输。Step S8: The Cache controller starts this data loading, feeds back the first data read on the bus to the processor, and jumps to step S1 to execute the next read transfer.

本发明的上述技术方案相比现有技术具有以下优点:本发明所述的Cache控制器及工作方法,通过使用双端口Sram,当Sram的写入端口被占用时,处理器可以通过Sram的读取端口继续访问命中的数据。因此加载操作和访问命中的数据之间互不干扰,用一定的逻辑面积来换取整个系统的效率。Compared with the prior art, the above-mentioned technical scheme of the present invention has the following advantages: the Cache controller and working method of the present invention, by using dual-port Sram, when the write port of Sram is occupied, the processor can pass the read port of Sram Take the port and continue to access the hit data. Therefore, there is no mutual interference between the loading operation and the access hit data, and a certain logic area is exchanged for the efficiency of the entire system.

附图说明Description of drawings

为了使本发明的内容更容易被清楚的理解,下面根据本发明的具体实施例并结合附图,对本发明作进一步详细的说明。In order to make the content of the present invention more clearly understood, the present invention will be further described in detail below according to the specific embodiments of the present invention and in conjunction with the accompanying drawings.

图1是本发明Cache控制器在系统中的拓扑示意图;Fig. 1 is the topological schematic diagram of the Cache controller in the system of the present invention;

图2是本发明所述Cache控制器中双端口Sram的存储示意图;Fig. 2 is the storage schematic diagram of dual-port Sram in the Cache controller of the present invention;

图3是本发明所述Cache控制器的工作流程图;Fig. 3 is the work flowchart of Cache controller of the present invention;

图4是本发明所述Cache控制器的一种时序图;Fig. 4 is a kind of sequence diagram of Cache controller of the present invention;

图5是本发明所述Cache控制器的另一时序图。FIG. 5 is another timing diagram of the Cache controller of the present invention.

具体实施方式Detailed ways

如图1所示,本实施例提供一种基于双端口Sram的Cache控制器,在处理器以及存储器中间增加一级Cache控制器,Cache控制器由双端口Sram及其相关控制电路组成,用于加速处理器的读取速度。As shown in Fig. 1, the present embodiment provides a kind of Cache controller based on dual-port Sram, adds a level of Cache controller in the middle of processor and memory, and Cache controller is made up of dual-port Sram and related control circuit thereof, is used for Accelerates the read speed of the processor.

如图2所示,为Cache控制器中TagSram和DataSram的存储示意图。TagSram用于存储标志位,V(x)用0或者1来表示该条缓存中某个偏移地址的数据是否有效,V的位数可以是2n(n=0,1,2,3等)个。T的值取自地址的高多位,位数的多少取决于Sram的容量,它可以用来匹配以后的读地址。DataSram用于存储数据,其宽度可以是Bus宽度的2n(n=0,1,2,3等)倍。As shown in FIG. 2, it is a storage diagram of TagSram and DataSram in the Cache controller. TagSram is used to store flag bits, V(x) uses 0 or 1 to indicate whether the data of a certain offset address in the cache is valid, and the number of bits of V can be 2 n (n=0, 1, 2, 3, etc. )indivual. The value of T is taken from the high-order bits of the address, and the number of bits depends on the capacity of Sram, which can be used to match future read addresses. The DataSram is used to store data, and its width can be 2 n (n=0, 1, 2, 3, etc.) times the width of the Bus.

如图3所示,为Cache控制器的工作流程图。As shown in FIG. 3 , it is a working flowchart of the Cache controller.

Cache控制器的工作方法,基于权利要求1-2所述双端口Sram的Cache控制器设计,其特征在于:包括如下步骤:The working method of Cache controller, based on the Cache controller design of dual-port Sram described in claim 1-2, is characterized in that: comprise the steps:

步骤S1:处理器在总线上发起一次读传输,Cache控制器接收该请求,跳转到步骤S7;Step S1: The processor initiates a read transfer on the bus, the Cache controller receives the request, and jumps to step S7;

步骤S2:处理器可直接读取Sram里的数据并且跳转到步骤S1执行下一次读传输;Step S2: The processor can directly read the data in Sram and jump to step S1 to perform the next read transfer;

步骤S3:处理器可直接读取Bus上的数据并且跳转到步骤S1执行下一次读传输;Step S3: The processor can directly read the data on the Bus and jump to step S1 to perform the next read transfer;

步骤S4:等待总线加载工作完成然后跳转到步骤S8;Step S4: wait for the bus loading work to be completed and then jump to step S8;

步骤S5:处理器当前的读数据不存在Cache控制器中,控制器需要从存储器加载数据;若当前已经有加载的操作正在执行中,则跳转到步骤S4,如果没有则跳转到步骤S8;Step S5: The current read data of the processor does not exist in the Cache controller, and the controller needs to load data from the memory; if there is currently a loading operation being executed, then jump to step S4, if not, then jump to step S8 ;

步骤S6:Cache控制器匹配当前处理器的读地址以及当前总线正在加载的读地址,如果两者地址相同,则数据命中并跳转到步骤S3;如果未命中则跳转到步骤S5;Step S6: The Cache controller matches the read address of the current processor and the read address being loaded by the current bus. If the two addresses are the same, the data hits and jumps to step S3; if it does not hit, jumps to step S5;

步骤S7:Cache控制器通过地址高位来搜索TagSram,如果Sram中已经存在该地址对应的数据,则数据命中并跳转到步骤S2;如果未命中则跳转到步骤S6;Step S7: The Cache controller searches the TagSram through the high bit of the address. If the data corresponding to the address already exists in the Sram, the data hits and jumps to step S2; if it does not hit, jumps to step S6;

步骤S8:Cache控制器开始本次数据加载,把总线上读取的第一个数据反馈给处理器,并且跳转到步骤S1执行下一次读传输。Step S8: The Cache controller starts this data loading, feeds back the first data read on the bus to the processor, and jumps to step S1 to execute the next read transfer.

图4、图5为Cache控制器的时序图,图中涉及的信号说明如下。Figure 4 and Figure 5 are timing diagrams of the Cache controller, and the signals involved in the diagrams are described as follows.

Clk:全局时钟信号。CoreAddr:处理器读地址;CoreRdata:处理器读取的数据。Clk: global clock signal. CoreAddr: Processor read address; CoreRdata: Processor read data.

符号Ax(y):表示处理器将要从地址为x,偏移地址为y读取数据。Symbol Ax(y): Indicates that the processor will read data from address x and offset address y.

HitSram:表示当前传输命中Sram,处理器从Sram中读取数据。TagSramAddr1:TagSram的读地址;TagSramRead:TagSram的读使能;TagSramDout:TagSram中读到的标签值。TagSram Addr2:TagSram的写地址;TagSramWrite:TagSram的写使能;TagSramDin:将要写入TagSram的标签值。HitSram: Indicates that the current transmission hits Sram, and the processor reads data from Sram. TagSramAddr1: Read address of TagSram; TagSramRead: Read enable of TagSram; TagSramDout: Tag value read in TagSram. TagSram Addr2: Write address of TagSram; TagSramWrite: Write enable of TagSram; TagSramDin: Tag value to be written into TagSram.

符号STx:表示从TagSram中读出的地址x的标签。Symbol STx: indicates the tag of address x read from TagSram.

DataSram的信号意义与TagSram类似。The signal meaning of DataSram is similar to that of TagSram.

符号SDx:表示从DataSram中读出的地址x的数据。Symbol SDx: indicates the data of address x read from DataSram.

HitBus:表示当前传输命中Bus,处理器从Bus上读取数据。BusAddr:当前加载操作的地址;BusRdata:当前加载操作的读数据。HitBus: Indicates that the current transmission hits the Bus, and the processor reads data from the Bus. BusAddr: the address of the current load operation; BusRdata: the read data of the current load operation.

符号BDx(y):表示从Bus上读取的地址为x,偏移地址为y的数据。Symbol BDx(y): Indicates that the address read from the Bus is x, and the data whose offset address is y.

如图4所示,第一次为处理器发起的地址为A1(1)并且命中Sram的读传输,第二次为处理器发起的地址为A2(2)并且未命中Sram的读传输。具体流程如下:As shown in FIG. 4 , the first read transfer initiated by the processor with the address A1(1) hits the Sram, and the second read transfer initiated by the processor with the address A2(2) misses the Sram. The specific process is as follows:

T1时刻,处理器发起的地址为A1(1)的读传输,同时从TagSram和DataSram中读取地址A1对应的标签和数据。At time T1, the processor initiates a read transfer with address A1(1), and simultaneously reads the tag and data corresponding to address A1 from TagSram and DataSram.

T2时刻,地址高位和标签ST1匹配并且V(1)有效,表示当前地址的数据已经存在于Sram中,HitSram信号拉高,处理器直接从DataSram中读取数据SD1(1)。At T2, the address high bit matches the label ST1 and V(1) is valid, indicating that the data at the current address already exists in the Sram, the HitSram signal is pulled high, and the processor directly reads the data SD1(1) from the DataSram.

T3时刻,处理器发起的地址为A2(2)的读传输,同时从TagSram和DataSram中读取地址A2对应的标签和数据。At time T3, the processor initiates a read transfer with address A2(2), and simultaneously reads the tag and data corresponding to address A2 from TagSram and DataSram.

T4时刻,地址高位和标签ST2不匹配或者V(2)无效,表示当前地址的数据不存在于Sram中,控制器需要从外部存储器加载包含当前所需数据的一块数据。At time T4, the address high bit does not match the label ST2 or V(2) is invalid, indicating that the data at the current address does not exist in the Sram, and the controller needs to load a piece of data containing the current required data from the external memory.

T5时刻,清除TagSram中A2地址的V,同时把当前传输的地址高位当作标签写入。在总线上发起BusAddr为A2(2)的读传输。At T5, clear the V of the A2 address in TagSram, and at the same time write the high bit of the currently transmitted address as a tag. Initiate a read transfer with BusAddr A2(2) on the bus.

T7时刻,处理器读取总线上读到的第一个数据BD2(2)。将V(2)写入TagSram中A2地址。将数据BD2(2)写入DataSram中A2(2)地址。在总线上发起BusAddr为A2(0)的读传输。At time T7, the processor reads the first data BD2(2) read on the bus. Write V(2) to address A2 in TagSram. Write data BD2(2) to address A2(2) in DataSram. Initiate a read transfer with BusAddr A2(0) on the bus.

T10时刻,将V(0)写入TagSram中A2地址。将数据BD2(0)写入DataSram中A2(0)地址。在总线上发起BusAddr为A2(1)的读传输。At time T10, write V(0) into address A2 in TagSram. Write data BD2(0) to address A2(0) in DataSram. Initiate a read transfer on the bus with BusAddr A2(1).

T11时刻,将V(1)写入TagSram中A2地址。将数据BD2(1)写入DataSram中A2(0)地址。在总线上发起BusAddr为A2(3)的读传输。At time T11, write V(1) into address A2 in TagSram. Write data BD2(1) to address A2(0) in DataSram. Initiate a read transfer with BusAddr A2(3) on the bus.

T12时刻,将V(3)写入TagSram中A2地址。将数据BD2(3)写入DataSram中A2(0)地址。At time T12, write V(3) into address A2 in TagSram. Write data BD2(3) to address A2(0) in DataSram.

如图5所示:第一次为处理器发起的地址为A2(2)并且未命中Sram的读传输,第二次为处理器发起的地址为A3(3)并且命中Sram的读传输,第三次为处理器发起的地址为A2(1)并且命中Bus的读传输。由于该过程中并行操作较多,描述会从两个角度去说明,分别是“处理器与Sram读端口”和“总线与Sram写端口”,具体流程如下:As shown in Figure 5: the first time is the read transfer initiated by the processor with the address A2(2) and misses the Sram, the second time is the read transfer initiated by the processor with the address A3(3) and hit the Sram, the second time is the read transfer initiated by the processor with the address A3(3) and hit the Sram Three read transfers initiated by the processor with the address A2(1) and hitting the Bus. Since there are many parallel operations in this process, the description will be explained from two perspectives, namely "processor and Sram read port" and "bus and Sram write port". The specific process is as follows:

T1时刻,T1 moment,

处理器与Sram读端口:处理器发起的地址为A2(2)的读传输,同时从TagSram和DataSram中读取地址A2对应的标签和数据。Processor and Sram read port: The processor initiates a read transfer with address A2(2), and reads the tag and data corresponding to address A2 from TagSram and DataSram at the same time.

总线与Sram写端口:空闲。Bus and Sram write port: idle.

T2时刻,T2 moment,

处理器与Sram读端口:地址高位和标签ST2不匹配或者V(2)无效,表示当前地址的数据不存在于Sram中,控制器需要从外部存储器加载包含当前所需数据的一块数据。Processor and Sram read port: The address high bit does not match the label ST2 or V(2) is invalid, indicating that the data at the current address does not exist in the Sram, and the controller needs to load a piece of data containing the current required data from the external memory.

总线与Sram写端口:空闲。Bus and Sram write port: idle.

T3时刻,T3 moment,

处理器与Sram读端口:空闲。Processor and Sram read ports: idle.

总线与Sram写端口:清除TagSram中A2地址的V,同时把当前传输的地址高位当作标签写入。在总线上发起BusAddr为A2(2)的读传输。Bus and Sram write port: Clear the V of the A2 address in TagSram, and write the high bit of the currently transmitted address as a tag. Initiate a read transfer with BusAddr A2(2) on the bus.

T5时刻,T5 moment,

处理器与Sram读端口:处理器读取总线上读到的第一个数据BD2(2)。处理器发起的地址为A3(3)的读传输,同时从TagSram和DataSram中读取地址A3对应的标签和数据。Processor and Sram read port: The processor reads the first data BD2(2) read on the bus. The processor initiates a read transfer with address A3(3), and reads the tag and data corresponding to address A3 from TagSram and DataSram at the same time.

总线与Sram写端口:将V(2)写入TagSram中A2地址。将数据BD2(2)写入DataSram中A2(2)地址。在总线上发起BusAddr为A2(0)的读传输。Bus and Sram write port: write V(2) to A2 address in TagSram. Write data BD2(2) to address A2(2) in DataSram. Initiate a read transfer with BusAddr A2(0) on the bus.

T6时刻,At time T6,

处理器与Sram读端口:地址高位和标签ST3匹配并且V(3)有效,表示当前地址的数据已经存在于Sram中,HitSram信号拉高,处理器直接从DataSram中读取数据SD3(3)。Processor and Sram read port: the address high bit matches the label ST3 and V(3) is valid, indicating that the data at the current address already exists in Sram, the HitSram signal is pulled high, and the processor directly reads data SD3(3) from DataSram.

总线与Sram写端口:空闲。Bus and Sram write port: free.

T8时刻,At time T8,

处理器与Sram读端口:处理器发起的地址为A2(1)的读传输,同时从TagSram和DataSram中读取地址A2对应的标签和数据。Processor and Sram read port: The processor initiates a read transfer with address A2(1), and reads the tag and data corresponding to address A2 from TagSram and DataSram at the same time.

总线与Sram写端口:将V(0)写入TagSram中A2地址。将数据BD2(0)写入DataSram中A2(0)地址。在总线上发起BusAddr为A2(1)的读传输。Bus and Sram write port: write V(0) to A2 address in TagSram. Write data BD2(0) to address A2(0) in DataSram. Initiate a read transfer on the bus with BusAddr A2(1).

T9时刻,T9 moment,

处理器与Sram读端口:地址高位和标签ST2匹配但是V(1)无效,表示当前地址的数据不存在于Sram中;总线地址和处理器读地址匹配,HitBus信号拉高,处理器直接从Bus上读取数据BD2(1)。Processor and Sram read port: the address high bit matches the label ST2 but V(1) is invalid, indicating that the data at the current address does not exist in Sram; the bus address matches the processor read address, the HitBus signal is pulled high, and the processor directly reads from the Bus Read data on BD2(1).

总线与Sram写端口:将V(1)写入TagSram中A2地址。将数据BD2(1)写入DataSram中A2(0)地址。在总线上发起BusAddr为A2(3)的读传输。Bus and Sram write port: write V(1) to A2 address in TagSram. Write data BD2(1) to address A2(0) in DataSram. Initiate a read transfer with BusAddr A2(3) on the bus.

T10时刻,Time T10,

处理器与Sram读端口:空闲。Processor and Sram read ports: idle.

总线与Sram写端口:将V(3)写入TagSram中A2地址。将数据BD2(3)写入DataSram中A2(0)地址。Bus and Sram write port: write V(3) to A2 address in TagSram. Write data BD2(3) to address A2(0) in DataSram.

显然,上述实施例仅仅是为清楚地说明所作的举例,并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可做出其它不同形式变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引申出的显而易见的变化或变动仍处于本发明创造的保护范围之中。Apparently, the above-mentioned embodiments are only examples for clear description, and are not intended to limit the implementation. For those of ordinary skill in the art, on the basis of the above description, other various changes or modifications can also be made. It is not necessary and impossible to exhaustively list all the implementation manners here. However, the obvious changes or changes derived therefrom are still within the scope of protection of the present invention.

Claims (3)

1. The Cache controller based on the dual-port Sram is composed of the dual-port Sram and a related control circuit thereof, and is characterized in that the dual-port Sram is used for caching data of a memory, a read port is used for matching read transmission of a processor, a write port is used for loading read data of a bus, and the two ports are not affected by each other; the Cache controller can continuously match the read operation address of the processor while loading data from the memory, and can immediately feed back the data if the Cache controller hits Sram or Bus; the width of the dual-port Sram in the Cache controller is 2 of the bus width n Multiple, 2 can be loaded from memory on each miss n Data; the Cache controller may match the data in Sram, or may match the data on the bus being transferred.
2. The Cache controller of claim 1, wherein: the Sram comprises TagSram and DataSram, wherein TagSram is used for storing a flag bit, V (x) is used for indicating whether data of a certain offset address in the strip cache is valid or not by 0 or 1, and the bit number of V can be 2 n A plurality of; the value of T is taken from the high bits of the address, the number of bits depending on the capacity of the Sram, which can be used to match the subsequent read address; dataSram is used to store data, and its width may be 2 of Bus width n Multiple times.
The working method of the Cache controller based on the dual-port Sram Cache controller design of claim 1-2 is characterized by comprising the following steps: the method comprises the following steps:
step S1: the processor initiates a read transmission on the bus, the Cache controller receives the request and jumps to step S7;
step S2: the processor can directly read the data in the Sram and jump to the step S1 to execute the next read transmission;
step S3: the processor can directly read the data on the Bus and jump to the step S1 to execute the next read transmission;
step S4: waiting for bus loading work to be completed and then jumping to the step S8;
step S5: the current read data of the processor does not exist in the Cache controller, and the controller needs to load the data from the memory; if the loaded operation is currently being executed, jumping to the step S4, and if not, jumping to the step S8;
step S6: the Cache controller matches the read address of the current processor and the read address of the current bus under loading, if the two addresses are the same, the data hits and jumps to step S3; if not, jumping to step S5;
step S7: the Cache controller searches TagSram through the high-order address, if the data corresponding to the address exists in the Sram, the data hits and jumps to step S2; if not, jumping to step S6;
step S8: the Cache controller starts the data loading, feeds back the first data read on the bus to the processor, and jumps to step S1 to execute the next read transmission.
CN202211590058.7A 2022-12-12 2022-12-12 Cache controller based on dual-port Sram and working method Pending CN116166186A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211590058.7A CN116166186A (en) 2022-12-12 2022-12-12 Cache controller based on dual-port Sram and working method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211590058.7A CN116166186A (en) 2022-12-12 2022-12-12 Cache controller based on dual-port Sram and working method

Publications (1)

Publication Number Publication Date
CN116166186A true CN116166186A (en) 2023-05-26

Family

ID=86417301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211590058.7A Pending CN116166186A (en) 2022-12-12 2022-12-12 Cache controller based on dual-port Sram and working method

Country Status (1)

Country Link
CN (1) CN116166186A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661695A (en) * 2023-06-02 2023-08-29 灵动微电子(苏州)有限公司 Bus acceleration method and device
CN119336279A (en) * 2024-12-23 2025-01-21 西安紫光国芯半导体股份有限公司 A storage device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6314047B1 (en) * 1999-12-30 2001-11-06 Texas Instruments Incorporated Low cost alternative to large dual port RAM
US20040153611A1 (en) * 2003-02-04 2004-08-05 Sujat Jamil Methods and apparatus for detecting an address conflict
CN101196856A (en) * 2008-01-04 2008-06-11 太原理工大学 Dual-port interface to a single dynamic memory
CN106126450A (en) * 2016-06-20 2016-11-16 中国航天科技集团公司第九研究院第七七研究所 A kind of Cache design structure tackling the conflict of polycaryon processor snoop accesses and method
CN112380157A (en) * 2020-11-26 2021-02-19 北京工业大学 IIC bus communication device with FIFO cache and check function
CN112486908A (en) * 2020-12-18 2021-03-12 清华大学 Hierarchical multi-RPU multi-PEA reconfigurable processor
CN113934364A (en) * 2020-07-13 2022-01-14 华为技术有限公司 Data access method and processor system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6314047B1 (en) * 1999-12-30 2001-11-06 Texas Instruments Incorporated Low cost alternative to large dual port RAM
US20040153611A1 (en) * 2003-02-04 2004-08-05 Sujat Jamil Methods and apparatus for detecting an address conflict
CN101196856A (en) * 2008-01-04 2008-06-11 太原理工大学 Dual-port interface to a single dynamic memory
CN106126450A (en) * 2016-06-20 2016-11-16 中国航天科技集团公司第九研究院第七七研究所 A kind of Cache design structure tackling the conflict of polycaryon processor snoop accesses and method
CN113934364A (en) * 2020-07-13 2022-01-14 华为技术有限公司 Data access method and processor system
CN112380157A (en) * 2020-11-26 2021-02-19 北京工业大学 IIC bus communication device with FIFO cache and check function
CN112486908A (en) * 2020-12-18 2021-03-12 清华大学 Hierarchical multi-RPU multi-PEA reconfigurable processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661695A (en) * 2023-06-02 2023-08-29 灵动微电子(苏州)有限公司 Bus acceleration method and device
CN116661695B (en) * 2023-06-02 2024-03-15 灵动微电子(苏州)有限公司 Bus acceleration method and device
CN119336279A (en) * 2024-12-23 2025-01-21 西安紫光国芯半导体股份有限公司 A storage device

Similar Documents

Publication Publication Date Title
US20230418759A1 (en) Slot/sub-slot prefetch architecture for multiple memory requestors
CN109918131B (en) Instruction reading method based on non-blocking instruction cache
CN100541665C (en) Programmable parallel lookup memory
CN116166186A (en) Cache controller based on dual-port Sram and working method
CN109891397A (en) Device and method for the operating system cache memory in solid-state device
JP3498673B2 (en) Storage device
CN100530141C (en) Method and apparatus for efficient ordered stores over an interconnection network
CN110324204B (en) A high-speed regular expression matching engine and method implemented in FPGA
US7185172B1 (en) CAM-based search engine devices having index translation capability
CN101930408B (en) Cache controller, method of controlling cache controller, and computer system
US7111127B2 (en) System for supporting unlimited consecutive data stores into a cache memory
CN110737612A (en) A processor with in-memory computing
CN114595173A (en) A data transmission method, system and computer-readable storage medium
US6591332B1 (en) Apparatus and method for tracking flushes of cache entries in a data processing system
JPH02292645A (en) Fast read change loading memory system and method
US7194573B1 (en) CAM-based search engine devices having advanced search and learn instruction handling
US7743184B2 (en) Coherent access register data transfer device and methods thereof
US10853123B2 (en) Memory module
CN112486897B (en) A high-speed cache system and a single-cycle multi-data stacking and popping operation method
CN115712392A (en) Buffer-based Cache controller and working method
CN118519956B (en) Data interaction method and device, electronic equipment and storage medium
CN101419543A (en) Method and system for predicting access position of high-speed register
CN112286863A (en) Processing and storage circuit
JPH05158793A (en) Parallel cache memory
JP3766166B2 (en) Associative memory device

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: 20230526

RJ01 Rejection of invention patent application after publication