peakrdl-python 3.0.0rc6__tar.gz → 3.0.0rc8__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.
Files changed (192) hide show
  1. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/.github/workflows/action.yaml +37 -0
  2. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/PKG-INFO +2 -2
  3. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/generated_package.rst +8 -0
  4. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/pyproject.toml +1 -1
  5. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/__about__.py +1 -1
  6. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/__peakrdl__.py +4 -2
  7. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/exporter.py +25 -12
  8. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/base_field.py +0 -45
  9. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib_test/__init__.py +2 -2
  10. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/_async_base_test_class.py +61 -0
  11. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/_base_test_class.py +53 -0
  12. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib_test/_common_base_test_class.py +93 -37
  13. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/async_field_test_class.py +615 -0
  14. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/async_mem_test_class.py +316 -0
  15. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/async_reg_test_class.py +331 -0
  16. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/async_test_class.py +34 -0
  17. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/field_test_class.py +615 -0
  18. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/mem_test_class.py +315 -0
  19. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/reg_test_class.py +327 -0
  20. peakrdl_python-3.0.0rc8/src/peakrdl_python/lib_test/test_class.py +33 -0
  21. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/field.py +91 -40
  22. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/register.py +43 -11
  23. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/simulator.py +2 -2
  24. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/systemrdl_node_utility_functions.py +20 -0
  25. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +2 -2
  26. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +1 -1
  27. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_tb.py.jinja +2 -26
  28. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python.egg-info/PKG-INFO +2 -2
  29. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python.egg-info/SOURCES.txt +13 -4
  30. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python.egg-info/requires.txt +1 -1
  31. peakrdl_python-3.0.0rc6/tests/pathological_register_maps/pathalogical_rdl_builder.py → peakrdl_python-3.0.0rc8/tests/pathological_register_maps/pathological_rdl_builder.py +12 -1
  32. peakrdl_python-3.0.0rc8/tests/testcases/overlapping_registers_and_fields.rdl +39 -0
  33. peakrdl_python-3.0.0rc8/tests/unit_tests/test_sim.py +257 -0
  34. peakrdl_python-3.0.0rc6/src/peakrdl_python/lib_test/async_reg_base_test_class.py +0 -1181
  35. peakrdl_python-3.0.0rc6/src/peakrdl_python/lib_test/base_reg_test_class.py +0 -1171
  36. peakrdl_python-3.0.0rc6/tests/testcases/shared_register_issue_202 +0 -24
  37. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/.gitignore +0 -0
  38. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/.readthedocs.yaml +0 -0
  39. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/LICENSE +0 -0
  40. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/MANIFEST.in +0 -0
  41. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/README.md +0 -0
  42. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/api.rst +0 -0
  43. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/api_components.rst +0 -0
  44. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/command_line.rst +0 -0
  45. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/conf.py +0 -0
  46. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/customisation.rst +0 -0
  47. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/design_decisions.rst +0 -0
  48. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/design_tools.rst +0 -0
  49. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/genindex.rst +0 -0
  50. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/index.rst +0 -0
  51. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/installation.rst +0 -0
  52. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/docs/requirements.txt +0 -0
  53. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/array_access/array_access.rdl +0 -0
  54. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/array_access/demo_array_access.py +0 -0
  55. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/enumerated_fields/demo_enumerated_fields.py +0 -0
  56. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/enumerated_fields/enumerated_fields.rdl +0 -0
  57. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/optimised_access/demo_optimised_access.py +0 -0
  58. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/optimised_access/demo_optimised_array_access.py +0 -0
  59. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/optimised_access/optimised_access.rdl +0 -0
  60. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/optimised_access/optimised_array_access.rdl +0 -0
  61. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/overridden_names/demo_over_ridden_names.py +0 -0
  62. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/overridden_names/overridden_names.rdl +0 -0
  63. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
  64. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/simulating_callbacks/flashing_the_LED.py +0 -0
  65. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
  66. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/tranversing_address_map/dumping_register_state_to_json_file.py +0 -0
  67. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/tranversing_address_map/reg_dump.json +0 -0
  68. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/tranversing_address_map/reseting_registers.py +0 -0
  69. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
  70. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/user_defined_properties/demo_user_defined_properties.py +0 -0
  71. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/user_defined_properties/user_defined_properties.rdl +0 -0
  72. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/why_ral/__init__.py +0 -0
  73. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/why_ral/gpio.rdl +0 -0
  74. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/why_ral/with_hal.py +0 -0
  75. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/why_ral/with_ral.py +0 -0
  76. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/example/why_ral/without_ral.py +0 -0
  77. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/generate_and_test.py +0 -0
  78. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/generate_testcases.py +0 -0
  79. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/setup.cfg +0 -0
  80. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/.coveragerc +0 -0
  81. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/__init__.py +0 -0
  82. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/_deploy_package.py +0 -0
  83. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/_node_walkers.py +0 -0
  84. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/class_names.py +0 -0
  85. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/compiler_udp.py +0 -0
  86. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/__init__.py +0 -0
  87. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/async_memory.py +0 -0
  88. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/async_register_and_field.py +0 -0
  89. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/base.py +0 -0
  90. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/base_register.py +0 -0
  91. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/callbacks.py +0 -0
  92. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/field_encoding.py +0 -0
  93. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/memory.py +0 -0
  94. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/py.typed +0 -0
  95. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/register_and_field.py +0 -0
  96. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/sections.py +0 -0
  97. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib/utility_functions.py +0 -0
  98. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/lib_test/utilities.py +0 -0
  99. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/py.typed +0 -0
  100. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/safe_name_utility.py +0 -0
  101. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/__init__.py +0 -0
  102. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/_callbacks.py +0 -0
  103. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/base.py +0 -0
  104. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/dummy_callbacks.py +0 -0
  105. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/memory.py +0 -0
  106. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/sim_lib/py.typed +0 -0
  107. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/systemrdl_node_hashes.py +0 -0
  108. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/__init__.py +0 -0
  109. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap.py.jinja +0 -0
  110. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_field.py.jinja +0 -0
  111. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_memory.py.jinja +0 -0
  112. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_register.py.jinja +0 -0
  113. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_system_rdl_name_mapping.py.jinja +0 -0
  114. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_udp_property.py.jinja +0 -0
  115. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/addrmap_universal_property.py.jinja +0 -0
  116. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/baseclass_simulation_tb.py.jinja +0 -0
  117. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/baseclass_tb.py.jinja +0 -0
  118. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/child_definitions.py.jinja +0 -0
  119. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/example.py.jinja +0 -0
  120. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/field_enums.py.jinja +0 -0
  121. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/header.py.jinja +0 -0
  122. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
  123. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/property_enums.py.jinja +0 -0
  124. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
  125. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/templates/template_ultilities.py.jinja +0 -0
  126. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python/unique_component_iterator.py +0 -0
  127. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
  128. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
  129. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/src/peakrdl_python.egg-info/top_level.txt +0 -0
  130. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates/header.py.jinja +0 -0
  131. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates/header_tb.py.jinja +0 -0
  132. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates_dynamic/header.py.jinja +0 -0
  133. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates_dynamic/header_tb.py.jinja +0 -0
  134. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates_dynamic_toml/header_check.py +0 -0
  135. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates_dynamic_toml/peakrdl.toml +0 -0
  136. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates_toml/header_check.py +0 -0
  137. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/alternative_templates_toml/peakrdl.toml +0 -0
  138. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/pathological_register_maps/templates/pathological_template.rdl.jinja +0 -0
  139. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/RDLFormatCode_example.rdl +0 -0
  140. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/addr_map.rdl +0 -0
  141. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/aliases.rdl +0 -0
  142. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/all_register_access_types.rdl +0 -0
  143. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/basic.rdl +0 -0
  144. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/block_a.xml +0 -0
  145. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/block_b.xml +0 -0
  146. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/deduplicated_field.rdl +0 -0
  147. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/different_array_types.rdl +0 -0
  148. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/enum_example.rdl +0 -0
  149. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/example_issue_106.rdl +0 -0
  150. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/extended_memories.rdl +0 -0
  151. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/extended_sizes_registers_array.rdl +0 -0
  152. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/field_scope.rdl +0 -0
  153. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/field_with_overridden_reset.rdl +0 -0
  154. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/fields_with_HW_write.rdl +0 -0
  155. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/fields_with_reset_values.rdl +0 -0
  156. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/hidden_property.rdl +0 -0
  157. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/large_field_combinations.rdl +0 -0
  158. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/memories.rdl +0 -0
  159. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/memories_with_registers.rdl +0 -0
  160. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/msb0_and_lsb0.rdl +0 -0
  161. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/multi_block.rdl +0 -0
  162. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/multifile.rdl +0 -0
  163. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/name_clash.rdl +0 -0
  164. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/name_desc_all_levels.rdl +0 -0
  165. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/name_desc_option_deduplicate.rdl +0 -0
  166. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/name_desc_stress_test.rdl +0 -0
  167. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/overridden_python_name.rdl +0 -0
  168. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
  169. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/parametrised_top.rdl +0 -0
  170. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/reg_name_stress.rdl +0 -0
  171. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/regfile_and_arrays.rdl +0 -0
  172. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/reserved_elements.rdl +0 -0
  173. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/same_but_different_enum.rdl +0 -0
  174. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
  175. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/simple.rdl +0 -0
  176. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/simple.xml +0 -0
  177. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/simulator_test.rdl +0 -0
  178. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/sizes_registers.rdl +0 -0
  179. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/sizes_registers_array.rdl +0 -0
  180. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/sparse_enum_issue_200.rdl +0 -0
  181. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/user_defined_properties.rdl +0 -0
  182. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
  183. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/__init__.py +0 -0
  184. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/simple_components.py +0 -0
  185. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_array_indexing.py +0 -0
  186. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_building_inner_addrmap.py +0 -0
  187. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_export.py +0 -0
  188. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_field.py +0 -0
  189. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_name_desc_export.py +0 -0
  190. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_optimised_reg_array.py +0 -0
  191. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_reg.py +0 -0
  192. {peakrdl_python-3.0.0rc6 → peakrdl_python-3.0.0rc8}/tests/unit_tests/test_system_rdl_enum.py +0 -0
