separate PWM and basic example into separate packages

This commit is contained in:
Howard Mao
2016-10-21 21:06:40 -07:00
parent 3b03ac15e0
commit f6993880dd
8 changed files with 50 additions and 45 deletions

View File

@@ -0,0 +1,7 @@
package example
import cde.{Parameters, Config, CDEMatchError}
import testchipip.WithSerialAdapter
class DefaultExampleConfig extends Config(
new WithSerialAdapter ++ new rocketchip.BaseConfig)

View File

@@ -0,0 +1,35 @@
package example
import util.GeneratorApp
import diplomacy.LazyModule
import rocketchip._
import testchipip._
import chisel3._
import cde.Parameters
class TestHarness(implicit val p: Parameters) extends Module {
val io = new Bundle {
val success = Bool(OUTPUT)
}
def buildTop(p: Parameters): ExampleTop = LazyModule(new ExampleTop(p))
val dut = buildTop(p).module
val ser = Module(new SimSerialWrapper(p(SerialInterfaceWidth)))
val nMemChannels = dut.io.mem_axi.size
for (axi <- dut.io.mem_axi) {
val mem = Module(new SimAXIMem(BigInt(p(ExtMemSize) / nMemChannels)))
mem.io.axi <> axi
}
ser.io.serial <> dut.io.serial
io.success := ser.io.exit
}
object Generator extends GeneratorApp {
val longName = names.topModuleProject + "." +
names.topModuleClass + "." +
names.configs
generateFirrtl
}

View File

@@ -0,0 +1,23 @@
package example
import chisel3._
import cde.Parameters
import testchipip._
import rocketchip._
class ExampleTop(q: Parameters) extends BaseTop(q)
with PeripheryBootROM with PeripheryCoreplexLocalInterrupter
with PeripherySerial with PeripheryMasterMem {
override lazy val module = Module(
new ExampleTopModule(p, this, new ExampleTopBundle(p)))
}
class ExampleTopBundle(p: Parameters) extends BaseTopBundle(p)
with PeripheryBootROMBundle with PeripheryCoreplexLocalInterrupterBundle
with PeripheryMasterMemBundle with PeripherySerialBundle
class ExampleTopModule[+L <: ExampleTop, +B <: ExampleTopBundle](p: Parameters, l: L, b: => B)
extends BaseTopModule(p, l, b)
with PeripheryBootROMModule with PeripheryCoreplexLocalInterrupterModule
with PeripheryMasterMemModule with PeripherySerialModule
with HardwiredResetVector with DirectConnection with NoDebug