I have a Peripheral which has a general layout as follows. The Block I have mentioned is not designed by me so, I want to inherit the module and make few internal signals as IO ports of the peripheral.
The Wire which needs to be converted as the ports is in a module instantiated using LazyModuleImp
and replaces the comment Some Wire needs to be converted as a port pin
in the following block.
package SomeBlock.SomePackage
import Chisel._
import freechips.rocketchip.diplomacy._
import freechips.rocketchip.config.Field
import freechips.rocketchip.subsystem.BaseSubsystem
case class SomeParams(
//Some Parameters
}
class SomeBundle extends Bundle {
// Some Port Pins
}
class SomeModule(params: SomeParams) extends LazyModule {
// Some Logic
lazy val module = new LazyModuleImp(this) {
val io = IO(new SomeBundle {
val clock = Clock(OUTPUT)
val reset = Bool(INPUT)
})
// Some logic
// Some Wire needs to be converted as a port pin
}
}
case object PeripherySomeModuleKey extends Field[SomeModuleParams]
trait HasPeripherySomeModule { this: BaseSubsystem =>
val someParams= p(PeripherySomeModuleKey)
val some = LazyModule(new SomeModule(someParams))
// Logic to connect to TileLink Node
}
trait HasPeripherySomeBundle {
val some: SomeBundle
}
trait HasPeripherySomeModuleImp extends LazyModuleImp with HasPeripherySomeBundle {
val outer: HasPeripherySomeModule
val some = IO(new SomeBundle)
some <> outer.some.module.io
}
What are the ways I can add some more port pins to the design without modifying the actual design?