@@ -425,10 +425,47 @@ jobs:
425
425
  mypy autoformatted_output
426
426
  python -m unittest discover -s autoformatted_output
427
427
 
428
+ pathological:
429
+
430
+ needs:
431
+ - integration_tests
432
+
433
+ runs-on: ubuntu-latest
434
+
435
+ steps:
436
+ - uses: actions/checkout@v4
437
+ - name: Set up Python
438
+ uses: actions/setup-python@v5
439
+ with:
440
+ python-version: "3.13"
441
+
442
+ - name: Install dependencies
443
+ run: |
444
+ python -m pip install --upgrade pip
445
+ python -m pip install .[peakrdl]
446
+ python -m pip install mypy
447
+
448
+ - name: Prepare System RDL
449
+ run: |
450
+ mkdir ./pathological_test
451
+ python -m tests.pathological_register_maps.pathological_rdl_builder ./pathological_test/deep.rdl deep
452
+
453
+ - name: build_package
454
+ run: |
455
+ peakrdl python ./pathological_test/deep.rdl -o ./pathological_test/ --skip_library_copy
456
+
457
+ - name: type check generated code
458
+ run: |
459
+ mypy ./pathological_test/deep/
460
+
461
+ - name: Run unit tests
462
+ run: python -m unittest discover -s ./pathological_test/
463
+
428
464
  #-------------------------------------------------------------------------------
