@@ -11,6 +11,8 @@ class RTestCase(unittest.TestCase):
1111 def test_simple (self ):
1212 f = action .R (unsigned (4 ))
1313 self .assertEqual (f .r_data .shape (), unsigned (4 ))
14+ self .assertTrue (f .port .access .readable ())
15+ self .assertFalse (f .port .access .writable ())
1416
1517 def test_sim (self ):
1618 dut = action .R (unsigned (4 ))
@@ -30,6 +32,8 @@ class WTestCase(unittest.TestCase):
3032 def test_simple (self ):
3133 f = action .W (unsigned (4 ))
3234 self .assertEqual (f .w_data .shape (), unsigned (4 ))
35+ self .assertFalse (f .port .access .readable ())
36+ self .assertTrue (f .port .access .writable ())
3337
3438 def test_sim (self ):
3539 dut = action .W (unsigned (4 ))
@@ -48,11 +52,16 @@ def process():
4852class RWTestCase (unittest .TestCase ):
4953 def test_simple (self ):
5054 f4 = action .RW (unsigned (4 ), reset = 0x5 )
51- f8 = action .RW (signed (8 ))
5255 self .assertEqual (f4 .data .shape (), unsigned (4 ))
5356 self .assertEqual (f4 .reset , 0x5 )
57+ self .assertTrue (f4 .port .access .readable ())
58+ self .assertTrue (f4 .port .access .writable ())
59+
60+ f8 = action .RW (signed (8 ))
5461 self .assertEqual (f8 .data .shape (), signed (8 ))
5562 self .assertEqual (f8 .reset , 0 )
63+ self .assertTrue (f8 .port .access .readable ())
64+ self .assertTrue (f8 .port .access .writable ())
5665
5766 def test_sim (self ):
5867 dut = action .RW (unsigned (4 ), reset = 0x5 )
@@ -77,13 +86,18 @@ def process():
7786class RW1CTestCase (unittest .TestCase ):
7887 def test_simple (self ):
7988 f4 = action .RW1C (unsigned (4 ), reset = 0x5 )
80- f8 = action .RW1C (signed (8 ))
8189 self .assertEqual (f4 .data .shape (), unsigned (4 ))
8290 self .assertEqual (f4 .set .shape (), unsigned (4 ))
8391 self .assertEqual (f4 .reset , 0x5 )
92+ self .assertTrue (f4 .port .access .readable ())
93+ self .assertTrue (f4 .port .access .writable ())
94+
95+ f8 = action .RW1C (signed (8 ))
8496 self .assertEqual (f8 .data .shape (), signed (8 ))
8597 self .assertEqual (f8 .set .shape (), signed (8 ))
8698 self .assertEqual (f8 .reset , 0 )
99+ self .assertTrue (f8 .port .access .readable ())
100+ self .assertTrue (f8 .port .access .writable ())
87101
88102 def test_sim (self ):
89103 dut = action .RW1C (unsigned (4 ), reset = 0xf )
@@ -115,13 +129,18 @@ def process():
115129class RW1STestCase (unittest .TestCase ):
116130 def test_simple (self ):
117131 f4 = action .RW1S (unsigned (4 ), reset = 0x5 )
118- f8 = action .RW1S (signed (8 ))
119132 self .assertEqual (f4 .data .shape (), unsigned (4 ))
120133 self .assertEqual (f4 .clear .shape (), unsigned (4 ))
121134 self .assertEqual (f4 .reset , 0x5 )
135+ self .assertTrue (f4 .port .access .readable ())
136+ self .assertTrue (f4 .port .access .writable ())
137+
138+ f8 = action .RW1S (signed (8 ))
122139 self .assertEqual (f8 .data .shape (), signed (8 ))
123140 self .assertEqual (f8 .clear .shape (), signed (8 ))
124141 self .assertEqual (f8 .reset , 0 )
142+ self .assertTrue (f8 .port .access .readable ())
143+ self .assertTrue (f8 .port .access .writable ())
125144
126145 def test_sim (self ):
127146 dut = action .RW1S (unsigned (4 ), reset = 0x5 )
@@ -148,3 +167,36 @@ def process():
148167 sim .add_sync_process (process )
149168 with sim .write_vcd (vcd_file = open ("test.vcd" , "w" )):
150169 sim .run ()
170+
171+
172+ class ResRAW0TestCase (unittest .TestCase ):
173+ def test_simple (self ):
174+ f = action .ResRAW0 (unsigned (4 ))
175+ self .assertEqual (f .port .shape , unsigned (4 ))
176+ self .assertFalse (f .port .access .readable ())
177+ self .assertFalse (f .port .access .writable ())
178+ self .assertIsInstance (f .elaborate (platform = None ), Module )
179+
180+ class ResRAWLTestCase (unittest .TestCase ):
181+ def test_simple (self ):
182+ f = action .ResRAWL (unsigned (4 ))
183+ self .assertEqual (f .port .shape , unsigned (4 ))
184+ self .assertFalse (f .port .access .readable ())
185+ self .assertFalse (f .port .access .writable ())
186+ self .assertIsInstance (f .elaborate (platform = None ), Module )
187+
188+ class ResR0WATestCase (unittest .TestCase ):
189+ def test_simple (self ):
190+ f = action .ResR0WA (unsigned (4 ))
191+ self .assertEqual (f .port .shape , unsigned (4 ))
192+ self .assertFalse (f .port .access .readable ())
193+ self .assertFalse (f .port .access .writable ())
194+ self .assertIsInstance (f .elaborate (platform = None ), Module )
195+
196+ class ResR0W0TestCase (unittest .TestCase ):
197+ def test_simple (self ):
198+ f = action .ResR0W0 (unsigned (4 ))
199+ self .assertEqual (f .port .shape , unsigned (4 ))
200+ self .assertFalse (f .port .access .readable ())
201+ self .assertFalse (f .port .access .writable ())
202+ self .assertIsInstance (f .elaborate (platform = None ), Module )
0 commit comments