Coverage for hdl_registers/register_modes.py: 100%
2 statements
« prev ^ index » next coverage.py v7.6.8, created at 2024-12-01 20:50 +0000
« prev ^ index » next coverage.py v7.6.8, created at 2024-12-01 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# --------------------------------------------------------------------------------------------------
10# Local folder libraries
11from .register_mode import RegisterMode
13# The official register modes in hdl-registers.
14# This dictionary maps the official shorthand name of the mode to the object that describes
15# the mode.
16REGISTER_MODES = dict(
17 r=RegisterMode(
18 shorthand="r",
19 name="Read",
20 description="Software can read a value that hardware provides.",
21 software_can_read=True,
22 software_can_write=False,
23 hardware_has_up=True,
24 ),
25 w=RegisterMode(
26 shorthand="w",
27 name="Write",
28 description="Software can write a value that is available for hardware usage.",
29 software_can_read=False,
30 software_can_write=True,
31 hardware_has_up=False,
32 ),
33 r_w=RegisterMode(
34 shorthand="r_w",
35 name="Read, Write",
36 description=(
37 "Software can write a value and read it back. "
38 "The written value is available for hardware usage."
39 ),
40 software_can_read=True,
41 software_can_write=True,
42 hardware_has_up=False,
43 ),
44 wpulse=RegisterMode(
45 shorthand="wpulse",
46 name="Write-pulse",
47 description="Software can write a value that is asserted for one clock cycle in hardware.",
48 software_can_read=False,
49 software_can_write=True,
50 hardware_has_up=False,
51 ),
52 r_wpulse=RegisterMode(
53 shorthand="r_wpulse",
54 name="Read, Write-pulse",
55 description=(
56 "Software can read a value that hardware provides. "
57 "Software can write a value that is asserted for one clock cycle in hardware."
58 ),
59 software_can_read=True,
60 software_can_write=True,
61 hardware_has_up=True,
62 ),
63)