Skip to content

Commit

Permalink
[Circuit] Make IO.add() public
Browse files Browse the repository at this point in the history
  • Loading branch information
rsetaluri committed Jan 26, 2024
1 parent 03d5aa9 commit 5189d9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magma/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def __init__(self, **kwargs):
self._ports = {}
self._bound = False
for name, typ in kwargs.items():
self._add(name, typ)
self.add(name, typ)

@property
def ports(self):
Expand Down Expand Up @@ -498,7 +498,7 @@ def __iadd__(self, other: 'IO') -> 'IO':
self._ports.update(other._ports)
return self

def _add(self, name, typ):
def add(self, name, typ):
if self._bound:
raise RuntimeError("Can not add to a bound IO")
# Definition port.
Expand Down Expand Up @@ -564,8 +564,8 @@ def make_interface(self):
}
return InterfaceKind(name, (_DeclareSingletonInstanceInterface,), dct)

def _add(self, name, typ):
super()._add(name, typ)
def add(self, name, typ):
super().add(name, typ)
# Instance port.
inst_ref = LazyInstRef(name=name)
inst_port = _make_port(typ, inst_ref, flip=False)
Expand Down

0 comments on commit 5189d9b

Please sign in to comment.