TW410300B - Detection method for the storage capacity of high speed cache - Google Patents
Detection method for the storage capacity of high speed cache Download PDFInfo
- Publication number
- TW410300B TW410300B TW87118464A TW87118464A TW410300B TW 410300 B TW410300 B TW 410300B TW 87118464 A TW87118464 A TW 87118464A TW 87118464 A TW87118464 A TW 87118464A TW 410300 B TW410300 B TW 410300B
- Authority
- TW
- Taiwan
- Prior art keywords
- cache
- data
- storage capacity
- read
- reading speed
- Prior art date
Links
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
41030C 五、發明說明(1) 【發明的應用範圍】 本發明係有關一種高速緩衝儲存器容量的偵測方法, ,別是一種應用於電腦系統令,用以偵測出電腦系统中之 =速緩衝儲存器)包含内建於處理器(processor)之一級 緩衝儲存器(LI Cache),以及二級緩衝儲存器(L2 Cache) 之错存容量的彳貞測方法。 【發明的技術背景】 現今的電腦結構中 及里时(Processor )與主|己 體(main meinory)之間設置高速緩衝儲存器(Cach^,用 以了提高處理器之資料存取速度的技術早已為人所孰知, 而此種高速緩衝儲存器(Cache)還包括有:内建於产理器41030C V. Description of the invention (1) [Scope of application of the invention] The present invention relates to a method for detecting the capacity of a cache memory, especially a computer system command for detecting the speed of a computer system. The buffer memory) includes a first-level buffer cache (LI Cache) and a second-level buffer cache (L2 Cache). [Technical background of the invention] A current cache structure (Cach ^) is installed in the current computer structure between the Processor and the main meinory to improve the data access speed of the processor. It has long been known, and this type of cache memory (Cache) also includes: built-in processor
Cache) , . ^ # , (L2 Cache),其硬體方塊圖如「第丄圖」所示;盆中二级 緩衝儲存器a2 Cache)3〇的規模要比—級緩衝儲存1· CacheWO大得多,而且在正常運作的情形下’u cache 的存取速度通常要較L2 Cache 30快1倍,而u 3〇的存取速度通常又比主記憶體(main mem〇ry)4〇快3〜5 倍,因此在提高處理器10的存取速度上有著明顯的助益。 因此’ Cache是否可以正常運作?其實際可用 儲存容篁為何?對於電腦製造者或是使用者而今非 重要的’尤其賴Μ電腦代理製造礙商而言更為^要疋 為OEM電腦代理製造薇商主要是把電腦週邊晶片製造者所 提供的零件组裝成-部完整的電腦產品,㈣唯有正 握Cache的規格及品質,才能生產出高品質的電腦產品,Cache),. ^ #, (L2 Cache), the hardware block diagram of which is shown in "Figure 2"; the secondary cache in the basin, a2 Cache) 3, is larger than the first-level cache storage 1. CacheWO Much more, and under normal operating conditions, the u cache access speed is usually 1 times faster than the L2 Cache 30, and the u 30 access speed is usually 4 times faster than the main memory (main memory). 3 ~ 5 times, so it has obvious help in improving the access speed of processor 10. So ’’s Cache working? What is the actual available storage capacity? For computer makers or users, it is not important now, especially for computer makers, which is more important. For OEM computer makers, we mainly assemble parts provided by computer peripheral chip makers. -Complete computer products. Only by holding the specifications and quality of Cache can we produce high-quality computer products.
C: \Prograin Fi Les\Patent\p-〇177tw. ptdC: \ Prograin Fi Les \ Patent \ p-〇177tw. Ptd
41030C 五、發明說明(2) 否則不但影響商譽,更使不知情的消費者權益受損。 已知用以檢知Cache之容量的方法,大部份都是從週 邊零件連接介面PCI (Peripheral Component Interc〇nnect )的地址空間獲得,而PCI上的值則是基本 輪入/輪出系統BIOS (Basic Input/Output System)程 式根據偵測而設定的,並沒有經過Cache運行性能的檢 驗。雖然在Pentium II以上的電腦中,Intel公司提供了 一種指令(CPUID )能夠獲得Cache的容量大小,但是這種 方法仍然是取用BI 0S設定的值,如果B 10S設定的值不正 確’則利用這種方法取得的Cache容量便不正確。例如: 在實際的情況下,某一電腦中的L2 Cache並沒有完全裝 好’而只有安裝了L2 Cache的標記(Tag )模塊(而一般 來說,L2 Cache應包括標記模塊和資料模塊),但是透過 剷述的方法,B I 0 S仍然會認為有一定大小的C a c h e存在, 而造成斷的錯誤。所以在取得Cache容量的方式上存在有 下列的缺點: 1. 適用性差:由於必須透過讀取PC I所在的地址空間 而獲得’但是由於控制L2 Cache之晶片的讀取地址會因製 造者之不同而有不同讀取端(Pin),所以欲取得地址空 間的方法也會不同,除非應用者非常瞭解此一晶片的技術 内容,否則將造成取得的困難,所以此種方法通常僅適用 於某些特定製造者的產品。 2. 不準確:採用此種方法,在L2 Cache缺乏時不能正 確的Cache之容量作出判斷。41030C V. Description of the invention (2) Otherwise, it will not only affect the goodwill, but also damage the rights and interests of unsuspecting consumers. The known methods for detecting the capacity of the cache are mostly obtained from the address space of the peripheral component connection interface PCI (Peripheral Component Interconnect), and the value on the PCI is the basic round-in / round-out system BIOS The (Basic Input / Output System) program is set according to the detection and has not passed the cache performance test. Although in Intel Pentium II and above computers, Intel provides a command (CPUID) to obtain the cache size. However, this method still uses the value set by BI 0S. If the value set by B 10S is incorrect, then use The cache capacity obtained by this method is incorrect. For example: In a practical situation, the L2 Cache in a computer is not completely installed, and only the L2 Cache tag module is installed (in general, the L2 Cache should include a tag module and a data module), However, through the method of description, BI 0 S will still think that there is a certain size of Cache, which will cause a broken error. Therefore, there are the following disadvantages in the way to obtain the cache capacity: 1. Poor applicability: because it must be obtained by reading the address space where PC I is located, but because the read address of the chip that controls the L2 cache will vary depending on the manufacturer And there are different read ends (Pin), so the method of obtaining the address space will be different. Unless the application is well aware of the technical content of this chip, it will cause difficulties in obtaining, so this method is usually only applicable to some Manufacturer-specific products. 2. Inaccurate: This method cannot be used to judge the correct cache capacity when L2 cache is lacking.
C:\Program Files\Patent\p-〇177tw.ptd 第 5 頁C: \ Program Files \ Patent \ p-〇177tw.ptd page 5
3·無法偵測LI Cache的容量大小:由於目前的Cache 控制晶片僅能控制L2 Cache ’而在PCI上的地址空間令也 只設定有L2 Cache的容量值’因此無法偵測L1 cache的容 量大小。 【發明之目的及概述】 本發明之目的在提供一種可以正確偵測Cache中各級 緩衝儲存器(包含LI Cache與L2 Cache)之儲存容量的谓 測方法。 本發明所揭露之方法,主要是根據處理器分別讀取L13. Cannot detect the capacity of the LI Cache: Since the current cache control chip can only control the L2 Cache ', and the address space on the PCI only sets the capacity value of the L2 Cache', the capacity of the L1 cache cannot be detected . [Objective and Summary of the Invention] The object of the present invention is to provide a predicate measuring method that can correctly detect the storage capacity of buffer caches (including LI Cache and L2 Cache) at all levels in the cache. The method disclosed in the present invention mainly reads L1 according to the processor
Cache、L2 Cache與主記憶體(Memory)之資料時’其讀 取速度明顯不同的特性,追蹤處理器讀取不同大小之資料 所花費的時間長短,進一步判斷Cache容量的大小。 本發明的另一目的是在提供一種玎以偵測出L1 Cache 之儲存容量的方法。 根據本發明所揭露之技術,猶如以曲線圖的方式記錄 處理器讀取資料的讀取速度,而讀取速度可以是:以讀取 時間/單位大小(time/Kbytes)與單位大小(Kbytes) 分別為兩個座標軸所構成的曲線圖表示(如「第2 — 1 圖」),也可以是以讀取的資料大小/時間 (Kbytes/time)與時間(time)分別為兩個座標軸所構 成的曲線圖表示(如「第2 — 4圖」);找出其中讀取速 度發生明顯變化之處,利用計算曲線圊之圖形面積的方 式’便可以計算出每一種讀取速度期間所讀取的資料大 小,而此一資料大小所代表的就是符合此一讀取速度之Cache, L2 Cache and main memory (Memory) data ’have significantly different read speed characteristics, track the length of time it takes the processor to read data of different sizes, and further determine the size of the cache capacity. Another object of the present invention is to provide a method for detecting the storage capacity of the L1 Cache. According to the technology disclosed in the present invention, the reading speed of the data read by the processor is recorded as a graph, and the reading speed can be: reading time / unit size (time / Kbytes) and unit size (Kbytes) The graph is composed of two coordinate axes (such as "Figure 2-1"), or it can be composed of the read data size / time (Kbytes / time) and time (time) respectively. (Such as "Figures 2-4"); find out where the reading speed has changed significantly, and use the method of calculating the graph area of the curve 'to calculate the reading during each reading speed The size of the data, and this data size represents the speed that meets this read speed
C:\ProgramFiles\Patent\p-0i77tw.ptd 第 6 頁 i、發明說明(4)C: \ ProgramFiles \ Patent \ p-0i77tw.ptd page 6 i. Description of the invention (4)
Che (可忐是U Cache或L2 Cache )的容量。 【圖式說明】 淫 1 圖係為電腦系統中處ΐ!器、L1 C a c h e、L 2 C a c h e以 第 及主記憶體之間的硬體方塊圖。 2 1圖’係為記錄電腦系統中處理器、L1 C a c h e、L 2The capacity of Che (may be U Cache or L2 Cache). [Illustration of the diagram] The picture of kinky 1 is a hardware block diagram between the computer, L1 C a c h e, L 2 C a c h e and the main memory in the computer system. 2 1 'is a record of the processor, L1 C a c h e, L 2 in the computer system.
Cache以及主記憶體之資料存取速度的曲線圖。 2 ~ 2圖,係為記錄電腦系統令處理器、u cache以及 主記憶體之資料存取速度的曲線圖。 2 ~ 3圖’係為記錄電腦系統中處理器、[2 Cache以及 主记憶體之資料存取速度的曲線圖。 第2 — 4圖,係為另一種記錄電腦系統中處理器、l 1A graph of the cache and main memory data access speeds. Figures 2 to 2 are graphs that record the data access speed of the computer system's processor, u cache, and main memory. Figures 2 to 3 are graphs that record the data access speed of the processor, [2 Cache, and main memory in the computer system. Figures 2 to 4 show the processor, l 1 in another recording computer system.
Cache、L2 Cache以及主記憶體之資料存取速度的 曲線圖》 ^ 3圖’係為本發明之方法步驟流程圖β ^ 4圖’係為本發明實施例之執行程序流程圖。 第5圖’係為第4圖之局部執行程序的詳細流程圖。 第6圖’顯示儲存在LI Cache、L2 Cache以及主記憶體内 的資料結構。 有關本發明之技術内容及實施例,茲配合圖示内容說 明如后。 【發明之詳細說明】 清參閱「第2 — 1圖」,如前所述由於LI Cache 20 ' L2 Cache 30以及主記憶體40在硬體設計上的差異, 造成處理器 10 (CPU, Central Processing Unit)在分別Curve of data access speed of Cache, L2 Cache and main memory "^ 3" is a flowchart of the method steps of the present invention β ^ 4 "is a flowchart of the execution procedure of the embodiment of the present invention. Fig. 5 'is a detailed flowchart of the partial execution procedure of Fig. 4. Figure 6 'shows the data structure stored in LI Cache, L2 Cache, and main memory. Regarding the technical content and embodiments of the present invention, the description with reference to the content of the drawings is as follows. [Detailed description of the invention] Please refer to "Figure 2-1", as mentioned above, due to the difference in hardware design of LI Cache 20 'L2 Cache 30 and main memory 40, the processor 10 (CPU, Central Processing Unit)
41030C 五、發明說明(5) 啤取儲存於LI Cache 20、L2 Cache 30以及主記憶體4〇令 相同大小之資料的時間也分別不同;例如:在一台 Pentium II頻率為266MHZ的電腦中,處理器讀取[I Cache 20的速度大約為2 9 9MB/每秒,讀取L2 Cache 30的 速度大約為240MB/每秒’而讀主記憶體4〇的速度大约為 1 2 0MB/每秒。現假設有某一電腦系統中L1 Cache 2〇的儲 存容量大小為16K (包含8K的資料Cache (Data Cache )和 8K 的指令Cache (Instruction Cache) ) ,L2 Cache 30 的容量大小為1 2 8 1 2 8 K °若隨著運作時間的增加造成讀取 資料的大小逐漸增加’而且當讀取的某一筆資料大小剛好 超過8K和128K時,就處理器10觀之,讀取每Kbytes資料所 需的時間會有突然增加的情形(亦即是讀取速度將會有突 然下降)’而如「第2 — 1圖」所示,在LI Cache 20和 L2 Cache 30為正常的條件下,讀取速度改變之處必然會 在已讀取的資料大小達到8 K與1 2 8 K之處各有一個跳躍的曲 線。因為當已讀取的資料大小超過8K (LI Data Cache的 容量)之時,處理器10將會再從L2 Cache 30讀取,所以 在讀取LI Cache 20時的讀取速度(線段201 )’將與讀取 L2 Cache 30之時的速度(線段301 )不同。同理,在上述 的例子之中,若是已讀取的資料大小超過1 28K (即超過L2 Cache 30之儲存容量)時,處理器10的讀取速度將會因為 讀取主記憶體40之資料,而又有一次的變化(線段40 1 )。因此’根據此種特性,記錄處理器1 0在不同時間下的 讀取速度’再找出每一種讀取速度下所讀取的資料大小’41030C V. Description of the invention (5) The time taken for beer to store data of the same size in LI Cache 20, L2 Cache 30, and main memory 40, respectively; for example, in a Pentium II computer with a frequency of 266MHZ, The processor reads [I Cache 20 at approximately 2.9 MB / s, the L2 Cache 30 is approximately 240 MB / s', and the main memory 40 is approximately 120 MB / s . Now assume that the storage capacity of L1 Cache 2 in a computer system is 16K (including 8K Data Cache and 8K Instruction Cache), and the capacity of L2 Cache 30 is 1 2 8 1 2 8 K ° If the size of the read data gradually increases with the increase of the operating time, and when the size of a certain data read just exceeds 8K and 128K, the processor 10 sees that it needs to read each Kbytes of data There will be a sudden increase in time (that is, the reading speed will drop suddenly) 'and as shown in "Figure 2-1", under the normal conditions of LI Cache 20 and L2 Cache 30, read The speed change will inevitably have a jumping curve where the size of the read data reaches 8 K and 1 2 8 K. When the size of the read data exceeds 8K (the capacity of the LI Data Cache), the processor 10 will read from the L2 Cache 30 again, so the read speed when reading the LI Cache 20 (line 201) ' It will be different from the speed when reading L2 Cache 30 (line 301). Similarly, in the above example, if the size of the read data exceeds 1 28K (that is, exceeds the storage capacity of L2 Cache 30), the reading speed of the processor 10 will be due to reading the data of the main memory 40 , And there is another change (line segment 40 1). Therefore, according to this characteristic, the reading speed of the recording processor 10 at different times is determined. Then, the size of the data read at each reading speed is found.
C:\Program Files\Patent\p-0177tw. ptd 第 8 頁C: \ Program Files \ Patent \ p-0177tw. Ptd page 8
41030G 五、發明說明(6) 就是表示符合此一讀取速度之Cache (可能是LI Cache或 L2 Cache )的儲存容量。 另一方面’若是L2 Cache 30不正常,則此時的記錄 曲線圖’可能如「第2 — 2圖」所示,將不會有符合L2 Cache 30之讀取速度的線段,而僅有代表U Cache 20與 主記憶體4 0之讀取速度的記錄線段,因此我們便可以判斷 出L2 Cache 30可能是故障;反之’若是LI Cache 20不正 常,則此時的記錄曲線圖,可能如「第2 — 3圖」所示, 將不會有符合LI Cache 20之讀取速度的線段,而僅有代 表L2 Cache 30與主記憶體40之讀取速度的記錄線段,因 此我們便可以判斷出L2 Cache 30可能是故障。 請參閱「第3圖」,係為本發明之方法的步驟流程 圖,其中揭露的步驟包含: 1 _建立一資料庫,其中包含數筆資料大小(Data B y, t e s )彼此均不相同之資料’而這些資料的大小 涵蓋一般Cache自最小儲存容量至最大儲存容量 的可能值; 2 令處理器1 〇讀取資料庫中的每一筆資料(或是拫 據每一筆資料的大小,自小而大或是自大而小依 序讀取資料庫中的每一筆資料); 3 .記錄處理器讀取每一筆資料的讀取速度’成為一 讀取速度記錄表; 4 .取得在每一種讀取速度期間所讀取的資料大小 (Date Bytes),成為一讀取速度一容量對照41030G V. Invention description (6) means the storage capacity of the cache (may be LI Cache or L2 Cache) that meets this read speed. On the other hand, "If the L2 Cache 30 is abnormal, the recording curve chart at this time" may be as shown in "Figure 2-2". There will be no line segments that conform to the read speed of the L2 Cache 30. Only the representative Recording line segments of the read speed of U Cache 20 and main memory 40, so we can judge that L2 Cache 30 may be faulty; otherwise, if LI Cache 20 is abnormal, the record curve chart at this time may be like " As shown in Figure 2—3, there will be no line segments that conform to the read speed of LI Cache 20, but only the record line segments that represent the read speed of L2 Cache 30 and main memory 40, so we can judge L2 Cache 30 may be malfunctioning. Please refer to "Figure 3", which is a flowchart of the steps of the method of the present invention. The disclosed steps include: 1 _ establishing a database containing a number of data sizes (DataBy, tes) are different from each other Data ', and the size of these data covers the possible values of the general cache from the minimum storage capacity to the maximum storage capacity; 2 makes the processor 10 read each piece of data in the database (or according to the size of each piece of data, from small And big or arrogant and small read each piece of data in the database in sequence) 3. The reading speed of the record processor to read each piece of data becomes a reading speed record table; 4. Get in each kind The data size (Date Bytes) read during the read speed becomes a read speed-capacity comparison
410300 五、發明說明(7) 表,如「表四」所示);【也可以視為根據「第 2 — 1圊至第2 — 4圖」的圖表記錄内容,找出 其中讀取速度發生明顯變化之處所對應的資料大 小】 5 .設符合該讀取速度之Cache的儲存容量為該讀取 速度期間所讀取的資料大小(也可以根據該讀取 速度一容量對照表’找出該讀取速度所對應之容 量),而此一資料大小就是符合此一讀取速度之 Cache (可能是LI Cache 20 或L2 Cache 30 )的 儲存容量。 其中步驟1的實現的方式可以如「表一」所示,建立 一個資料-大小(Data-By tes )的對照表,每一筆大小不 同的資料,均由一資料序號(SN, Serial Number ),以 及對應此一資料序號SN的資料大小值(DS,Daΐ a S i ze ),用以指定每一筆資料的資料大小(Data Bytes)。 步驟2的實現方式,可以根據前述「表一」所指定的 資料大小值DS,令處理器10讀取某一實際地址中的數據而 達成;例如:要讀取64 Kbytes大小的資料,則可以令處 理器10讀取地址00000〜FFFFH中的數據就可以,見「第6 圖」。 在步驟3之中所稱的讀取速度記錄表,若以圖表的形 態表示,則可以是如「第2—1圖至第2—4圖」,若是 以數據的方式表示,則如「表二、三」所示,其中「表 二」記錄了處理器1 0已讀取之資料大小(K,Kbytes )(係410300 V. Description of the invention (7) table, as shown in "Table 4"); [It can also be regarded as recording content according to the chart of "Figures 2-1 to 2-4", to find out where the reading speed occurred The size of the data corresponding to the obvious change] 5. Set the storage capacity of the cache that meets the read speed to the size of the data read during the read speed (you can also find the capacity according to the read speed-capacity comparison table Capacity corresponding to the read speed), and this data size is the storage capacity of the cache (may be LI Cache 20 or L2 Cache 30) that meets this read speed. The implementation method of step 1 can be as shown in "Table 1", and a data-size (Data-By tes) comparison table is created. Each data of different size is assigned a data serial number (SN, Serial Number). And a data size value (DS, Daΐa S ze) corresponding to this data serial number SN is used to specify the data size (Data Bytes) of each piece of data. The implementation of step 2 can be achieved by causing the processor 10 to read the data in an actual address according to the data size value DS specified in the aforementioned "Table 1"; for example, to read 64 Kbytes data, you can Just let the processor 10 read the data in the addresses 00000 ~ FFFFH, see "Figure 6". The reading speed record table referred to in step 3, if it is expressed in the form of a chart, can be as "Figure 2-1 to Figure 2-4", if it is expressed in the form of data, it is as "table "2, 3", in which "Table 2" records the data size (K, Kbytes) that the processor 10 has read (system
C:\Program F i1es\Patent\p~〇177tw. ptd 第 10 頁C: \ Program F i1es \ Patent \ p ~ 〇177tw. Ptd page 10
41030C 五、發明說明(8) ^ 為累計值)與對應的讀取速度值(Time/K,表示讀取每一 K資料所需的時間);「表三J則記錄了讀取速度值 (K / T i m e,表示每單位時間所讀取的資料大小)’與對應 讀取速度值之已讀取時間。 步驟4所欲取得的資料大小可以根據Γ表二、二」的 值計算獲得,以「表二」之值(均為假設值)為例’如在 讀取速度=0.5秒/K(Kbytes)的數個記錄中’其累積讀取 的資料大小為8K即為步驟4所求之資料量大小。同理,若 是以「第2 — 1圖」所記錄的曲線計算,則更可以輕易的 發現,在累積讀取的資料大小為8 K之前幾乎相同之讀取速 度,係代表LI cache 20的讀取速度曲線,而累積值8K就 是LI Cache 20的容量。若是以「第2 — 4圖」之記錄曲 線圖求得,其中在第一個讀取速度明顯變化之累積讀取時 間為t i m e 1 (也就是在此一讀取速度中的最大讀取時間值 ),則以timel與相應之讀取速度值Kl/Time相乘,所得的 圖形面積K1就是U Cache 20的儲存容量。 【實施例說明】 關於本發明的方法’可以透過下列的例子說明而瞭 解·’假設有一電腦系統之L1 C a c h e 2 0的錯存容量為3 2尺 (包含 ΠΚ Date Cache,16K Code Cache ),其資料儲存 請參閱「第4圖」,根據本發明所揭露之技術,其 際實施的執行過程,是在一包括有:處理器1〇、内 理器内部的一級緩衝儲存器20(L1 Cache)、二級緩衝儲g41030C V. Description of the invention (8) ^ is the cumulative value) and the corresponding reading speed value (Time / K, representing the time required to read each K data); "Table III J records the reading speed value ( K / T ime, which represents the size of the data read per unit time) 'and the read time corresponding to the value of the reading speed. The size of the data to be obtained in step 4 can be calculated according to the values of Table 2 and 2. Take the value of "Table 2" (both hypothetical values) as an example. 'For example, in several records with a reading speed = 0.5 sec / K (Kbytes)', the cumulative read data size is 8K. The amount of data. Similarly, if the calculation is based on the curve recorded in "Figure 2-1", it can be more easily found that the read speed is almost the same before the accumulated data size is 8 K, which represents the read of LI cache 20. Take the speed curve, and the cumulative value of 8K is the capacity of LI Cache 20. If it is obtained from the recording curve of "Figures 2-4", the cumulative reading time at the first reading speed changes significantly is time 1 (that is, the maximum reading time value at this reading speed) ), Multiply timel by the corresponding reading speed value Kl / Time, and the resulting graphic area K1 is the storage capacity of U Cache 20. [Explanation of the embodiment] The method of the present invention can be understood through the following example descriptions. 'Assume that the error storage capacity of a computer system L1 C ache 2 0 is 32 feet (including ΠK Date Cache, 16K Code Cache), For the data storage, please refer to "Figure 4". According to the technology disclosed in the present invention, the implementation process is implemented in a level 1 buffer memory 20 (L1 Cache) including the processor 10 and the internal processor. ), Secondary buffer storage g
C:\Program Files\Patent\p-0177tw. ptd第 u 貞 ' -一―C: \ Program Files \ Patent \ p-0177tw.ptd
41030C 發明說明(9) 器30(L2 Cache),以及主記憶體40的電腦系統,透過下列 步驟的執行而實現,包括有: 1 ·侦測當前電腦系統的運行模式;【一般而言,在 8 0486級以上的處理器1 〇存在一個名叫CR〇的控制 暫存器,其控制著當前電腦系統的狀態;而在 8 0 4 8 6級以下的處理器1 〇中則設有一機器狀態字 暫存器(MSW,Machine Status Word)。通過檢 知CR0或是MSW中之PE (Protect Enable)端的邏 輯位準’便可以判斷處理器1 〇目前的狀態,若 PE = 1,表示在保護模式(protect Mode),反之 若ΡΕ = 0,表示在真實地址模式(Reai Address Mode )。] 2 ·初始化偵測環境; 3 ·偵測Cache的容量; 4 ·輸出偵測結果;以及 5 ·結束偵測程序。 其中的步驟1還包括有: 1 -1 ‘檢出當前電腦系統的運行模式;以及 卜2 .判斷是否為真實地址模式?若為否則提示使用 者重設為正確的電腦系統運行環境’然後跳至步 驟5 ’若為是則繼續步驟2 Q 其中的步驊2還包括有: 2 -1 ·儲存當前電腦系統的中斷狀態,禁止所有的中 斷操作;以及41030C Description of the Invention (9) The computer system of the device 30 (L2 Cache) and the main memory 40 is implemented by performing the following steps, including: 1 Detecting the current computer system operating mode; [Generally, in There is a control register named CR〇 for processors 8 0486 and above, which controls the current state of the computer system. A processor state is set in processors 10 for processors below 8 0 8 8 Word Register (MSW, Machine Status Word). By detecting the logic level of the PE (Protect Enable) terminal in CR0 or MSW, the current state of the processor 1 can be judged. If PE = 1, it means that it is in protection mode, otherwise if PE = 0, Represents the real address mode (Reai Address Mode). ] 2 · Initialize the detection environment; 3 · Detect the cache capacity; 4 · Output the detection results; and 5 · End the detection process. Step 1 also includes: 1 -1 ‘Check out the current operating mode of the computer system; and 2. 2. Determine whether it is the real address mode? If not, it prompts the user to reset to the correct operating system of the computer system. Then skip to step 5 'If yes, continue to step 2 Q. Step 2 of this step also includes: 2 -1 · Store the current interruption status of the computer system To disable all interrupt operations; and
C:\ProgramFiles\Patent\p-0177.tw.ptd 第 12 頁C: \ ProgramFiles \ Patent \ p-0177.tw.ptd page 12
41030C 五、發明說明(I0) 2- 2 *健存當前Cache的工作狀態,致能(Enable )[141030C V. Description of the Invention (I0) 2- 2 * Save the current working state of the Cache, Enable (Enable) [1
Cache 20 與L2 Cache 30 a 其中的步驟3則包括有: 3- 1 ‘建立一個資料-大小(Data-Bytes )的對照表 (如「表一」); 3 -2 ·令處理器1 〇讀取「表一」所指定之大小的資 料’並計算出讀取每一筆資料所需的讀取時間; 3- 3 ·計算出每一筆資料中讀取每K (Kbytes )之資料 所需要的時間(係根據步驟3-2的記錄計算); 以及 3 - 4 ·分析電腦系統讀取每K ( K b y t e s )之資料所花費 的時間(即分析讀取速度) ' 求得L1 C a c h e和L 2Cache 20 and L2 Cache 30 a Step 3 includes: 3- 1 'Create a data-size (Data-Bytes) comparison table (such as "Table 1"); 3 -2 · Let the processor 1 〇 read Take the data of the size specified in "Table 1" and calculate the reading time required to read each piece of data; 3- 3 · Calculate the time required to read each K (Kbytes) of data in each piece of data (Calculated based on the records in step 3-2); and 3-4 · Time taken by the analysis computer system to read each K (K bytes) of data (ie, the analysis read speed) 'Find L1 C ache and L 2
Cache的容量大小。 其中的步驟4亦包括有: 4- 1,明確顯示Cache的容量大小(包含LI Cache和L2The size of the cache. Step 4 also includes: 4- 1, clearly shows the size of the cache (including LI Cache and L2
Cache的容量大小); 4-2 _恢復Cache的初始狀態;以及 4-3 ·恢復電腦系統原始的中斷狀態。 再請參閱「第5圖」,係為根據「第4圖」所示之執 行程序’所揭露的另一詳細的執行流程,其包括有: A .初始化偵測環境; B .偵測處理器1 0的類型; C *判斷是否為Pent ium級以上的處理器?若為是則繼 續下一步驟,若為否則利用8523系統計時器標記Cache capacity); 4-2 _Restore the initial state of the Cache; and 4-3 · Restore the original interrupted state of the computer system. Please refer to "Figure 5" again, which is another detailed execution process disclosed according to the execution procedure shown in "Figure 4", which includes: A. Initializing the detection environment; B. Detection processor 1 0 type; C * Judge if it is a Pent ium or higher processor? If yes, continue to the next step, otherwise, use the 8523 system timer flag.
C:\Program Files\Patent\p-0177tw.ptd 第 13 頁C: \ Program Files \ Patent \ p-0177tw.ptd page 13
41030C 五、發明說明(u) 時間,然後跳至步驟E ; D ·利用TSC暫存器作為計時器標記時間; E ·設定計時器使用標誌; F ·載入一資料-大小(D a t a - B y t e s )的對照表(如 「表一」); G ·令處理器1 0讀取「表一」所指定的某一筆資料; (此一步驟之目的是使得資料先被填充至Cache 與主記憶體40之中,如此一來,在下一次讀取相 同之資料時,處理器便會視資料的大小而先從L1 Cache ,或依序從LI Cache 、L2 Cache,或是 依序從LI Cache 、L2 Cache和主記憶體中讀取 資料。) Η,利用計時器標記開始時刻; I ·令處理器1 0再一次讀取「表一」所指定之大小的 第一筆資料; J ·利用計時器標記結束時刻; Κ ·計鼻出t買取貢料的時間(所花的時間=結束時刻 —開始時刻); L·令處理器10讀取「表一」所指定的下一筆資料; Μ ·判斷是否已讀取完「表一」所指定的全部資料? 若為是、則繼續下一步驟,若為否、則跳至步驟 F ; Ν ·計算讀取每K(Kbytes)資料所花的時間;以及 0 ·計算出Cache的儲存容量。41030C V. Description of the invention (u) Time, then skip to step E; D · Use TSC register as timer to mark time; E · Set timer use flag; F · Load a data-size (D ata-B ytes) comparison table (such as "Table 1"); G · instruct processor 10 to read a certain piece of data specified in "Table 1"; (the purpose of this step is to make the data first be filled into the cache and the main memory In the body 40, in this way, the next time the same data is read, the processor will first read from the L1 Cache, or sequentially from the LI Cache, L2 Cache, or sequentially from the LI Cache, depending on the size of the data. Read data from the L2 Cache and main memory.) Η, use the timer to mark the start time; I · Make the processor 10 once again read the first data of the size specified in "Table 1"; J · Use the timer Marking the end time of the device; κ · Counting the time to buy the tribute from the t (time spent = end time-start time); L · instruct the processor 10 to read the next data specified in "Table 1"; Μ · Determine whether all the data specified in Table 1 have been readIf yes, continue to the next step; if no, skip to step F; NR • Calculate the time it takes to read each K (Kbytes) of data; and 0 • Calculate the storage capacity of the cache.
C:\Program Files\Patent\p-〇177tw.ptd 第 14 頁C: \ Program Files \ Patent \ p-〇177tw.ptd page 14
41030C 五、發明說明(12) 由於隨著電腦的快速發展,處理器1〇的存取速度也越 來越快,因此為了反應LI Cache 20以及L2 Cache 30在讀 取速度上的差異性,8253系統計時器對於高性能的處理器 ,言精度不夠,所以本發明對於Pentium級以上的處理 器,使用一種名為TSC (Time Stamp Counter )的暫存器 (Register)來§己錄讀取時間,但此種tsc暫存器是在 Pentium級處理器公開之後才出現的,故較佳的實施方式 是將Pentium級以上的處理器,採用TSC暫存器作為計時 器’反之Pent i um以下的處理器,則採用8253系統計時 器。 以上所揭露的實施例’僅在於揭露本發明之技術,舉 凡熟習此一技藝之人士 ’在瞭解本發明之技術手段之後所 作的修改變化,亦應不脫離本發明之技術範缚。 【發明之功效】 可以正確偵測C a c h e中各級緩衝儲存器(包含l 1 Cache與L2 Cache )之儲存容量。 適用性佳’根據本發明所揭露的儲存容量偵測方法, 不再需要熟悉L2 Cache之控制晶片的性能,便可以輕易的 偵測出Cache (包含LI Cache與L2 Cache)之儲存容量。41030C V. Description of the invention (12) As the rapid development of the computer, the access speed of the processor 10 is getting faster and faster, so in order to reflect the difference in read speed between the LI Cache 20 and L2 Cache 30, 8253 The system timer is not accurate enough for high-performance processors, so for the processors above the Pentium level, the present invention uses a temporary register (Register) called TSC (Time Stamp Counter) to record the read time. However, this kind of tsc register does not appear until the Pentium-class processor is released. Therefore, the preferred implementation is to use a TSC register as a timer for the processor above the Pentium class, and vice versa. Device, it uses the 8253 system timer. The embodiment disclosed above is only for exposing the technology of the present invention, and modifications and changes made by those who are familiar with this technology after understanding the technical means of the present invention should not depart from the technical scope of the present invention. [Effect of the invention] It can correctly detect the storage capacity of each level of buffer storage (including l 1 Cache and L2 Cache) in C a c h e. Good applicability 'According to the storage capacity detection method disclosed in the present invention, it is no longer necessary to be familiar with the performance of the L2 Cache control chip, and the storage capacity of the Cache (including the LI Cache and the L2 Cache) can be easily detected.
C:\ProgramFiles\Patent\p-0I77tw.ptd 第 15 頁C: \ ProgramFiles \ Patent \ p-0I77tw.ptd page 15
41030C 五、發明說明(13) 個數i ! 2 4 1 5 6 7 8 1 9 1 10 1 " 資料大小 2K 4Κ 8Κ 12Κ ΙΤβΚ' Ρ〇κ Γ2 4Κ 28Κ 32Κ 48Κ Τ54Κ- (Bytes) Γ1 Γ1 Γ Γ1 Γ1 個數i π±: 15 18 19 (20^ 21 1 22 資料大小 80Κ 96Κ 112 128 160 192 224 256 3 20 3 84 1448 (Bytes) Κ Κ Κ Κ Κ Κ Κ κ κ 個數i 23 24 . 25 26 29 30 ρτ~ 資料大小 5 12 576 640 768 896 1Μ 2Μ 3Μ 4Μ (Bytes) LL Li_ L_J ___ L1 ___ J____ 【表一】41030C V. Description of the invention (13) The number i! 2 4 1 5 6 7 8 1 9 1 10 1 " Data size 2K 4K 8K 12K ΙΤβΚ 'Ρκκ Γ2 4K 28K 32K 48K Τ54K- (Bytes) Γ1 Γ1 Γ Γ1 Γ1 number i π ±: 15 18 19 (20 ^ 21 1 22 data size 80Κ 96Κ 112 128 160 192 224 256 3 20 3 84 1448 (Bytes) Κ Κ Κ Κ Κ κ κ κ number i 23 24. 25 26 29 30 ρτ ~ Data size 5 12 576 640 768 896 1M 2M 3M 4M (Bytes) LL Li_ L_J ___ L1 ___ J____ [Table 1]
【表四】 ΙΜΜΜΪ C:\Program Files\Patent\p-0177tw. ptd 第 16 頁[Table 4] ΙΜΜΜΪ C: \ Program Files \ Patent \ p-0177tw. Ptd page 16
41030C 五、發明說明(14) 【圖示符號說明】 10............* · · 處理器 20........級緩衝儲存器(LI Cache) 3 0.......二級缓衝儲存器(L2 Cache) 40..........主記憶體(Memory) 201......LI Cache的讀取速度記錄線段 3 0 1......L2 Cache的讀取速度記錄線段 401......主記憶體的讀取速度記錄線段41030C V. Description of the Invention (14) [Illustration of Symbols] 10 ............ * · Processor 20 ........ Level Cache (LI Cache) 3 0 ....... L2 Cache 40 ............. Main memory 201 ... Li Cache read speed record line segment 3 0 1 ... L2 Cache read speed record line segment 401 ... Main memory read speed record line segment
C:\ProgramFiies\Patent\p-0177tw.ptd 第 17 頁C: \ ProgramFiies \ Patent \ p-0177tw.ptd page 17
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW87118464A TW410300B (en) | 1998-11-06 | 1998-11-06 | Detection method for the storage capacity of high speed cache |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW87118464A TW410300B (en) | 1998-11-06 | 1998-11-06 | Detection method for the storage capacity of high speed cache |
Publications (1)
Publication Number | Publication Date |
---|---|
TW410300B true TW410300B (en) | 2000-11-01 |
Family
ID=21631910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW87118464A TW410300B (en) | 1998-11-06 | 1998-11-06 | Detection method for the storage capacity of high speed cache |
Country Status (1)
Country | Link |
---|---|
TW (1) | TW410300B (en) |
-
1998
- 1998-11-06 TW TW87118464A patent/TW410300B/en not_active IP Right Cessation
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100873943B1 (en) | System and method of reading non-volatile computer memory | |
US10643736B2 (en) | Method, apparatus and electronic device for read/write speed testing | |
US20160147587A1 (en) | Method of analyzing a fault of an electronic system | |
US10713162B1 (en) | System and method for computer data garbage collection acceleration using peer to peer data transfers | |
TW201220186A (en) | Data protection method for damaged memory cells | |
US20040088474A1 (en) | NAND type flash memory disk device and method for detecting the logical address | |
CN116049034A (en) | Verification method and device for cache consistency of multi-core processor system | |
WO2016173172A1 (en) | Method and apparatus for detecting heap memory operation | |
JP7038656B2 (en) | Access to cache | |
JP6145193B2 (en) | Read or write to memory | |
JPWO2012108020A1 (en) | Log recording device | |
TW410300B (en) | Detection method for the storage capacity of high speed cache | |
CN115292147A (en) | Convenient and efficient memory pressure testing method and system and readable storage medium | |
US9251023B2 (en) | Implementing automated memory address recording in constrained random test generation for verification of processor hardware designs | |
JP2006172234A (en) | System performance evaluation method and system performance evaluation device | |
CN113626272B (en) | Memory read-write rate testing method, device and system based on mmap system | |
KR102210544B1 (en) | Method of analyzing a fault of an electronic system | |
CN113806149B (en) | Memory read-write test method and device and storage medium | |
JP2004348635A (en) | Method for developing program | |
GB2345163A (en) | Detecting capacity of cache memories | |
JP2024059109A5 (en) | Information processing program and information processing device | |
JP2004240783A (en) | Simulator | |
CN117112382A (en) | SoC memory read-write performance test method, system, device and storage medium | |
JPH1031620A (en) | Diagnostic device for cache memory | |
KR100723475B1 (en) | Cash memory system and method for changing line size of cash memory according to bus latency of bus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GD4A | Issue of patent certificate for granted invention patent | ||
MM4A | Annulment or lapse of patent due to non-payment of fees |