"""
def __init__(self, bus=None, features=None, name=None):
+ if name:
+ self.idx = int(name.split("_")[-1])
+ else:
+ self.idx = 0
self.enable = Signal(reset=1) # enable signal, defaults to 1
if features is None:
features = frozenset()
# create Chips4Makers 4k SRAM cell here, mark it as "black box"
# for coriolis2 to pick up
- sram = Instance("spblock512w64b8w", i_a=a, o_q=q, i_d=d,
- i_we=we, i_clk=ClockSignal())
+ idx = self.idx
+ sram = Instance("spblock512w64b8w_%d" % idx, i_a=a, o_q=q,
+ i_d=d, i_we=we,
+ i_clk=ClockSignal())
m.submodules.spb = sram
# has to be added to the actual module rather than the instance
# sram.attrs['blackbox'] = 1