From: Luke Kenneth Casson Leighton Date: Wed, 25 Jul 2018 12:04:48 +0000 (+0100) Subject: put jtag interface straight out, not with bscan etc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d59cfd2f778e018efc5d41af52583c9a6d2bd246;p=pinmux.git put jtag interface straight out, not with bscan etc --- diff --git a/src/bsv/peripheral_gen/base.py b/src/bsv/peripheral_gen/base.py index 0cc11df..23adfb6 100644 --- a/src/bsv/peripheral_gen/base.py +++ b/src/bsv/peripheral_gen/base.py @@ -210,11 +210,18 @@ class PBase(object): def extfastifinstance(self, name, count): return '' - def extifinstance(self, name, count): - sname = self.peripheral.iname().format(count) + def _extifinstance(self, name, count, suffix, prefix, samename=False): pname = self.get_iname(count) - template = " interface {0} = pinmux.peripheral_side.{1};" - return template.format(pname, sname) + if samename: + sname = pname + else: + sname = self.peripheral.iname().format(count) + template = " interface {0}{3} = {2}{1};" + return template.format(pname, sname, prefix, suffix) + + def extifinstance(self, name, count): + return self._extifinstance(name, count, "", + "pinmux.peripheral_side.") mkplic_rule = """\ diff --git a/src/bsv/peripheral_gen/jtag.py b/src/bsv/peripheral_gen/jtag.py index 04d4481..042d802 100644 --- a/src/bsv/peripheral_gen/jtag.py +++ b/src/bsv/peripheral_gen/jtag.py @@ -7,47 +7,13 @@ class jtag(PBase): return " import jtagtdm::*;\n" def extfastifinstance(self, name, count): - # YUK! - print "jtag", name, count - return """\ - method Action tms_i(Bit#(1) tms); - {0}.tms_i(tms); - endmethod - method Action tdi_i(Bit#(1) tdi); - {0}.tdi_i(tdi); - endmethod - method Action bs_chain_i(Bit#(1) bs_chain); - {0}.bs_chain_i(bs_chain); - endmethod - method Bit#(1) shiftBscan2Edge={0}.shiftBscan2Edge; - method Bit#(1) selectJtagInput={0}.selectJtagInput; - method Bit#(1) selectJtagOutput={0}.selectJtagOutput; - method Bit#(1) updateBscan={0}.updateBscan; - method Bit#(1) bscan_in={0}.bscan_in; - method Bit#(1) scan_shift_en={0}.scan_shift_en; - method Bit#(1) tdo={0}.tdo; - method Bit#(1) tdo_oe={0}.tdo_oe; -""".format(self.name, count) + return self._extifinstance(name, count, "_out", "", True) def fastifdecl(self, name, count): # YUK! - template = """ \ - (*always_ready,always_enabled*) method Action tms_i(Bit#(1) tms); - (*always_ready,always_enabled*) method Action tdi_i(Bit#(1) tdi); - (*always_ready,always_enabled*) - method Action bs_chain_i(Bit#(1) bs_chain); - (*always_ready,always_enabled*) method Bit#(1) shiftBscan2Edge; - (*always_ready,always_enabled*) method Bit#(1) selectJtagInput; - (*always_ready,always_enabled*) method Bit#(1) selectJtagOutput; - (*always_ready,always_enabled*) method Bit#(1) updateBscan; - (*always_ready,always_enabled*) method Bit#(1) bscan_in; - (*always_ready,always_enabled*) method Bit#(1) scan_shift_en; - (*always_ready,always_enabled*) method Bit#(1) tdo; - (*always_ready,always_enabled*) method Bit#(1) tdo_oe; -""" - return template + return " Ifc_jtagdtm jtag{0}_out;".format(count); def mkfast_peripheral(self): return """\