|
12 | 12 |
|
13 | 13 | class _MockRegister(wiring.Component):
|
14 | 14 | def __init__(self, width, access):
|
15 |
| - super().__init__({"element": Out(csr.Element.Signature(width, access))}) |
| 15 | + super().__init__({"element": In(csr.Element.Signature(width, access))}) |
16 | 16 |
|
17 | 17 |
|
18 | 18 | class ElementSignatureTestCase(unittest.TestCase):
|
@@ -204,32 +204,32 @@ class _Reg(wiring.Component):
|
204 | 204 | pass
|
205 | 205 | # wrong name
|
206 | 206 | map_0 = MemoryMap(addr_width=1, data_width=8)
|
207 |
| - map_0.add_resource(_Reg({"foo": Out(csr.Element.Signature(8, "rw"))}), name=("a",), size=1) |
| 207 | + map_0.add_resource(_Reg({"foo": In(csr.Element.Signature(8, "rw"))}), name=("a",), size=1) |
208 | 208 | with self.assertRaisesRegex(AttributeError,
|
209 | 209 | r"Signature of CSR register \('a',\) must have a csr\.Element\.Signature member "
|
210 |
| - r"named 'element' and oriented as wiring\.Out"): |
| 210 | + r"named 'element' and oriented as wiring\.In"): |
211 | 211 | csr.Multiplexer(map_0)
|
212 | 212 | # wrong direction
|
213 | 213 | map_1 = MemoryMap(addr_width=1, data_width=8)
|
214 |
| - map_1.add_resource(_Reg({"element": In(csr.Element.Signature(8, "rw"))}), name=("a",), |
| 214 | + map_1.add_resource(_Reg({"element": Out(csr.Element.Signature(8, "rw"))}), name=("a",), |
215 | 215 | size=1)
|
216 | 216 | with self.assertRaisesRegex(AttributeError,
|
217 | 217 | r"Signature of CSR register \('a',\) must have a csr\.Element\.Signature member "
|
218 |
| - r"named 'element' and oriented as wiring\.Out"): |
| 218 | + r"named 'element' and oriented as wiring\.In"): |
219 | 219 | csr.Multiplexer(map_1)
|
220 | 220 | # wrong member type
|
221 | 221 | map_2 = MemoryMap(addr_width=1, data_width=8)
|
222 |
| - map_2.add_resource(_Reg({"element": Out(unsigned(8))}), name=("a",), size=1) |
| 222 | + map_2.add_resource(_Reg({"element": In(unsigned(8))}), name=("a",), size=1) |
223 | 223 | with self.assertRaisesRegex(AttributeError,
|
224 | 224 | r"Signature of CSR register \('a',\) must have a csr\.Element\.Signature member "
|
225 |
| - r"named 'element' and oriented as wiring\.Out"): |
| 225 | + r"named 'element' and oriented as wiring\.In"): |
226 | 226 | csr.Multiplexer(map_2)
|
227 | 227 | # wrong member signature
|
228 | 228 | map_3 = MemoryMap(addr_width=1, data_width=8)
|
229 |
| - map_3.add_resource(_Reg({"element": Out(wiring.Signature({}))}), name=("a",), size=1) |
| 229 | + map_3.add_resource(_Reg({"element": In(wiring.Signature({}))}), name=("a",), size=1) |
230 | 230 | with self.assertRaisesRegex(AttributeError,
|
231 | 231 | r"Signature of CSR register \('a',\) must have a csr\.Element\.Signature member "
|
232 |
| - r"named 'element' and oriented as wiring\.Out"): |
| 232 | + r"named 'element' and oriented as wiring\.In"): |
233 | 233 | csr.Multiplexer(map_3)
|
234 | 234 |
|
235 | 235 | def test_wrong_memory_map_windows(self):
|
|
0 commit comments