From: Luke Kenneth Casson Leighton Date: Fri, 19 Jun 2020 14:39:04 +0000 (+0100) Subject: add docstring comment for SelectableInt X-Git-Tag: div_pipeline~309 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e43859beeb38a2f7affb639017f431d26d57b0eb;p=soc.git add docstring comment for SelectableInt --- 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