build.{dsl,plat,res}: allow dir="oe".
Although a dir="oe" pin is generally equivalent to dir="io" pin with the i* signal(s) disconnected, they are not equivalent, because some pins may not be able to support input buffers at all, either because there are no input buffers, or because the input buffers are consumed by some other resource. E.g. this can happen on iCE40 when the input buffer is consumed by a PLL.
This commit is contained in:
parent
1eee7cd76f
commit
6fae06aea9
6 changed files with 45 additions and 12 deletions
13
nmigen/vendor/fpga/lattice_ice40.py
vendored
13
nmigen/vendor/fpga/lattice_ice40.py
vendored
|
|
@ -9,7 +9,8 @@ from ...hdl.ir import *
|
|||
from ...build import *
|
||||
|
||||
|
||||
__all__ = ["LatticeICE40Platform", "IceStormProgrammerMixin", "IceBurnProgrammerMixin", "TinyProgrammerMixin"]
|
||||
__all__ = ["LatticeICE40Platform",
|
||||
"IceStormProgrammerMixin", "IceBurnProgrammerMixin", "TinyProgrammerMixin"]
|
||||
|
||||
|
||||
class LatticeICE40Platform(TemplatedPlatform):
|
||||
|
|
@ -140,6 +141,16 @@ class LatticeICE40Platform(TemplatedPlatform):
|
|||
return self._get_io_buffer(port, extras, lambda bit: [
|
||||
# PIN_OUTPUT_TRISTATE|PIN_INPUT_REGISTERED
|
||||
("p", "PIN_TYPE", 0b1010_00),
|
||||
("i", "D_OUT_0", pin.o[bit]),
|
||||
("i", "OUTPUT_ENABLE", pin.oe),
|
||||
])
|
||||
|
||||
def get_input_output(self, pin, port, extras):
|
||||
self._check_feature("single-ended input/output", pin, extras,
|
||||
valid_xdrs=(0,), valid_extras=True)
|
||||
return self._get_io_buffer(port, extras, lambda bit: [
|
||||
# PIN_OUTPUT_TRISTATE|PIN_INPUT
|
||||
("p", "PIN_TYPE", 0b1010_01),
|
||||
("o", "D_IN_0", pin.i[bit]),
|
||||
("i", "D_OUT_0", pin.o[bit]),
|
||||
("i", "OUTPUT_ENABLE", pin.oe),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue