From e43859beeb38a2f7affb639017f431d26d57b0eb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 19 Jun 2020 15:39:04 +0100 Subject: [PATCH] add docstring comment for SelectableInt --- src/soc/decoder/selectable_int.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 8e0564f6..0c5e560c 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -145,6 +145,16 @@ class FieldSelectableIntTestCase(unittest.TestCase): class SelectableInt: + """SelectableInt - a class that behaves exactly like python int + + this class is designed to mirror precisely the behaviour of python int. + the only difference is that it must contain the context of the bitwidth + (number of bits) associated with that integer. + + FieldSelectableInt can then operate on partial bits, and because there + is a bit width associated with SelectableInt, slices operate correctly + including negative start/end points. + """ def __init__(self, value, bits): if isinstance(value, SelectableInt): value = value.value -- 2.30.2