1
0

now able to add periphery devices through traits

Unfortunately, I had to touch a lot of code, which weren't quite possible to split up into multiple commits.
This commit gets rid of the "extra" infrastructure to add periphery devices into Top.
This commit is contained in:
Yunsup Lee
2016-09-10 23:39:29 -07:00
parent 2c000a99da
commit bb3f514e8d
15 changed files with 414 additions and 472 deletions

View File

@ -7,11 +7,13 @@ import cde.{Parameters, Field}
import rocket.Util._
import junctions._
class TestHarness(implicit p: Parameters) extends Module {
case object BuildExampleTop extends Field[Parameters => ExampleTop]
class TestHarness(implicit val p: Parameters) extends Module with HasAddrMapParameters {
val io = new Bundle {
val success = Bool(OUTPUT)
}
val dut = uncore.tilelink2.LazyModule(new ExampleTop(p)).module
val dut = p(BuildExampleTop)(p).module
// This test harness isn't especially flexible yet
require(dut.io.mem_clk.isEmpty)
@ -29,7 +31,7 @@ class TestHarness(implicit p: Parameters) extends Module {
int := false
if (dut.io.mem_axi.nonEmpty) {
val memSize = p(GlobalAddrMap)("mem").size
val memSize = addrMap("mem").size
require(memSize % dut.io.mem_axi.size == 0)
for (axi <- dut.io.mem_axi)
Module(new SimAXIMem(memSize / dut.io.mem_axi.size)).io.axi <> axi