pname = self.pname(p['name']).format(*args)
if p.get('outen') is True:
outname = self.ifacefmtoutfn(pname)
- ganged.append("%s_outen" % outname) # match wirefmt
-
+ ganged.append("%s_outen" % outname) # match wirefmt
+
gangedfmt = '{%s} = duplicate(%s);'
res.append(gangedfmt % (',\n '.join(ganged), name))
return '\n'.join(res) + '\n\n'
if p.get('outen') is True:
outname = self.ifacefmtoutfn(name)
params.append('outputval:%s_out,' % outname)
- params.append('output_en:%s_outen,' % outname) # match busfmt
+ params.append('output_en:%s_outen,' % outname) # match busfmt
params.append('input_en:~%s_outen,' % outname)
elif p.get('action'):
outname = self.ifacefmtoutfn(name)
elif ln[1] == 'inout':
d['outen'] = True
if len(ln) == 3:
- bus = ln[2]
- if not ganged.has_key(bus):
+ bus = ln[2]
+ if bus not in ganged:
ganged[bus] = []
ganged[bus].append(name)
spec.append(d)
# copy over template and library files
shutil.copyfile(os.path.join(cwd, 'Makefile.template'),
- os.path.join(bp, 'Makefile'))
+ os.path.join(bp, 'Makefile'))
cwd = os.path.join(cwd, 'bsv_lib')
for fname in ['AXI4_Lite_Types.bsv', 'Semi_FIFOF.bsv']:
shutil.copyfile(os.path.join(cwd, fname),
- os.path.join(bl, fname))
+ os.path.join(bl, fname))
bus = os.path.join(bp, 'busenable.bsv')
pmp = os.path.join(bp, 'pinmux.bsv')
def get_cell_bit_width(p):
max_num_cells = 0
for cell in p.muxed_cells:
- max_num_cells = max(len(cell)-1, max_num_cells)
+ max_num_cells = max(len(cell) - 1, max_num_cells)
return int(math.log(max_num_cells, 2))
+
def write_pmp(pmp, p, ifaces):
# package and interface declaration followed by
# the generic io_cell definition