429
465
  build:
430
466
  needs:
431
467
  - autoformating
468
+ - pathological
432
469
 
433
470
  name: Build source distribution
434
471
  runs-on: ubuntu-latest
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peakrdl-python
3
- Version: 3.0.0rc6
3
+ Version: 3.0.0rc8
4
4
  Summary: Generate Python Register Access Layer (RAL) from SystemRDL
5
5
  Author: Keith Brady
6
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
@@ -191,7 +191,7 @@ Classifier: Typing :: Typed
191
191
  Requires-Python: >=3.9.2
192
192
  Description-Content-Type: text/markdown
193
193
  License-File: LICENSE
194
- Requires-Dist: systemrdl-compiler>=1.29.3
194
+ Requires-Dist: systemrdl-compiler>=1.31.0
195
195
  Requires-Dist: jinja2
196
196
  Requires-Dist: typing-extensions; python_version < "3.11"
197
197
  Requires-Dist: more_itertools; python_version < "3.13"
@@ -174,6 +174,10 @@ Legacy Block Callback and Block Access
174
174
  * ``NormalCallbackSetLegacy`` for standard python function callbacks
175
175
  * ``AsyncCallbackSetLegacy`` for async python function callbacks, these are called from the library using ``await``
176
176
 
177
+ .. versionchanged:: 3.0.0
178
+
179
+ The ``legacy_block_access`` will now default to ``False``
180
+
177
181
  Legacy Enumeration Types
178
182
  ------------------------
179
183
 
@@ -187,6 +191,10 @@ Legacy Enumeration Types
187
191
  There was a small risk this may impact some users code, in the case of advanced usage of the
188
192
  enumeration. The old behaviour can be brought back using the ``legacy_enum_type`` build option.
189
193
 
194
+ .. versionchanged:: 3.0.0
195
+
196
+ The ``legacy_enum_type`` will now default to ``False``
197
+
190
198
 
191
199
  Using the Register Access Layer
192
200
  ===============================
@@ -8,7 +8,7 @@ dynamic = ["version"]
8
8
  # Callable is broken in python 3.9.0 and 3.9.1 so these need to be excluded
9
9
  requires-python = ">=3.9.2"
