Skip to content

Commit 95f8261

Browse files
committed
Fix some wiring up issues in simulation
1 parent 7a17121 commit 95f8261

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

chipflow_lib/platforms/sim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def instantiate_ports(self, m: Module):
8181
raise ChipFlowError(f"Unable to find clock {name} in pinlock")
8282

8383
port_data = pinlock.package.clocks[name]
84-
port = io.SimulationPort(io.Direction.Input, port_data.width, invert=True, name=f"clock-{name}")
84+
port = io.SimulationPort(io.Direction.Input, port_data.width, name=f"clock-{name}")
8585
self._ports[name] = port
8686

8787
if clock == 'default':
@@ -93,7 +93,7 @@ def instantiate_ports(self, m: Module):
9393

9494
for reset, name in self._config["chipflow"]["resets"].items():
9595
port_data = pinlock.package.resets[name]
96-
port = io.SimulationPort(io.Direction.Input, port_data.width, invert=port.invert, name=f"clock-{name}", )
96+
port = io.SimulationPort(io.Direction.Input, port_data.width, name=f"reset-{name}", )
9797
self._ports[name] = port
9898
rst_buffer = io.Buffer("i", port)
9999
setattr(m.submodules, reset, rst_buffer)

chipflow_lib/steps/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def _wire_up_ports(m: Module, top, platform):
5959
port = platform._ports[port.port_name]
6060
if hasattr(wire, 'i'):
6161
m.d.comb += wire.i.eq(port.i ^ inv_mask)
62-
for d in ['o', 'oe']:
63-
if hasattr(wire, d):
64-
m.d.comb += getattr(port, d).eq(getattr(wire, d) ^ inv_mask)
62+
if hasattr(wire, 'o'):
63+
m.d.comb += port.o.eq(wire.o)^ inv_mask
64+
if hasattr(wire, 'oe'):
65+
m.d.comb += port.oe.eq(wire.oe)^ inv_mask
6566

0 commit comments

Comments
 (0)