CN106250325B - A kind of cache optimization method and system - Google Patents
A kind of cache optimization method and system Download PDFInfo
- Publication number
- CN106250325B CN106250325B CN201610575700.2A CN201610575700A CN106250325B CN 106250325 B CN106250325 B CN 106250325B CN 201610575700 A CN201610575700 A CN 201610575700A CN 106250325 B CN106250325 B CN 106250325B
- Authority
- CN
- China
- Prior art keywords
- cache
- parameter
- value
- power consumption
- predetermined
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0893—Caches characterised by their organisation or structure
- G06F12/0897—Caches characterised by their organisation or structure with two or more cache hierarchy levels
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0877—Cache access modes
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
This application discloses a kind of cache optimization method and systems, the method runs on the size of corresponding power consumption number when the different values of predetermined cache parameter by calculation procedure, determine that minimum power consumption is worth the value of the corresponding predetermined cache parameter, and using the value as the optimal value of the predetermined cache parameter, on this basis, the value of the predetermined cache parameter is optimized, the optimal value is adjusted to, caching reconstruct is realized with this;To which subsequent described program can effectively reduce the system power dissipation of the equipment such as embedded based on the cached parameters after optimization, i.e., the optimal value operation of the described predetermined cache parameter.
Description
Technical field
The invention belongs to computer application technology more particularly to a kind of cache optimization method and systems.
Background technique
With reference to Fig. 1, in embedded equal electronic equipments, CPU (central processing unit, Central Processing Unit)
Usually there are level cache, L2 cache.Specifically, the appearance of L2 cache is to coordinate between level cache and memory
Speed, the data being mainly used between level cache and memory temporarily exchange, and L2 cache is slower than the speed of level cache, hold
It measures bigger.
With increasingly popularizing for embedded equal electronic equipments, people are when using these devices to the requirement of equipment power dissipation
It is higher and higher, wherein by especially reducing power consumption to the optimal reconfiguration of L2 cache to caching, further lifting means
System energy efficiency has huge development space.It is challenged in caching reconstruct under technology at this stage maximum no more than to cached parameters
Optimization, caching exist three parameters, caching block size (cache block size), cache line size (line size) and
It is associated with (associativity), cached parameters is optimized at present to realize caching reconstruct and then reduce the system function of equipment
Consumption becomes the popular problem of this field.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of cache optimization method and systems, it is intended to by joining to caching
Number optimizes realization caching reconstruct, and then reduces the system power dissipation of the equipment such as embedded.
For this purpose, the present invention is disclosed directly below technical solution:
A kind of cache optimization method, comprising:
Obtain the different values that program runs on corresponding predetermined power consumption parameter when the different values of predetermined cache parameter;
Based on the corresponding value of the predetermined power consumption parameter, the corresponding institute of every kind of value of the predetermined cache parameter is calculated
State the operation power consumption number of program;
It determines the value of the corresponding predetermined cache parameter of the smallest operation power consumption number, and joins as the predetermined cache
Several optimal values;
The value of the predetermined cache parameter is adjusted to the optimal value, so that described program is subsequent based on described predetermined
The optimal value operation of cached parameters.
The above method, it is preferred that the acquisition program runs on corresponding predetermined when the different values of predetermined cache parameter
The different values of power consumption parameter include:
When program runs on every kind of value of the predetermined cache parameter, predetermined cache parameter described in respective record is taken
The value of value and the predetermined power consumption parameter.
The above method, it is preferred that the corresponding value based on the predetermined power consumption parameter calculates the predetermined cache ginseng
The operation power consumption number of several corresponding described programs of every kind of value includes:
Based on the corresponding value of the predetermined power consumption parameter, the corresponding institute of every kind of value of the predetermined cache parameter is calculated
State the cache hit power consumption of program, cache miss power consumption and leakage current power consumption;
Based on the cache hit power consumption, predetermined cache parameter described in cache miss power consumption and leakage current power consumption calculation
The corresponding described program of every kind of value operation power consumption number.
The above method, it is preferred that the predetermined cache parameter is any in caching block size, cache line size and being associated with
It is a kind of.
The above method, it is preferred that the predetermined cache parameter is specially to cache block size, then the method is will be described pre-
The value for determining cached parameters is adjusted to after the optimal value, further includes:
It is successively the cache line size, the association by the predetermined cache parameter switching, and every time to described pre-
Determine to execute the method and optimize the value of the predetermined cache parameter after switching, make after cached parameters switch over
It is subsequent based on the caching block size, cache line size and associated optimal value operation to obtain described program.
A kind of cache optimization system, comprising:
Module is obtained, for obtaining corresponding predetermined power consumption parameter when program runs on the different values of predetermined cache parameter
Different values;
Computing module calculates the every of the predetermined cache parameter for the corresponding value based on the predetermined power consumption parameter
The operation power consumption number of the corresponding described program of kind value;
Determining module, for determining the value of the corresponding predetermined cache parameter of the smallest operation power consumption number, and conduct
The optimal value of the predetermined cache parameter;
First optimization module, for the value of the predetermined cache parameter to be adjusted to the optimal value, so that the journey
The subsequent optimal value operation based on the predetermined cache parameter of sequence.
Above system, it is preferred that the acquisition module includes:
Recording unit, it is pre- described in respective record when for running on every kind of value of the predetermined cache parameter in program
Determine the value of cached parameters and the value of the predetermined power consumption parameter.
Above system, it is preferred that the computing module includes:
First computing unit calculates the predetermined cache parameter for the corresponding value based on the predetermined power consumption parameter
The corresponding described program of every kind of value cache hit power consumption, cache miss power consumption and leakage current power consumption;
Second computing unit, for being based on the cache hit power consumption, cache miss power consumption and leakage current power consumption meter
Calculate the operation power consumption number of the corresponding described program of every kind of value of the predetermined cache parameter.
Above system, it is preferred that the predetermined cache parameter be specially cache block size, then the system also includes:
Second optimization module is used to be successively cache line size and association by the predetermined cache parameter switching, and every
It is secondary the predetermined cache parameter is switched over after, triggering executes each module in the system to described predetermined slow after switching
The value for depositing parameter optimizes so that described program it is subsequent based on the caching block size, cache line size and it is associated most
Excellent value operation.
As it can be seen from the above scheme the method is by calculating journey this application discloses a kind of cache optimization method and system
The size of sort run corresponding power consumption number when the different values of predetermined cache parameter determines that minimum power consumption value is corresponding described
The value of predetermined cache parameter, and using the value as the optimal value of the predetermined cache parameter, on this basis, to described pre-
The value for determining cached parameters optimizes, and is adjusted to the optimal value, realizes caching reconstruct with this;To subsequent institute
Stating program can be can effectively reduce based on the cached parameters after optimization, i.e., the optimal value operation of the described predetermined cache parameter
The system power dissipation of the equipment such as embedded.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is the cache structure schematic diagram under CPU platform;
Fig. 2 is a kind of flow chart for the cache optimization method that the embodiment of the present application one provides;
Fig. 3 is the principle of optimality schematic diagram for the L2 cache that the embodiment of the present application one provides;
Fig. 4 is another flow chart for the cache optimization method that the embodiment of the present application two provides;
Fig. 5 is the optimizing schematic diagram for the cached parameters that the embodiment of the present application two provides;
Fig. 6-Fig. 7 is the structural schematic diagram for the cache optimization system that the embodiment of the present application three provides.
Specific embodiment
For the sake of quoting and understanding, hereafter used in technical term, write a Chinese character in simplified form or abridge summary be explained as follows:
Cache block size: cache block size, wherein cache blocks (cache block) refer specifically to carry out at caching
Used logical operations unit when reason, caching block size refer to the size of the logical operations unit, and caching process can be by block
It is operated, such as when to data cached hit, successively takes out the monolith data in caching, and in the block taken out
It is hit.
Association: associativity, such as n-way associativity, referring specifically to caching can support multichannel to cache simultaneously
Operation, such as the data cached hit of multichannel.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Embodiment one
The embodiment of the present application one discloses a kind of cache optimization method, and this method is primarily adapted for use in slow to L2 cache or three-level
The cached parameters for depositing equal multi-level buffers optimize, thus by L2 cache or other multi-level buffers carry out caching reconstruct come
The system power dissipation for reducing the equipment such as embedded, with reference to Fig. 2 shows cache optimization method flow chart, the method may include with
Lower step:
S101: the difference for obtaining corresponding predetermined power consumption parameter when program runs on the different values of predetermined cache parameter takes
Value.
Wherein, there are three parameters for caching, cache block size (cache block size), cache line size (line
Size) and it is associated with (associativity), is based on this, the predetermined cache parameter specifically can be caching block size, cache lines
Size and any one being associated in these three cached parameters.That is, specifically, the central scope of the application is: can be described
In the case that the value of any two cached parameters is fixed in three cached parameters, to third cached parameters by program in the ginseng
Power consumption situation when being run under several different values carries out caching optimizing, obtains the optimal of the parameter based on lowest power consumption point
Value is realized optimize to the i.e. described third cached parameters of the parameter on this basis.In practical application, this Shen can be based on
It please conceive and optimizing and optimization are successively carried out to each cached parameters in three cached parameters by endless form, to make
Calling program can be run in the case where three cached parameters are optimal.
The present embodiment is specifically illustrated the application method for optimizing to L2 cache.
Above three cached parameters it is each can selected value it is generally as follows:
Cache block size: 32KB, 64KB ..., 4MB;
Cache line size: 16B, 32B, 64B;
Association: 1-way, 2-way, 4-way, 8-way, 16-way.
The present embodiment assuming that cache line size and be associated with the two cached parameters value it is fixed in the case where, to caching
This parameter of block size carries out optimizing, that is, assumes that the predetermined cache parameter is specially to cache block size.
It wherein, can be corresponding to remember when program runs on every kind of value of the predetermined cache parameter in this step S101
Record the value of the predetermined cache parameter and the value of the predetermined power consumption parameter.Specifically, with predetermined cache parameter tool
Body is (specifically may be used for caching block size in cache line size and in the case where being associated with the value fixation of the two cached parameters
Be above-mentioned correspondence enumerate it is multiple can in selected value one of), can run on caching block size in program is 32KB,
When every kind of value in 64KB ..., 4MB, the value of corresponding caching block size and the predetermined power consumption parameter of program are recorded
Value.
The predetermined power consumption parameter specifically may include a series of parameters relevant to program power consumption calculation, in cache access
The number of miss, the hit of current accessed are time-consuming in the number of hit, cache access, the access of data needed for obtaining is time-consuming,
Access power consumption of internal memory, caching replacement power consumption etc..
S102: the corresponding value based on the predetermined power consumption parameter calculates every kind of value pair of the predetermined cache parameter
The operation power consumption number for the described program answered.
On the basis of the program power consumption parameter value to match under every kind of value condition for obtaining cache block size,
Power consumption parameter value of this step based on acquisition, calculation procedure run on the power consumption under the various values of cache block size
Value.
Wherein, following various be calculated specifically can be used in the operation power consumption number of program:
Etotal=Ecache-hit+Ecache-miss+Eleakage (1)
Ecache-hit=(Nhit)×(AThit)×(Ptag+Pdata+Poutput) (2)
Ecache-miss=(Nmiss)×(AThit·Ptag+ATmiss·(Pmemory+Pprocessor-stall+Pcache-refill)) (3)
It is above it is various in, meaning represented by each character is specific as follows:
EtotalIt indicates total power consumption, i.e. the operation power consumption of described program, altogether includes three parts power consumption data: cache hit function
Consume Ecache-hit, cache miss power consumption Ecache-missAnd leakage current power consumption Eleakage;
Nhit、NmissRespectively indicate the number hit in cache access, in cache access miss number;
AThit、ATmissThe hit for respectively indicating current accessed is time-consuming, is obtained under miss caching situation by search memory
The time-consuming of required data;
Ptag、Pdata、PoutputRespectively indicate tag array power consumption, data array power consumption and output equipment power consumption;
PmemoryIndicate access power consumption of internal memory;
Pprocessor-stallIndicate the power consumption consumed when processor waits;
Pcache-refillIndicate caching replacement power consumption.
S103: the value of the corresponding predetermined cache parameter of the smallest operation power consumption number is determined, and as described predetermined
The optimal value of cached parameters.
Under the different values for calculating cache block size, the not corresponding different power consumption value of program motion time
On the basis of, the smallest operation power consumption number, i.e. lowest power consumption can be determined by being compared to each power consumption number being calculated
Point, and by the value of the corresponding cache block size of lowest power consumption point, as its optimal value.
S104: being adjusted to the optimal value for the value of the predetermined cache parameter, so that described program is subsequent to be based on institute
State the optimal value operation of predetermined cache parameter.
On the basis of above step, the value of cache block size is adjusted to the lowest power consumption point pair by this step
The value of the cache block size answered, i.e., the described optimal value, to realize to this caching of cache block size
Parameter optimizes, and then realizes and optimize to L2 cache.Subsequent described program can be based on the cache block after optimization
The value of the size, that is, optimal value operation.When other different programs are run, using the application method again to this
The corresponding cached parameter values of program carry out optimizing and dynamic is modified, and carry out to realize to the corresponding cached parameters used of the program
Optimization.
In practical application, it is not limited to the successive execution order for each step that must be proposed using the application, for example, can
On the basis of need not be confined to the different power consumption values of program under all different value conditions for calculating predetermined cache parameter, then
Each power consumption values are compared and are determined with lowest energy consumption point, but can be to calculate program this operation every time corresponding
After power consumption values, it is compared with the lowest energy consumption value determined when running it with the program last time, more can determine every time
Current lowest energy consumption value out, so that corresponding can determine that current best cached parameter values, and then by repeatedly comparing
Obtain the lowest energy consumption point of program and corresponding optimal cached parameters under all different value conditions of predetermined cache parameter
Value.
The present processes are carried out in fact when it is implemented, a device with historical information register module can be used
Existing, which may include a historical information register module and a cached parameters search module, wherein the historical information is posted
Buffer module includes function interface unit, parameter cache unit and power consumption calculation unit based on historical information register.
By taking the L2 cache shown in Fig. 3 as an example, wherein the part on the dotted line left side is secondary cache structure in Fig. 3, current
Cached parameters be configured to cache block size:64KB, line size:64Bytes, associativity:8-way,
The configuration of cached parameters is completed especially by access controller (access controller).
Each program can have corresponding cached parameters, function entrance address etc. at runtime.When function entrance unit ratio
After being fitted on the entry address for the program (subroutine) being currently running, parameter cache unit records this in historical information register
Address, and recording current cached parameters (wherein includes that there is fixation to take by the cached parameters of to be searched/optimization and other two
The cached parameters of value) value and corresponding power consumption parameter value, power consumption parameter value calculation procedure of the power consumption calculation unit based on record
The power consumption number of this operation, when described program is run again, function entrance unit passes through the entrance again than being fitted on the program
Address knows that the program is run again, and records corresponding information in historical information register, and calculate by power consumption calculation unit
This power consumption number, on this basis, cached parameters search module were transported using the power consumption number that comparator runs this with last time
The lowest power consumption value determined when row is compared, and determines the corresponding cached parameter values of lesser power consumption number, and historical information is posted
Storage, which will be updated, records current cache optimum parameter value, thus, pass through multiple record, the meter when the program is run multiple times
It calculates, compare, can obtain lowest power consumption point of the program under each value condition of the cached parameters of to be searched/optimization, Jin Erke
It determines the corresponding optimal value of cached parameters of the lowest power consumption point, realizes the value of the cached parameters to be searched/optimization
Optimizing is scanned for, the cached parameters used when can finally run based on the resulting optimal cache size of optimizing to program carry out excellent
Change.
In practical application, to simplify implementation complexity and economizing on resources, it is not necessary to apply journey for each program is for example each
Sequence is all made of the application method and scans for optimizing and optimization to its cached parameters, and can carry out classification to distinct program and draw
Point, it will be one kind with the procedure division of similar behavior or similar codes feature, it, can be only for such hence for same class method
In a certain program execute the application method cached parameters optimizing carried out to the program, the subsequent class method can be sought based on this
Identified optimal cached parameters operation.
As it can be seen from the above scheme the method is run by calculation procedure this application discloses a kind of cache optimization method
The size of corresponding power consumption number when the different values of predetermined cache parameter determines that minimum power consumption value is corresponding described predetermined slow
The value of parameter is deposited, and using the value as the optimal value of the predetermined cache parameter, on this basis, to the predetermined cache
The value of parameter optimizes, and is adjusted to the optimal value, realizes caching reconstruct with this;To subsequent described program
It can be can effectively reduce embedded based on the cached parameters after optimization, i.e., the optimal value operation of the described predetermined cache parameter
Etc. equipment system power dissipation.
Embodiment two
The present embodiment two continues to supplement the scheme of embodiment one, in the present embodiment, the predetermined cache parameter tool
Body is caching block size, then refers to Fig. 4, and the cache optimization method can also include: after the step S104
S105: being successively the cache line size, the association by the predetermined cache parameter switching, and every time to institute
State after predetermined cache parameter switches over, execute the method the value of the predetermined cache parameter after switching is carried out it is excellent
Change, so that described program is subsequent based on the caching block size, cache line size and associated optimal value operation.
Since cached parameters include three: cache block size, line size and associativity, thus
Using the cache optimization method of embodiment one to one of cached parameters, the basis optimized such as cache block size
On, it can continue successively for the predetermined cache parameter to be switched to other two cached parameters, and after each switching, circulation is executed
The method of embodiment one carries out optimizing to the cached parameters after switching, to finally make the value of three cached parameters equal
It is optimised.
Specifically, there are bigger influence, institute to power consumption compared to other two parameters due to cache block size
With the present embodiment determines the optimal value of cache block size first, and then successively traverses other two parameters
Each value of (line size and associativity) realizes optimizing.The optimizing of cached parameters with reference to shown in Fig. 5 is illustrated
Figure, after the optimal value for determining cache block size first, under the optimal value of cache block size, after
It is continuous that each value of other two cached parameters is traversed, and optimizing is realized on the basis of lowest power consumption point.
Embodiment three
The embodiment of the present application three discloses a kind of cache optimization system, cache optimization disclosed in the system and the above various embodiments
Method is corresponding.
Corresponding to embodiment one, with reference to Fig. 6, the cache optimization system include obtain module 100, computing module 200, really
Cover half block 300 and the first optimization module 400.
Module 100 is obtained, for obtaining corresponding predetermined power consumption when program runs on the different values of predetermined cache parameter
The different values of parameter.
The acquisition module 100 includes recording unit, is taken for running on every kind of the predetermined cache parameter in program
When value, the value of the value of predetermined cache parameter described in respective record and the predetermined power consumption parameter.
Computing module 200 calculates the predetermined cache parameter for the corresponding value based on the predetermined power consumption parameter
The operation power consumption number of the corresponding described program of every kind of value.
The computing module 200 includes the first computing unit and the second computing unit.
First computing unit calculates the predetermined cache parameter for the corresponding value based on the predetermined power consumption parameter
The corresponding described program of every kind of value cache hit power consumption, cache miss power consumption and leakage current power consumption;
Second computing unit, for being based on the cache hit power consumption, cache miss power consumption and leakage current power consumption meter
Calculate the operation power consumption number of the corresponding described program of every kind of value of the predetermined cache parameter.
Determining module 300 for determining the value of the corresponding predetermined cache parameter of the smallest operation power consumption number, and is made
For the optimal value of the predetermined cache parameter.
First optimization module 400, for the value of the predetermined cache parameter to be adjusted to the optimal value, so that described
The subsequent optimal value operation based on the predetermined cache parameter of program.
Corresponding to embodiment two, with reference to Fig. 7, the cache optimization system can also include the second optimization module 500, be used for
It is successively cache line size, association by the predetermined cache parameter switching, and the predetermined cache parameter is being cut every time
After changing, each module that triggering executes in the system optimizes the value of the predetermined cache parameter after switching, so that
Described program is subsequent based on the caching block size, cache line size and associated optimal value operation.
For the cache optimization system disclosed in the embodiment of the present invention three, since itself and embodiment one are public to embodiment two
The cache optimization method opened is corresponding, so being described relatively simple, related similarity refers to embodiment one to embodiment
The explanation of cache optimization method part in two, and will not be described here in detail.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight
Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other.
For convenience of description, it describes to be divided into various modules when system above or device with function or unit describes respectively.
Certainly, the function of each unit can be realized in the same or multiple software and or hardware when implementing the application.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can
It realizes by means of software and necessary general hardware platform.Based on this understanding, the technical solution essence of the application
On in other words the part that contributes to existing technology can be embodied in the form of software products, the computer software product
It can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are used so that a computer equipment
(can be personal computer, server or the network equipment etc.) executes the certain of each embodiment of the application or embodiment
Method described in part.
Finally, it is to be noted that, herein, such as first, second, third and fourth or the like relational terms
It is only used to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying these
There are any actual relationship or orders between entity or operation.Moreover, the terms "include", "comprise" or its is any
Other variants are intended to non-exclusive inclusion, so that including the process, method, article or equipment of a series of elements
Include not only those elements, but also including other elements that are not explicitly listed, or further includes for this process, side
Method, article or the intrinsic element of equipment.In the absence of more restrictions, limited by sentence "including a ..."
Element, it is not excluded that there is also other identical elements in the process, method, article or apparatus that includes the element.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (8)
1. a kind of cache optimization method characterized by comprising
Obtain the different values that program runs on corresponding predetermined power consumption parameter when the different values of predetermined cache parameter;It is described pre-
Determining cached parameters is any one cached in block size, cache line size and association;
Based on the corresponding value of the predetermined power consumption parameter, the corresponding journey of every kind of value of the predetermined cache parameter is calculated
The operation power consumption number of sequence;
Determine the value of the corresponding predetermined cache parameter of the smallest operation power consumption number, and as the predetermined cache parameter
Optimal value;
The value of the predetermined cache parameter is adjusted to the optimal value, so that described program is subsequent to be based on the predetermined cache
The optimal value operation of parameter.
2. the method according to claim 1, wherein the difference for obtaining program and running on predetermined cache parameter
The different values of corresponding predetermined power consumption parameter include: when value
When program runs on every kind of value of the predetermined cache parameter, the value of predetermined cache parameter described in respective record and
The value of the predetermined power consumption parameter.
3. the method according to claim 1, wherein the corresponding value based on the predetermined power consumption parameter,
The operation power consumption number for calculating the corresponding described program of every kind of value of the predetermined cache parameter includes:
Based on the corresponding value of the predetermined power consumption parameter, the corresponding journey of every kind of value of the predetermined cache parameter is calculated
The cache hit power consumption of sequence, cache miss power consumption and leakage current power consumption;
Based on the cache hit power consumption, predetermined cache parameter described in cache miss power consumption and leakage current power consumption calculation it is every
The operation power consumption number of the corresponding described program of kind value.
4. the method according to claim 1, wherein the predetermined cache parameter is specially to cache block size, then
The method is after being adjusted to the optimal value for the value of the predetermined cache parameter, further includes:
It is successively the cache line size, the association by the predetermined cache parameter switching, and every time to described predetermined slow
It deposits after parameter switches over, executes the method and the value of the predetermined cache parameter after switching is optimized, so that institute
It is subsequent based on the caching block size, cache line size and associated optimal value operation to state program.
5. a kind of cache optimization system characterized by comprising
Module is obtained, for obtaining when program runs on the different values of predetermined cache parameter corresponding predetermined power consumption parameter not
Same value;The predetermined cache parameter is any one cached in block size, cache line size and association;
Computing module, for the corresponding value based on the predetermined power consumption parameter, every kind for calculating the predetermined cache parameter is taken
It is worth the operation power consumption number of corresponding described program;
Determining module, for determining the value of the corresponding predetermined cache parameter of the smallest operation power consumption number, and as described
The optimal value of predetermined cache parameter;
First optimization module, for the value of the predetermined cache parameter to be adjusted to the optimal value, so that after described program
The continuous optimal value operation based on the predetermined cache parameter.
6. system according to claim 5, which is characterized in that the acquisition module includes:
Recording unit makes a reservation for slow when for running on every kind of value of the predetermined cache parameter in program, described in respective record
Deposit the value of parameter and the value of the predetermined power consumption parameter.
7. system according to claim 5, which is characterized in that the computing module includes:
First computing unit calculates the every of the predetermined cache parameter for the corresponding value based on the predetermined power consumption parameter
The cache hit power consumption of the corresponding described program of kind value, cache miss power consumption and leakage current power consumption;
Second computing unit, for being based on the cache hit power consumption, cache miss power consumption and leakage current power consumption calculation institute
State the operation power consumption number of the corresponding described program of every kind of value of predetermined cache parameter.
8. system according to claim 5, which is characterized in that the predetermined cache parameter is specially to cache block size, then
The system also includes:
Second optimization module is used to be successively cache line size and association by the predetermined cache parameter switching, and right every time
After the predetermined cache parameter switches over, triggering executes each module in the system and joins to the predetermined cache after switching
Several values optimize, and based on the caching block size, cache line size and associated optimal take so that described program is subsequent
Value operation.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610575700.2A CN106250325B (en) | 2016-07-19 | 2016-07-19 | A kind of cache optimization method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610575700.2A CN106250325B (en) | 2016-07-19 | 2016-07-19 | A kind of cache optimization method and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN106250325A CN106250325A (en) | 2016-12-21 |
| CN106250325B true CN106250325B (en) | 2019-11-19 |
Family
ID=57613566
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610575700.2A Active CN106250325B (en) | 2016-07-19 | 2016-07-19 | A kind of cache optimization method and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106250325B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1645341A (en) * | 2003-11-26 | 2005-07-27 | 英特尔公司 | Method and apparatus for processing cache allocation requests based on priority |
| CN1971538A (en) * | 2005-08-05 | 2007-05-30 | 富士通株式会社 | Reducing power consumption at a cache |
| CN102521150A (en) * | 2011-11-28 | 2012-06-27 | 华为技术有限公司 | Application program cache distribution method and device |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8156357B2 (en) * | 2009-01-27 | 2012-04-10 | Freescale Semiconductor, Inc. | Voltage-based memory size scaling in a data processing system |
| US9021207B2 (en) * | 2012-12-20 | 2015-04-28 | Advanced Micro Devices, Inc. | Management of cache size |
-
2016
- 2016-07-19 CN CN201610575700.2A patent/CN106250325B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1645341A (en) * | 2003-11-26 | 2005-07-27 | 英特尔公司 | Method and apparatus for processing cache allocation requests based on priority |
| CN1971538A (en) * | 2005-08-05 | 2007-05-30 | 富士通株式会社 | Reducing power consumption at a cache |
| CN102521150A (en) * | 2011-11-28 | 2012-06-27 | 华为技术有限公司 | Application program cache distribution method and device |
Non-Patent Citations (1)
| Title |
|---|
| Amoeba-Cache: Adaptive Blocks for EliminatingWaste in the Memory Hierarchy;Snehasish Kumar等;《IEEE》;20121205;第376-388页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106250325A (en) | 2016-12-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109598338B (en) | An FPGA-Based Computationally Optimized Convolutional Neural Network Accelerator | |
| CN111143243B (en) | A cache prefetching method and system based on NVM hybrid memory | |
| US20220374692A1 (en) | Interleaving memory requests to accelerate memory accesses | |
| CN103150265B (en) | The fine-grained data distribution method of isomery storer on Embedded sheet | |
| CN108418858B (en) | A Data Replica Placement Method for Geo-distributed Cloud Storage | |
| CN103246613A (en) | Cache device and cache data acquiring method therefor | |
| CN106874478A (en) | Parallelization random tags subset multi-tag file classification method based on Spark | |
| CN102937937A (en) | Data prefetcher and method for prefetching data into cache memory | |
| Mishra et al. | Fine-grained accelerators for sparse machine learning workloads | |
| CN107798346A (en) | Quick track similarity matching method based on Frechet distance threshold | |
| CN110705702A (en) | Dynamic extensible convolutional neural network accelerator | |
| CN115440226A (en) | Low-power-consumption system applied to voice keyword recognition based on impulse neural network | |
| CN109359729B (en) | System and method for realizing data caching on FPGA | |
| CN118863055A (en) | A hybrid expert model reasoning method | |
| CN105359142A (en) | Hash connection method, device and database management system | |
| Fang et al. | An Energy-Efficient Unstructured Sparsity-Aware Deep SNN Accelerator With 3-D Computation Array | |
| CN113780529B (en) | A sparse convolutional neural network multi-level storage computing system for FPGA | |
| CN118278468B (en) | Deep neural network reasoning method and device based on database management system | |
| WO2023030227A1 (en) | Data processing method, apparatus and system | |
| CN106250325B (en) | A kind of cache optimization method and system | |
| CN102662863A (en) | Coarse-grained last-level caching bypass method | |
| CN118819427A (en) | Multi-level intelligent cache system and cache data processing method and program product | |
| CN111653317B (en) | Gene comparison acceleration device, method and system | |
| Keramidas et al. | Applying decay to reduce dynamic power in set-associative caches | |
| Zhao et al. | Resource-aware cache management for in-memory data analytics frameworks |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP02 | Change in the address of a patent holder |
Address after: Room 101-105, floor 1, Chuangda building, No. 9, Qinghua East Road, Haidian District, Beijing 100083 (Dongsheng District) Patentee after: Thunder Software Technology Co., Ltd. Address before: 100191 Beijing Haidian District Lung Cheung Road No. 1 Tai Xiang business building 4 layer 401-409 Patentee before: Thunder Software Technology Co., Ltd. |
|
| CP02 | Change in the address of a patent holder |