def __init__(self, subkls, rwid, n_src=None, n_dst=None, name=None):
RegSpec.__init__(self, rwid, n_src, n_dst)
- RecordObject.__init__(self, name)
+ print ("name", name)
+ RecordObject.__init__(self)
self._subkls = subkls
n_src, n_dst = self._n_src, self._n_dst
src = []
for i in range(n_src):
j = i + 1 # name numbering to match src1/src2
- name = "src%d_i" % j
+ sname = "src%d_i" % j
rw = self._get_srcwid(i)
- sreg = Signal(rw, name=name, reset_less=True)
- setattr(self, name, sreg)
+ sreg = Signal(rw, name=sname, reset_less=True)
+ setattr(self, sname, sreg)
src.append(sreg)
self._src_i = src
dst = []
for i in range(n_dst):
j = i + 1 # name numbering to match dest1/2...
- name = "dest%d_o" % j
+ dname = "dest%d_o" % j
rw = self._get_dstwid(i)
# dreg = Data(rw, name=name) XXX ??? output needs to be a Data type?
- dreg = Signal(rw, name=name, reset_less=True)
- setattr(self, name, dreg)
+ dreg = Signal(rw, name=dname, reset_less=True)
+ setattr(self, dname, dreg)
dst.append(dreg)
self._dest = dst
# operation / data input
- self.oper_i = subkls(name="oper_i") # operand
+ self.oper_i = subkls(name="oper_i_%s" % name) # operand
# create read/write and other scoreboard signalling
self.rd = go_record(n_src, name="rd") # read in, req out
RegSpecALUAPI.__init__(self, rwid, alu)
self.alu_name = name or "alu"
self.opsubsetkls = opsubsetkls
- self.cu = cu = CompUnitRecord(opsubsetkls, rwid, n_src, n_dst)
+ self.cu = cu = CompUnitRecord(opsubsetkls, rwid, n_src, n_dst,
+ name=name)
n_src, n_dst = self.n_src, self.n_dst = cu._n_src, cu._n_dst
print("n_src %d n_dst %d" % (self.n_src, self.n_dst))
"""
def __init__(self, pi=None, rwid=64, awid=48, opsubset=CompLDSTOpSubset,
- debugtest=False):
+ debugtest=False, name=None):
super().__init__(rwid)
self.awid = awid
self.pi = pi
- self.cu = cu = LDSTCompUnitRecord(rwid, opsubset)
+ self.cu = cu = LDSTCompUnitRecord(rwid, opsubset, name=name)
self.debugtest = debugtest
# POWER-compliant LD/ST has index and update: *fixed* number of ports
base class of subset Operation information
"""
def __init__(self, layout, name):
+ if name is None:
+ name = self.__class__.__name__
+ print ("Subset name", name)
+ assert name.startswith("Comp")
+ assert name.endswith("OpSubset")
+ name = name[4:-8].lower() + "_op"
Record.__init__(self, Layout(layout), name=name)
fnunit = Function.LDST
def __init__(self, pi, awid, idx):
+ alu_name = "ldst_%s%d" % (self.fnunit.name.lower(), idx)
pspec = LDSTPipeSpec(id_wid=2) # spec (NNNPipeSpec instance)
opsubset = pspec.opsubsetkls # get the operand subset class
regspec = pspec.regspec # get the regspec
- super().__init__(pi, regspec, awid, opsubset)
+ super().__init__(pi, regspec, awid, opsubset, name=alu_name)
#####################################################################