10
10
  dependencies = [
11
- "systemrdl-compiler>=1.29.3", # this is needed to make sure all the latest type checking
11
+ "systemrdl-compiler>=1.31.0", # this is needed for the latest overlappign register features
12
12
  "jinja2",
13
13
  "typing-extensions;python_version<'3.11'",
14
14
  # the batched fucntion was adopted into the standard python library at 3.13
@@ -17,4 +17,4 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
 
18
18
  Variables that describes the peakrdl-python Package
19
19
  """
20
- __version__ = "3.0.0rc6"
20
+ __version__ = "3.0.0rc8"
@@ -80,7 +80,8 @@ class Exporter(ExporterSubcommandPlugin):
80
80
  arg_group.add_argument('--legacy_block_access', action='store_true',
81
81
  dest='legacy_block_access',
82
82
  help='peakrdl python has two methods to hold blocks of data, the '
83
- 'legacy mode based on array.array or the new mode using lists')
83
+ 'legacy mode based on array.array or the new mode using '
84
+ 'lists. This option will be removed in version 4.0')
84
85
  arg_group.add_argument('--show_hidden', action='store_true',
85
86
  dest='show_hidden',
86
87
  help='show addrmap, regfile, memory, register and fields that '
@@ -100,7 +101,8 @@ class Exporter(ExporterSubcommandPlugin):
100
101
  dest='legacy_enum_type',
101
102
  help='peakrdl python has two ways to define field encoding as '
102
103
  'enums new method and an old method based on IntEnum. '
103
- 'Setting this to true will restore the old behaviour')
104
+ 'Setting this to true will restore the old behaviour.'
105
+ ' This option will be removed in version 4.0')
104
106
  arg_group.add_argument('--skip_systemrdl_name_and_desc_properties', action='store_true',
105
107
  dest='skip_systemrdl_name_and_desc_properties',
106
108
  help='peakrdl python includes the system RDL name and desc '
@@ -47,7 +47,7 @@ from .systemrdl_node_utility_functions import get_reg_writable_fields, \
47
47
  get_field_default_value, get_enum_values, get_properties_to_include, \
48
48
  HideNodeCallback, hide_based_on_property, \
49
49
  full_slice_accessor, ShowUDPCallback, \
50
- node_iterator_entry
50
+ node_iterator_entry, simulator_field_definition
51
51
  from .unique_component_iterator import UniqueComponents
52
52
  from .unique_component_iterator import PeakRDLPythonUniqueRegisterComponents
53
53
  from .unique_component_iterator import PeakRDLPythonUniqueMemoryComponents
@@ -676,16 +676,17 @@ class PythonExporter:
676
676
  raise TypeError(f'node should be a register, got {type(node)}')
677
677
  reg_addr = node.absolute_address
678
678
  if reg_addr in reg_dict:
679
+ if not node.has_overlaps:
680
+ raise RuntimeError('A non-overlaping node should not have a duplicate address')
679
681
  existing_entry = reg_dict[reg_addr]
680
- # if the entry is already list simply append to it
681
- if isinstance(existing_entry, list):
682
- existing_entry.append(node)
683
- elif isinstance(existing_entry, RegNode):
684
- reg_dict[reg_addr] = [existing_entry, node]
685
- else:
686
- raise TypeError(f'exiting entry of unexpected type: {type(existing_entry)}')
682
+ if not isinstance(existing_entry, list):
683
+ raise RuntimeError('A overlapping entry should have been made as list')
684
+ existing_entry.append(node)
687
685
  else:
688
- reg_dict[reg_addr] = node
686
+ if node.has_overlaps:
687
+ reg_dict[reg_addr] = [node,]
688
+ else:
689
+ reg_dict[reg_addr] = node
689
690
 
690
691
 
691
692
  context = {
@@ -697,7 +698,8 @@ class PythonExporter:
697
698
  'asyncoutput': asyncoutput,
698
699
  'skip_lib_copy': skip_lib_copy,
699
700
  'legacy_block_access': legacy_block_access,
700
- 'list': list
701
+ 'list': list,
702
+ 'simulator_field_definition': simulator_field_definition,
701
703
  }
702
704
 
703
705
  module_name = top_block.inst_name
@@ -951,12 +953,12 @@ class PythonExporter:
951
953
  skip_test_case_generation: bool = False,
952
954
  delete_existing_package_content: bool = True,
953
955
  skip_library_copy: bool = False,
954
- legacy_block_access: bool = True,
956
+ legacy_block_access: bool = False,
955
957
  show_hidden: bool = False,
956
958
  user_defined_properties_to_include: Optional[list[str]] = None,
957
959
  user_defined_properties_to_include_regex: Optional[str] = None,
958
960
  hidden_inst_name_regex: Optional[str] = None,
959
- legacy_enum_type: bool = True,
961
+ legacy_enum_type: bool = False,
960
962
  skip_systemrdl_name_and_desc_properties: bool = False,
961
963
  skip_systemrdl_name_and_desc_in_docstring: bool = False,
962
964
  register_class_per_generated_file: int =
@@ -1011,6 +1013,7 @@ class PythonExporter:
1011
1013
  legacy_enum_type: version 1.2 introduced a new Enum type that allows system
1012
1014
  rdl ``name`` and ``desc`` properties on field encoding
1013
1015
  to be included. The legacy mode uses python IntEnum.
1016
+ .. version-deprecated:: 3.0
1014
1017
  skip_systemrdl_name_and_desc_properties (bool) : version 1.2 introduced new properties
1015
1018
  that include the systemRDL name and
1016
1019
  desc as properties of the built
@@ -1053,6 +1056,16 @@ class PythonExporter:
1053
1056
  Returns:
1054
1057
  modules that have been exported:
1055
1058
  """
1059
+ if legacy_enum_type:
1060
+ warnings.warn('legacy_enum_type is deprecated and '
1061
+ 'will be removed from a future version please try the new mode',
1062
+ category=DeprecationWarning)
1063
+
1064
+ if legacy_block_access:
1065
+ warnings.warn('legacy_block_access is deprecated and '
1066
+ 'will be removed from a future version please try the new mode',
1067
+ category=DeprecationWarning)
1068
+
1056
1069
 
1057
1070
  # If it is the root node, skip to top addrmap
1058
1071
  if isinstance(node, RootNode):
@@ -385,28 +385,6 @@ class _FieldReadOnlyFramework(Field[FieldType], ABC):
385
385
  """
386
386
  __slots__ : list[str] = []
387
387
 
388
- def decode_read_value(self, value: int) -> FieldType:
389
- """
390
- extracts the field value from a register value, by applying the bit
391
- mask and shift needed
392
-
393
- Args:
394
- value: value to decode, normally read from a register
395
-
396
- Returns:
397
- field value
398
-
399
- Warning:
400
- This method will be removed from a future version, if you have a compelling use
401
- case for it please add a comment to the #184 ticket
402
-
403
- """
404
- # end users should not need access to the `decode_read_value` as the decoding is done
405
- # for them, it felt like an anomaly that this was public, see #184
406
- warnings.warn('decode_read_value will be made private in a future version',
407
- DeprecationWarning, stacklevel=2)
408
- return self._decode_read_value(value=value)
409
-
410
388
  def _decode_read_value(self, value: int) -> FieldType:
411
389
  """
412
390
  extracts the field value from a register value, by applying the bit
@@ -476,29 +454,6 @@ class _FieldWriteOnlyFramework(Field[FieldType], ABC):
476
454
  raise ValueError(f'value to be written to register must be less '
477
455
  f'than or equal to {self.max_value:d}')
478
456
 
479
-
480
- def encode_write_value(self, value: FieldType) -> int:
481
- """
482
- Check that a value is legal for the field and then encode it in preparation to be written
483
- to the register
484
-
485
- Args:
486
- value: field value
487
-
488
- Returns:
489
- value which can be applied to the register to update the field
490
-
491
- Warning:
492
- This method will be removed from a future version, if you have a compelling use
493
- case for it please add a comment to the #184 ticket
494
-
495
- """
496
- # end users should not need access to the `decode_read_value` as the decoding is done
497
- # for them, it felt like an anomaly that this was public, see #184
498
- warnings.warn('encode_write_value will be made private in a future version',
499
- DeprecationWarning, stacklevel=2)
500
- return self._encode_write_value(value=value)
501
-
502
457
  def _encode_write_value(self, value: FieldType) -> int:
503
458
  """
504
459
  Check that a value is legal for the field and then encode it in preparation to be written
@@ -18,8 +18,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
18
18
  This package is intended to distributed as part of automatically generated code by the PeakRDL
19
19
  Python tool. It provides a set of base test classes to reduce the size of the auto generated code
20
20
  """
21
- from .base_reg_test_class import LibTestBase
22
- from .async_reg_base_test_class import AsyncLibTestBase
21
+ from .test_class import LibTestBase
22
+ from .async_test_class import AsyncLibTestBase
23
23
 
24
24
  from .utilities import reverse_bits
25
25
 
@@ -0,0 +1,61 @@
1
+ """
2
+ peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
3
+ Copyright (C) 2021 - 2025
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Lesser General Public License as
7
+ published by the Free Software Foundation, either version 3 of
8
+ the License, or (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+
18
+ This package is intended to distributed as part of automatically generated code by the PeakRDL
19
+ Python tool. It provide the base class for the autogenerated tests
20
+ """
21
+ # this module is very similar to the non-async version, a lot of code has been put into common
22
+ # methods but it did not make sense to do everything as it would destroy readability
23
+ # pylint:disable=duplicate-code
24
+
25
+ import unittest
26
+ from abc import ABC, abstractmethod
27
+
28
+ from ._common_base_test_class import CommonTestBase
29
+
30
+ class AsyncLibTestCommon(unittest.IsolatedAsyncioTestCase, CommonTestBase, ABC):
31
+ """
32
+ Base Test class for the autogenerated register test when in async mode
33
+ """
34
+
35
+ # The following may look odd by a second layer of indirection is required to effectively patch
36
+ # the read and write within tests
37
+
38
+ # pylint:disable=missing-function-docstring
39
+
40
+ async def outer_read_callback(self, addr: int, width: int, accesswidth: int) -> int:
41
+ return await self.read_callback(addr=addr,
42
+ width=width,
43
+ accesswidth=accesswidth)
44
+
45
+ @abstractmethod
46
+ async def read_callback(self, addr: int, width: int, accesswidth: int) -> int:
47
+ ...
48
+
49
+ async def outer_write_callback(self, addr: int,
50
+ width: int, accesswidth: int,
51
+ data: int) -> None:
52
+ return await self.write_callback(addr=addr,
53
+ width=width,
54
+ accesswidth=accesswidth,
55
+ data=data)
56
+
57
+ @abstractmethod
58
+ async def write_callback(self, addr: int, width: int, accesswidth: int, data: int) -> None:
59
+ ...
60
+
61
+ # pylint:enable=missing-function-docstring
@@ -0,0 +1,53 @@
1
+ """
2
+ peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
3
+ Copyright (C) 2021 - 2025
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Lesser General Public License as
7
+ published by the Free Software Foundation, either version 3 of
8
+ the License, or (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+
21
+ This package is intended to distributed as part of automatically generated code by the PeakRDL
22
+ Python tool. It provide the base class for the autogenerated tests
23
+ """
24
+ from abc import ABC, abstractmethod
25
+
26
+ from ._common_base_test_class import CommonTestBase
27
+
28
+
29
+ class LibTestCommon(CommonTestBase, ABC):
30
+ """
31
+ Base Test class for the autogenerated register test when in non-async mode
32
+ """
33
+
34
+ # The following may look odd by a second layer of indirection is required to effectively patch
35
+ # the read and write within tests
36
+
37
+ # pylint:disable=missing-function-docstring
38
+
39
+ def outer_read_callback(self, addr: int, width: int, accesswidth: int) -> int:
40
+ return self.read_callback(addr=addr, width=width, accesswidth=accesswidth)
41
+
42
+ @abstractmethod
43
+ def read_callback(self, addr: int, width: int, accesswidth: int) -> int:
44
+ ...
45
+
46
+ def outer_write_callback(self, addr: int, width: int, accesswidth: int, data: int) -> None:
47
+ return self.write_callback(addr=addr, width=width, accesswidth=accesswidth, data=data)
48
+
49
+ @abstractmethod
50
+ def write_callback(self, addr: int, width: int, accesswidth: int, data: int) -> None:
51
+ ...
52
+
53
+ # pylint:enable=missing-function-docstring
@@ -41,20 +41,23 @@ from ..lib import MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy
41
41
  from ..lib.base_register import BaseReg
42
42
  from ..lib import Node
43
43
  from ..lib import Base
44
+ from ..lib import SystemRDLEnum
44
45
  from .utilities import get_field_bitmask_int, get_field_inv_bitmask
45
46
  from ..sim_lib.simulator import BaseSimulator
46
47
 
48
+
47
49
  class NodeIterators:
48
50
  """
49
51
  The Node Iterator class is intended to an efficient way to define the iterators of particular
50
52
  type that are present on a node
51
53
  """
52
54
  __slots__ = ['__node_descriptions']
53
- def __init__(self, *args:Union[str, tuple[str, list[int]]]):
55
+
56
+ def __init__(self, *args: Union[str, tuple[str, list[int]]]):
54
57
  self.__node_descriptions = args
55
58
 
56
59
  @staticmethod
57
- def __rolled_item(item:Union[str, tuple[str, list[int]]]) -> str:
60
+ def __rolled_item(item: Union[str, tuple[str, list[int]]]) -> str:
58
61
  if isinstance(item, tuple):
59
62
  return item[0]
60
63
  return item
@@ -64,7 +67,7 @@ class NodeIterators:
64
67
  """
65
68
  name of all the rolled nodes in a set
66
69
  """
67
- return { self.__rolled_item(item) for item in self.__node_descriptions }
70
+ return {self.__rolled_item(item) for item in self.__node_descriptions}
68
71
 
69
72
  @property
70
73
  def unrolled(self) -> set[str]:
@@ -74,7 +77,7 @@ class NodeIterators:
74
77
  return_list = []
75
78
  for item in self.__node_descriptions:
76
79
  if isinstance(item, tuple):
77
- dim_set = list(product(*[range(dim) for dim in item[1]]))
80
+ dim_set = list(product(*[range(dim) for dim in item[1]]))
78
81
  for dim in dim_set:
79
82
  # to match the systemrdl compiler dimension put into the inst name of
80
83
  # the array, the name must be item[x][y]
@@ -84,6 +87,7 @@ class NodeIterators:
84
87
  return_list.append(item)
85
88
  return set(return_list)
86
89
 
90
+
87
91
  class CommonTestBase(unittest.TestCase, ABC):
88
92
  """
89
93
  Base Test class for the autogenerated register test to be used for the async and
@@ -107,17 +111,17 @@ class CommonTestBase(unittest.TestCase, ABC):
107
111
  # pylint:disable-next=too-many-arguments
108
112
  def _single_field_property_test(self, *,
109
113
  fut: Union[FieldReadWrite,
110
- FieldReadOnly,
111
- FieldWriteOnly,
112
- FieldEnumReadWrite,
113
- FieldEnumReadOnly,
114
- FieldEnumWriteOnly,
115
- FieldAsyncReadOnly,
116
- FieldAsyncWriteOnly,
117
- FieldAsyncReadWrite,
118
- FieldEnumAsyncReadOnly,
119
- FieldEnumAsyncWriteOnly,
120
- FieldEnumAsyncReadWrite],
114
+ FieldReadOnly,
115
+ FieldWriteOnly,
116
+ FieldEnumReadWrite,
117
+ FieldEnumReadOnly,
118
+ FieldEnumWriteOnly,
119
+ FieldAsyncReadOnly,
120
+ FieldAsyncWriteOnly,
121
+ FieldAsyncReadWrite,
122
+ FieldEnumAsyncReadOnly,
123
+ FieldEnumAsyncWriteOnly,
124
+ FieldEnumAsyncReadWrite],
121
125
  lsb: int,
122
126
  msb: int,
123
127
  low: int,
@@ -137,7 +141,7 @@ class CommonTestBase(unittest.TestCase, ABC):
137
141
  self.assertEqual(fut.inverse_bitmask, get_field_inv_bitmask(fut))
138
142
  width = (fut.high - fut.low) + 1
139
143
  self.assertEqual(fut.width, width)
140
- self.assertEqual(fut.max_value, (2**width) - 1)
144
+ self.assertEqual(fut.max_value, (2 ** width) - 1)
141
145
  self.assertEqual(fut.is_volatile, is_volatile)
142
146
 
143
147
  if default is None:
@@ -284,9 +288,9 @@ class CommonTestBase(unittest.TestCase, ABC):
284
288
  self.__bad_attribute_test(dut=dut)
285
289
 
286
290
  def __single_node_rdl_name_and_desc_test(self,
287
- dut: Base,
288
- rdl_name: Optional[str],
289
- rdl_desc: Optional[str]) -> None:
291
+ dut: Base,
292
+ rdl_name: Optional[str],
293
+ rdl_desc: Optional[str]) -> None:
290
294
  """
291
295
  Check the SystemRDL Name and Desc properties for a node
292
296
  """
@@ -302,8 +306,8 @@ class CommonTestBase(unittest.TestCase, ABC):
302
306
 
303
307
  def __test_node_inst_name(self,
304
308
  dut: Base,
305
- parent_full_inst_name:Optional[str],
306
- inst_name:str) -> None:
309
+ parent_full_inst_name: Optional[str],
310
+ inst_name: str) -> None:
307
311
  """
308
312
  Test the `inst_name` and `full_inst_name` attributes of a node
309
313
  """
@@ -337,11 +341,11 @@ class CommonTestBase(unittest.TestCase, ABC):
337
341
 
338
342
  def _test_field_iterators(self, *,
339
343
  rut: Union[RegReadOnly,
340
- RegReadWrite,
341
- RegWriteOnly,
342
- RegAsyncReadOnly,
343
- RegAsyncReadWrite,
344
- RegAsyncWriteOnly],
344
+ RegReadWrite,
345
+ RegWriteOnly,
346
+ RegAsyncReadOnly,
347
+ RegAsyncReadWrite,
348
+ RegAsyncWriteOnly],
345
349
  has_sw_readable: bool,
346
350
  has_sw_writable: bool,
347
351
  readable_fields: set[str],
@@ -354,7 +358,7 @@ class CommonTestBase(unittest.TestCase, ABC):
354
358
  )):
355
359
  raise TypeError(f'Register was expected to readable, got {type(rut)}')
356
360
 
357
- child_readable_field_names = { field.inst_name for field in rut.readable_fields}
361
+ child_readable_field_names = {field.inst_name for field in rut.readable_fields}
358
362
 
359
363
  self.assertEqual(readable_fields, child_readable_field_names)
360
364
  else:
@@ -382,16 +386,16 @@ class CommonTestBase(unittest.TestCase, ABC):
382
386
  self.assertEqual(readable_fields | writeable_fields, child_field_names)
383
387
 
384
388
  # Check the child name map
385
- self.__test_name_map(dut=rut, child_names= readable_fields | writeable_fields)
389
+ self.__test_name_map(dut=rut, child_names=readable_fields | writeable_fields)
386
390
 
387
391
  def _test_register_iterators(self,
388
392
  dut: Union[AddressMap, AsyncAddressMap, RegFile, AsyncRegFile,
389
- MemoryReadOnly, MemoryReadOnlyLegacy,
390
- MemoryWriteOnly, MemoryWriteOnlyLegacy,
391
- MemoryReadWrite, MemoryReadWriteLegacy,
392
- MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy,
393
- MemoryAsyncWriteOnly, MemoryAsyncWriteOnlyLegacy,
394
- MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy],
393
+ MemoryReadOnly, MemoryReadOnlyLegacy,
394
+ MemoryWriteOnly, MemoryWriteOnlyLegacy,
395
+ MemoryReadWrite, MemoryReadWriteLegacy,
396
+ MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy,
397
+ MemoryAsyncWriteOnly, MemoryAsyncWriteOnlyLegacy,
398
+ MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy],
395
399
  readable_registers: NodeIterators,
396
400
  writeable_registers: NodeIterators) -> None:
397
401
 
@@ -400,8 +404,8 @@ class CommonTestBase(unittest.TestCase, ABC):
400
404
  MemoryReadWrite, MemoryReadWriteLegacy,
401
405
  MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy,
402
406
  MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy)):
403
- child_readable_reg_names = { reg.inst_name for reg in
404
- dut.get_readable_registers(unroll=True)}
407
+ child_readable_reg_names = {reg.inst_name for reg in
408
+ dut.get_readable_registers(unroll=True)}
405
409
  self.assertEqual(readable_registers.unrolled, child_readable_reg_names)
406
410
  child_readable_reg_names = {reg.inst_name for reg in
407
411
  dut.get_readable_registers(unroll=False)}
@@ -443,7 +447,6 @@ class CommonTestBase(unittest.TestCase, ABC):
443
447
  child_names=readable_registers.rolled |
444
448
  writeable_registers.rolled)
445
449
 
446
-
447
450
  def _test_memory_iterators(self,
448
451
  dut: Union[AddressMap, AsyncAddressMap],
449
452
  memories: NodeIterators) -> None:
@@ -494,3 +497,56 @@ class CommonTestBase(unittest.TestCase, ABC):
494
497
  self.__test_name_map(dut=dut, child_names=readable_registers.rolled |
495
498
  writeable_registers.rolled |
496
499
  sections.rolled)
500
+
501
+ def _full_to_reduced_enum_conversion(
502
+ self,
503
+ full_enum_def: dict[str, tuple[int, Optional[str], Optional[str]]]) -> dict[str, int]:
504
+ return {key:value[0] for key,value in full_enum_def.items() }
505
+
506
+ def _test_enum_def_rdl_name_desc_(
507
+ self,
508
+ fut: Union[FieldEnumReadOnly, FieldEnumReadOnly, FieldEnumWriteOnly,
509
+ FieldEnumAsyncReadOnly, FieldEnumAsyncReadOnly, FieldEnumAsyncWriteOnly],
510
+ full_enum_def: dict[str, tuple[int, Optional[str], Optional[str]]]) -> None:
511
+ """
512
+ Check that the enumeration in the field matches the enumeration specifed in the
513
+ systemRDL
514
+
515
+ Args:
516
+ fut: field node
517
+ full_enum_def: definition of the enumeration a dictionary, with the of the
518
+ entry as a key and the value a tuple that has:
519
+ 1. int value encoding the enumeration
520
+ 2. system RDL name (or None)
521
+ 3. system RDL name (or None)
522
+
523
+ Returns: None
524
+
525
+ """
526
+
527
+ # pylint does not realise this is a class being returned rather than an object, so
528
+ # is unhappy with the name
529
+ # pylint:disable-next=invalid-name
530
+ EnumCls = fut.enum_cls
531
+ for name, value in full_enum_def.items():
532
+ enum_inst = EnumCls[name]
533
+ self.assertEqual(enum_inst.value, value[0])
534
+
535
+ if issubclass(EnumCls, SystemRDLEnum):
536
+ if value[1] is None:
537
+ self.assertIsNone(enum_inst.rdl_name)
538
+ else:
539
+ self.assertEqual(enum_inst.rdl_name, value[1])
540
+
541
+ if value[2] is None:
542
+ self.assertIsNone(enum_inst.rdl_desc)
543
+ else:
544
+ self.assertEqual(enum_inst.rdl_desc, value[2])
545
+
546
+ else:
547
+ # if using a legacy enumeration, then the systemRDL name and desc must be None
548
+ # as the legacy enum did not support these
549
+ self.assertIsNone(value[1])
550
+ self.assertIsNone(value[2])
551
+ self.assertFalse(hasattr(enum_inst, 'rdl_name'))
552
+ self.assertFalse(hasattr(enum_inst, 'rdl_desc'))