@@ -82,9 +82,9 @@ def test_data_width_wrong(self):
8282 Interface (addr_width = 16 , data_width = - 1 )
8383
8484
85- class DecoderTestCase (unittest .TestCase ):
85+ class MultiplexerTestCase (unittest .TestCase ):
8686 def setUp (self ):
87- self .dut = Decoder (addr_width = 16 , data_width = 8 )
87+ self .dut = Multiplexer (addr_width = 16 , data_width = 8 )
8888 Fragment .get (self .dut , platform = None ) # silence UnusedElaboratable
8989
9090 def test_add_4b (self ):
@@ -195,9 +195,9 @@ def sim_test():
195195 sim .run ()
196196
197197
198- class DecoderAlignedTestCase (unittest .TestCase ):
198+ class MultiplexerAlignedTestCase (unittest .TestCase ):
199199 def setUp (self ):
200- self .dut = Decoder (addr_width = 16 , data_width = 8 , alignment = 2 )
200+ self .dut = Multiplexer (addr_width = 16 , data_width = 8 , alignment = 2 )
201201 Fragment .get (self .dut , platform = None ) # silence UnusedElaboratable
202202
203203 def test_add_two (self ):
@@ -255,9 +255,9 @@ def sim_test():
255255 sim .run ()
256256
257257
258- class MultiplexerTestCase (unittest .TestCase ):
258+ class DecoderTestCase (unittest .TestCase ):
259259 def setUp (self ):
260- self .dut = Multiplexer (addr_width = 16 , data_width = 8 )
260+ self .dut = Decoder (addr_width = 16 , data_width = 8 )
261261 Fragment .get (self .dut , platform = None ) # silence UnusedElaboratable
262262
263263 def test_add_wrong_sub_bus (self ):
@@ -266,24 +266,24 @@ def test_add_wrong_sub_bus(self):
266266 self .dut .add (1 )
267267
268268 def test_add_wrong_data_width (self ):
269- decoder = Decoder (addr_width = 10 , data_width = 16 )
270- Fragment .get (decoder , platform = None ) # silence UnusedElaboratable
269+ mux = Multiplexer (addr_width = 10 , data_width = 16 )
270+ Fragment .get (mux , platform = None ) # silence UnusedElaboratable
271271
272272 with self .assertRaisesRegex (ValueError ,
273273 r"Subordinate bus has data width 16, which is not the same as "
274274 r"multiplexer data width 8" ):
275- self .dut .add (decoder .bus )
275+ self .dut .add (mux .bus )
276276
277277 def test_sim (self ):
278- dec_1 = Decoder (addr_width = 10 , data_width = 8 )
279- self .dut .add (dec_1 .bus )
278+ mux_1 = Multiplexer (addr_width = 10 , data_width = 8 )
279+ self .dut .add (mux_1 .bus )
280280 elem_1 = Element (8 , "rw" )
281- dec_1 .add (elem_1 )
281+ mux_1 .add (elem_1 )
282282
283- dec_2 = Decoder (addr_width = 10 , data_width = 8 )
284- self .dut .add (dec_2 .bus )
283+ mux_2 = Multiplexer (addr_width = 10 , data_width = 8 )
284+ self .dut .add (mux_2 .bus )
285285 elem_2 = Element (8 , "rw" )
286- dec_2 .add (elem_2 , addr = 2 )
286+ mux_2 .add (elem_2 , addr = 2 )
287287
288288 elem_1_addr , _ , _ = self .dut .bus .memory_map .find_resource (elem_1 )
289289 elem_2_addr , _ , _ = self .dut .bus .memory_map .find_resource (elem_2 )
@@ -322,7 +322,7 @@ def sim_test():
322322 self .assertEqual ((yield bus .r_data ), 0xaa )
323323
324324 m = Module ()
325- m .submodules += self .dut , dec_1 , dec_2
325+ m .submodules += self .dut , mux_1 , mux_2
326326 with Simulator (m , vcd_file = open ("test.vcd" , "w" )) as sim :
327327 sim .add_clock (1e-6 )
328328 sim .add_sync_process (sim_test ())
0 commit comments