override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
- def fromGPIOPort(port: GPIOPortIO){
+ def fromPort(port: GPIOPortIO){
// This will just match up the components of the Bundle that
// exist in both.
+++ /dev/null
-// See LICENSE for license details.
-package sifive.blocks.devices.gpio
-
-import Chisel._
-
-// ------------------------------------------------------------
-// SPI, UART, etc are with their
-// respective packages,
-// This file is for those that don't seem to have a good place
-// to put them otherwise.
-// ------------------------------------------------------------
-
-import freechips.rocketchip.config._
-import freechips.rocketchip.jtag.{JTAGIO}
-import sifive.blocks.devices.pinctrl.{Pin, PinCtrl}
-
-class JTAGPins[T <: Pin](pingen: () => T, hasTRSTn: Boolean = true) extends Bundle {
-
- val TCK = pingen()
- val TMS = pingen()
- val TDI = pingen()
- val TDO = pingen()
- val TRSTn = if (hasTRSTn) Option(pingen()) else None
-
- def fromJTAGPort(jtag: JTAGIO): Unit = {
- jtag.TCK := TCK.inputPin (pue = Bool(true)).asClock
- jtag.TMS := TMS.inputPin (pue = Bool(true))
- jtag.TDI := TDI.inputPin(pue = Bool(true))
- jtag.TRSTn.foreach{t => t := TRSTn.get.inputPin(pue = Bool(true))}
-
- TDO.outputPin(jtag.TDO.data)
- TDO.o.oe := jtag.TDO.driven
- }
-}
override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen).asInstanceOf[this.type]
- def fromI2CPort(i2c: I2CPort, clock: Clock, reset: Bool, syncStages: Int = 0) = {
+ def fromPort(i2c: I2CPort, clock: Clock, reset: Bool, syncStages: Int = 0) = {
withClockAndReset(clock, reset) {
scl.outputPin(i2c.scl.out, pue=true.B, ie = true.B)
scl.o.oe := i2c.scl.oe
--- /dev/null
+// See LICENSE for license details.
+package sifive.blocks.devices.jtag
+
+import Chisel._
+
+// ------------------------------------------------------------
+// SPI, UART, etc are with their respective packages,
+// JTAG doesn't really correspond directly to a device, but it does
+// define pins as those devices do.
+// ------------------------------------------------------------
+
+import freechips.rocketchip.config._
+import freechips.rocketchip.jtag.{JTAGIO}
+import sifive.blocks.devices.pinctrl.{Pin, PinCtrl}
+
+class JTAGPins[T <: Pin](pingen: () => T, hasTRSTn: Boolean = true) extends Bundle {
+
+ val TCK = pingen()
+ val TMS = pingen()
+ val TDI = pingen()
+ val TDO = pingen()
+ val TRSTn = if (hasTRSTn) Option(pingen()) else None
+
+ def fromPort(jtag: JTAGIO): Unit = {
+ jtag.TCK := TCK.inputPin (pue = Bool(true)).asClock
+ jtag.TMS := TMS.inputPin (pue = Bool(true))
+ jtag.TDI := TDI.inputPin(pue = Bool(true))
+ jtag.TRSTn.foreach{t => t := TRSTn.get.inputPin(pue = Bool(true))}
+
+ TDO.outputPin(jtag.TDO.data)
+ TDO.o.oe := jtag.TDO.driven
+ }
+}
override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
- def fromPWMPort(port: PWMPortIO) {
+ def fromPort(port: PWMPortIO) {
(pwm zip port.port) foreach {case (pin, port) =>
pin.outputPin(port)
}
override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen, c).asInstanceOf[this.type]
- def fromSPIPort(spi: SPIPortIO, clock: Clock, reset: Bool,
+ def fromPort(spi: SPIPortIO, clock: Clock, reset: Bool,
syncStages: Int = 0, driveStrength: Bool = Bool(false)) {
withClockAndReset(clock, reset) {
override def cloneType: this.type =
this.getClass.getConstructors.head.newInstance(pingen).asInstanceOf[this.type]
- def fromUARTPort(uart: UARTPortIO, clock: Clock, reset: Bool, syncStages: Int = 0) {
+ def fromPort(uart: UARTPortIO, clock: Clock, reset: Bool, syncStages: Int = 0) {
withClockAndReset(clock, reset) {
txd.outputPin(uart.txd)
val rxd_t = rxd.inputPin()