我有一个外围设备,其总体布局如下。我提到的Block不是我设计的,所以我想继承模块并做一些内部信号作为外设的IO端口。
需要转换为端口的 Wire 位于使用实例化的模块中LazyModuleImp
,并替换Some Wire needs to be converted as a port pin
了以下块中的注释。
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
}
在不修改实际设计的情况下,有哪些方法可以在设计中添加更多端口引脚?