lib.io: allow Pin(xdr=0), representing a combinatorial I/O buffer.
This commit is contained in:
parent
3327deae92
commit
c30617fc05
2 changed files with 49 additions and 9 deletions
|
|
@ -4,7 +4,7 @@ from ..hdl.rec import *
|
|||
from ..lib.io import *
|
||||
|
||||
|
||||
class PinLayoutSDRTestCase(FHDLTestCase):
|
||||
class PinLayoutCombTestCase(FHDLTestCase):
|
||||
def test_pin_layout_i(self):
|
||||
layout_1 = pin_layout(1, dir="i")
|
||||
self.assertEqual(layout_1.fields, {
|
||||
|
|
@ -43,6 +43,45 @@ class PinLayoutSDRTestCase(FHDLTestCase):
|
|||
})
|
||||
|
||||
|
||||
class PinLayoutSDRTestCase(FHDLTestCase):
|
||||
def test_pin_layout_i(self):
|
||||
layout_1 = pin_layout(1, dir="i", xdr=1)
|
||||
self.assertEqual(layout_1.fields, {
|
||||
"i": ((1, False), DIR_NONE),
|
||||
})
|
||||
|
||||
layout_2 = pin_layout(2, dir="i", xdr=1)
|
||||
self.assertEqual(layout_2.fields, {
|
||||
"i": ((2, False), DIR_NONE),
|
||||
})
|
||||
|
||||
def test_pin_layout_o(self):
|
||||
layout_1 = pin_layout(1, dir="o", xdr=1)
|
||||
self.assertEqual(layout_1.fields, {
|
||||
"o": ((1, False), DIR_NONE),
|
||||
})
|
||||
|
||||
layout_2 = pin_layout(2, dir="o", xdr=1)
|
||||
self.assertEqual(layout_2.fields, {
|
||||
"o": ((2, False), DIR_NONE),
|
||||
})
|
||||
|
||||
def test_pin_layout_io(self):
|
||||
layout_1 = pin_layout(1, dir="io", xdr=1)
|
||||
self.assertEqual(layout_1.fields, {
|
||||
"i": ((1, False), DIR_NONE),
|
||||
"o": ((1, False), DIR_NONE),
|
||||
"oe": ((1, False), DIR_NONE),
|
||||
})
|
||||
|
||||
layout_2 = pin_layout(2, dir="io", xdr=1)
|
||||
self.assertEqual(layout_2.fields, {
|
||||
"i": ((2, False), DIR_NONE),
|
||||
"o": ((2, False), DIR_NONE),
|
||||
"oe": ((1, False), DIR_NONE),
|
||||
})
|
||||
|
||||
|
||||
class PinLayoutDDRTestCase(FHDLTestCase):
|
||||
def test_pin_layout_i(self):
|
||||
layout_1 = pin_layout(1, dir="i", xdr=2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue