peakrdl-python 0.9.2__tar.gz → 0.9.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/PKG-INFO +1 -1
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/__about__.py +1 -1
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/lib/__init__.py +41 -41
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/lib/async_memory.py +3 -4
- peakrdl_python-0.9.2/src/peakrdl_python/lib/async_register.py → peakrdl_python-0.9.3/src/peakrdl_python/lib/async_register_and_field.py +237 -11
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/lib/base.py +6 -6
- peakrdl_python-0.9.3/src/peakrdl_python/lib/base_field.py +473 -0
- peakrdl_python-0.9.3/src/peakrdl_python/lib/base_register.py +229 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/lib/memory.py +3 -3
- peakrdl_python-0.9.2/src/peakrdl_python/lib/register.py → peakrdl_python-0.9.3/src/peakrdl_python/lib/register_and_field.py +232 -216
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_register.py.jinja +1 -26
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python.egg-info/PKG-INFO +1 -1
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python.egg-info/SOURCES.txt +4 -3
- peakrdl_python-0.9.2/src/peakrdl_python/lib/fields.py +0 -892
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/.github/workflows/action.yaml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/.gitignore +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/.readthedocs.yaml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/LICENSE +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/MANIFEST.in +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/README.md +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/api.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/api_components.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/command_line.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/conf.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/customisation.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/design_decisions.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/design_tools.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/generated_package.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/genindex.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/index.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/installation.rst +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/docs/requirements.txt +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/array_access/array_access.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/array_access/demo_array_access.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/enumerated_fields/demo_enumerated_fields.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/enumerated_fields/enumerated_fields.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/optimised_access/demo_optimised_access.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/optimised_access/demo_optimised_array_access.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/optimised_access/optimised_access.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/optimised_access/optimised_array_access.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/overridden_names/demo_over_ridden_names.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/overridden_names/overridden_names.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/simulating_callbacks/flashing_the_LED.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/tranversing_address_map/dumping_register_state_to_json_file.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/tranversing_address_map/reg_dump.json +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/tranversing_address_map/reseting_registers.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/user_defined_properties/demo_user_defined_properties.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/user_defined_properties/user_defined_properties.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/why_ral/__init__.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/why_ral/gpio.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/why_ral/with_hal.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/why_ral/with_ral.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/example/why_ral/without_ral.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/generate_and_test.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/generate_testcases.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/pyproject.toml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/setup.cfg +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/.coveragerc +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/__init__.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/__peakrdl__.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/_node_walkers.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/compiler_udp.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/exporter.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/lib/callbacks.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/lib/utility_functions.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/safe_name_utility.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/__init__.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/_callbacks.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/base.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/dummy_callbacks.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/field.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/memory.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/register.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/sim_lib/simulator.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/systemrdl_node_utility_functions.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/__init__.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_field.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_memory.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/addrmap_udp_property.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/baseclass_simulation_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/baseclass_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/example.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/header.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python/templates/sim_addrmap.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python.egg-info/requires.txt +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/src/peakrdl_python.egg-info/top_level.txt +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/.mypy.ini +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates/header.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates/header_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates_dynamic/header.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates_dynamic/header_tb.py.jinja +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates_dynamic_toml/header_check.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates_dynamic_toml/peakrdl.toml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates_toml/header_check.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/alternative_templates_toml/peakrdl.toml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/pylint.rc +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/RDLFormatCode_example.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/addr_map.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/all_register_access_types.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/basic.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/block_a.xml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/block_b.xml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/different_array_types.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/enum_example.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/example_issue_106.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/extended_memories.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/extended_sizes_registers_array.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/field_scope.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/field_with_overridden_reset.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/fields_with_HW_write.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/fields_with_reset_values.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/hidden_property.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/memories.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/memories_with_registers.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/msb0_and_lsb0.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/multi_block.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/multifile.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/name_clash.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/overridden_python_name.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/regfile_and_arrays.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/reserved_elements.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/same_but_different_enum.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/simple.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/simple.xml +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/simulator_test.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/sizes_registers.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/sizes_registers_array.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/user_defined_properties.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/unit_tests/__init__.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/unit_tests/simple_components.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/unit_tests/test_array_indexing.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/unit_tests/test_export.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/unit_tests/test_optimised_reg_array.py +0 -0
- {peakrdl_python-0.9.2 → peakrdl_python-0.9.3}/tests/unit_tests/test_reg.py +0 -0
|
@@ -37,52 +37,52 @@ from .base import AsyncRegFile
|
|
|
37
37
|
from .base import AsyncAddressMapArray
|
|
38
38
|
from .base import AsyncRegFileArray
|
|
39
39
|
|
|
40
|
-
from .
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
40
|
+
from .register_and_field import Reg
|
|
41
|
+
from .register_and_field import RegArray
|
|
42
|
+
from .register_and_field import RegisterWriteVerifyError
|
|
43
43
|
|
|
44
|
-
from .
|
|
45
|
-
from .
|
|
46
|
-
from .
|
|
47
|
-
from .
|
|
48
|
-
from .
|
|
44
|
+
from .register_and_field import RegReadOnly
|
|
45
|
+
from .register_and_field import RegWriteOnly
|
|
46
|
+
from .register_and_field import RegReadWrite
|
|
47
|
+
from .register_and_field import WritableRegister
|
|
48
|
+
from .register_and_field import ReadableRegister
|
|
49
49
|
|
|
50
|
-
from .
|
|
51
|
-
from .
|
|
52
|
-
from .
|
|
53
|
-
from .
|
|
54
|
-
from .
|
|
50
|
+
from .register_and_field import RegReadOnlyArray
|
|
51
|
+
from .register_and_field import RegWriteOnlyArray
|
|
52
|
+
from .register_and_field import RegReadWriteArray
|
|
53
|
+
from .register_and_field import ReadableRegisterArray
|
|
54
|
+
from .register_and_field import WriteableRegisterArray
|
|
55
55
|
|
|
56
|
-
from .
|
|
57
|
-
from .
|
|
58
|
-
from .
|
|
59
|
-
from .
|
|
60
|
-
from .
|
|
61
|
-
from .
|
|
62
|
-
from .
|
|
63
|
-
from .
|
|
64
|
-
from .
|
|
65
|
-
from .
|
|
66
|
-
from .
|
|
67
|
-
from .
|
|
56
|
+
from .async_register_and_field import AsyncReg
|
|
57
|
+
from .async_register_and_field import AsyncRegArray
|
|
58
|
+
from .async_register_and_field import RegAsyncReadOnly
|
|
59
|
+
from .async_register_and_field import RegAsyncWriteOnly
|
|
60
|
+
from .async_register_and_field import RegAsyncReadWrite
|
|
61
|
+
from .async_register_and_field import ReadableAsyncRegister
|
|
62
|
+
from .async_register_and_field import WritableAsyncRegister
|
|
63
|
+
from .async_register_and_field import RegAsyncReadOnlyArray
|
|
64
|
+
from .async_register_and_field import RegAsyncWriteOnlyArray
|
|
65
|
+
from .async_register_and_field import RegAsyncReadWriteArray
|
|
66
|
+
from .async_register_and_field import ReadableAsyncRegisterArray
|
|
67
|
+
from .async_register_and_field import WriteableAsyncRegisterArray
|
|
68
68
|
|
|
69
|
-
from .
|
|
70
|
-
from .
|
|
71
|
-
from .
|
|
72
|
-
from .
|
|
73
|
-
from .
|
|
74
|
-
from .
|
|
75
|
-
from .
|
|
76
|
-
from .
|
|
77
|
-
from .
|
|
78
|
-
from .
|
|
69
|
+
from .base_field import FieldSizeProps
|
|
70
|
+
from .base_field import FieldMiscProps
|
|
71
|
+
from .register_and_field import FieldReadOnly
|
|
72
|
+
from .register_and_field import FieldWriteOnly
|
|
73
|
+
from .register_and_field import FieldReadWrite
|
|
74
|
+
from .base_field import Field
|
|
75
|
+
from .register_and_field import FieldEnumReadOnly
|
|
76
|
+
from .register_and_field import FieldEnumWriteOnly
|
|
77
|
+
from .register_and_field import FieldEnumReadWrite
|
|
78
|
+
from .base_field import FieldEnum
|
|
79
79
|
|
|
80
|
-
from .
|
|
81
|
-
from .
|
|
82
|
-
from .
|
|
83
|
-
from .
|
|
84
|
-
from .
|
|
85
|
-
from .
|
|
80
|
+
from .async_register_and_field import FieldAsyncReadOnly
|
|
81
|
+
from .async_register_and_field import FieldAsyncWriteOnly
|
|
82
|
+
from .async_register_and_field import FieldAsyncReadWrite
|
|
83
|
+
from .async_register_and_field import FieldEnumAsyncReadOnly
|
|
84
|
+
from .async_register_and_field import FieldEnumAsyncWriteOnly
|
|
85
|
+
from .async_register_and_field import FieldEnumAsyncReadWrite
|
|
86
86
|
|
|
87
87
|
from .memory import MemoryReadOnly, MemoryReadOnlyLegacy
|
|
88
88
|
from .memory import MemoryWriteOnly, MemoryWriteOnlyLegacy
|
|
@@ -40,10 +40,9 @@ else:
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
if TYPE_CHECKING:
|
|
43
|
-
from .
|
|
44
|
-
from .
|
|
45
|
-
from .
|
|
46
|
-
|
|
43
|
+
from .async_register_and_field import AsyncReg, AsyncRegArray
|
|
44
|
+
from .async_register_and_field import ReadableAsyncRegister, WritableAsyncRegister
|
|
45
|
+
from .async_register_and_field import ReadableAsyncRegisterArray, WriteableAsyncRegisterArray
|
|
47
46
|
# pylint: disable=duplicate-code
|
|
48
47
|
|
|
49
48
|
|
|
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
This module is intended to distributed as part of automatically generated code by the
|
|
19
19
|
peakrdl-python tool. It provides a set of classes used by the autogenerated code to represent
|
|
20
|
-
registers
|
|
20
|
+
asynchronous registers and fields
|
|
21
21
|
"""
|
|
22
22
|
from enum import Enum
|
|
23
|
-
from typing import List, Union, Iterator,
|
|
23
|
+
from typing import List, Union, Iterator, Tuple, Optional, Dict, TypeVar, cast
|
|
24
24
|
from typing import AsyncGenerator
|
|
25
25
|
from abc import ABC, abstractmethod
|
|
26
26
|
from contextlib import asynccontextmanager
|
|
@@ -28,15 +28,17 @@ from array import array as Array
|
|
|
28
28
|
import sys
|
|
29
29
|
from warnings import warn
|
|
30
30
|
|
|
31
|
-
from .utility_functions import get_array_typecode
|
|
31
|
+
from .utility_functions import get_array_typecode, swap_msb_lsb_ordering
|
|
32
32
|
from .base import AsyncAddressMap, AsyncRegFile
|
|
33
|
-
from .register import BaseReg, BaseRegArray, RegisterWriteVerifyError
|
|
34
33
|
from .async_memory import MemoryAsyncReadOnly, MemoryAsyncWriteOnly, MemoryAsyncReadWrite, \
|
|
35
34
|
AsyncMemory, ReadableAsyncMemory, WritableAsyncMemory
|
|
36
35
|
from .async_memory import MemoryAsyncReadOnlyLegacy, MemoryAsyncWriteOnlyLegacy, \
|
|
37
36
|
MemoryAsyncReadWriteLegacy
|
|
38
37
|
from .async_memory import ReadableAsyncMemoryLegacy, WritableAsyncMemoryLegacy
|
|
39
38
|
from .callbacks import AsyncCallbackSet, AsyncCallbackSetLegacy
|
|
39
|
+
from .base_register import BaseReg, BaseRegArray, RegisterWriteVerifyError
|
|
40
|
+
from .base_field import FieldEnum, FieldSizeProps, FieldMiscProps, \
|
|
41
|
+
_FieldReadOnlyFramework, _FieldWriteOnlyFramework
|
|
40
42
|
|
|
41
43
|
# pylint: disable=duplicate-code
|
|
42
44
|
if sys.version_info >= (3, 11):
|
|
@@ -45,9 +47,13 @@ else:
|
|
|
45
47
|
from typing_extensions import Self
|
|
46
48
|
# pylint: enable=duplicate-code
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
# pylint: disable=duplicate-code
|
|
51
|
+
if sys.version_info >= (3, 10):
|
|
52
|
+
# type guarding was introduced in python 3.10
|
|
53
|
+
from typing import TypeGuard
|
|
54
|
+
else:
|
|
55
|
+
from typing_extensions import TypeGuard
|
|
56
|
+
# pylint: enable=duplicate-code
|
|
51
57
|
|
|
52
58
|
# pylint: disable=redefined-slots-in-subclass,too-many-lines
|
|
53
59
|
|
|
@@ -99,7 +105,7 @@ class AsyncReg(BaseReg, ABC):
|
|
|
99
105
|
@property
|
|
100
106
|
@abstractmethod
|
|
101
107
|
def fields(self) -> \
|
|
102
|
-
Iterator[Union['FieldAsyncReadOnly','FieldAsyncWriteOnly', 'FieldAsyncReadWrite']]:
|
|
108
|
+
Iterator[Union['FieldAsyncReadOnly', 'FieldAsyncWriteOnly', 'FieldAsyncReadWrite']]:
|
|
103
109
|
"""
|
|
104
110
|
generator that produces has all the fields within the register
|
|
105
111
|
"""
|
|
@@ -191,11 +197,17 @@ class RegAsyncReadOnly(AsyncReg, ABC):
|
|
|
191
197
|
raise RuntimeError('This function does not have a useable callback')
|
|
192
198
|
|
|
193
199
|
@property
|
|
194
|
-
@abstractmethod
|
|
195
200
|
def readable_fields(self) -> Iterator[Union['FieldAsyncReadOnly', 'FieldAsyncReadWrite']]:
|
|
196
201
|
"""
|
|
197
202
|
generator that produces has all the readable fields within the register
|
|
198
203
|
"""
|
|
204
|
+
def is_readable(field: Union['FieldAsyncReadOnly',
|
|
205
|
+
'FieldAsyncWriteOnly',
|
|
206
|
+
'FieldAsyncReadWrite']) -> \
|
|
207
|
+
TypeGuard[Union['FieldAsyncReadOnly', 'FieldAsyncReadWrite']]:
|
|
208
|
+
return isinstance(field, (FieldAsyncReadOnly, FieldAsyncReadWrite))
|
|
209
|
+
|
|
210
|
+
return filter(is_readable, self.fields)
|
|
199
211
|
|
|
200
212
|
async def read_fields(self) -> Dict['str', Union[bool, Enum, int]]:
|
|
201
213
|
"""
|
|
@@ -295,11 +307,17 @@ class RegAsyncWriteOnly(AsyncReg, ABC):
|
|
|
295
307
|
raise RuntimeError('This function does not have a useable callback')
|
|
296
308
|
|
|
297
309
|
@property
|
|
298
|
-
@abstractmethod
|
|
299
310
|
def writable_fields(self) -> Iterator[Union['FieldAsyncWriteOnly', 'FieldAsyncReadWrite']]:
|
|
300
311
|
"""
|
|
301
312
|
generator that produces has all the writable fields within the register
|
|
302
313
|
"""
|
|
314
|
+
def is_writable(field: Union['FieldAsyncReadOnly',
|
|
315
|
+
'FieldAsyncWriteOnly',
|
|
316
|
+
'FieldAsyncReadWrite']) -> \
|
|
317
|
+
TypeGuard[Union['FieldAsyncWriteOnly', 'FieldAsyncReadWrite']]:
|
|
318
|
+
return isinstance(field, (FieldAsyncWriteOnly, FieldAsyncReadWrite))
|
|
319
|
+
|
|
320
|
+
return filter(is_writable, self.fields)
|
|
303
321
|
|
|
304
322
|
@abstractmethod
|
|
305
323
|
async def write_fields(self, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
@@ -348,7 +366,7 @@ class RegAsyncReadWrite(RegAsyncReadOnly, RegAsyncWriteOnly, ABC):
|
|
|
348
366
|
|
|
349
367
|
@asynccontextmanager
|
|
350
368
|
async def single_read_modify_write(self, verify: bool = False, skip_write: bool = False) -> \
|
|
351
|
-
|
|
369
|
+
AsyncGenerator[Self, None]:
|
|
352
370
|
"""
|
|
353
371
|
Context manager to allow multiple field reads/write to be done with a single set of
|
|
354
372
|
field operations
|
|
@@ -1035,3 +1053,211 @@ class RegAsyncReadWriteArray(AsyncRegArray, ABC):
|
|
|
1035
1053
|
|
|
1036
1054
|
ReadableAsyncRegisterArray = Union[RegAsyncReadOnlyArray, RegAsyncReadWriteArray]
|
|
1037
1055
|
WriteableAsyncRegisterArray = Union[RegAsyncWriteOnlyArray, RegAsyncReadWriteArray]
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
class FieldAsyncReadOnly(_FieldReadOnlyFramework, ABC):
|
|
1059
|
+
"""
|
|
1060
|
+
class for an asynchronous read only register field
|
|
1061
|
+
|
|
1062
|
+
Args:
|
|
1063
|
+
parent_register: register within which the field resides
|
|
1064
|
+
size_props: object defining the msb, lsb, high bit, low bit and width
|
|
1065
|
+
logger_handle: name to be used logging messages associate with this
|
|
1066
|
+
object
|
|
1067
|
+
|
|
1068
|
+
"""
|
|
1069
|
+
__slots__: List[str] = []
|
|
1070
|
+
|
|
1071
|
+
def __init__(self, *,
|
|
1072
|
+
parent_register: ReadableAsyncRegister,
|
|
1073
|
+
size_props: FieldSizeProps,
|
|
1074
|
+
misc_props: FieldMiscProps,
|
|
1075
|
+
logger_handle: str,
|
|
1076
|
+
inst_name: str):
|
|
1077
|
+
|
|
1078
|
+
if not isinstance(parent_register, (RegAsyncReadWrite, RegAsyncReadOnly)):
|
|
1079
|
+
raise TypeError(f'size_props must be of {type(RegAsyncReadWrite)} or '
|
|
1080
|
+
f'{type(RegAsyncReadOnly)} but got {type(parent_register)}')
|
|
1081
|
+
|
|
1082
|
+
# pylint: disable=duplicate-code
|
|
1083
|
+
super().__init__(logger_handle=logger_handle,
|
|
1084
|
+
size_props=size_props,
|
|
1085
|
+
misc_props=misc_props,
|
|
1086
|
+
parent_register=parent_register,
|
|
1087
|
+
inst_name=inst_name)
|
|
1088
|
+
# pylint: enable=duplicate-code
|
|
1089
|
+
|
|
1090
|
+
async def read(self) -> int: # pylint: disable=invalid-overridden-method
|
|
1091
|
+
"""
|
|
1092
|
+
Asynchronously reads the register that this field is located in and retries the field
|
|
1093
|
+
value applying the required masking and shifting
|
|
1094
|
+
|
|
1095
|
+
Returns:
|
|
1096
|
+
field value
|
|
1097
|
+
|
|
1098
|
+
"""
|
|
1099
|
+
return self.decode_read_value(await self.parent_register.read())
|
|
1100
|
+
|
|
1101
|
+
@property
|
|
1102
|
+
def parent_register(self) -> ReadableAsyncRegister:
|
|
1103
|
+
"""
|
|
1104
|
+
parent register the field is placed in
|
|
1105
|
+
"""
|
|
1106
|
+
|
|
1107
|
+
# this cast is OK because an explict typing check was done in the __init__
|
|
1108
|
+
return cast(ReadableAsyncRegister, self.parent)
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
class FieldAsyncWriteOnly(_FieldWriteOnlyFramework, ABC):
|
|
1112
|
+
"""
|
|
1113
|
+
class for an asynchronous write only register field
|
|
1114
|
+
|
|
1115
|
+
Args:
|
|
1116
|
+
parent_register: register within which the field resides
|
|
1117
|
+
size_props: object defining the msb, lsb, high bit, low bit and width
|
|
1118
|
+
logger_handle: name to be used logging messages associate with this
|
|
1119
|
+
object
|
|
1120
|
+
|
|
1121
|
+
"""
|
|
1122
|
+
__slots__: List[str] = []
|
|
1123
|
+
|
|
1124
|
+
def __init__(self, *,
|
|
1125
|
+
parent_register: WritableAsyncRegister,
|
|
1126
|
+
size_props: FieldSizeProps,
|
|
1127
|
+
misc_props: FieldMiscProps,
|
|
1128
|
+
logger_handle: str,
|
|
1129
|
+
inst_name: str):
|
|
1130
|
+
|
|
1131
|
+
if not isinstance(parent_register, (RegAsyncReadWrite, RegAsyncWriteOnly)):
|
|
1132
|
+
raise TypeError(f'size_props must be of {type(RegAsyncReadWrite)} or '
|
|
1133
|
+
f'{type(RegAsyncWriteOnly)} but got {type(parent_register)}')
|
|
1134
|
+
|
|
1135
|
+
# pylint: disable=duplicate-code
|
|
1136
|
+
super().__init__(logger_handle=logger_handle,
|
|
1137
|
+
size_props=size_props,
|
|
1138
|
+
misc_props=misc_props,
|
|
1139
|
+
parent_register=parent_register,
|
|
1140
|
+
inst_name=inst_name)
|
|
1141
|
+
# pylint: enable=duplicate-code
|
|
1142
|
+
|
|
1143
|
+
async def write(self, value: int) -> None: # pylint: disable=invalid-overridden-method
|
|
1144
|
+
"""
|
|
1145
|
+
The behaviour of this method depends on whether the field is located in
|
|
1146
|
+
a readable register or not:
|
|
1147
|
+
|
|
1148
|
+
If the register is readable, the method will perform an async read-modify-write
|
|
1149
|
+
on the register updating the field with the value provided
|
|
1150
|
+
|
|
1151
|
+
If the register is not writable all other field values will be asynchronously written
|
|
1152
|
+
with zero.
|
|
1153
|
+
|
|
1154
|
+
Args:
|
|
1155
|
+
value: field value to update to
|
|
1156
|
+
|
|
1157
|
+
"""
|
|
1158
|
+
|
|
1159
|
+
# This code closely resembles the non-async version but is duplicated for clarity
|
|
1160
|
+
# pylint: disable=duplicate-code
|
|
1161
|
+
self._write_value_checks(value=value)
|
|
1162
|
+
|
|
1163
|
+
if self.msb0:
|
|
1164
|
+
value = swap_msb_lsb_ordering(value=value, width=self.width)
|
|
1165
|
+
# pylint: enable=duplicate-code
|
|
1166
|
+
|
|
1167
|
+
if (self.high == (self.register_data_width - 1)) and (self.low == 0):
|
|
1168
|
+
# special case where the field occupies the whole register,
|
|
1169
|
+
# there a straight write can be performed
|
|
1170
|
+
new_reg_value = value
|
|
1171
|
+
else:
|
|
1172
|
+
# do a read, modify write
|
|
1173
|
+
if isinstance(self.parent_register, RegAsyncReadWrite):
|
|
1174
|
+
reg_value = await self.parent_register.read()
|
|
1175
|
+
masked_reg_value = reg_value & self.inverse_bitmask
|
|
1176
|
+
new_reg_value = masked_reg_value | (value << self.low)
|
|
1177
|
+
elif isinstance(self.parent_register, RegAsyncWriteOnly):
|
|
1178
|
+
new_reg_value = value << self.low
|
|
1179
|
+
else:
|
|
1180
|
+
raise TypeError('Unhandled parent type')
|
|
1181
|
+
|
|
1182
|
+
await self.parent_register.write(new_reg_value)
|
|
1183
|
+
|
|
1184
|
+
@property
|
|
1185
|
+
def parent_register(self) -> WritableAsyncRegister:
|
|
1186
|
+
"""
|
|
1187
|
+
parent register the field is placed in
|
|
1188
|
+
"""
|
|
1189
|
+
|
|
1190
|
+
# this cast is OK because an explict typing check was done in the __init__
|
|
1191
|
+
return cast(WritableAsyncRegister, self.parent)
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
class FieldAsyncReadWrite(FieldAsyncReadOnly, FieldAsyncWriteOnly, ABC):
|
|
1195
|
+
"""
|
|
1196
|
+
class for an asyncronous read/write register field
|
|
1197
|
+
|
|
1198
|
+
Args:
|
|
1199
|
+
parent_register: register within which the field resides
|
|
1200
|
+
size_props: object defining the msb, lsb, high bit, low bit and width
|
|
1201
|
+
logger_handle: name to be used logging messages associate with this
|
|
1202
|
+
object
|
|
1203
|
+
|
|
1204
|
+
"""
|
|
1205
|
+
__slots__: List[str] = []
|
|
1206
|
+
|
|
1207
|
+
def __init__(self, *,
|
|
1208
|
+
parent_register: RegAsyncReadWrite,
|
|
1209
|
+
size_props: FieldSizeProps,
|
|
1210
|
+
misc_props: FieldMiscProps,
|
|
1211
|
+
logger_handle: str,
|
|
1212
|
+
inst_name: str):
|
|
1213
|
+
|
|
1214
|
+
if not isinstance(parent_register, RegAsyncReadWrite):
|
|
1215
|
+
raise TypeError(f'size_props must be of {type(RegAsyncReadWrite)} '
|
|
1216
|
+
f'but got {type(parent_register)}')
|
|
1217
|
+
|
|
1218
|
+
# pylint: disable=duplicate-code
|
|
1219
|
+
super().__init__(logger_handle=logger_handle,
|
|
1220
|
+
size_props=size_props,
|
|
1221
|
+
misc_props=misc_props,
|
|
1222
|
+
parent_register=parent_register,
|
|
1223
|
+
inst_name=inst_name)
|
|
1224
|
+
# pylint: enable=duplicate-code
|
|
1225
|
+
|
|
1226
|
+
@property
|
|
1227
|
+
def parent_register(self) -> RegAsyncReadWrite:
|
|
1228
|
+
"""
|
|
1229
|
+
parent register the field is placed in
|
|
1230
|
+
"""
|
|
1231
|
+
|
|
1232
|
+
# this cast is OK because an explict typing check was done in the __init__
|
|
1233
|
+
return cast(RegAsyncReadWrite, self.parent)
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
class FieldEnumAsyncReadWrite(FieldAsyncReadWrite, FieldEnum, ABC):
|
|
1237
|
+
"""
|
|
1238
|
+
class for an async read/write register field with an enumerated value
|
|
1239
|
+
"""
|
|
1240
|
+
__slots__: List[str] = []
|
|
1241
|
+
|
|
1242
|
+
@property
|
|
1243
|
+
def parent_register(self) -> RegAsyncReadWrite:
|
|
1244
|
+
"""
|
|
1245
|
+
parent register the field is placed in
|
|
1246
|
+
"""
|
|
1247
|
+
|
|
1248
|
+
# this cast is OK because an explict typing check was done in the __init__
|
|
1249
|
+
return cast(RegAsyncReadWrite, self.parent)
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
class FieldEnumAsyncReadOnly(FieldAsyncReadOnly, FieldEnum, ABC):
|
|
1253
|
+
"""
|
|
1254
|
+
class for an async read only register field with an enumerated value
|
|
1255
|
+
"""
|
|
1256
|
+
__slots__: List[str] = []
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
class FieldEnumAsyncWriteOnly(FieldAsyncWriteOnly, FieldEnum, ABC):
|
|
1260
|
+
"""
|
|
1261
|
+
class for an async write only register field with an enumerated value
|
|
1262
|
+
"""
|
|
1263
|
+
__slots__: List[str] = []
|
|
@@ -43,12 +43,12 @@ else:
|
|
|
43
43
|
if TYPE_CHECKING:
|
|
44
44
|
from .memory import Memory, MemoryArray
|
|
45
45
|
from .async_memory import AsyncMemory, AsyncMemoryArray
|
|
46
|
-
from .
|
|
47
|
-
from .
|
|
48
|
-
from .
|
|
49
|
-
from .
|
|
50
|
-
from .
|
|
51
|
-
from .
|
|
46
|
+
from .register_and_field import Reg, RegArray
|
|
47
|
+
from .register_and_field import WritableRegister, ReadableRegister
|
|
48
|
+
from .async_register_and_field import AsyncReg, AsyncRegArray
|
|
49
|
+
from .async_register_and_field import ReadableAsyncRegister, WritableAsyncRegister
|
|
50
|
+
from .register_and_field import ReadableRegisterArray, WriteableRegisterArray
|
|
51
|
+
from .async_register_and_field import ReadableAsyncRegisterArray, WriteableAsyncRegisterArray
|
|
52
52
|
|
|
53
53
|
UDPStruct = Dict[str, 'UDPType']
|
|
54
54
|
UDPType = Union[str, int, bool, IntEnum, UDPStruct]
|