Skip to content

SukhmeetSingh2002/UCP-using-ChampSim

Repository files navigation

Utility-Based Cache Partitioning in ChampSim Simulator

Implement Utility-Based Cache Partitioning in ChampSim(trace-based simulator). It uses The Lookahead Algorithm to find the right partition for each core for L3 cache and uses LRU without partition for L1 cache and L2 cache.

How to run

Run the following command to build the binaries

./build_champsim.sh bimodal no no no no <REP_POLICY> <NUM_CORE> 

Then run

./run_2core.sh bimodal-no-no-no-no-<REP_POLICY>-<NUM_CORE>core <NUM_WARM> <NUM_INS> 0 <TRACE1> <TRACE2> ... <TRACE<NUM_CORE>>

to run the simulation

  • REP_POLICY is the replacement policy i.e. lru (without any partitioning) or ucp (with UCP as partitiong technique)
  • NUM_CORE is number of cores on which the code is to be run
  • NUM_WARM is number of warmup instructions
  • NUM_INS is number of instructions
  • TRACEi is name of the trace given'

Give traces equal to value of NUM_CORE

Brief Implementation Details

  1. Cache.h
  2. Cache.cc
    • Modified the check hit function to check the hit only for the ways it has access
  3. UCP.llc_repl
    • UMON_update: This function takes the cpu, set_index and way and updates the lru value of the whole set for the ATD.

    • UMON_find_victim: This takes cpu and set_index and finds the way which is lru for that cpu

    • get_utility: It returns the change in misses that occurs when the number of ways assigned to a cpu increases by one

    • UMON: If the set is one of the sampled sets it checks the hits in that set. If not then calls the UMON_find_victim and UMON_update.

    • make_partition: It uses the number of hits in ATD and uses the The Lookahead Algorithm to find the number of sets to be assigned to each core. It is called after every 5M cycles

    • llc_initialize_replacement: It runs at the starting of the simualtion. It finds the sample sets randomly and sets the intial LRU value of L3 cache and ATD.

    • llc_find_victim: Editied this function to find the victim by taking in consideration the partitioning for each core. It also assigns the way to the corresponding core when the partitioning changes.

    • ucp_update: This function takes the cpu, set_index and way and updates the lru value of the for L3 cache.

    • llc_update_replacemetn_state: Modified this function to call make_partition every 5M cycles and calls ucp_update

Results

  • The following graph shows the ways allocated to each core after every 5 million cycles, when the simulation ran for 4 core



  • The following graph shows the ways allocated to each core after every 5 million cycles, when the simulation ran for 2 core

Releases

No releases published

Packages

No packages published