Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where is the source code of LRU implemented in. #18

Open
tickfqw opened this issue May 25, 2016 · 1 comment
Open

where is the source code of LRU implemented in. #18

tickfqw opened this issue May 25, 2016 · 1 comment

Comments

@tickfqw
Copy link

tickfqw commented May 25, 2016

Hello,I want to make some changes to the LRU algorithm,but I can't find where is it in gpgpu-sim.Could you help me ,it help me a lot .Thanks a lot!

@grasshoper97
Copy link

in the function tag_array::probe() in file gpu-cache.cc
142 if (line->m_status != RESERVED) {//-at least one is not RESERVED, all_reserved = false;means one can be evict.
143 all_reserved = false;
144 if (line->m_status == INVALID) {
145 invalid_line = index; //- the cache has a blank line, can be allocte to the quest if miss.
146 } else {
147 //- valid line : keep track of most appropriate replacement candidate. select a cadidate line if miss.
148 if ( m_config.m_replacement_policy == LRU ) {
149 if ( line->m_last_access_time < valid_timestamp ) {//-find a line with earlyest access time
150 valid_timestamp = line->m_last_access_time;
151 valid_line = index;
152 }
153 } else if ( m_config.m_replacement_policy == FIFO ) {
154 if ( line->m_alloc_time < valid_timestamp ) { //-find a line with earlyest alloc time
155 valid_timestamp = line->m_alloc_time;
156 valid_line = index;
157 }
158 }
159 }
160 }

gpusim implement LRU/FIFO by record the access time/allocate time of a cache-line.

mkhairy referenced this issue in purdue-aalp/gpgpu-sim_distribution_old Oct 16, 2018
yechen3 referenced this issue in yechen3/gpgpu-sim_distribution Jan 21, 2021
VijayKandiah pushed a commit to VijayKandiah/gpgpu-sim_distribution that referenced this issue Oct 12, 2021
Sub core & some minor bug fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants