-def port_decl(comment, dt, name):
- if dt is None or dt.dims is None:
- width = '' # width: 1
- else:
- width = dt.dims
- # XXX TODO, better checking, should be using data structure... *sigh*
- width = width[1:-1] # strip brackets
- width = width.split(':')
- assert width[0] == '0'
- width = width[1]
- return 'self.%s = Signal(%s) # %s' % (name, width, comment)
-