Skip to content

Commit

Permalink
Delete TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohan Hu committed Dec 4, 2020
1 parent 683e9f8 commit 70d8b81
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/main/scala/common/Consts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package common {

import chisel3._

// TODO: Use enum to replace the constants
// TODO: Use zip to replace the xx :: xx :: xx style assignment (Think of a list of signal)
object OpConstants {

//************************************
Expand Down
3 changes: 1 addition & 2 deletions src/main/scala/core/csrFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,8 @@ class CSRFile extends Module {
}
BoringUtils.addSource(mstatus & sstatus_read_mask.asUInt(), "difftestSstatus")

val WrMaskedCSR = Map( // TODO: Finish the CSR Mask
val WrMaskedCSR = Map(
CSRAddr.mstatus -> mstatus_write_mask,
// CSRAddr.mip -> 0.U, // TODO: Patch: Unwritable
CSRAddr.mideleg -> midelegMask, // SSIP, SEIP, STIP
CSRAddr.mie -> ((1.U << 1) | (1.U << 3) | (1.U << 5) | (1.U << 7) | (1.U << 9) | (1.U << 11)),
CSRAddr.mip -> "h77f".U,
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/core/exu.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class EXUIO extends Bundle {

class EXU extends Module {
val io = IO(new EXUIO)
// TODO: Deal with the bypass condition
val op1 = io.decode2Exe.Op1
val op2 = io.decode2Exe.Op2
val rs2 = io.decode2Exe.R2val
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/core/ifu.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IFU extends Module {
val state = RegInit(sIDLE)
val pendingRedirect = RegInit(false.B)
val pendingRedirectAddr = RegInit(0.U(64.W))
val pc = RegInit(0x80000000L.U(64.W)-4.U)
val pc = RegInit(0x40000000L.U(64.W)-4.U)
val thisInstValid = WireInit(false.B)
val thisPC = WireInit(0.U)
val thisInst = WireInit(0.U)
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/core/top.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class Top extends Module {
// io.instBundleOut := wb.io.instBundleOut

// Consts
// TODO: TEST
val clint = Module(new CLINT)
csrFile.io.clintIn := clint.io.tocsr
clint.io.memport <> axiBridge.io.toClint
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/mmu/mmu.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class MMUIO extends Bundle {

class MMU (isDMMU: Boolean) extends Module {
val io = IO(new MMUIO)
// TODO: Add TLB Here
val tlb = Module(new TLB)
val ptw = Module(new PTW(isDMMU))
// PTW <> MMU
Expand Down
4 changes: 0 additions & 4 deletions src/main/scala/mmu/ptw.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ class PTWIO extends Bundle {
val mxr = Input(Bool())
// DMem request
val memReq = new NaiveBusM2S
// TODO: TLB Query
val tlbQuery = Flipped(new TLBQuery)
// TODO: TLB Update
val tlbUpdate = Output(new TLBEntry)

// TODO: PMP Access Exception
Expand Down Expand Up @@ -187,7 +185,6 @@ class PTW(isDPTW: Boolean) extends Module {
io.respValid := false.B
stateReg := sERROR
}
// TODO: Recover the condition
when(!pteConverted.A ||
(io.reqIsStore && !pteConverted.D)) { // pte.a = 0,
// or if the memory access is a store and pte.d = 0
Expand All @@ -199,7 +196,6 @@ class PTW(isDPTW: Boolean) extends Module {
Attempting to fetch an instruction from a page that does not have execute permissions
raises a fetch page-fault exception
*/
// TODO: Recover the condition
when(!pteConverted.X || !pteConverted.A) { // Instr, not eXecutable
// when(!pteConverted.X) { // Instr, not eXecutable
io.respValid := false.B
Expand Down

0 comments on commit 70d8b81

Please sign in to comment.