import Chisel._
import freechips.rocketchip.config.Field
-import freechips.rocketchip.diplomacy.{LazyModule,LazyMultiIOModuleImp}
-import freechips.rocketchip.chip.{HasSystemNetworks}
-import freechips.rocketchip.tilelink.TLFragmenter
+import freechips.rocketchip.coreplex.{HasPeripheryBus, HasInterruptBus}
+import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp}
case object PeripheryI2CKey extends Field[Seq[I2CParams]]
-trait HasPeripheryI2C extends HasSystemNetworks {
+trait HasPeripheryI2C extends HasPeripheryBus {
val i2cParams = p(PeripheryI2CKey)
val i2c = i2cParams map { params =>
- val i2c = LazyModule(new TLI2C(peripheryBusBytes, params))
- i2c.node := TLFragmenter(peripheryBusBytes, cacheBlockBytes)(peripheryBus.node)
- intBus.intnode := i2c.intnode
+ val i2c = LazyModule(new TLI2C(pbus.beatBytes, params))
+ i2c.node := pbus.toVariableWidthSlaves
+ ibus.fromSync := i2c.intnode
i2c
}
}
val i2c: Vec[I2CPort]
}
-trait HasPeripheryI2CModuleImp extends LazyMultiIOModuleImp with HasPeripheryI2CBundle {
+trait HasPeripheryI2CModuleImp extends LazyModuleImp with HasPeripheryI2CBundle {
val outer: HasPeripheryI2C
val i2c = IO(Vec(outer.i2cParams.size, new I2CPort))