Skip to main content Link Menu Expand (external link) Document Search Copy Copied

RISC-V Emulation - Analysis - Cache Simulation

Code due Tue Oct 8th by 11:59pm in your Project04 GitHub repo

Interactive Grading on Wed Oct 9th

There are no Exam problems for Project04

Tests: https://github.com/USF-CS315-F24/tests

Autograder: https://github.com/phpeterson-usf/autograder

Requirements

  1. You will write an emulator in C for a subset of the RISC-V Instruction Set Architecture (ISA).

  2. You do not have to emulate the entire instruction set; just enough to emulate the following programs:
    • quadratic_s (given)
    • midpoint_s (given)
    • max3_s (given)
    • to_upper (given)
    • get_bitseq_s (given)
    • get_bitseq_signed_s (given)
    • countll_s (given)
    • swap_s (given)
    • sort_s (given)
    • fib_rec_s (yours)
  3. Your emulator will need the logic (decoding and emulating instructions) and state (struct rv_state) from lab03

  4. Your emulator will support dynamic analysis of instruction execution. Here are the metrics you will collect:
    1. # of instructions executed (i_count)
    2. # of I-type and R-type instructions executed (ir_count)
    3. # of LOAD instructions executed (ld_count)
    4. # of STORE instructions executed (st_count)
    5. # of jump instructions executed including j, jal, jalr (j_count)
    6. # of conditional branches taken (b_taken)
    7. # of conditional branches not taken (b_not_taken)
  5. Your emulator will include an implementation of a processor cache simulator for the following cache types:
    1. A direct mapped cache with a block size on 1 word (given)
    2. A direct mapped cache with a block size of 4 words
    3. A 4-way set associative cache with a block size of 1 word and LRU slot replacement
    4. A 4-way set associative cache with a block size of 4 words and LRU slot replacement

Given

  1. In lecture and lab, we will:
    1. illustrate how to decode machine code and execute the operations specified
    2. illustrate a direct-mapped cache and describe the data structures and algorithms required for a set-associative cache
    3. We have written a Guide to Cache Memory to help you develop your cache implementation
  2. In-class coding will be pushed to Github. You will provide the rest of the code yourself
  3. We will provide autograder test cases for the emulation targets

Grading Rubric

Automated testing

90 pts: Automated tests

Interactive grading

10 pts: code walkthrough including, but not limited to, your implementation of dynamic analysis and the instruction cache.

Code Quality

You need to have a clean repo, consistent naming and indentation, no dead code, no unnecessarily complex code. Any deductions can be earned back.