1
0

rocket: don't remove ports on top module

This commit is contained in:
Henry Cook
2017-10-05 16:29:16 -07:00
committed by Wesley W. Terpstra
parent 5ff4c1674a
commit 75345b6048
3 changed files with 19 additions and 0 deletions

View File

@ -4,6 +4,7 @@
package freechips.rocketchip.util
import Chisel._
import chisel3.experimental.{dontTouch, RawModule}
import freechips.rocketchip.config.Parameters
import scala.math._
@ -21,6 +22,21 @@ class ParameterizedBundle(implicit p: Parameters) extends Bundle {
}
}
// TODO: replace this with an implicit class when @chisel unprotects dontTouchPorts
trait DontTouch {
self: RawModule =>
/** Marks every port as don't touch
*
* @note This method can only be called after the Module has been fully constructed
* (after Module(...))
*/
def dontTouchPorts(): this.type = {
self.getModulePorts.foreach(dontTouch(_))
self
}
}
trait Clocked extends Bundle {
val clock = Clock()
val reset = Bool()