hdl.mem,lib.fifo: use keyword-only arguments for memory geometry.
Fixes #230.
This commit is contained in:
parent
1aeb11d7e3
commit
bc53bbf564
4 changed files with 53 additions and 27 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue