def __init__(self, address_input: BasicStream, memory: Memory): assert len(address_input.payload) == bits_for(memory.depth) self.address_input = address_input self.memory = memory self.output = address_input.clone() self.output.payload = Signal(memory.width)
def __init__(self, input: BasicStream, target_width): self.input = input self.output = input.clone(name="gearbox_output") self.output.payload = Signal(target_width) @ DOWNWARDS self.input_width = len(self.input.payload) self.output_width = target_width self.division_factor = self.input_width / target_width assert target_width < self.input_width assert self.division_factor % 1 == 0 self.division_factor = int(self.division_factor)
def __init__(self, input: BasicStream, target_width, upper_bits=False): self.input = input self.output = input.clone(name="resizer_output") self.output.payload = Signal(target_width) @ DOWNWARDS self.upper_bits = upper_bits
def __init__(self, input: BasicStream, target_width): self.input = input self.output = input.clone(name="gearbox_output") self.output.payload = Signal(target_width) @ DOWNWARDS