From: Luke Kenneth Casson Leighton Date: Wed, 13 Jun 2018 13:03:12 +0000 (+0100) Subject: use getifacetype to identify generation of xxxx_io objects X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c9f340ba14e8e79568214bf68e5debc00d0cf28;p=pinmux.git use getifacetype to identify generation of xxxx_io objects --- diff --git a/src/bsv/interface_decl.py b/src/bsv/interface_decl.py index b24e13d..46b5bb7 100644 --- a/src/bsv/interface_decl.py +++ b/src/bsv/interface_decl.py @@ -160,20 +160,23 @@ class Interface(object): res = '\n'.join(map(self.wirefmtpin, self.pins)).format(*args) res += '\n' for p in self.pinspecs: - name = self.pname(p['name']).format(*args) + name = self.pname(p['name']) + typ = self.getifacetype(name.format("")) + name = name.format(*args) + res += " # declare %s_io, set up as type '%s'\n" % (name, typ) res += " GenericIOType %s_io = GenericIOType{\n" % name params = [] - if p.get('outen') is True: + if typ == 'inout': outname = self.ifacefmtoutfn(name) params.append('outputval:%s_out,' % outname) params.append('output_en:%s_outen,' % outname) # match busfmt params.append('input_en:~%s_outen,' % outname) - elif p.get('action'): + elif typ == 'out': outname = self.ifacefmtoutfn(name) params.append('outputval:%s,' % outname) params.append('output_en:1,') params.append('input_en:0,') - else: + else: # input params.append('outputval:0,') params.append('output_en:0,') params.append('input_en:1,')