Coverage for hdl_registers/register_modes.py: 100%

2 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-02-15 20:50 +0000

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

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

3# 

4# This file is part of the hdl-registers project, an HDL register generator fast enough to run 

5# in real time. 

6# https://hdl-registers.com 

7# https://github.com/hdl-registers/hdl-registers 

8# -------------------------------------------------------------------------------------------------- 

9 

10from .register_mode import RegisterMode 

11 

12# The official register modes in hdl-registers. 

13# This dictionary maps the official shorthand name of the mode to the object that describes 

14# the mode. 

15REGISTER_MODES = { 

16 "r": RegisterMode( 

17 shorthand="r", 

18 name="Read", 

19 description="Software can read a value that hardware provides.", 

20 software_can_read=True, 

21 software_can_write=False, 

22 hardware_has_up=True, 

23 ), 

24 "w": RegisterMode( 

25 shorthand="w", 

26 name="Write", 

27 description="Software can write a value that is available for hardware usage.", 

28 software_can_read=False, 

29 software_can_write=True, 

30 hardware_has_up=False, 

31 ), 

32 "r_w": RegisterMode( 

33 shorthand="r_w", 

34 name="Read, Write", 

35 description=( 

36 "Software can write a value and read it back. " 

37 "The written value is available for hardware usage." 

38 ), 

39 software_can_read=True, 

40 software_can_write=True, 

41 hardware_has_up=False, 

42 ), 

43 "wpulse": RegisterMode( 

44 shorthand="wpulse", 

45 name="Write-pulse", 

46 description="Software can write a value that is asserted for one clock cycle in hardware.", 

47 software_can_read=False, 

48 software_can_write=True, 

49 hardware_has_up=False, 

50 ), 

51 "r_wpulse": RegisterMode( 

52 shorthand="r_wpulse", 

53 name="Read, Write-pulse", 

54 description=( 

55 "Software can read a value that hardware provides. " 

56 "Software can write a value that is asserted for one clock cycle in hardware." 

57 ), 

58 software_can_read=True, 

59 software_can_write=True, 

60 hardware_has_up=True, 

61 ), 

62}