build.{res,plat}: use xdr=0 as default, not xdr=1.
The previous behavior was semantically incorrect.
This commit is contained in:
parent
cd6488c782
commit
9ba2efd86b
4 changed files with 14 additions and 8 deletions
|
|
@ -169,7 +169,7 @@ class Platform(ConstraintManager, metaclass=ABCMeta):
|
|||
|
||||
def get_input(self, pin, port, extras):
|
||||
self._check_feature("single-ended input", pin, extras,
|
||||
valid_xdrs=(1,), valid_extras=None)
|
||||
valid_xdrs=(0,), valid_extras=None)
|
||||
|
||||
m = Module()
|
||||
m.d.comb += pin.i.eq(port)
|
||||
|
|
@ -177,7 +177,7 @@ class Platform(ConstraintManager, metaclass=ABCMeta):
|
|||
|
||||
def get_output(self, pin, port, extras):
|
||||
self._check_feature("single-ended output", pin, extras,
|
||||
valid_xdrs=(1,), valid_extras=None)
|
||||
valid_xdrs=(0,), valid_extras=None)
|
||||
|
||||
m = Module()
|
||||
m.d.comb += port.eq(pin.o)
|
||||
|
|
@ -185,7 +185,7 @@ class Platform(ConstraintManager, metaclass=ABCMeta):
|
|||
|
||||
def get_tristate(self, pin, port, extras):
|
||||
self._check_feature("single-ended tristate", pin, extras,
|
||||
valid_xdrs=(1,), valid_extras=None)
|
||||
valid_xdrs=(0,), valid_extras=None)
|
||||
|
||||
m = Module()
|
||||
m.submodules += Instance("$tribuf",
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class ConstraintManager:
|
|||
if dir is None:
|
||||
dir = subsignal.io[0].dir
|
||||
if xdr is None:
|
||||
xdr = 1
|
||||
xdr = 0
|
||||
if dir not in ("i", "o", "io", "-"):
|
||||
raise TypeError("Direction must be one of \"i\", \"o\", \"io\", or \"-\", "
|
||||
"not {!r}"
|
||||
|
|
@ -93,8 +93,8 @@ class ConstraintManager:
|
|||
"direction can be changed from \"io\" to \"i\", from \"io\""
|
||||
"to \"o\", or from anything to \"-\""
|
||||
.format(subsignal.io[0], subsignal.io[0].dir, dir))
|
||||
if not isinstance(xdr, int) or xdr < 1:
|
||||
raise ValueError("Data rate of {!r} must be a positive integer, not {!r}"
|
||||
if not isinstance(xdr, int) or xdr < 0:
|
||||
raise ValueError("Data rate of {!r} must be a non-negative integer, not {!r}"
|
||||
.format(subsignal.io[0], xdr))
|
||||
return dir, xdr
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue