self.fract_width = fract_width
self.log2_radix = log2_radix
if supported is None:
- supported = [DP.SqrtRem, DP.UDivRem, DP.RSqrtRem]
+ supported = frozenset(DP)
+ else:
+ supported = frozenset(supported)
self.supported = supported
print(f"{self}: n_stages={self.n_stages}")
def __repr__(self):
""" Get repr. """
return f"DivPipeCoreConfig({self.bit_width}, " \
- + f"{self.fract_width}, {self.log2_radix})"
+ + f"{self.fract_width}, {self.log2_radix}, "\
+ + f"supported={self.supported})"
@property
def n_stages(self):
""" Create a ``DivPipeCoreInterstageData`` instance. """
self.core_config = core_config
bw = core_config.bit_width
- if core_config.supported == [DP.UDivRem]:
+ if core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3
""" Create a ``DivPipeCoreOutputData`` instance. """
self.core_config = core_config
bw = core_config.bit_width
- if core_config.supported == [DP.UDivRem]:
+ if core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3
self.i = self.ispec()
self.o = self.ospec()
bw = core_config.bit_width
- if core_config.supported == [DP.UDivRem]:
+ if core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3
self.current_shift = current_shift
self.log2_radix = log2_radix
bw = core_config.bit_width
- if core_config.supported == [DP.UDivRem]:
+ if core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3
assert stage_index in range(core_config.n_stages)
self.core_config = core_config
bw = core_config.bit_width
- if core_config.supported == [DP.UDivRem]:
+ if core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3