c62b009e54e3d1530b0c314464fb16d2ba42168d
[pinmux.git] / src / bsv / peripheral_gen / jtag.py
1 from bsv.peripheral_gen.base import PBase
2
3
4 class jtag(PBase):
5
6 def slowimport(self):
7 return "import jtagdtm::*;\n"
8
9 def extfastifinstance(self, name, count):
10 return self._extifinstance(name, count, "_out", "", True)
11
12 def fastifdecl(self, name, count):
13 # YUK!
14 return "interface Ifc_jtagdtm jtag{0}_out;".format(count)
15
16 def get_clk_spc(self, typ):
17 return "tck, trst"
18
19 def get_clock_reset(self, name, count):
20 return "slow_clock, slow_reset"
21
22 def pinname_in(self, pname):
23 return {'tms': 'tms',
24 'tdi': 'tdi',
25 }.get(pname, '')
26
27 def pinname_out(self, pname):
28 return {'tck': 'tck',
29 'tdo': 'tdo',
30 }.get(pname, '')
31
32 def mkfast_peripheral(self):
33 return """\
34 Ifc_jtagdtm jtag{0} <-mkjtagdtm(clocked_by tck, reset_by trst);
35 rule drive_tmp_scan_outs;
36 jtag{0}.scan_out_1_i(1'b0);
37 jtag{0}.scan_out_2_i(1'b0);
38 jtag{0}.scan_out_3_i(1'b0);
39 jtag{0}.scan_out_4_i(1'b0);
40 jtag{0}.scan_out_5_i(1'b0);
41 endrule
42 """
43
44 def axi_slave_name(self, name, ifacenum, typ=None):
45 return ''
46
47 def axi_slave_idx(self, idx, name, ifacenum, typ):
48 return ('', 0)
49
50 def axi_addr_map(self, name, ifacenum, typ=None):
51 return ''