generated from chipsalliance/chisel-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add SocTop and modify the AXI4RAM
- Loading branch information
1 parent
5114385
commit 49376ff
Showing
4 changed files
with
94 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package rvspeccore.core | ||
import chisel3._ | ||
import chisel3.util._ | ||
import rvspeccore.bus.axi4._ | ||
import rvspeccore.device.AXI4RAM | ||
|
||
class SoCTop(genCore: => RiscvCore)(implicit config: RVConfig) extends Module { | ||
val io = IO(new Bundle { | ||
val mem = new AXI4 | ||
}) | ||
val core = Module(genCore) | ||
val pc = core.io.now.pc - "h8000_0000".U | ||
printf("[SoCTop] pc = %d\n", pc) | ||
// val inst = Wire(UInt(32.W)) | ||
|
||
core.io.valid := !reset.asBool | ||
core.io.mem.read.data := 0.U | ||
core.io.inst := "h00b00193".U | ||
io.mem.ar.bits.addr := 0.U | ||
io.mem.ar.valid := 0.U | ||
io.mem.ar.bits.size := 0.U | ||
io.mem.ar.bits.len := 0.U | ||
io.mem.r.ready := 0.U | ||
io.mem.aw.valid := 0.U | ||
io.mem.aw.bits.addr := "h0000_0000".U | ||
io.mem.aw.bits.size := 4.U | ||
io.mem.aw.bits.len := 1.U | ||
io.mem.w.bits.data := 0.U | ||
io.mem.w.bits.strb := 0.U | ||
io.mem.w.bits.last := 0.U | ||
io.mem.w.valid := 0.U | ||
io.mem.aw.bits.user := 0.U | ||
io.mem.aw.bits.burst := 0.U | ||
io.mem.aw.bits.cache := 0.U | ||
io.mem.aw.bits.prot := 0.U | ||
io.mem.aw.bits.lock := 0.U | ||
io.mem.aw.bits.qos := 0.U | ||
io.mem.aw.bits.id := 0.U | ||
io.mem.ar.bits.prot := 0.U | ||
io.mem.ar.bits.burst := 0.U | ||
io.mem.ar.bits.cache := 0.U | ||
io.mem.ar.bits.user := 0.U | ||
io.mem.ar.bits.qos := 0.U | ||
io.mem.ar.bits.lock := 0.U | ||
io.mem.ar.bits.id := 0.U | ||
io.mem.b.ready := 0.U | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// See README.md for license details. | ||
|
||
package rvspeccore.core | ||
|
||
import chisel3._ | ||
import chiseltest._ | ||
import org.scalatest.freespec.AnyFreeSpec | ||
import chisel3.experimental.BundleLiterals._ | ||
import rvspeccore.device.AXI4RAM | ||
import rvspeccore.bus.axi4._ | ||
|
||
class SoC() extends Module { | ||
// val Spec = Module(new SpecCore) | ||
implicit val config = RV32Config("MC") | ||
|
||
val mem = Module(new AXI4RAM(new AXI4, 1024 * 1024 * 4, false, "./testcase/riscv-tests-hex/rv32ui/rv32ui-add.hex")) | ||
val memdelay = Module(new AXI4Delayer(0)) | ||
val core = Module(new SoCTop(new RiscvCore)) | ||
memdelay.io.in <> core.io.mem | ||
mem.io.in <> memdelay.io.out | ||
} | ||
|
||
class SocTopSpec extends AnyFreeSpec with ChiselScalatestTester { | ||
"SocTopSpec pass" in { | ||
test(new SoC()) { dut => | ||
dut.clock.step(20) | ||
} | ||
} | ||
} |