From: Luke Kenneth Casson Leighton Date: Sun, 5 Apr 2020 11:46:24 +0000 (+0100) Subject: add selectconcat test X-Git-Tag: div_pipeline~1497 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c458d1e7d55868334305a57dbd44bd0382de63f2;hp=6f3a9e20445cb9e78f59d3f0943f152b9981562a;p=soc.git add selectconcat test --- diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 130b2978..fb064fcb 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -264,5 +264,16 @@ class SelectableIntTestCase(unittest.TestCase): a[0:4] = a[4:8] self.assertEqual(a, 0x199) + def test_concat(self): + a = SelectableInt(0x1, 1) + c = selectconcat(a, repeat=8) + self.assertEqual(c, 0xff) + self.assertEqual(c.bits, 8) + a = SelectableInt(0x0, 1) + c = selectconcat(a, repeat=8) + self.assertEqual(c, 0x00) + self.assertEqual(c.bits, 8) + + if __name__ == "__main__": unittest.main()