美文网首页
实验 请求调页存储管理方式的模拟

实验 请求调页存储管理方式的模拟

作者: Jingtianer | 来源:发表于2020-12-14 23:16 被阅读0次

    1、实验目的

    通过对页面、页表、地址转换和页面置换过程的模拟,加深对请求调页系统的原理和实现过程的理解。

    2、实验内容

    1. 假设每个页面中可存放10条指令,分配给一作业的内存块数为4。
    2. 用C语言模拟一作业的执行过程。该作业共有320条指令,即它的地址空间为32页,目前它的所有页都还未调入内存。在模拟过程中,如果所访问的指令已经在内存中,则显示其物理地址,并转下一条指令。如果所访问的指令还未装入内存,则发生缺页,此时需记录缺页的次数,并将相应页调入内存。如果4个内存块中均已装入该作业,则需进行页面置换。最后显示其物理地址,并转下一条指令。在所有320条指令执行完毕后,请计算并显示作业运行过程中发生的缺页率。
    3. 置换算法:请分别考虑OPT、FIFO和LRU算法。
    4. 作业中指令的访问次序按下述原则生成:

    • 50%的指令是顺序执行的。
    • 25%的指令是均匀分布在前地址部分。
    • 25%的指令时均匀分布在后地址部分。

    具体的实施办法是:

    ① 在[0,319]之间随机选取一条起始执行指令,其序号为m;
    ② 顺序执行下一条指令,即序号为m+1的指令;
    ③ 通过随机数,跳转到前地址部分[0,m-1]中的某条指令处,其序号为m1;
    ④ 顺序执行下一条指令,即序号为m1+1的指令;
    ⑤ 通过随机数,跳转到后地址部分[m1+2,319]中的某条指令处,其序号为m2;
    ⑥ 顺序执行下一条指令,即序号为m2+1的指令;
    ⑦ 重复跳转到前地址部分、顺序执行、跳转到后地址部分、顺序执行的过程,直至执行320条指令。

    实验代码

    #include <iostream>
    #include <vector>
    #include <map>
    #include <random>
    #include <ctime>
    #include <iomanip>
    #include <queue>
    #include <stack>
    using std::cout;
    using std::endl;
    #define show_progress
    const int max_ins_num = 320;
    const int ins_per_mb = 10;
    const int mem_max_mb = 4;
    
    int cur_clock = 0;
    const int total_mb = max_ins_num/ins_per_mb;
    
    int get_inst_i(int min, int max) {
        static std::default_random_engine engine(time(nullptr));
        //std::uniform_int_distribution<int>distribution(min, max);
        return engine() %(max - min + 1) + min;
    }
    #define chart_head std::left << std::setw(len+1) << std::setfill('-') << ""
    #define chart_cell "|" << std::left << std::setw(len) << std::setfill(' ')
    void show_chart(std::queue<int> fifo, std::stack<int> lru, const std::vector<int>& opt, int ins, int block) {
        std::cout << "cur_ins = " << ins << "\ncur_block = " << block << std::endl;
        int len = 5;
        std::cout
                << chart_head << "" << chart_head << "" << chart_head << "-" << std::endl
                << chart_cell << "fifo"
                << chart_cell<< "lru"
                << chart_cell << "opt" << "|" << std::endl
                << chart_head << "" << chart_head << "" << chart_head << "-" << std::endl;
        for (int i = 0; i < mem_max_mb; ++i) {
            int lru_cout = -1;
            int fifo_cout = -1;
            if (!fifo.empty()) {
                fifo_cout = fifo.front();
                fifo.pop();
            }
            if (!lru.empty()) {
                lru_cout = lru.top();
                lru.pop();
            }
            std::cout
                << chart_cell << fifo_cout
                << chart_cell << lru_cout
                << chart_cell << opt[i] << "|" << std::endl;
        }
        std::cout << chart_head << "" << chart_head << "" << chart_head << "-" << std::endl;
    }
    int fifo_exchange = 0;
    int lru_exchange = 0;
    int opt_exchange = 0;
    
    void exe_inst_i(int ins, const std::vector<int>& ins_arr) {
    
        static std::queue<int> fifo_mem_blocks;
        static std::vector<bool> fifo_map(total_mb, false);
    
        static std::stack<int> lru_mem_blocks;
        static std::vector<bool> lru_map(total_mb, false);
    
        static std::vector<int> opt_mem_blocks(mem_max_mb, -1);
        static std::vector<int> opt_map(total_mb, max_ins_num);
    
        int cur_ins = ins;
        int cur_block = ins/ins_per_mb;
        //fifo
        if(!fifo_map[cur_block]) {
            if (fifo_mem_blocks.size() >= mem_max_mb) {
                fifo_map[fifo_mem_blocks.front()] = false;
                fifo_mem_blocks.pop();
                fifo_exchange++;
            }
            fifo_mem_blocks.push(cur_block);
            fifo_map[cur_block] = true;
        } else {
        }
        // lru
        std::stack<int> lru_temp;
        if (!lru_map[cur_block]) {
            while (!lru_mem_blocks.empty()) {
                lru_temp.push(lru_mem_blocks.top());
                lru_mem_blocks.pop();
            }
            if (lru_temp.size() >= mem_max_mb) {
                lru_map[lru_temp.top()] = false;
                lru_temp.pop();
                lru_exchange++;
            }
            lru_map[cur_block] = true;
            while (!lru_temp.empty()) {
                lru_mem_blocks.push(lru_temp.top());
                lru_temp.pop();
            }
            lru_mem_blocks.push(cur_block);
        } else {
            while (lru_mem_blocks.top() != cur_block) {
                lru_temp.push(lru_mem_blocks.top());
                lru_mem_blocks.pop();
            }
            lru_mem_blocks.pop();
            while (!lru_temp.empty()) {
                lru_mem_blocks.push(lru_temp.top());
                lru_temp.pop();
            }
            lru_mem_blocks.push(cur_block);
        }
        //opt
        for (int i = cur_clock; i < max_ins_num; i++) {
            int block_i = ins_arr[i]/ins_per_mb;
            opt_map[block_i] = opt_map[block_i] < i ? opt_map[block_i] : i;
            //设置opt=从clock开始,某个块儿第一次出现的位置
        }
        static int opt_num = 0;
        int opt_exchange_i = 0;
        for (int i = 0; i < mem_max_mb; ++i) {
            if (opt_mem_blocks[i] == cur_block || opt_mem_blocks[i] == -1) {
                opt_exchange_i = i;
                // 需要的块儿已经在里面了,停止
                break;
            }// 如果不在里面,分支不会执行,可以找到最远被访问的最佳替换
            if (opt_map[opt_mem_blocks[i]] > opt_map[opt_mem_blocks[opt_exchange_i]]) { //这里opt_exchange_i 和 i等价的,少套用了一层
                opt_exchange_i = i;
            }
        }
        if (opt_mem_blocks[opt_exchange_i] == -1) {
            opt_mem_blocks[opt_num] = cur_block;
            opt_num++;
        } else if (opt_mem_blocks[opt_exchange_i] != cur_block) {
            opt_mem_blocks[opt_exchange_i] = cur_block;
            opt_exchange++;
        }
        //opt_map[cur_block] = max_ins_num;
        for (int i = 0; i < total_mb; i++) {
            opt_map[i] = max_ins_num;
        }
        //执行过的块儿置为最大值,意为再也不用(可能)
    #ifdef show_progress
        show_chart(fifo_mem_blocks, lru_mem_blocks, opt_mem_blocks, cur_ins, cur_block);
    #endif
    }
    
    void show_info(int fifo, int lru, int opt) {
        int len = int(std::string("miss_ratio").length()+1);
        std::cout
                << chart_head << "" << chart_head << "" << chart_head << "" << chart_head << "-" << std::endl
                << chart_cell << "item"
                << chart_cell << "fifo"
                << chart_cell<< "lru"
                << chart_cell << "opt" << "|" << std::endl
                << chart_head << "" << chart_head << "" << chart_head << "" << chart_head << "-" << std::endl
                << chart_cell << "hit"
                << chart_cell << max_ins_num-fifo
                << chart_cell << max_ins_num-lru
                << chart_cell << max_ins_num-opt << "|" << std::endl
                << chart_cell << "hit_ratio"
                << chart_cell << (1-fifo/(double)max_ins_num)*100
                << chart_cell << (1-lru/(double)max_ins_num)*100
                << chart_cell << (1-opt/(double)max_ins_num)*100 << "|" << std::endl
                << chart_cell << "miss"
                << chart_cell << fifo
                << chart_cell << lru
                << chart_cell << opt << "|" << std::endl
                << chart_cell << "miss_ratio"
                << chart_cell << fifo/(double)max_ins_num*100
                << chart_cell << lru/(double)max_ins_num*100
                << chart_cell << opt/(double)max_ins_num*100 << "|" << std::endl
                << chart_head << "" << chart_head << "" << chart_head << "" << chart_head << "-" << std::endl;
    }
    
    int main() {
    
        std::vector<int> ins_arr(max_ins_num,0);
        int ins;
        for(int i = 0; i < max_ins_num; i++) {
            if (i%6 == 0) {
                ins = get_inst_i(0,max_ins_num-1);
                ins_arr[i] = ins;
            } else if (i%6 == 1 || i%6 == 3 || i%6 == 5) {
                ins_arr[i] = ins_arr[i-1] + 1 < max_ins_num ? ins_arr[i-1] + 1 : max_ins_num-1;
            } else if (i%6 == 2){
                ins = get_inst_i(0, ins - 1 > 0 ? ins - 1 : 1);
                ins_arr[i] = ins;
            } else if (i%6 == 4) {
                ins =  get_inst_i(ins + 2 > max_ins_num-2 ? max_ins_num-2 : ins+2, max_ins_num-1);
                ins_arr[i] = ins;
            }
        }
        for (cur_clock = 0; cur_clock < max_ins_num; ++cur_clock) {
            exe_inst_i(ins_arr[cur_clock], ins_arr);
        }
        show_info(fifo_exchange, lru_exchange, opt_exchange);
        return 0;
    }
    
    

    运行结果

    cur_ins = 222
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |22   |22   |
    |-1   |-1   |-1   |
    |-1   |-1   |-1   |
    |-1   |-1   |-1   |
    -------------------
    cur_ins = 223
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |22   |22   |
    |-1   |-1   |-1   |
    |-1   |-1   |-1   |
    |-1   |-1   |-1   |
    -------------------
    cur_ins = 179
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |17   |22   |
    |17   |22   |17   |
    |-1   |-1   |-1   |
    |-1   |-1   |-1   |
    -------------------
    cur_ins = 180
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |18   |22   |
    |17   |17   |17   |
    |18   |22   |18   |
    |-1   |-1   |-1   |
    -------------------
    cur_ins = 255
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |25   |22   |
    |17   |18   |17   |
    |18   |17   |18   |
    |25   |22   |25   |
    -------------------
    cur_ins = 256
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |25   |22   |
    |17   |18   |17   |
    |18   |17   |18   |
    |25   |22   |25   |
    -------------------
    cur_ins = 312
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |17   |31   |22   |
    |18   |25   |31   |
    |25   |18   |18   |
    |31   |17   |25   |
    -------------------
    cur_ins = 313
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |17   |31   |22   |
    |18   |25   |31   |
    |25   |18   |18   |
    |31   |17   |25   |
    -------------------
    cur_ins = 17
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |1    |22   |
    |25   |31   |1    |
    |31   |25   |18   |
    |1    |18   |25   |
    -------------------
    cur_ins = 18
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |1    |22   |
    |25   |31   |1    |
    |31   |25   |18   |
    |1    |18   |25   |
    -------------------
    cur_ins = 232
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |23   |22   |
    |31   |1    |1    |
    |1    |31   |23   |
    |23   |25   |25   |
    -------------------
    cur_ins = 233
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |23   |22   |
    |31   |1    |1    |
    |1    |31   |23   |
    |23   |25   |25   |
    -------------------
    cur_ins = 83
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |8    |22   |
    |1    |23   |1    |
    |23   |1    |8    |
    |8    |31   |25   |
    -------------------
    cur_ins = 84
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |8    |22   |
    |1    |23   |1    |
    |23   |1    |8    |
    |8    |31   |25   |
    -------------------
    cur_ins = 23
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |2    |22   |
    |23   |8    |1    |
    |8    |23   |2    |
    |2    |1    |25   |
    -------------------
    cur_ins = 24
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |2    |22   |
    |23   |8    |1    |
    |8    |23   |2    |
    |2    |1    |25   |
    -------------------
    cur_ins = 196
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |19   |22   |
    |8    |2    |1    |
    |2    |8    |2    |
    |19   |23   |19   |
    -------------------
    cur_ins = 197
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |19   |22   |
    |8    |2    |1    |
    |2    |8    |2    |
    |19   |23   |19   |
    -------------------
    cur_ins = 212
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |21   |21   |
    |2    |19   |1    |
    |19   |2    |2    |
    |21   |8    |19   |
    -------------------
    cur_ins = 213
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |21   |21   |
    |2    |19   |1    |
    |19   |2    |2    |
    |21   |8    |19   |
    -------------------
    cur_ins = 45
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |4    |4    |
    |19   |21   |1    |
    |21   |19   |2    |
    |4    |2    |19   |
    -------------------
    cur_ins = 46
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |4    |4    |
    |19   |21   |1    |
    |21   |19   |2    |
    |4    |2    |19   |
    -------------------
    cur_ins = 193
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |19   |4    |
    |19   |4    |1    |
    |21   |21   |2    |
    |4    |2    |19   |
    -------------------
    cur_ins = 194
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |19   |4    |
    |19   |4    |1    |
    |21   |21   |2    |
    |4    |2    |19   |
    -------------------
    cur_ins = 157
    cur_block = 15
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |15   |15   |
    |21   |19   |1    |
    |4    |4    |2    |
    |15   |21   |19   |
    -------------------
    cur_ins = 158
    cur_block = 15
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |15   |15   |
    |21   |19   |1    |
    |4    |4    |2    |
    |15   |21   |19   |
    -------------------
    cur_ins = 31
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |3    |3    |
    |4    |15   |1    |
    |15   |19   |2    |
    |3    |4    |19   |
    -------------------
    cur_ins = 32
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |3    |3    |
    |4    |15   |1    |
    |15   |19   |2    |
    |3    |4    |19   |
    -------------------
    cur_ins = 142
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |14   |14   |
    |15   |3    |1    |
    |3    |15   |2    |
    |14   |19   |19   |
    -------------------
    cur_ins = 143
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |14   |14   |
    |15   |3    |1    |
    |3    |15   |2    |
    |14   |19   |19   |
    -------------------
    cur_ins = 190
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |15   |19   |14   |
    |3    |14   |1    |
    |14   |3    |2    |
    |19   |15   |19   |
    -------------------
    cur_ins = 191
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |15   |19   |14   |
    |3    |14   |1    |
    |14   |3    |2    |
    |19   |15   |19   |
    -------------------
    cur_ins = 115
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |11   |11   |
    |14   |19   |1    |
    |19   |14   |2    |
    |11   |3    |19   |
    -------------------
    cur_ins = 116
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |11   |11   |
    |14   |19   |1    |
    |19   |14   |2    |
    |11   |3    |19   |
    -------------------
    cur_ins = 192
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |19   |11   |
    |14   |11   |1    |
    |19   |14   |2    |
    |11   |3    |19   |
    -------------------
    cur_ins = 193
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |19   |11   |
    |14   |11   |1    |
    |19   |14   |2    |
    |11   |3    |19   |
    -------------------
    cur_ins = 271
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |27   |11   |
    |19   |19   |1    |
    |11   |11   |2    |
    |27   |14   |27   |
    -------------------
    cur_ins = 272
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |27   |11   |
    |19   |19   |1    |
    |11   |11   |2    |
    |27   |14   |27   |
    -------------------
    cur_ins = 27
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |2    |11   |
    |11   |27   |1    |
    |27   |19   |2    |
    |2    |11   |27   |
    -------------------
    cur_ins = 28
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |2    |11   |
    |11   |27   |1    |
    |27   |19   |2    |
    |2    |11   |27   |
    -------------------
    cur_ins = 264
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |26   |11   |
    |27   |2    |1    |
    |2    |27   |2    |
    |26   |19   |26   |
    -------------------
    cur_ins = 265
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |26   |11   |
    |27   |2    |1    |
    |2    |27   |2    |
    |26   |19   |26   |
    -------------------
    cur_ins = 9
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |0    |11   |
    |2    |26   |1    |
    |26   |2    |0    |
    |0    |27   |26   |
    -------------------
    cur_ins = 10
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |1    |11   |
    |26   |0    |1    |
    |0    |26   |0    |
    |1    |2    |26   |
    -------------------
    cur_ins = 4
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |0    |11   |
    |26   |1    |1    |
    |0    |26   |0    |
    |1    |2    |26   |
    -------------------
    cur_ins = 5
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |0    |11   |
    |26   |1    |1    |
    |0    |26   |0    |
    |1    |2    |26   |
    -------------------
    cur_ins = 219
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |21   |11   |
    |0    |0    |1    |
    |1    |1    |21   |
    |21   |26   |26   |
    -------------------
    cur_ins = 220
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |22   |11   |
    |1    |21   |1    |
    |21   |0    |22   |
    |22   |1    |26   |
    -------------------
    cur_ins = 122
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |12   |11   |
    |21   |22   |1    |
    |22   |21   |12   |
    |12   |0    |26   |
    -------------------
    cur_ins = 123
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |12   |11   |
    |21   |22   |1    |
    |22   |21   |12   |
    |12   |0    |26   |
    -------------------
    cur_ins = 121
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |12   |11   |
    |21   |22   |1    |
    |22   |21   |12   |
    |12   |0    |26   |
    -------------------
    cur_ins = 122
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |12   |11   |
    |21   |22   |1    |
    |22   |21   |12   |
    |12   |0    |26   |
    -------------------
    cur_ins = 295
    cur_block = 29
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |29   |11   |
    |22   |12   |1    |
    |12   |22   |29   |
    |29   |21   |26   |
    -------------------
    cur_ins = 296
    cur_block = 29
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |29   |11   |
    |22   |12   |1    |
    |12   |22   |29   |
    |29   |21   |26   |
    -------------------
    cur_ins = 158
    cur_block = 15
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |15   |11   |
    |12   |29   |1    |
    |29   |12   |15   |
    |15   |22   |26   |
    -------------------
    cur_ins = 159
    cur_block = 15
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |15   |11   |
    |12   |29   |1    |
    |29   |12   |15   |
    |15   |22   |26   |
    -------------------
    cur_ins = 15
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |1    |11   |
    |29   |15   |1    |
    |15   |29   |15   |
    |1    |12   |26   |
    -------------------
    cur_ins = 16
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |1    |11   |
    |29   |15   |1    |
    |15   |29   |15   |
    |1    |12   |26   |
    -------------------
    cur_ins = 53
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |29   |5    |11   |
    |15   |1    |1    |
    |1    |15   |5    |
    |5    |29   |26   |
    -------------------
    cur_ins = 54
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |29   |5    |11   |
    |15   |1    |1    |
    |1    |15   |5    |
    |5    |29   |26   |
    -------------------
    cur_ins = 161
    cur_block = 16
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |15   |16   |11   |
    |1    |5    |16   |
    |5    |1    |5    |
    |16   |15   |26   |
    -------------------
    cur_ins = 162
    cur_block = 16
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |15   |16   |11   |
    |1    |5    |16   |
    |5    |1    |5    |
    |16   |15   |26   |
    -------------------
    cur_ins = 97
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |9    |11   |
    |5    |16   |9    |
    |16   |5    |5    |
    |9    |1    |26   |
    -------------------
    cur_ins = 98
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |9    |11   |
    |5    |16   |9    |
    |16   |5    |5    |
    |9    |1    |26   |
    -------------------
    cur_ins = 131
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |13   |11   |
    |16   |9    |13   |
    |9    |16   |5    |
    |13   |5    |26   |
    -------------------
    cur_ins = 132
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |13   |11   |
    |16   |9    |13   |
    |9    |16   |5    |
    |13   |5    |26   |
    -------------------
    cur_ins = 259
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |25   |11   |
    |9    |13   |25   |
    |13   |9    |5    |
    |25   |16   |26   |
    -------------------
    cur_ins = 260
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |9    |26   |11   |
    |13   |25   |25   |
    |25   |13   |5    |
    |26   |9    |26   |
    -------------------
    cur_ins = 241
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |24   |11   |
    |25   |26   |25   |
    |26   |25   |5    |
    |24   |13   |24   |
    -------------------
    cur_ins = 242
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |24   |11   |
    |25   |26   |25   |
    |26   |25   |5    |
    |24   |13   |24   |
    -------------------
    cur_ins = 256
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |25   |11   |
    |25   |24   |25   |
    |26   |26   |5    |
    |24   |13   |24   |
    -------------------
    cur_ins = 257
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |25   |11   |
    |25   |24   |25   |
    |26   |26   |5    |
    |24   |13   |24   |
    -------------------
    cur_ins = 114
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |11   |11   |
    |26   |25   |25   |
    |24   |24   |5    |
    |11   |26   |24   |
    -------------------
    cur_ins = 115
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |11   |11   |
    |26   |25   |25   |
    |24   |24   |5    |
    |11   |26   |24   |
    -------------------
    cur_ins = 35
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |3    |3    |
    |24   |11   |25   |
    |11   |25   |5    |
    |3    |24   |24   |
    -------------------
    cur_ins = 36
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |3    |3    |
    |24   |11   |25   |
    |11   |25   |5    |
    |3    |24   |24   |
    -------------------
    cur_ins = 124
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |12   |3    |
    |11   |3    |12   |
    |3    |11   |5    |
    |12   |25   |24   |
    -------------------
    cur_ins = 125
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |12   |3    |
    |11   |3    |12   |
    |3    |11   |5    |
    |12   |25   |24   |
    -------------------
    cur_ins = 53
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |5    |3    |
    |3    |12   |12   |
    |12   |3    |5    |
    |5    |11   |24   |
    -------------------
    cur_ins = 54
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |5    |3    |
    |3    |12   |12   |
    |12   |3    |5    |
    |5    |11   |24   |
    -------------------
    cur_ins = 8
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |0    |3    |
    |12   |5    |0    |
    |5    |12   |5    |
    |0    |3    |24   |
    -------------------
    cur_ins = 9
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |0    |3    |
    |12   |5    |0    |
    |5    |12   |5    |
    |0    |3    |24   |
    -------------------
    cur_ins = 184
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |18   |3    |
    |5    |0    |18   |
    |0    |5    |5    |
    |18   |12   |24   |
    -------------------
    cur_ins = 185
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |18   |3    |
    |5    |0    |18   |
    |0    |5    |5    |
    |18   |12   |24   |
    -------------------
    cur_ins = 240
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |24   |3    |
    |0    |18   |18   |
    |18   |0    |5    |
    |24   |5    |24   |
    -------------------
    cur_ins = 241
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |24   |3    |
    |0    |18   |18   |
    |18   |0    |5    |
    |24   |5    |24   |
    -------------------
    cur_ins = 28
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |2    |3    |
    |18   |24   |2    |
    |24   |18   |5    |
    |2    |0    |24   |
    -------------------
    cur_ins = 29
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |2    |3    |
    |18   |24   |2    |
    |24   |18   |5    |
    |2    |0    |24   |
    -------------------
    cur_ins = 224
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |22   |3    |
    |24   |2    |2    |
    |2    |24   |5    |
    |22   |18   |22   |
    -------------------
    cur_ins = 225
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |22   |3    |
    |24   |2    |2    |
    |2    |24   |5    |
    |22   |18   |22   |
    -------------------
    cur_ins = 92
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |9    |3    |
    |2    |22   |2    |
    |22   |2    |5    |
    |9    |24   |9    |
    -------------------
    cur_ins = 93
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |9    |3    |
    |2    |22   |2    |
    |22   |2    |5    |
    |9    |24   |9    |
    -------------------
    cur_ins = 49
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |4    |3    |
    |22   |9    |2    |
    |9    |22   |5    |
    |4    |2    |4    |
    -------------------
    cur_ins = 50
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |5    |3    |
    |9    |4    |2    |
    |4    |9    |5    |
    |5    |22   |4    |
    -------------------
    cur_ins = 279
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |9    |27   |3    |
    |4    |5    |2    |
    |5    |4    |5    |
    |27   |9    |27   |
    -------------------
    cur_ins = 280
    cur_block = 28
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |28   |3    |
    |5    |27   |2    |
    |27   |5    |28   |
    |28   |4    |27   |
    -------------------
    cur_ins = 34
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |3    |3    |
    |27   |28   |2    |
    |28   |27   |28   |
    |3    |5    |27   |
    -------------------
    cur_ins = 35
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |3    |3    |
    |27   |28   |2    |
    |28   |27   |28   |
    |3    |5    |27   |
    -------------------
    cur_ins = 26
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |2    |3    |
    |28   |3    |2    |
    |3    |28   |28   |
    |2    |27   |27   |
    -------------------
    cur_ins = 27
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |2    |3    |
    |28   |3    |2    |
    |3    |28   |28   |
    |2    |27   |27   |
    -------------------
    cur_ins = 239
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |28   |23   |3    |
    |3    |2    |2    |
    |2    |3    |23   |
    |23   |28   |27   |
    -------------------
    cur_ins = 240
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |24   |24   |
    |2    |23   |2    |
    |23   |2    |23   |
    |24   |3    |27   |
    -------------------
    cur_ins = 270
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |27   |24   |
    |23   |24   |2    |
    |24   |23   |23   |
    |27   |2    |27   |
    -------------------
    cur_ins = 271
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |27   |24   |
    |23   |24   |2    |
    |24   |23   |23   |
    |27   |2    |27   |
    -------------------
    cur_ins = 229
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |22   |24   |
    |24   |27   |2    |
    |27   |24   |23   |
    |22   |23   |22   |
    -------------------
    cur_ins = 230
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |23   |24   |
    |24   |22   |2    |
    |27   |27   |23   |
    |22   |24   |22   |
    -------------------
    cur_ins = 315
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |31   |24   |
    |27   |23   |2    |
    |22   |22   |23   |
    |31   |27   |31   |
    -------------------
    cur_ins = 316
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |31   |24   |
    |27   |23   |2    |
    |22   |22   |23   |
    |31   |27   |31   |
    -------------------
    cur_ins = 160
    cur_block = 16
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |16   |24   |
    |22   |31   |2    |
    |31   |23   |16   |
    |16   |22   |31   |
    -------------------
    cur_ins = 161
    cur_block = 16
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |16   |24   |
    |22   |31   |2    |
    |31   |23   |16   |
    |16   |22   |31   |
    -------------------
    cur_ins = 8
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |0    |24   |
    |31   |16   |2    |
    |16   |31   |0    |
    |0    |23   |31   |
    -------------------
    cur_ins = 9
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |0    |24   |
    |31   |16   |2    |
    |16   |31   |0    |
    |0    |23   |31   |
    -------------------
    cur_ins = 242
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |24   |24   |
    |16   |0    |2    |
    |0    |16   |0    |
    |24   |31   |31   |
    -------------------
    cur_ins = 243
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |24   |24   |
    |16   |0    |2    |
    |0    |16   |0    |
    |24   |31   |31   |
    -------------------
    cur_ins = 216
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |21   |24   |
    |0    |24   |21   |
    |24   |0    |0    |
    |21   |16   |31   |
    -------------------
    cur_ins = 217
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |21   |24   |
    |0    |24   |21   |
    |24   |0    |0    |
    |21   |16   |31   |
    -------------------
    cur_ins = 2
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |0    |24   |
    |0    |21   |21   |
    |24   |24   |0    |
    |21   |16   |31   |
    -------------------
    cur_ins = 3
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |0    |24   |
    |0    |21   |21   |
    |24   |24   |0    |
    |21   |16   |31   |
    -------------------
    cur_ins = 268
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |26   |24   |
    |24   |0    |21   |
    |21   |21   |26   |
    |26   |24   |31   |
    -------------------
    cur_ins = 269
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |26   |24   |
    |24   |0    |21   |
    |21   |21   |26   |
    |26   |24   |31   |
    -------------------
    cur_ins = 250
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |25   |24   |
    |21   |26   |21   |
    |26   |0    |25   |
    |25   |21   |31   |
    -------------------
    cur_ins = 251
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |25   |24   |
    |21   |26   |21   |
    |26   |0    |25   |
    |25   |21   |31   |
    -------------------
    cur_ins = 132
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |13   |24   |
    |26   |25   |21   |
    |25   |26   |13   |
    |13   |0    |31   |
    -------------------
    cur_ins = 133
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |13   |24   |
    |26   |25   |21   |
    |25   |26   |13   |
    |13   |0    |31   |
    -------------------
    cur_ins = 144
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |14   |24   |
    |25   |13   |21   |
    |13   |25   |14   |
    |14   |26   |31   |
    -------------------
    cur_ins = 145
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |14   |24   |
    |25   |13   |21   |
    |13   |25   |14   |
    |14   |26   |31   |
    -------------------
    cur_ins = 243
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |24   |24   |
    |13   |14   |21   |
    |14   |13   |14   |
    |24   |25   |31   |
    -------------------
    cur_ins = 244
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |24   |24   |
    |13   |14   |21   |
    |14   |13   |14   |
    |24   |25   |31   |
    -------------------
    cur_ins = 173
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |17   |24   |
    |14   |24   |21   |
    |24   |14   |17   |
    |17   |13   |31   |
    -------------------
    cur_ins = 174
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |17   |24   |
    |14   |24   |21   |
    |24   |14   |17   |
    |17   |13   |31   |
    -------------------
    cur_ins = 178
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |17   |24   |
    |14   |24   |21   |
    |24   |14   |17   |
    |17   |13   |31   |
    -------------------
    cur_ins = 179
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |17   |24   |
    |14   |24   |21   |
    |24   |14   |17   |
    |17   |13   |31   |
    -------------------
    cur_ins = 185
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |18   |24   |
    |24   |17   |21   |
    |17   |24   |18   |
    |18   |14   |31   |
    -------------------
    cur_ins = 186
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |18   |24   |
    |24   |17   |21   |
    |17   |24   |18   |
    |18   |14   |31   |
    -------------------
    cur_ins = 181
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |18   |24   |
    |24   |17   |21   |
    |17   |24   |18   |
    |18   |14   |31   |
    -------------------
    cur_ins = 182
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |18   |24   |
    |24   |17   |21   |
    |17   |24   |18   |
    |18   |14   |31   |
    -------------------
    cur_ins = 296
    cur_block = 29
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |29   |24   |
    |17   |18   |21   |
    |18   |17   |29   |
    |29   |24   |31   |
    -------------------
    cur_ins = 297
    cur_block = 29
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |29   |24   |
    |17   |18   |21   |
    |18   |17   |29   |
    |29   |24   |31   |
    -------------------
    cur_ins = 319
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |17   |31   |24   |
    |18   |29   |21   |
    |29   |18   |29   |
    |31   |17   |31   |
    -------------------
    cur_ins = 319
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |17   |31   |24   |
    |18   |29   |21   |
    |29   |18   |29   |
    |31   |17   |31   |
    -------------------
    cur_ins = 191
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |19   |24   |
    |29   |31   |21   |
    |31   |29   |19   |
    |19   |18   |31   |
    -------------------
    cur_ins = 192
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |19   |24   |
    |29   |31   |21   |
    |31   |29   |19   |
    |19   |18   |31   |
    -------------------
    cur_ins = 212
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |29   |21   |24   |
    |31   |19   |21   |
    |19   |31   |19   |
    |21   |29   |31   |
    -------------------
    cur_ins = 213
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |29   |21   |24   |
    |31   |19   |21   |
    |19   |31   |19   |
    |21   |29   |31   |
    -------------------
    cur_ins = 52
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |5    |24   |
    |19   |21   |5    |
    |21   |19   |19   |
    |5    |31   |31   |
    -------------------
    cur_ins = 53
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |5    |24   |
    |19   |21   |5    |
    |21   |19   |19   |
    |5    |31   |31   |
    -------------------
    cur_ins = 12
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |1    |1    |
    |21   |5    |5    |
    |5    |21   |19   |
    |1    |19   |31   |
    -------------------
    cur_ins = 13
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |1    |1    |
    |21   |5    |5    |
    |5    |21   |19   |
    |1    |19   |31   |
    -------------------
    cur_ins = 312
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |31   |1    |
    |5    |1    |5    |
    |1    |5    |19   |
    |31   |21   |31   |
    -------------------
    cur_ins = 313
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |31   |1    |
    |5    |1    |5    |
    |1    |5    |19   |
    |31   |21   |31   |
    -------------------
    cur_ins = 313
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |31   |1    |
    |5    |1    |5    |
    |1    |5    |19   |
    |31   |21   |31   |
    -------------------
    cur_ins = 314
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |31   |1    |
    |5    |1    |5    |
    |1    |5    |19   |
    |31   |21   |31   |
    -------------------
    cur_ins = 73
    cur_block = 7
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |7    |1    |
    |1    |31   |5    |
    |31   |1    |19   |
    |7    |5    |7    |
    -------------------
    cur_ins = 74
    cur_block = 7
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |7    |1    |
    |1    |31   |5    |
    |31   |1    |19   |
    |7    |5    |7    |
    -------------------
    cur_ins = 195
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |19   |1    |
    |31   |7    |5    |
    |7    |31   |19   |
    |19   |1    |7    |
    -------------------
    cur_ins = 196
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |19   |1    |
    |31   |7    |5    |
    |7    |31   |19   |
    |19   |1    |7    |
    -------------------
    cur_ins = 73
    cur_block = 7
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |7    |1    |
    |31   |19   |5    |
    |7    |31   |19   |
    |19   |1    |7    |
    -------------------
    cur_ins = 74
    cur_block = 7
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |7    |1    |
    |31   |19   |5    |
    |7    |31   |19   |
    |19   |1    |7    |
    -------------------
    cur_ins = 17
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |1    |1    |
    |31   |7    |5    |
    |7    |19   |19   |
    |19   |31   |7    |
    -------------------
    cur_ins = 18
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |1    |1    |
    |31   |7    |5    |
    |7    |19   |19   |
    |19   |31   |7    |
    -------------------
    cur_ins = 27
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |2    |1    |
    |7    |1    |5    |
    |19   |7    |19   |
    |2    |19   |2    |
    -------------------
    cur_ins = 28
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |2    |1    |
    |7    |1    |5    |
    |19   |7    |19   |
    |2    |19   |2    |
    -------------------
    cur_ins = 237
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |7    |23   |1    |
    |19   |2    |5    |
    |2    |1    |23   |
    |23   |7    |2    |
    -------------------
    cur_ins = 238
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |7    |23   |1    |
    |19   |2    |5    |
    |2    |1    |23   |
    |23   |7    |2    |
    -------------------
    cur_ins = 89
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |8    |1    |
    |2    |23   |5    |
    |23   |2    |8    |
    |8    |1    |2    |
    -------------------
    cur_ins = 90
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |9    |1    |
    |23   |8    |5    |
    |8    |23   |9    |
    |9    |2    |2    |
    -------------------
    cur_ins = 277
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |27   |1    |
    |8    |9    |5    |
    |9    |8    |27   |
    |27   |23   |2    |
    -------------------
    cur_ins = 278
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |27   |1    |
    |8    |9    |5    |
    |9    |8    |27   |
    |27   |23   |2    |
    -------------------
    cur_ins = 130
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |13   |1    |
    |9    |27   |5    |
    |27   |9    |27   |
    |13   |8    |13   |
    -------------------
    cur_ins = 131
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |13   |1    |
    |9    |27   |5    |
    |27   |9    |27   |
    |13   |8    |13   |
    -------------------
    cur_ins = 11
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |9    |1    |1    |
    |27   |13   |5    |
    |13   |27   |27   |
    |1    |9    |13   |
    -------------------
    cur_ins = 12
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |9    |1    |1    |
    |27   |13   |5    |
    |13   |27   |27   |
    |1    |9    |13   |
    -------------------
    cur_ins = 57
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |5    |1    |
    |13   |1    |5    |
    |1    |13   |27   |
    |5    |27   |13   |
    -------------------
    cur_ins = 58
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |5    |1    |
    |13   |1    |5    |
    |1    |13   |27   |
    |5    |27   |13   |
    -------------------
    cur_ins = 267
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |26   |1    |
    |1    |5    |5    |
    |5    |1    |27   |
    |26   |13   |26   |
    -------------------
    cur_ins = 268
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |26   |1    |
    |1    |5    |5    |
    |5    |1    |27   |
    |26   |13   |26   |
    -------------------
    cur_ins = 242
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |24   |24   |
    |5    |26   |5    |
    |26   |5    |27   |
    |24   |1    |26   |
    -------------------
    cur_ins = 243
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |24   |24   |
    |5    |26   |5    |
    |26   |5    |27   |
    |24   |1    |26   |
    -------------------
    cur_ins = 276
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |27   |24   |
    |26   |24   |5    |
    |24   |26   |27   |
    |27   |5    |26   |
    -------------------
    cur_ins = 277
    cur_block = 27
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |27   |24   |
    |26   |24   |5    |
    |24   |26   |27   |
    |27   |5    |26   |
    -------------------
    cur_ins = 43
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |4    |24   |
    |24   |27   |5    |
    |27   |24   |4    |
    |4    |26   |26   |
    -------------------
    cur_ins = 44
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |4    |24   |
    |24   |27   |5    |
    |27   |24   |4    |
    |4    |26   |26   |
    -------------------
    cur_ins = 31
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |3    |3    |
    |27   |4    |5    |
    |4    |27   |4    |
    |3    |24   |26   |
    -------------------
    cur_ins = 32
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |3    |3    |
    |27   |4    |5    |
    |4    |27   |4    |
    |3    |24   |26   |
    -------------------
    cur_ins = 140
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |14   |3    |
    |4    |3    |14   |
    |3    |4    |4    |
    |14   |27   |26   |
    -------------------
    cur_ins = 141
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |27   |14   |3    |
    |4    |3    |14   |
    |3    |4    |4    |
    |14   |27   |26   |
    -------------------
    cur_ins = 315
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |31   |3    |
    |3    |14   |14   |
    |14   |3    |31   |
    |31   |4    |26   |
    -------------------
    cur_ins = 316
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |31   |3    |
    |3    |14   |14   |
    |14   |3    |31   |
    |31   |4    |26   |
    -------------------
    cur_ins = 187
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |18   |3    |
    |14   |31   |14   |
    |31   |14   |18   |
    |18   |3    |26   |
    -------------------
    cur_ins = 188
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |18   |3    |
    |14   |31   |14   |
    |31   |14   |18   |
    |18   |3    |26   |
    -------------------
    cur_ins = 221
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |22   |3    |
    |31   |18   |14   |
    |18   |31   |22   |
    |22   |14   |26   |
    -------------------
    cur_ins = 222
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |22   |3    |
    |31   |18   |14   |
    |18   |31   |22   |
    |22   |14   |26   |
    -------------------
    cur_ins = 301
    cur_block = 30
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |30   |3    |
    |18   |22   |30   |
    |22   |18   |22   |
    |30   |31   |26   |
    -------------------
    cur_ins = 302
    cur_block = 30
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |30   |3    |
    |18   |22   |30   |
    |22   |18   |22   |
    |30   |31   |26   |
    -------------------
    cur_ins = 28
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |2    |3    |
    |22   |30   |2    |
    |30   |22   |22   |
    |2    |18   |26   |
    -------------------
    cur_ins = 29
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |2    |3    |
    |22   |30   |2    |
    |30   |22   |22   |
    |2    |18   |26   |
    -------------------
    cur_ins = 198
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |19   |3    |
    |30   |2    |19   |
    |2    |30   |22   |
    |19   |22   |26   |
    -------------------
    cur_ins = 199
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |19   |3    |
    |30   |2    |19   |
    |2    |30   |22   |
    |19   |22   |26   |
    -------------------
    cur_ins = 128
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |30   |12   |3    |
    |2    |19   |12   |
    |19   |2    |22   |
    |12   |30   |26   |
    -------------------
    cur_ins = 129
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |30   |12   |3    |
    |2    |19   |12   |
    |19   |2    |22   |
    |12   |30   |26   |
    -------------------
    cur_ins = 117
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |11   |3    |
    |19   |12   |11   |
    |12   |19   |22   |
    |11   |2    |26   |
    -------------------
    cur_ins = 118
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |11   |3    |
    |19   |12   |11   |
    |12   |19   |22   |
    |11   |2    |26   |
    -------------------
    cur_ins = 262
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |26   |3    |
    |12   |11   |11   |
    |11   |12   |22   |
    |26   |19   |26   |
    -------------------
    cur_ins = 263
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |26   |3    |
    |12   |11   |11   |
    |11   |12   |22   |
    |26   |19   |26   |
    -------------------
    cur_ins = 223
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |22   |3    |
    |11   |26   |11   |
    |26   |11   |22   |
    |22   |12   |26   |
    -------------------
    cur_ins = 224
    cur_block = 22
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |22   |3    |
    |11   |26   |11   |
    |26   |11   |22   |
    |22   |12   |26   |
    -------------------
    cur_ins = 35
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |3    |3    |
    |26   |22   |11   |
    |22   |26   |22   |
    |3    |11   |26   |
    -------------------
    cur_ins = 36
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |3    |3    |
    |26   |22   |11   |
    |22   |26   |22   |
    |3    |11   |26   |
    -------------------
    cur_ins = 140
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |14   |3    |
    |22   |3    |11   |
    |3    |22   |14   |
    |14   |26   |26   |
    -------------------
    cur_ins = 141
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |14   |3    |
    |22   |3    |11   |
    |3    |22   |14   |
    |14   |26   |26   |
    -------------------
    cur_ins = 210
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |21   |21   |
    |3    |14   |11   |
    |14   |3    |14   |
    |21   |22   |26   |
    -------------------
    cur_ins = 211
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |22   |21   |21   |
    |3    |14   |11   |
    |14   |3    |14   |
    |21   |22   |26   |
    -------------------
    cur_ins = 40
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |4    |21   |
    |14   |21   |11   |
    |21   |14   |14   |
    |4    |3    |4    |
    -------------------
    cur_ins = 41
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |4    |21   |
    |14   |21   |11   |
    |21   |14   |14   |
    |4    |3    |4    |
    -------------------
    cur_ins = 128
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |12   |12   |
    |21   |4    |11   |
    |4    |21   |14   |
    |12   |14   |4    |
    -------------------
    cur_ins = 129
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |12   |12   |
    |21   |4    |11   |
    |4    |21   |14   |
    |12   |14   |4    |
    -------------------
    cur_ins = 86
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |8    |8    |
    |4    |12   |11   |
    |12   |4    |14   |
    |8    |21   |4    |
    -------------------
    cur_ins = 87
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |8    |8    |
    |4    |12   |11   |
    |12   |4    |14   |
    |8    |21   |4    |
    -------------------
    cur_ins = 40
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |4    |8    |
    |4    |8    |11   |
    |12   |12   |14   |
    |8    |21   |4    |
    -------------------
    cur_ins = 41
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |4    |8    |
    |4    |8    |11   |
    |12   |12   |14   |
    |8    |21   |4    |
    -------------------
    cur_ins = 101
    cur_block = 10
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |10   |10   |
    |12   |4    |11   |
    |8    |8    |14   |
    |10   |12   |4    |
    -------------------
    cur_ins = 102
    cur_block = 10
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |10   |10   |
    |12   |4    |11   |
    |8    |8    |14   |
    |10   |12   |4    |
    -------------------
    cur_ins = 109
    cur_block = 10
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |10   |10   |
    |12   |4    |11   |
    |8    |8    |14   |
    |10   |12   |4    |
    -------------------
    cur_ins = 110
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |11   |10   |
    |8    |10   |11   |
    |10   |4    |14   |
    |11   |8    |4    |
    -------------------
    cur_ins = 51
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |5    |5    |
    |10   |11   |11   |
    |11   |10   |14   |
    |5    |4    |4    |
    -------------------
    cur_ins = 52
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |5    |5    |
    |10   |11   |11   |
    |11   |10   |14   |
    |5    |4    |4    |
    -------------------
    cur_ins = 146
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |10   |14   |5    |
    |11   |5    |11   |
    |5    |11   |14   |
    |14   |10   |4    |
    -------------------
    cur_ins = 147
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |10   |14   |5    |
    |11   |5    |11   |
    |5    |11   |14   |
    |14   |10   |4    |
    -------------------
    cur_ins = 42
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |4    |5    |
    |5    |14   |11   |
    |14   |5    |14   |
    |4    |11   |4    |
    -------------------
    cur_ins = 43
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |4    |5    |
    |5    |14   |11   |
    |14   |5    |14   |
    |4    |11   |4    |
    -------------------
    cur_ins = 14
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |1    |5    |
    |14   |4    |11   |
    |4    |14   |1    |
    |1    |5    |4    |
    -------------------
    cur_ins = 15
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |1    |5    |
    |14   |4    |11   |
    |4    |14   |1    |
    |1    |5    |4    |
    -------------------
    cur_ins = 216
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |21   |5    |
    |4    |1    |11   |
    |1    |4    |21   |
    |21   |14   |4    |
    -------------------
    cur_ins = 217
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |21   |5    |
    |4    |1    |11   |
    |1    |4    |21   |
    |21   |14   |4    |
    -------------------
    cur_ins = 177
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |17   |5    |
    |1    |21   |11   |
    |21   |1    |17   |
    |17   |4    |4    |
    -------------------
    cur_ins = 178
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |17   |5    |
    |1    |21   |11   |
    |21   |1    |17   |
    |17   |4    |4    |
    -------------------
    cur_ins = 49
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |4    |5    |
    |1    |17   |11   |
    |21   |21   |17   |
    |17   |1    |4    |
    -------------------
    cur_ins = 50
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |5    |5    |
    |21   |4    |11   |
    |17   |17   |17   |
    |5    |21   |4    |
    -------------------
    cur_ins = 110
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |11   |5    |
    |17   |5    |11   |
    |5    |4    |17   |
    |11   |17   |4    |
    -------------------
    cur_ins = 111
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |11   |5    |
    |17   |5    |11   |
    |5    |4    |17   |
    |11   |17   |4    |
    -------------------
    cur_ins = 300
    cur_block = 30
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |17   |30   |5    |
    |5    |11   |11   |
    |11   |5    |30   |
    |30   |4    |4    |
    -------------------
    cur_ins = 301
    cur_block = 30
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |17   |30   |5    |
    |5    |11   |11   |
    |11   |5    |30   |
    |30   |4    |4    |
    -------------------
    cur_ins = 49
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |4    |5    |
    |11   |30   |11   |
    |30   |11   |30   |
    |4    |5    |4    |
    -------------------
    cur_ins = 50
    cur_block = 5
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |5    |5    |5    |
    |11   |4    |11   |
    |30   |30   |30   |
    |4    |11   |4    |
    -------------------
    cur_ins = 263
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |26   |26   |
    |30   |5    |11   |
    |4    |4    |30   |
    |26   |30   |4    |
    -------------------
    cur_ins = 264
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |26   |26   |
    |30   |5    |11   |
    |4    |4    |30   |
    |26   |30   |4    |
    -------------------
    cur_ins = 21
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |30   |2    |26   |
    |4    |26   |11   |
    |26   |5    |2    |
    |2    |4    |4    |
    -------------------
    cur_ins = 22
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |30   |2    |26   |
    |4    |26   |11   |
    |26   |5    |2    |
    |2    |4    |4    |
    -------------------
    cur_ins = 9
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |0    |26   |
    |26   |2    |11   |
    |2    |26   |0    |
    |0    |5    |4    |
    -------------------
    cur_ins = 10
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |1    |26   |
    |2    |0    |11   |
    |0    |2    |0    |
    |1    |26   |1    |
    -------------------
    cur_ins = 194
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |19   |26   |
    |0    |1    |11   |
    |1    |0    |0    |
    |19   |2    |19   |
    -------------------
    cur_ins = 195
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |19   |26   |
    |0    |1    |11   |
    |1    |0    |0    |
    |19   |2    |19   |
    -------------------
    cur_ins = 192
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |19   |26   |
    |0    |1    |11   |
    |1    |0    |0    |
    |19   |2    |19   |
    -------------------
    cur_ins = 193
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |2    |19   |26   |
    |0    |1    |11   |
    |1    |0    |0    |
    |19   |2    |19   |
    -------------------
    cur_ins = 159
    cur_block = 15
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |15   |26   |
    |1    |19   |11   |
    |19   |1    |0    |
    |15   |0    |15   |
    -------------------
    cur_ins = 160
    cur_block = 16
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |16   |26   |
    |19   |15   |11   |
    |15   |19   |0    |
    |16   |1    |16   |
    -------------------
    cur_ins = 244
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |24   |26   |
    |15   |16   |11   |
    |16   |15   |0    |
    |24   |19   |24   |
    -------------------
    cur_ins = 245
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |24   |26   |
    |15   |16   |11   |
    |16   |15   |0    |
    |24   |19   |24   |
    -------------------
    cur_ins = 128
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |15   |12   |26   |
    |16   |24   |11   |
    |24   |16   |0    |
    |12   |15   |12   |
    -------------------
    cur_ins = 129
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |15   |12   |26   |
    |16   |24   |11   |
    |24   |16   |0    |
    |12   |15   |12   |
    -------------------
    cur_ins = 35
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |3    |26   |
    |24   |12   |11   |
    |12   |24   |0    |
    |3    |16   |3    |
    -------------------
    cur_ins = 36
    cur_block = 3
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |16   |3    |26   |
    |24   |12   |11   |
    |12   |24   |0    |
    |3    |16   |3    |
    -------------------
    cur_ins = 114
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |11   |26   |
    |12   |3    |11   |
    |3    |12   |0    |
    |11   |24   |3    |
    -------------------
    cur_ins = 115
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |11   |26   |
    |12   |3    |11   |
    |3    |12   |0    |
    |11   |24   |3    |
    -------------------
    cur_ins = 237
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |23   |26   |
    |3    |11   |11   |
    |11   |3    |0    |
    |23   |12   |23   |
    -------------------
    cur_ins = 238
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |23   |26   |
    |3    |11   |11   |
    |11   |3    |0    |
    |23   |12   |23   |
    -------------------
    cur_ins = 74
    cur_block = 7
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |7    |26   |
    |11   |23   |11   |
    |23   |11   |0    |
    |7    |3    |7    |
    -------------------
    cur_ins = 75
    cur_block = 7
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |3    |7    |26   |
    |11   |23   |11   |
    |23   |11   |0    |
    |7    |3    |7    |
    -------------------
    cur_ins = 264
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |26   |26   |
    |23   |7    |11   |
    |7    |23   |0    |
    |26   |11   |7    |
    -------------------
    cur_ins = 265
    cur_block = 26
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |26   |26   |
    |23   |7    |11   |
    |7    |23   |0    |
    |26   |11   |7    |
    -------------------
    cur_ins = 2
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |0    |26   |
    |7    |26   |11   |
    |26   |7    |0    |
    |0    |23   |7    |
    -------------------
    cur_ins = 3
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |0    |26   |
    |7    |26   |11   |
    |26   |7    |0    |
    |0    |23   |7    |
    -------------------
    cur_ins = 0
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |0    |26   |
    |7    |26   |11   |
    |26   |7    |0    |
    |0    |23   |7    |
    -------------------
    cur_ins = 1
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |0    |26   |
    |7    |26   |11   |
    |26   |7    |0    |
    |0    |23   |7    |
    -------------------
    cur_ins = 194
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |7    |19   |19   |
    |26   |0    |11   |
    |0    |26   |0    |
    |19   |7    |7    |
    -------------------
    cur_ins = 195
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |7    |19   |19   |
    |26   |0    |11   |
    |0    |26   |0    |
    |19   |7    |7    |
    -------------------
    cur_ins = 257
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |25   |19   |
    |0    |19   |11   |
    |19   |0    |0    |
    |25   |26   |25   |
    -------------------
    cur_ins = 258
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |26   |25   |19   |
    |0    |19   |11   |
    |19   |0    |0    |
    |25   |26   |25   |
    -------------------
    cur_ins = 10
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |1    |1    |
    |19   |25   |11   |
    |25   |19   |0    |
    |1    |0    |25   |
    -------------------
    cur_ins = 11
    cur_block = 1
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |1    |1    |
    |19   |25   |11   |
    |25   |19   |0    |
    |1    |0    |25   |
    -------------------
    cur_ins = 64
    cur_block = 6
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |6    |6    |
    |25   |1    |11   |
    |1    |25   |0    |
    |6    |19   |25   |
    -------------------
    cur_ins = 65
    cur_block = 6
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |6    |6    |
    |25   |1    |11   |
    |1    |25   |0    |
    |6    |19   |25   |
    -------------------
    cur_ins = 84
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |8    |8    |
    |1    |6    |11   |
    |6    |1    |0    |
    |8    |25   |25   |
    -------------------
    cur_ins = 85
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |8    |8    |
    |1    |6    |11   |
    |6    |1    |0    |
    |8    |25   |25   |
    -------------------
    cur_ins = 48
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |4    |8    |
    |6    |8    |11   |
    |8    |6    |0    |
    |4    |1    |4    |
    -------------------
    cur_ins = 49
    cur_block = 4
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |1    |4    |8    |
    |6    |8    |11   |
    |8    |6    |0    |
    |4    |1    |4    |
    -------------------
    cur_ins = 318
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |6    |31   |8    |
    |8    |4    |11   |
    |4    |8    |0    |
    |31   |6    |31   |
    -------------------
    cur_ins = 319
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |6    |31   |8    |
    |8    |4    |11   |
    |4    |8    |0    |
    |31   |6    |31   |
    -------------------
    cur_ins = 98
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |9    |8    |
    |4    |31   |11   |
    |31   |4    |0    |
    |9    |8    |9    |
    -------------------
    cur_ins = 99
    cur_block = 9
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |9    |8    |
    |4    |31   |11   |
    |31   |4    |0    |
    |9    |8    |9    |
    -------------------
    cur_ins = 1
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |0    |8    |
    |31   |9    |11   |
    |9    |31   |0    |
    |0    |4    |9    |
    -------------------
    cur_ins = 2
    cur_block = 0
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |4    |0    |8    |
    |31   |9    |11   |
    |9    |31   |0    |
    |0    |4    |9    |
    -------------------
    cur_ins = 215
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |21   |8    |
    |9    |0    |11   |
    |0    |9    |21   |
    |21   |31   |9    |
    -------------------
    cur_ins = 216
    cur_block = 21
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |31   |21   |8    |
    |9    |0    |11   |
    |0    |9    |21   |
    |21   |31   |9    |
    -------------------
    cur_ins = 144
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |9    |14   |8    |
    |0    |21   |11   |
    |21   |0    |14   |
    |14   |9    |9    |
    -------------------
    cur_ins = 145
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |9    |14   |8    |
    |0    |21   |11   |
    |21   |0    |14   |
    |14   |9    |9    |
    -------------------
    cur_ins = 119
    cur_block = 11
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |0    |11   |8    |
    |21   |14   |11   |
    |14   |21   |14   |
    |11   |0    |9    |
    -------------------
    cur_ins = 120
    cur_block = 12
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |21   |12   |8    |
    |14   |11   |12   |
    |11   |14   |14   |
    |12   |21   |9    |
    -------------------
    cur_ins = 137
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |13   |8    |
    |11   |12   |13   |
    |12   |11   |14   |
    |13   |14   |9    |
    -------------------
    cur_ins = 138
    cur_block = 13
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |13   |8    |
    |11   |12   |13   |
    |12   |11   |14   |
    |13   |14   |9    |
    -------------------
    cur_ins = 188
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |18   |8    |
    |12   |13   |18   |
    |13   |12   |14   |
    |18   |11   |9    |
    -------------------
    cur_ins = 189
    cur_block = 18
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |11   |18   |8    |
    |12   |13   |18   |
    |13   |12   |14   |
    |18   |11   |9    |
    -------------------
    cur_ins = 143
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |14   |8    |
    |13   |18   |18   |
    |18   |13   |14   |
    |14   |12   |9    |
    -------------------
    cur_ins = 144
    cur_block = 14
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |12   |14   |8    |
    |13   |18   |18   |
    |18   |13   |14   |
    |14   |12   |9    |
    -------------------
    cur_ins = 237
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |23   |8    |
    |18   |14   |23   |
    |14   |18   |14   |
    |23   |13   |9    |
    -------------------
    cur_ins = 238
    cur_block = 23
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |13   |23   |8    |
    |18   |14   |23   |
    |14   |18   |14   |
    |23   |13   |9    |
    -------------------
    cur_ins = 243
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |24   |8    |
    |14   |23   |24   |
    |23   |14   |14   |
    |24   |18   |9    |
    -------------------
    cur_ins = 244
    cur_block = 24
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |18   |24   |8    |
    |14   |23   |24   |
    |23   |14   |14   |
    |24   |18   |9    |
    -------------------
    cur_ins = 84
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |8    |8    |
    |23   |24   |24   |
    |24   |23   |14   |
    |8    |14   |9    |
    -------------------
    cur_ins = 85
    cur_block = 8
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |14   |8    |8    |
    |23   |24   |24   |
    |24   |23   |14   |
    |8    |14   |9    |
    -------------------
    cur_ins = 251
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |25   |25   |
    |24   |8    |24   |
    |8    |24   |14   |
    |25   |23   |9    |
    -------------------
    cur_ins = 252
    cur_block = 25
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |23   |25   |25   |
    |24   |8    |24   |
    |8    |24   |14   |
    |25   |23   |9    |
    -------------------
    cur_ins = 195
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |19   |19   |
    |8    |25   |24   |
    |25   |8    |14   |
    |19   |24   |9    |
    -------------------
    cur_ins = 196
    cur_block = 19
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |24   |19   |19   |
    |8    |25   |24   |
    |25   |8    |14   |
    |19   |24   |9    |
    -------------------
    cur_ins = 172
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |17   |17   |
    |25   |19   |24   |
    |19   |25   |14   |
    |17   |8    |9    |
    -------------------
    cur_ins = 173
    cur_block = 17
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |8    |17   |17   |
    |25   |19   |24   |
    |19   |25   |14   |
    |17   |8    |9    |
    -------------------
    cur_ins = 311
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |31   |31   |
    |19   |17   |24   |
    |17   |19   |14   |
    |31   |25   |9    |
    -------------------
    cur_ins = 312
    cur_block = 31
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |25   |31   |31   |
    |19   |17   |24   |
    |17   |19   |14   |
    |31   |25   |9    |
    -------------------
    cur_ins = 24
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |2    |2    |
    |17   |31   |24   |
    |31   |17   |14   |
    |2    |19   |9    |
    -------------------
    cur_ins = 25
    cur_block = 2
    -------------------
    |fifo |lru  |opt  |
    -------------------
    |19   |2    |2    |
    |17   |31   |24   |
    |31   |17   |14   |
    |2    |19   |9    |
    -------------------
    -------------------------------------------------
    |item       |fifo       |lru        |opt        |
    -------------------------------------------------
    |hit        |167        |169        |204        |
    |hit_ratio  |52.1875    |52.8125    |63.75      |
    |miss       |153        |151        |116        |
    |miss_ratio |47.8125    |47.1875    |36.25      |
    -------------------------------------------------
    

    突然想到这个实验后天才要上,结果我今天就发出来了,这会不会算我抄袭啊hhhhhhhhh

    相关文章

      网友评论

          本文标题:实验 请求调页存储管理方式的模拟

          本文链接:https://www.haomeiwen.com/subject/jrfigktx.html