minitest, test_partsig_scope.py, worked (which it did).
now can work out how to remove it
# XXX ################################################### XXX
# XXX Keep these functions in the same order as ast.Value XXX
# XXX ################################################### XXX
- def __init__(self, mask, shape=None, *args, src_loc_at=0, **kwargs):
+ def __init__(self, mask, shape=None, *args,
+ src_loc_at=0, fixed_width=None, **kwargs):
super().__init__(src_loc_at=src_loc_at)
print ("SimdSignal shape", shape)
# create partition points
self.ptype = ElwidPartType(self)
# adapt shape to a SimdShape
if not isinstance(shape, SimdShape):
- shape = SimdShape(self.scope, shape)
+ shape = SimdShape(self.scope, shape, fixed_width=fixed_width)
self._shape = shape
self.sig = Signal(shape, *args, **kwargs)
# get partpoints from SimdShape
##################
def Signal(self, shape=None, *, name=None, reset=0, reset_less=False,
- attrs=None, decoder=None, src_loc_at=0):
+ attrs=None, decoder=None, src_loc_at=0,
+ fixed_width=None): # TODO: *REMOVE* THIS. work out how.
+ # BE CAREFUL when using this param
+ # it is NOT available in scalar mode
if self.scalar:
# scalar mode, just return a nmigen Signal. THIS IS IMPORTANT.
# when passing in SimdShape it should go "oh, this is
# 3) lane_shapes 4) fixed_width
name=name, reset=reset,
reset_less=reset_less, attrs=attrs,
- decoder=decoder, src_loc_at=src_loc_at)
+ decoder=decoder, src_loc_at=src_loc_at,
+ fixed_width=fixed_width)
# set the module context so that the SimdSignal can create
# its own submodules during AST creation
s.set_module(self.module)
def __init__(self, width, elwid, vec_el_counts):
self.m = Module()
with SimdScope(self.m, elwid, vec_el_counts) as s:
- self.a = s.Signal(width)
- self.b = s.Signal(width*2)
- self.o = s.Signal(width*3)
+ # BE CAREFUL with the fixed_width parameter.
+ # it is NOT available in SimdScope.scalar mode
+ self.a = s.Signal(fixed_width=width)
+ self.b = s.Signal(fixed_width=width*2)
+ self.o = s.Signal(fixed_width=width*3)
self.cat_out = self.o.sig
def elaborate(self, platform):