hdl.mem,lib.fifo: use keyword-only arguments for memory geometry.

Fixes #230.
This commit is contained in:
whitequark 2019-09-23 11:18:01 +00:00
parent 1aeb11d7e3
commit bc53bbf564
4 changed files with 53 additions and 27 deletions

View file

@ -9,7 +9,7 @@ __all__ = ["Memory", "ReadPort", "WritePort", "DummyPort"]
class Memory:
def __init__(self, width, depth, *, init=None, name=None, simulate=True):
def __init__(self, *, width, depth, init=None, name=None, simulate=True):
if not isinstance(width, int) or width < 0:
raise TypeError("Memory width must be a non-negative integer, not '{!r}'"
.format(width))