Git Product home page Git Product logo

tlb-controller's Introduction

SAPPHIRE: A 2-Level TLB Controller

A Translation Lookaside Buffer (TLB) stores the recentmost translations/mappings between the virtual and physical memory hence sometimes referred as the 'address-translation cache'. It is a part of the chip's Memory Management Unit (MMU).
The search key is the Virtual Page Number (VPN) while the search result is the Physical Frame Number (PFN), the latter being determined by the size of the main memory i.e., the RAM.

A 'hit' occurs when the requested mapping is present in the TLB, using which the physical address is calculated. If the entry is not found, it is a 'miss' and the translation then proceeds by looking up in the next level of TLB and eventually the page table (if it's a 'miss' in every TLB level) in a process called a 'page walk'. A more detailed explanation can be found here.*

SAPPHIRE was written as a part of the project in the course 'CSN506: Advanced Computer Architecture' taught by Professor Debiprasanna Sahoo during the Spring Semester 2022.

TLB Design

Cache design

Using SAPPHIRE

First, one needs to download the input benchmark files from here.

Now, compile and run the benchmark as follows:

  • Change into the src directory:

     $ cd TLB-Controller/src
    
  • Place the input.tar.gz in the src directory and extract it:

     $ tar -xvf input.tar.gz
    
  • Create the output directory:

     $ mkdir output
    
  • Compile the code and run the benchmark

     $ make -j$(nproc)
    

Results

Results


*We will intentionally refrain from explaining the simulator flow since we are aware that due to the "open-source" nature of the project, it will be blatantly copied by naive students who do not want to put any sort of effort into their coursework. Therefore, from an academic standpoint, it is appreciated if someone could put the least effort of understanding the code before copying it.

tlb-controller's People

Contributors

0mega28 avatar deepanshumatia avatar pega5us avatar periperidip avatar

Stargazers

 avatar

Watchers

 avatar  avatar

tlb-controller's Issues

Parse USIMM traces

  • Just change the R to W and W to R.

  • Ignore the data part

  • The first column of the traces counts the number of non-load store instructions after which the current load/store operation is triggered, Simply ignore the 1st and last column in the trace.

  • Download source

std::string l_transactionStr = "";    std::string l_delimiter = " ";
    size_t l_pos = 0;
    std::string l_token;
    unsigned int l_count = 0;
    t_VirtualAddress l_address;
    t_RequestType l_reqType;
    t_Time l_traceTime;
    t_Size l_nonLsCount;
    t_Data l_data;
    while ((l_pos = l_transactionStr.find(l_delimiter)) != std::string::npos) {​​​​​​​​
        l_token = l_transactionStr.substr(0, l_pos);
        const char* l_value = l_token.c_str();
        char* l_end;
        if(l_count == 0)    {​​​​​​​​
            l_nonLsCount = strtol(l_value, &l_end, 0);
        }​​​​​​​​
        else if(l_count == 1)    {​​​​​​​​
            if(l_value[0] == 'W')   {​​​​​​​​
                l_reqType = t_RequestType::E_CORE_READ;
            }​​​​​​​​
            else if(l_value[0] == 'R') {​​​​​​​​
                l_reqType = t_RequestType::E_CORE_WRITE;
            }​​​​​​​​
            else        {​​​​​​​​
                assert(false);
            }​​​​​​​​
        }​​​​​​​​
        else if(l_count == 2)    {​​​​​​​​
            l_address = strtol(l_value, &l_end, 0);
        }​​​​​​​​
        else if(l_count == 3)    {​​​​​​​​
            l_data = new unsigned char[64];
            std::memcpy(l_data, l_value, 64);
        }​​​​​​​​
        l_transactionStr.erase(0, l_pos + l_delimiter.length());
        l_count++;
    }​​​​​​​​

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.