Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -------------------------------------------------------------------------------------------------- 

2# Copyright (c) Lukas Vik. All rights reserved. 

3# 

4# This file is part of the tsfpga project. 

5# https://tsfpga.com 

6# https://gitlab.com/tsfpga/tsfpga 

7# -------------------------------------------------------------------------------------------------- 

8 

9 

10class Constant: 

11 def __init__(self, name, value, description=None): 

12 """ 

13 Arguments: 

14 name (str): The name of the constant. 

15 length (int): The constant value (signed). 

16 description (str): Textual description for the constant. 

17 """ 

18 self.name = name 

19 self.value = value 

20 self.description = "" if description is None else description 

21 

22 def __repr__(self): 

23 return f"""{self.__class__.__name__}(\ 

24name={self.name},\ 

25value={self.value},\ 

26description={self.description}, 

27)"""