1 from nmigen
.build
import *
8 def PmodJTAGResource(*args
, pmod_name
="pmod", pmod_number
, attrs
=None,
9 master
=False, reset
=False):
10 """Get a resource for a JTAG pins on a pmod.
12 The pins are configured in such a way that the master pmod jtag can
13 be connected to the tap pmod with a straight cable.
16 *args: either number or name, number.
17 pmod_name (str): name of the pmod connector; default = "pmod"
18 pmod_number (int): number of pmod connector
19 attrs (Attrs): attributes for the ``Resource``
20 master (bool): wether if this a master interface
21 reset (bool): wether to include a reset signal
33 conn
= (pmod_name
, pmod_number
)
36 Subsignal("tck", Pins("1", dir=mosi
, conn
=conn
)),
37 Subsignal("tms", Pins("2", dir=mosi
, conn
=conn
)),
38 Subsignal("tdo", Pins(tdo_pin
, dir="o", conn
=conn
)),
39 Subsignal("tdi", Pins(tdi_pin
, dir="i", conn
=conn
)),
42 ios
.append(Subsignal("trst", PinsN("7", dir=mosi
, conn
=conn
)))
46 return Resource
.family(*args
, default_name
="jtag", ios
=ios
)