Skip to content

Commit

Permalink
And the refactoring is going again 2
Browse files Browse the repository at this point in the history
  • Loading branch information
HidetaroTanaka committed Jan 29, 2024
1 parent b0acf72 commit 528cf43
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/test/scala/hajime/simple4Stage/CoreAndCache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CoreAndCache[T <: CpuModule](iCacheMemsize: Int = 8192, dCacheMemsize: Int
val iCacheInitialising = Input(Bool())
val dCacheInitialising = Input(Bool())
val iMemInitialiseAxi = Flipped(new AXI4liteIO(addrWidth = 64, dataWidth = 32))
val dmem_initialiseAXI = Flipped(new AXI4liteIO(addrWidth = 64, dataWidth = 64))
val dMemInitialiseAxi = Flipped(new AXI4liteIO(addrWidth = 64, dataWidth = 64))
})

val core = withReset(io.iCacheInitialising || io.dCacheInitialising || reset.asBool) {
Expand All @@ -31,7 +31,7 @@ class CoreAndCache[T <: CpuModule](iCacheMemsize: Int = 8192, dCacheMemsize: Int
io.iMemInitialiseAxi := DontCare
core.io.iCacheAxi4Lite := DontCare
dcache.io := DontCare
io.dmem_initialiseAXI := DontCare
io.dMemInitialiseAxi := DontCare
core.io.dCacheAxi4Lite := DontCare

when(io.iCacheInitialising) {
Expand All @@ -47,15 +47,15 @@ class CoreAndCache[T <: CpuModule](iCacheMemsize: Int = 8192, dCacheMemsize: Int
}

when(io.dCacheInitialising) {
dcache.io <> io.dmem_initialiseAXI
dcache.io <> io.dMemInitialiseAxi
core.io.dCacheAxi4Lite.ar.ready := false.B
core.io.dCacheAxi4Lite.aw.ready := false.B
core.io.dCacheAxi4Lite.w.ready := false.B
} .otherwise {
dcache.io <> core.io.dCacheAxi4Lite
io.dmem_initialiseAXI.ar.ready := false.B
io.dmem_initialiseAXI.aw.ready := false.B
io.dmem_initialiseAXI.w.ready := false.B
io.dMemInitialiseAxi.ar.ready := false.B
io.dMemInitialiseAxi.aw.ready := false.B
io.dMemInitialiseAxi.w.ready := false.B
}

core.io.resetVector := io.resetVector
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/hajime/simple4Stage/CoreTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CoreTest extends AnyFlatSpec with ChiselScalatestTester {
}

def initialiseDmem[T <: CpuModule](filename: String, dut: CoreAndCache[T]): Unit = {
hajime.vectormodules.MemInitializer.initialiseMemWithAxi(filename, dut.io.dmem_initialiseAXI, dut.io.dCacheInitialising, dut.clock, 0x4000)
hajime.vectormodules.MemInitializer.initialiseMemWithAxi(filename, dut.io.dMemInitialiseAxi, dut.io.dCacheInitialising, dut.clock, 0x4000)
}

val instList_noDmem = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object Core_ApplicationTest {
fork {
initialiseMemWithAxi(s"src/main/resources/applications_${testType}/${testName}_inst.hex", dut.io.iMemInitialiseAxi, dut.io.iCacheInitialising, dut.clock, 0)
}.fork {
initialiseMemWithAxi(s"src/main/resources/applications_${testType}/${testName}_data.hex", dut.io.dmem_initialiseAXI, dut.io.dCacheInitialising, dut.clock, 0x4000)
initialiseMemWithAxi(s"src/main/resources/applications_${testType}/${testName}_data.hex", dut.io.dMemInitialiseAxi, dut.io.dCacheInitialising, dut.clock, 0x4000)
}.join()
dut.clock.setTimeout(1048576)
dut.io.resetVector.poke(0.U)
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/hajime/vectormodules/VectorCpuSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class VectorCpuSpec extends AnyFlatSpec with ChiselScalatestTester {
}.fork {
initialiseMemWithAxi(
filename = s"src/main/resources/rv64ui/${e}_data.hex",
axi = dut.io.dmem_initialiseAXI,
axi = dut.io.dMemInitialiseAxi,
initialising = dut.io.dCacheInitialising,
clock = dut.clock,
baseAddr = 0x4000
Expand Down Expand Up @@ -162,7 +162,7 @@ class FpgaTestForVecCpu extends AnyFlatSpec with ChiselScalatestTester {
fork {
initialiseMemWithAxi(s"src/main/resources/applications_${testType}/${testName}_inst.mem", dut.io.iMemInitialiseAxi, dut.io.iCacheInitialising, dut.clock, 0)
}.fork {
initialiseMemWithAxi(s"src/main/resources/applications_${testType}/${testName}_data.mem", dut.io.dmem_initialiseAXI, dut.io.dCacheInitialising, dut.clock, 0x4000)
initialiseMemWithAxi(s"src/main/resources/applications_${testType}/${testName}_data.mem", dut.io.dMemInitialiseAxi, dut.io.dCacheInitialising, dut.clock, 0x4000)
}.join()
dut.clock.setTimeout(0)
dut.io.resetVector.poke(0.U)
Expand Down

0 comments on commit 528cf43

Please sign in to comment.