Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/scala_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package memory.enums
package common.enums

import chisel3.ChiselEnum

Expand Down
3 changes: 2 additions & 1 deletion src/src/memory/DCache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import axi.bundles.AxiMasterPort
import chisel3._
import chisel3.util._
import chisel3.util.random.LFSR
import common.enums.ReadWriteSel
import memory.bundles.{DCacheAccessPort, StatusTagBundle}
import memory.enums.{DCacheState => State, ReadWriteSel}
import memory.enums.{DCacheState => State}
import spec._

class DCache(
Expand Down
2 changes: 1 addition & 1 deletion src/src/memory/bundles/DCacheAccessPort.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package memory.bundles

import chisel3._
import memory.enums.ReadWriteSel
import common.enums.ReadWriteSel
import spec._

class DCacheAccessPort extends Bundle {
Expand Down
23 changes: 5 additions & 18 deletions src/src/pipeline/mem/MemStage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ package pipeline.mem
import chisel3._
import chisel3.util._
import common.bundles.{PassThroughPort, RfWriteNdPort}
import pipeline.dispatch.bundles.ExeInstNdPort
import spec.ExeInst.Sel
import spec._
import pipeline.execution.bundles.MemLoadStoreInfoNdPort
import chisel3.experimental.VecLiterals._
import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor
import control.bundles.PipelineControlNDPort
import pipeline.mem.bundles.MemLoadStorePort
import pipeline.mem.bundles.MemAccessNdPort
import pipeline.writeback.bundles.InstInfoNdPort
import pipeline.dispatch.bundles.ScoreboardChangeNdPort

Expand All @@ -23,14 +18,13 @@ class MemStage extends Module {
// `Cu` -> `MemStage`
val pipelineControlPort = Input(new PipelineControlNDPort)
// `MemStage` -> Cu
val stallRequest = Output(Bool())
// `MemStage` -> ?Ram
val memLoadStorePort = Flipped(new MemLoadStorePort)
val stallRequest = Output(Bool())
val memLoadStorePort = Flipped(new MemAccessNdPort)

// Scoreboard
val freePorts = Output(new ScoreboardChangeNdPort)

// (next clock pause)
// (Next clock pulse)
val instInfoPassThroughPort = new PassThroughPort(new InstInfoNdPort)
})

Expand All @@ -49,16 +43,9 @@ class MemStage extends Module {

io.stallRequest := false.B

val storeData = WireDefault(io.memLoadStoreInfoPort.data)
val hint = WireDefault(io.memLoadStoreInfoPort.data)

io.memLoadStorePort <> DontCare

// Indicate the availability in scoreboard
io.freePorts.en := false.B
io.freePorts.addr := io.gprWritePassThroughPort.out.addr

// flush or clear
// Flush or clear
when(io.pipelineControlPort.flush || io.pipelineControlPort.clear) {
gprWriteReg := RfWriteNdPort.default
InstInfoNdPort.setDefault(instInfoReg)
Expand Down
18 changes: 18 additions & 0 deletions src/src/pipeline/mem/bundles/MemAccessNdPort.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package pipeline.mem.bundles

import chisel3._
import chisel3.util._
import spec._
import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor
import common.enums.ReadWriteSel

class MemAccessNdPort extends Bundle {
val isValid = Bool()
val isAtomic = Bool()
val rw = ReadWriteSel
val addr = UInt(Width.Reg.data)
val write = new Bundle {
val mask = UInt(Width.Reg.data)
val data = UInt(Width.Reg.data)
}
}
15 changes: 0 additions & 15 deletions src/src/pipeline/mem/bundles/MemLoadStorePort.scala

This file was deleted.

1 change: 0 additions & 1 deletion src/src/pipeline/writeback/bundles/InstInfoNdPort.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ object InstInfoNdPort {
instInfoPort.csrWritePort := CsrWriteNdPort.default
instInfoPort.exeOp := 0.U
}

}
2 changes: 0 additions & 2 deletions src/src/spec/Param.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ object Param {
val exeOp = 8.W
val simpleFetchStageState = 2.W

val memSel = 4.W

object Axi { // crossbar
val slaveId = 8
val masterId = slaveId + log2Ceil(Count.Axi.slave)
Expand Down
2 changes: 1 addition & 1 deletion src/test/src/DCacheSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import chiseltest._
import utest._
import chisel3._
import chisel3.util._
import common.enums.ReadWriteSel
import memory.DCache
import memory.bundles.StatusTagBundle
import memory.enums.ReadWriteSel
import spec.Param

import scala.collection.immutable
Expand Down