コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
 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
コード例 #4
0
 def __init__(self, input: BasicStream, target_width):
     self.input = input
     self.output = input.clone(name="gearbox_output")
     self.output.payload = Signal(target_width) @ DOWNWARDS