|
16 | 16 | from amaranth.lib.cdc import FFSynchronizer |
17 | 17 | from amaranth.lib.wiring import Component, In, PureInterface |
18 | 18 |
|
19 | | -from amaranth.back import rtlil |
| 19 | +from amaranth.back import rtlil #type: ignore[reportAttributeAccessIssue] |
20 | 20 | from amaranth.hdl import Fragment |
21 | 21 | from amaranth.hdl._ir import PortDirection |
22 | 22 |
|
@@ -63,7 +63,7 @@ def elaborate(self, platform): |
63 | 63 | heartbeat_ctr = Signal(self.counter_size) |
64 | 64 | getattr(m.d, self.clock_domain).__iadd__(heartbeat_ctr.eq(heartbeat_ctr + 1)) |
65 | 65 |
|
66 | | - heartbeat_buffer = io.Buffer("o", self.ports.heartbeat) |
| 66 | + heartbeat_buffer = io.Buffer(io.Direction.Output, self.ports.heartbeat) |
67 | 67 | m.submodules.heartbeat_buffer = heartbeat_buffer |
68 | 68 | m.d.comb += heartbeat_buffer.o.eq(heartbeat_ctr[-1]) # type: ignore |
69 | 69 | return m |
@@ -240,10 +240,10 @@ def __init__(self, |
240 | 240 | self._ie = None |
241 | 241 |
|
242 | 242 | if self._oe is not None: |
243 | | - self._oe_n = Signal(self._oe.width, name=f"{self._name}$oeb") |
| 243 | + self._oe_n = Signal(self._oe.shape().width, name=f"{self._name}$oeb") |
244 | 244 | self._signals.append((self._oe_n, PortDirection.Output)) |
245 | 245 | if self._i is not None: |
246 | | - self._ie = Signal(self._i.width, name=f"{self._name}$inp_dis") |
| 246 | + self._ie = Signal(self._i.shape().width, name=f"{self._name}$inp_dis") |
247 | 247 | self._signals.append((self._ie, PortDirection.Input)) |
248 | 248 |
|
249 | 249 | # Port Configuration |
@@ -412,14 +412,14 @@ def instantiate_ports(self, m: Module): |
412 | 412 | assert 'clock_domain' in clock.iomodel |
413 | 413 | domain = clock.iomodel['clock_domain'] |
414 | 414 | setattr(m.domains, domain, ClockDomain(name=domain)) |
415 | | - clk_buffer = io.Buffer("i", self._ports[clock.port_name]) |
| 415 | + clk_buffer = io.Buffer(io.Direction.Input, self._ports[clock.port_name]) |
416 | 416 | setattr(m.submodules, "clk_buffer_" + domain, clk_buffer) |
417 | 417 | m.d.comb += ClockSignal().eq(clk_buffer.i) #type: ignore[reportAttributeAccessIssue] |
418 | 418 |
|
419 | 419 | for reset in pinlock.port_map.get_resets(): |
420 | 420 | assert 'clock_domain' in reset.iomodel |
421 | 421 | domain = reset.iomodel['clock_domain'] |
422 | | - rst_buffer = io.Buffer("i", self._ports[reset.port_name]) |
| 422 | + rst_buffer = io.Buffer(io.Direction.Input, self._ports[reset.port_name]) |
423 | 423 | setattr(m.submodules, reset.port_name, rst_buffer) |
424 | 424 | setattr(m.submodules, reset.port_name + "_sync", FFSynchronizer(rst_buffer.i, ResetSignal())) #type: ignore[reportAttributeAccessIssue] |
425 | 425 |
|
|
0 commit comments