jtag: The jtag interfaces have moved to a different package.
[sifive-blocks.git] / src / main / scala / devices / gpio / JTAG.scala
1 // See LICENSE for license details.
2 package sifive.blocks.devices.gpio
3
4 import Chisel._
5
6 // ------------------------------------------------------------
7 // SPI, UART, etc are with their
8 // respective packages,
9 // This file is for those that don't seem to have a good place
10 // to put them otherwise.
11 // ------------------------------------------------------------
12
13 import config._
14 import jtag.{JTAGIO}
15
16 class JTAGPinsIO extends Bundle {
17
18 val TCK = new GPIOPin()
19 val TMS = new GPIOPin()
20 val TDI = new GPIOPin()
21 val TDO = new GPIOPin()
22 val TRSTn = new GPIOPin()
23
24 }
25
26 class JTAGGPIOPort()(implicit p: Parameters) extends Module {
27
28 val io = new Bundle {
29 val jtag = new JTAGIO()
30 val pins = new JTAGPinsIO()
31 }
32
33 io.jtag.TCK := GPIOInputPinCtrl(io.pins.TCK, pue = Bool(true)).asClock
34 io.jtag.TMS := GPIOInputPinCtrl(io.pins.TMS, pue = Bool(true))
35 io.jtag.TDI := GPIOInputPinCtrl(io.pins.TDI, pue = Bool(true))
36 io.jtag.TRSTn := GPIOInputPinCtrl(io.pins.TRSTn, pue = Bool(true))
37
38 GPIOOutputPinCtrl(io.pins.TDO, io.jtag.TDO.data)
39 io.pins.TDO.o.oe := io.jtag.TDO.driven
40 }