This file will note down major meetups and breakdown the progress completed by those meetups. Note that only meetings with all 4 members present will be documented in this file.
- Discussed and allocated lab 4 parts to team members
- Team goals:
- Lab 4 design
- Single cycle
- 5-stage pipeline
- Hazard detection
- Cache (2-way set associative) with prefetching
- Lab 4 parts were mostly completed before the lab meetup
- Main issues discussed during meeting:
- Should we group by making sub-top modules?
- Not necessary
- Note carefully the defining of wires and ports, there seems to be some confusion regarding those and also the internal and external interconnecting wires relative to each module.
- Should we change module names to follow sth_sth.sv underscore standard?
- Yes
- Should we group by making sub-top modules?
- Plan (part 1 and 2)
Part Task Status Member 1 Member 2 1 Lab 4 control unit debugging [ ] William 1 ALU testbench [x] Noam William 1 Data memory creation [x] Jamie Kevin 2 Code refactoring (pulling out muxes) [ ] 2 Write ALU for single cycle [ ] 2 Write control unit for single cycle [x] Noam Jamie 2 Write asm code for F1 lights [x] Jamie extra Design two-way set associative cache [x] Kevin Jamie extra Code FETCH cycle of pipeline [x] Kevin - Note:
- A lot of testbench writing was done by William today for the Lab 4 control unit debugging - this will be further elaborated in William's logbook
- By the end of meetup, the control unit is NOT FULLY DEBUGGED and it remains the only component in lab4 that has issues, and we are still trying to debug it
- Notes:
- Jamie: ALU and top file updated for single-cycle, data_mem fixed, ALU nearly done, top file needs debugging
- Noam: Control unit for single-cycle done
- William: Testbenches fixed, "things will be done by tonight"
- Kevin: Cache discussion with UTA
- We met from 1pm to 6pm today to:
- Complete the single cycle CPU
- Officially start working on pipeline
- Create a direct mapped cache
- Single cycle CPU
- Over the past few days, all of the single cycle instructions have been debugged (refer to personal .md files)
- Only the
load byte
andstore byte
instructions had to be implemented since the provided reference program requires these instructions, which was quickly done by Noam - We created a snapshot
v0.2.0
, which refers to the completedSingle Cycle Version
of our RISC-V 32I processor, which should be able to run both F1 lights and the reference PDF program
- Pipelining
- Working on the previously created pipeline files and completed IF/ID file, the implementation of the 4 pipeline flip-flops was worked on by Kevin and William
- After using Verilator to debug all the implicitly defined ports and logic in the top module, we managed to pass the
add_positive.s
(in thetb/asm
file), by adding severalno ops
to the test program (this was done purely to verify that pipeline was working properly) - Afterwards, we worked the
hazard unit
, where we combatted data hazard by usingforwardA_E
andforwardB_E
signals based on whether to forward from ALU result or writeback, so it skips the write to and read from register file (refer to slides)
- Cache
- A
direct mapped
version of the cache was being created by Jamie and Noam, where the structure was defined and read/write logic was being discussed - There was much discussion about the implementation of the cache - since we don't actually have a physical silicon cache, should we create a cache array to just point to memory in data memory, or should we define one of the areas in unused space as a cache memory
- A
- Brief meetup between lectures for 2 hours
- Cache
- Progress has been made to the cache - the direct mapped cache has been fully created (including the read write logic) and is currently being verified
- Pipelining
- Stalling for lw data dependency has now been added to the IF/ID stage through using the
stall
signal from the hazard unit - Code modifications for other relevant parts such as the
program counter
,control unit
, etc. - The lw data dependency has been tested and verified to be working
- Next meetup: Control hazards
- Decision after discussion:
- There are three methods to deal with control hazards:
- Flushing instructions by assuming branch isn't taken
- Branch decision detection at an earlier stage to reduce number of instructions to flush
- Branch prediction using 1-bit branch prediction buffer
- Our decision is to prioritise finishing the data cache first before going for our own stretched goal
- Hence we will implement instruction flushing first, finish the cache, then work on branch prediction if we have time
- There are three methods to deal with control hazards:
- Stalling for lw data dependency has now been added to the IF/ID stage through using the
- Cache
- Snapshot with tag
v0.3.0
has been fully tested - it runs through all tests and runs the reference programpdf.s
perfectly - A bug was found with the previous single-cycle version
v0.2.0
, however the snapshot cannot be modified so here is a remark:- There was a bug with the
data_mem.sv
which caused the 3 MS bytes of a word to be set to zero when using byte addressing mode - this is unintended behaviour and has been corrected in the pipelined versionv0.3.0
- Further details can be found in the debugging notes in
kevin.md
- There was a bug with the
- Meetup in the afternoon + online at night
- Agendas
Hazard unit
has been debugged and finished over the weekendDirect-mapped cache
needs to be implemented in top module
- Progress
- Direct-mapped cache structure drawn and connected to the top module
- The structure focused on a more parallel structure between the data memory and the cache
- Cache hit and miss was acting weird when some new tests written the night before was used to test
- A lot of previous tests were also failing
- At night, a refactored version of the cache was written, interlinking the data memory with the cache (with cache interacting with the main interface and accessing data memory when needed), and byte adressing was more focused on
- Unknown byte overwriting errors led to fails in the combined test (fibonacci + byte array) and the PDF test specifically
- Tests were conjured to test overwriting but found no faults
- Meetup in the afternoon
- Agendas
- Fixing
direct-mapped cache
- Fixing
- Code was refactored to address issues with byte-addressing
- Cache is now more byte-addressing oriented
Direct-mapped cache
was fixed and tested, but CI fixes and more tests of cache hits/misses were neededTwo-way set associative cache
logic structure was implemented
- Team gym session in the morning!
- Meetup in the afternoon
- Agendas
- Debugging
two-way set associative cache
- Complete fixes for CI
- Cache hit/miss data analysis
- Write up most of the team statement
- Debugging
- Results:
- Team statement
- Cache written but needs changes
- Cache hit/miss data analysis written
- Other parts of the team statement written, including but not limited to: testing
- Team statement
- Agendas:
- Finish up the team statement
- Single cycle
- Pipeline
- Cache (modifications required)
- The general statement and evidence of testing / working vbuddy
- Two-way set associative cache
- Finish up the team statement