peakrdl-python 3.0.0rc5__tar.gz → 3.0.0rc6__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 (181) hide show
  1. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/PKG-INFO +1 -1
  2. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/__about__.py +1 -1
  3. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/exporter.py +4 -2
  4. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/async_memory.py +4 -0
  5. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/memory.py +18 -0
  6. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/utility_functions.py +1 -1
  7. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib_test/__init__.py +2 -0
  8. peakrdl_python-3.0.0rc6/src/peakrdl_python/lib_test/_common_base_test_class.py +496 -0
  9. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib_test/async_reg_base_test_class.py +284 -2
  10. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib_test/base_reg_test_class.py +284 -2
  11. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib_test/utilities.py +13 -0
  12. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/simulator.py +16 -0
  13. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/systemrdl_node_utility_functions.py +15 -0
  14. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +3 -73
  15. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_tb.py.jinja +78 -237
  16. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/baseclass_simulation_tb.py.jinja +0 -7
  17. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/baseclass_tb.py.jinja +4 -0
  18. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python.egg-info/PKG-INFO +1 -1
  19. peakrdl_python-3.0.0rc5/src/peakrdl_python/lib_test/_common_base_test_class.py +0 -269
  20. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/.github/workflows/action.yaml +0 -0
  21. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/.gitignore +0 -0
  22. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/.readthedocs.yaml +0 -0
  23. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/LICENSE +0 -0
  24. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/MANIFEST.in +0 -0
  25. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/README.md +0 -0
  26. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/api.rst +0 -0
  27. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/api_components.rst +0 -0
  28. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/command_line.rst +0 -0
  29. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/conf.py +0 -0
  30. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/customisation.rst +0 -0
  31. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/design_decisions.rst +0 -0
  32. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/design_tools.rst +0 -0
  33. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/generated_package.rst +0 -0
  34. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/genindex.rst +0 -0
  35. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/index.rst +0 -0
  36. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/installation.rst +0 -0
  37. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/docs/requirements.txt +0 -0
  38. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/array_access/array_access.rdl +0 -0
  39. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/array_access/demo_array_access.py +0 -0
  40. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/enumerated_fields/demo_enumerated_fields.py +0 -0
  41. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/enumerated_fields/enumerated_fields.rdl +0 -0
  42. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/optimised_access/demo_optimised_access.py +0 -0
  43. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/optimised_access/demo_optimised_array_access.py +0 -0
  44. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/optimised_access/optimised_access.rdl +0 -0
  45. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/optimised_access/optimised_array_access.rdl +0 -0
  46. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/overridden_names/demo_over_ridden_names.py +0 -0
  47. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/overridden_names/overridden_names.rdl +0 -0
  48. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
  49. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/simulating_callbacks/flashing_the_LED.py +0 -0
  50. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
  51. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/tranversing_address_map/dumping_register_state_to_json_file.py +0 -0
  52. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/tranversing_address_map/reg_dump.json +0 -0
  53. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/tranversing_address_map/reseting_registers.py +0 -0
  54. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
  55. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/user_defined_properties/demo_user_defined_properties.py +0 -0
  56. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/user_defined_properties/user_defined_properties.rdl +0 -0
  57. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/why_ral/__init__.py +0 -0
  58. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/why_ral/gpio.rdl +0 -0
  59. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/why_ral/with_hal.py +0 -0
  60. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/why_ral/with_ral.py +0 -0
  61. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/example/why_ral/without_ral.py +0 -0
  62. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/generate_and_test.py +0 -0
  63. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/generate_testcases.py +0 -0
  64. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/pyproject.toml +0 -0
  65. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/setup.cfg +0 -0
  66. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/.coveragerc +0 -0
  67. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/__init__.py +0 -0
  68. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/__peakrdl__.py +0 -0
  69. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/_deploy_package.py +0 -0
  70. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/_node_walkers.py +0 -0
  71. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/class_names.py +0 -0
  72. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/compiler_udp.py +0 -0
  73. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/__init__.py +0 -0
  74. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/async_register_and_field.py +0 -0
  75. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/base.py +0 -0
  76. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/base_field.py +0 -0
  77. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/base_register.py +0 -0
  78. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/callbacks.py +0 -0
  79. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/field_encoding.py +0 -0
  80. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/py.typed +0 -0
  81. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/register_and_field.py +0 -0
  82. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/lib/sections.py +0 -0
  83. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/py.typed +0 -0
  84. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/safe_name_utility.py +0 -0
  85. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/__init__.py +0 -0
  86. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/_callbacks.py +0 -0
  87. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/base.py +0 -0
  88. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/dummy_callbacks.py +0 -0
  89. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/field.py +0 -0
  90. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/memory.py +0 -0
  91. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/py.typed +0 -0
  92. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/sim_lib/register.py +0 -0
  93. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/systemrdl_node_hashes.py +0 -0
  94. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/__init__.py +0 -0
  95. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap.py.jinja +0 -0
  96. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_field.py.jinja +0 -0
  97. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_memory.py.jinja +0 -0
  98. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_register.py.jinja +0 -0
  99. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +0 -0
  100. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_system_rdl_name_mapping.py.jinja +0 -0
  101. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_udp_property.py.jinja +0 -0
  102. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/addrmap_universal_property.py.jinja +0 -0
  103. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/child_definitions.py.jinja +0 -0
  104. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/example.py.jinja +0 -0
  105. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/field_enums.py.jinja +0 -0
  106. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/header.py.jinja +0 -0
  107. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
  108. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/property_enums.py.jinja +0 -0
  109. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
  110. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/templates/template_ultilities.py.jinja +0 -0
  111. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python/unique_component_iterator.py +0 -0
  112. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python.egg-info/SOURCES.txt +0 -0
  113. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
  114. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
  115. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python.egg-info/requires.txt +0 -0
  116. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/src/peakrdl_python.egg-info/top_level.txt +0 -0
  117. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates/header.py.jinja +0 -0
  118. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates/header_tb.py.jinja +0 -0
  119. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates_dynamic/header.py.jinja +0 -0
  120. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates_dynamic/header_tb.py.jinja +0 -0
  121. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates_dynamic_toml/header_check.py +0 -0
  122. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates_dynamic_toml/peakrdl.toml +0 -0
  123. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates_toml/header_check.py +0 -0
  124. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/alternative_templates_toml/peakrdl.toml +0 -0
  125. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/pathological_register_maps/pathalogical_rdl_builder.py +0 -0
  126. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/pathological_register_maps/templates/pathological_template.rdl.jinja +0 -0
  127. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/RDLFormatCode_example.rdl +0 -0
  128. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/addr_map.rdl +0 -0
  129. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/aliases.rdl +0 -0
  130. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/all_register_access_types.rdl +0 -0
  131. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/basic.rdl +0 -0
  132. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/block_a.xml +0 -0
  133. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/block_b.xml +0 -0
  134. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/deduplicated_field.rdl +0 -0
  135. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/different_array_types.rdl +0 -0
  136. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/enum_example.rdl +0 -0
  137. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/example_issue_106.rdl +0 -0
  138. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/extended_memories.rdl +0 -0
  139. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/extended_sizes_registers_array.rdl +0 -0
  140. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/field_scope.rdl +0 -0
  141. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/field_with_overridden_reset.rdl +0 -0
  142. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/fields_with_HW_write.rdl +0 -0
  143. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/fields_with_reset_values.rdl +0 -0
  144. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/hidden_property.rdl +0 -0
  145. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/large_field_combinations.rdl +0 -0
  146. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/memories.rdl +0 -0
  147. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/memories_with_registers.rdl +0 -0
  148. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/msb0_and_lsb0.rdl +0 -0
  149. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/multi_block.rdl +0 -0
  150. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/multifile.rdl +0 -0
  151. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/name_clash.rdl +0 -0
  152. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/name_desc_all_levels.rdl +0 -0
  153. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/name_desc_option_deduplicate.rdl +0 -0
  154. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/name_desc_stress_test.rdl +0 -0
  155. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/overridden_python_name.rdl +0 -0
  156. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
  157. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/parametrised_top.rdl +0 -0
  158. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/reg_name_stress.rdl +0 -0
  159. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/regfile_and_arrays.rdl +0 -0
  160. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/reserved_elements.rdl +0 -0
  161. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/same_but_different_enum.rdl +0 -0
  162. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/shared_register_issue_202 +0 -0
  163. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
  164. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/simple.rdl +0 -0
  165. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/simple.xml +0 -0
  166. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/simulator_test.rdl +0 -0
  167. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/sizes_registers.rdl +0 -0
  168. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/sizes_registers_array.rdl +0 -0
  169. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/sparse_enum_issue_200.rdl +0 -0
  170. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/user_defined_properties.rdl +0 -0
  171. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
  172. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/__init__.py +0 -0
  173. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/simple_components.py +0 -0
  174. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_array_indexing.py +0 -0
  175. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_building_inner_addrmap.py +0 -0
  176. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_export.py +0 -0
  177. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_field.py +0 -0
  178. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_name_desc_export.py +0 -0
  179. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_optimised_reg_array.py +0 -0
  180. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_reg.py +0 -0
  181. {peakrdl_python-3.0.0rc5 → peakrdl_python-3.0.0rc6}/tests/unit_tests/test_system_rdl_enum.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peakrdl-python
3
- Version: 3.0.0rc5
3
+ Version: 3.0.0rc6
4
4
  Summary: Generate Python Register Access Layer (RAL) from SystemRDL
5
5
  Author: Keith Brady
6
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
@@ -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.0rc5"
20
+ __version__ = "3.0.0rc6"
@@ -46,7 +46,8 @@ from .systemrdl_node_utility_functions import get_reg_writable_fields, \
46
46
  get_memory_max_entry_value_hex_string, get_memory_width_bytes, \
47
47
  get_field_default_value, get_enum_values, get_properties_to_include, \
48
48
  HideNodeCallback, hide_based_on_property, \
49
- full_slice_accessor, ShowUDPCallback
49
+ full_slice_accessor, ShowUDPCallback, \
50
+ node_iterator_entry
50
51
  from .unique_component_iterator import UniqueComponents
51
52
  from .unique_component_iterator import PeakRDLPythonUniqueRegisterComponents
52
53
  from .unique_component_iterator import PeakRDLPythonUniqueMemoryComponents
@@ -865,7 +866,8 @@ class PythonExporter:
865
866
  'get_properties_to_include': get_properties_to_include,
866
867
  'hide_node_func': hide_node_func,
867
868
  'legacy_enum_type': legacy_enum_type,
868
- 'skip_systemrdl_name_and_desc_properties': skip_systemrdl_name_and_desc_properties
869
+ 'skip_systemrdl_name_and_desc_properties': skip_systemrdl_name_and_desc_properties,
870
+ 'node_iterator_entry': node_iterator_entry,
869
871
  }
870
872
 
871
873
  self.__stream_jinja_template(template_name="addrmap_tb.py.jinja",
@@ -377,6 +377,10 @@ class _MemoryAsyncWriteOnly(AsyncMemory, ABC):
377
377
  if not isinstance(data, (list, Array)):
378
378
  raise TypeError(f'data should be an array.array got {type(data)}')
379
379
 
380
+ if (max(data) > self.max_entry_value) or (min(data) < 0):
381
+ raise ValueError('Data out of range for memory must be in the '
382
+ f'range 0 to {self.max_entry_value}')
383
+
380
384
  if len(data) not in range(0, self.entries - start_entry + 1):
381
385
  raise ValueError(f'data length must be in range 0 to {self.entries - start_entry:d} '
382
386
  f'but got {len(data):d}')
@@ -99,6 +99,20 @@ class BaseMemory(Node, ABC):
99
99
  """
100
100
  return self.__memwidth
101
101
 
102
+ @property
103
+ def max_entry_value(self) -> int:
104
+ """
105
+ maximum unsigned integer value that can be stored in a memory entry
106
+
107
+ For example:
108
+
109
+ * 8-bit memory width returns 0xFF (255)
110
+ * 16-bit memory width returns 0xFFFF (65535)
111
+ * 32-bit memory width returns 0xFFFF_FFFF (4294967295)
112
+
113
+ """
114
+ return (2 ** self.width) - 1
115
+
102
116
  @property
103
117
  def width_in_bytes(self) -> int:
104
118
  """
@@ -505,6 +519,10 @@ class _MemoryWriteOnly(Memory, ABC):
505
519
  if not isinstance(data, (Array, list)):
506
520
  raise TypeError(f'data should be an List or array.array got {type(data)}')
507
521
 
522
+ if (max(data) > self.max_entry_value) or (min(data) < 0):
523
+ raise ValueError('Data out of range for memory must be in the '
524
+ f'range 0 to {self.max_entry_value}')
525
+
508
526
  if len(data) not in range(0, self.entries - start_entry + 1):
509
527
  raise ValueError(f'data length must be in range 0 to {self.entries - start_entry:d} '
510
528
  f'but got {len(data):d}')
@@ -59,7 +59,7 @@ def get_array_typecode(width: int) -> str:
59
59
  return 'Q'
60
60
 
61
61
  if width == 16:
62
- return 'I'
62
+ return 'H'
63
63
 
64
64
  if width == 8:
65
65
  return 'B'
@@ -22,3 +22,5 @@ from .base_reg_test_class import LibTestBase
22
22
  from .async_reg_base_test_class import AsyncLibTestBase
23
23
 
24
24
  from .utilities import reverse_bits
25
+
26
+ from ._common_base_test_class import NodeIterators
@@ -0,0 +1,496 @@
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 common to both the async and non-async versions
20
+ """
21
+ import unittest
22
+ from abc import ABC, abstractmethod
23
+ from typing import Union, Optional
24
+ from itertools import product
25
+
26
+ from ..lib import FieldReadWrite, FieldReadOnly, FieldWriteOnly
27
+ from ..lib import FieldEnumReadWrite, FieldEnumReadOnly, FieldEnumWriteOnly
28
+ from ..lib import FieldAsyncReadOnly, FieldAsyncWriteOnly, FieldAsyncReadWrite
29
+ from ..lib import FieldEnumAsyncReadOnly, FieldEnumAsyncWriteOnly, FieldEnumAsyncReadWrite
30
+ from ..lib import RegReadOnly, RegReadWrite, RegWriteOnly
31
+ from ..lib import RegAsyncReadOnly, RegAsyncReadWrite, RegAsyncWriteOnly
32
+ from ..lib import AddressMap, AsyncAddressMap
33
+ from ..lib import RegFile, AsyncRegFile
34
+ from ..lib.memory import BaseMemory
35
+ from ..lib import MemoryReadOnly, MemoryReadOnlyLegacy
36
+ from ..lib import MemoryWriteOnly, MemoryWriteOnlyLegacy
37
+ from ..lib import MemoryReadWrite, MemoryReadWriteLegacy
38
+ from ..lib import MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy
39
+ from ..lib import MemoryAsyncWriteOnly, MemoryAsyncWriteOnlyLegacy
40
+ from ..lib import MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy
41
+ from ..lib.base_register import BaseReg
42
+ from ..lib import Node
43
+ from ..lib import Base
44
+ from .utilities import get_field_bitmask_int, get_field_inv_bitmask
45
+ from ..sim_lib.simulator import BaseSimulator
46
+
47
+ class NodeIterators:
48
+ """
49
+ The Node Iterator class is intended to an efficient way to define the iterators of particular
50
+ type that are present on a node
51
+ """
52
+ __slots__ = ['__node_descriptions']
53
+ def __init__(self, *args:Union[str, tuple[str, list[int]]]):
54
+ self.__node_descriptions = args
55
+
56
+ @staticmethod
57
+ def __rolled_item(item:Union[str, tuple[str, list[int]]]) -> str:
58
+ if isinstance(item, tuple):
59
+ return item[0]
60
+ return item
61
+
62
+ @property
63
+ def rolled(self) -> set[str]:
64
+ """
65
+ name of all the rolled nodes in a set
66
+ """
67
+ return { self.__rolled_item(item) for item in self.__node_descriptions }
68
+
69
+ @property
70
+ def unrolled(self) -> set[str]:
71
+ """
72
+ name of all the unrolled nodes in a set
73
+ """
74
+ return_list = []
75
+ for item in self.__node_descriptions:
76
+ if isinstance(item, tuple):
77
+ dim_set = list(product(*[range(dim) for dim in item[1]]))
78
+ for dim in dim_set:
79
+ # to match the systemrdl compiler dimension put into the inst name of
80
+ # the array, the name must be item[x][y]
81
+ dim_str = ''.join([f'[{str(i)}]' for i in dim])
82
+ return_list.append(f'{item[0]}{dim_str}')
83
+ else:
84
+ return_list.append(item)
85
+ return set(return_list)
86
+
87
+ class CommonTestBase(unittest.TestCase, ABC):
88
+ """
89
+ Base Test class for the autogenerated register test to be used for the async and
90
+ non-async cases
91
+ """
92
+
93
+ @property
94
+ @abstractmethod
95
+ def simulator_instance(self) -> BaseSimulator:
96
+ """
97
+ Simulator configured for the DUT
98
+ """
99
+
100
+ @property
101
+ @abstractmethod
102
+ def legacy_block_access(self) -> bool:
103
+ """
104
+ Whether the register model has been configured for legacy block access or not
105
+ """
106
+
107
+ # pylint:disable-next=too-many-arguments
108
+ def _single_field_property_test(self, *,
109
+ 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],
121
+ lsb: int,
122
+ msb: int,
123
+ low: int,
124
+ high: int,
125
+ is_volatile: bool,
126
+ default: Optional[int],
127
+ rdl_name: Optional[str],
128
+ rdl_desc: Optional[str],
129
+ parent_full_inst_name: str,
130
+ inst_name: str
131
+ ) -> None:
132
+ self.assertEqual(fut.lsb, lsb)
133
+ self.assertEqual(fut.msb, msb)
134
+ self.assertEqual(fut.low, low)
135
+ self.assertEqual(fut.high, high)
136
+ self.assertEqual(fut.bitmask, get_field_bitmask_int(fut))
137
+ self.assertEqual(fut.inverse_bitmask, get_field_inv_bitmask(fut))
138
+ width = (fut.high - fut.low) + 1
139
+ self.assertEqual(fut.width, width)
140
+ self.assertEqual(fut.max_value, (2**width) - 1)
141
+ self.assertEqual(fut.is_volatile, is_volatile)
142
+
143
+ if default is None:
144
+ self.assertIsNone(fut.default)
145
+ else:
146
+ if isinstance(fut, (FieldEnumReadWrite,
147
+ FieldEnumReadOnly,
148
+ FieldEnumWriteOnly,
149
+ FieldEnumAsyncReadOnly,
150
+ FieldEnumAsyncWriteOnly,
151
+ FieldEnumAsyncReadWrite)):
152
+ # pylint does not realise this is a class being returned rather than an object, so
153
+ # is unhappy with the name
154
+ # pylint:disable-next=invalid-name
155
+ EnumCls = fut.enum_cls
156
+ if default in [item.value for item in fut.enum_cls]:
157
+ self.assertEqual(fut.default, EnumCls(default))
158
+ else:
159
+ # this is a special case if the default value for the field does not map
160
+ # to a legal value of the encoding
161
+ self.assertIsNone(fut.default)
162
+ else:
163
+ self.assertEqual(fut.default, default)
164
+
165
+ self.__single_node_rdl_name_and_desc_test(dut=fut,
166
+ rdl_name=rdl_name,
167
+ rdl_desc=rdl_desc)
168
+
169
+ self.__test_node_inst_name(dut=fut,
170
+ parent_full_inst_name=parent_full_inst_name,
171
+ inst_name=inst_name)
172
+
173
+ self.__bad_attribute_test(dut=fut)
174
+
175
+ # pylint:disable-next=too-many-arguments
176
+ def _single_register_property_test(self, *,
177
+ rut: BaseReg,
178
+ address: int,
179
+ width: int,
180
+ accesswidth: Optional[int],
181
+ size: int,
182
+ rdl_name: Optional[str],
183
+ rdl_desc: Optional[str],
184
+ parent_full_inst_name: str,
185
+ inst_name: str
186
+ ) -> None:
187
+ self.assertEqual(rut.address, address)
188
+ self.assertEqual(rut.width, width)
189
+ if accesswidth is not None:
190
+ self.assertEqual(rut.accesswidth, accesswidth)
191
+ else:
192
+ self.assertEqual(rut.accesswidth, width)
193
+ self.assertEqual(rut.size, size)
194
+
195
+ self.__single_node_rdl_name_and_desc_test(dut=rut,
196
+ rdl_name=rdl_name,
197
+ rdl_desc=rdl_desc)
198
+
199
+ self.__test_node_inst_name(dut=rut,
200
+ parent_full_inst_name=parent_full_inst_name,
201
+ inst_name=inst_name)
202
+
203
+ self.__bad_attribute_test(dut=rut)
204
+
205
+ # pylint:disable-next=too-many-arguments
206
+ def _single_memory_property_test(self, *,
207
+ mut: BaseMemory,
208
+ address: int,
209
+ width: int,
210
+ entries: int,
211
+ accesswidth: Optional[int],
212
+ array_typecode: Optional[str],
213
+ size: int,
214
+ rdl_name: Optional[str],
215
+ rdl_desc: Optional[str],
216
+ parent_full_inst_name: str,
217
+ inst_name: str
218
+ ) -> None:
219
+ self.assertEqual(mut.address, address)
220
+ self.assertEqual(mut.width, width)
221
+ self.assertEqual(mut.entries, entries)
222
+ if accesswidth is not None:
223
+ self.assertEqual(mut.accesswidth, accesswidth)
224
+ else:
225
+ self.assertEqual(mut.accesswidth, width)
226
+ if self.legacy_block_access:
227
+ self.assertEqual(mut.array_typecode, array_typecode)
228
+ else:
229
+ self.assertIsNone(array_typecode)
230
+ self.assertEqual(mut.size, size)
231
+
232
+ self.__single_node_rdl_name_and_desc_test(dut=mut,
233
+ rdl_name=rdl_name,
234
+ rdl_desc=rdl_desc)
235
+
236
+ self.__test_node_inst_name(dut=mut,
237
+ parent_full_inst_name=parent_full_inst_name,
238
+ inst_name=inst_name)
239
+
240
+ self.__bad_attribute_test(dut=mut)
241
+
242
+ # pylint:disable-next=too-many-arguments
243
+ def _single_addrmap_property_test(self, *,
244
+ dut: Union[AddressMap, AsyncAddressMap],
245
+ size: int,
246
+ rdl_name: Optional[str],
247
+ rdl_desc: Optional[str],
248
+ parent_full_inst_name: Optional[str],
249
+ inst_name: str
250
+ ) -> None:
251
+
252
+ self.assertEqual(dut.size, size)
253
+
254
+ self.__single_node_rdl_name_and_desc_test(dut=dut,
255
+ rdl_name=rdl_name,
256
+ rdl_desc=rdl_desc)
257
+
258
+ self.__test_node_inst_name(dut=dut,
259
+ parent_full_inst_name=parent_full_inst_name,
260
+ inst_name=inst_name)
261
+
262
+ self.__bad_attribute_test(dut=dut)
263
+
264
+ # pylint:disable-next=too-many-arguments
265
+ def _single_regfile_property_test(self, *,
266
+ dut: Union[RegFile, AsyncRegFile],
267
+ size: int,
268
+ rdl_name: Optional[str],
269
+ rdl_desc: Optional[str],
270
+ parent_full_inst_name: str,
271
+ inst_name: str
272
+ ) -> None:
273
+
274
+ self.assertEqual(dut.size, size)
275
+
276
+ self.__single_node_rdl_name_and_desc_test(dut=dut,
277
+ rdl_name=rdl_name,
278
+ rdl_desc=rdl_desc)
279
+
280
+ self.__test_node_inst_name(dut=dut,
281
+ parent_full_inst_name=parent_full_inst_name,
282
+ inst_name=inst_name)
283
+
284
+ self.__bad_attribute_test(dut=dut)
285
+
286
+ def __single_node_rdl_name_and_desc_test(self,
287
+ dut: Base,
288
+ rdl_name: Optional[str],
289
+ rdl_desc: Optional[str]) -> None:
290
+ """
291
+ Check the SystemRDL Name and Desc properties for a node
292
+ """
293
+ if rdl_name is None:
294
+ self.assertIsNone(dut.rdl_name)
295
+ else:
296
+ self.assertEqual(dut.rdl_name, rdl_name)
297
+
298
+ if rdl_desc is None:
299
+ self.assertIsNone(dut.rdl_desc)
300
+ else:
301
+ self.assertEqual(dut.rdl_desc, rdl_desc)
302
+
303
+ def __test_node_inst_name(self,
304
+ dut: Base,
305
+ parent_full_inst_name:Optional[str],
306
+ inst_name:str) -> None:
307
+ """
308
+ Test the `inst_name` and `full_inst_name` attributes of a node
309
+ """
310
+ self.assertEqual(dut.inst_name, inst_name)
311
+ if parent_full_inst_name is None:
312
+ # root node (which has no parent)
313
+ self.assertEqual(dut.full_inst_name, inst_name)
314
+ else:
315
+ full_inst_name = parent_full_inst_name + '.' + inst_name
316
+ self.assertEqual(dut.full_inst_name, full_inst_name)
317
+
318
+ def __bad_attribute_test(self, dut: Base) -> None:
319
+ """
320
+ Check that adding an attribute fails, the __slots__ should prevent this
321
+
322
+ The attribute name: cppkbrgmgeloagvfgjjeiiushygirh was randomly generated to be unlikely to
323
+ every be a attribute name
324
+ """
325
+ with self.assertRaises(AttributeError):
326
+ dut.cppkbrgmgeloagvfgjjeiiushygirh = 1 # type: ignore[attr-defined,union-attr]
327
+
328
+ def __test_name_map(self, dut: Node, child_names: set[str]) -> None:
329
+ """
330
+ Test that the get_child_by_system_rdl_name and systemrdl_python_child_name_map are
331
+ populated correctly
332
+ """
333
+ self.assertCountEqual(dut.systemrdl_python_child_name_map, child_names)
334
+ self.assertEqual(set(dut.systemrdl_python_child_name_map.keys()), child_names)
335
+ for child_name in child_names:
336
+ self.assertEqual(dut.get_child_by_system_rdl_name(child_name).inst_name, child_name)
337
+
338
+ def _test_field_iterators(self, *,
339
+ rut: Union[RegReadOnly,
340
+ RegReadWrite,
341
+ RegWriteOnly,
342
+ RegAsyncReadOnly,
343
+ RegAsyncReadWrite,
344
+ RegAsyncWriteOnly],
345
+ has_sw_readable: bool,
346
+ has_sw_writable: bool,
347
+ readable_fields: set[str],
348
+ writeable_fields: set[str]) -> None:
349
+ if has_sw_readable:
350
+ if not isinstance(rut, (RegReadOnly,
351
+ RegReadWrite,
352
+ RegAsyncReadOnly,
353
+ RegAsyncReadWrite,
354
+ )):
355
+ raise TypeError(f'Register was expected to readable, got {type(rut)}')
356
+
357
+ child_readable_field_names = { field.inst_name for field in rut.readable_fields}
358
+
359
+ self.assertEqual(readable_fields, child_readable_field_names)
360
+ else:
361
+ self.assertFalse(hasattr(rut, 'readable_fields'))
362
+ # check the readable_fields is empty
363
+ self.assertFalse(readable_fields)
364
+
365
+ if has_sw_writable:
366
+ if not isinstance(rut, (RegWriteOnly,
367
+ RegReadWrite,
368
+ RegAsyncWriteOnly,
369
+ RegAsyncReadWrite,
370
+ )):
371
+ raise TypeError(f'Register was expected to writable, got {type(rut)}')
372
+
373
+ child_writeable_fields_names = {field.inst_name for field in rut.writable_fields}
374
+
375
+ self.assertEqual(writeable_fields, child_writeable_fields_names)
376
+ else:
377
+ self.assertFalse(hasattr(rut, 'writeable_fields'))
378
+ # check the writeable_fields is empty
379
+ self.assertFalse(writeable_fields)
380
+
381
+ child_field_names = {field.inst_name for field in rut.fields}
382
+ self.assertEqual(readable_fields | writeable_fields, child_field_names)
383
+
384
+ # Check the child name map
385
+ self.__test_name_map(dut=rut, child_names= readable_fields | writeable_fields)
386
+
387
+ def _test_register_iterators(self,
388
+ dut: Union[AddressMap, AsyncAddressMap, RegFile, AsyncRegFile,
389
+ MemoryReadOnly, MemoryReadOnlyLegacy,
390
+ MemoryWriteOnly, MemoryWriteOnlyLegacy,
391
+ MemoryReadWrite, MemoryReadWriteLegacy,
392
+ MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy,
393
+ MemoryAsyncWriteOnly, MemoryAsyncWriteOnlyLegacy,
394
+ MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy],
395
+ readable_registers: NodeIterators,
396
+ writeable_registers: NodeIterators) -> None:
397
+
398
+ if isinstance(dut, (AddressMap, AsyncAddressMap, RegFile, AsyncRegFile,
399
+ MemoryReadOnly, MemoryReadOnlyLegacy,
400
+ MemoryReadWrite, MemoryReadWriteLegacy,
401
+ MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy,
402
+ MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy)):
403
+ child_readable_reg_names = { reg.inst_name for reg in
404
+ dut.get_readable_registers(unroll=True)}
405
+ self.assertEqual(readable_registers.unrolled, child_readable_reg_names)
406
+ child_readable_reg_names = {reg.inst_name for reg in
407
+ dut.get_readable_registers(unroll=False)}
408
+ self.assertEqual(readable_registers.rolled, child_readable_reg_names)
409
+ else:
410
+ self.assertFalse(hasattr(dut, 'get_readable_registers'))
411
+
412
+ if isinstance(dut, (AddressMap, AsyncAddressMap, RegFile, AsyncRegFile,
413
+ MemoryWriteOnly, MemoryWriteOnlyLegacy,
414
+ MemoryReadWrite, MemoryReadWriteLegacy,
415
+ MemoryAsyncWriteOnly, MemoryAsyncWriteOnlyLegacy,
416
+ MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy)):
417
+ child_writable_reg_names = {reg.inst_name for reg in
418
+ dut.get_writable_registers(unroll=True)}
419
+ self.assertEqual(writeable_registers.unrolled, child_writable_reg_names)
420
+ child_writable_reg_names = {reg.inst_name for reg in
421
+ dut.get_writable_registers(unroll=False)}
422
+ self.assertEqual(writeable_registers.rolled, child_writable_reg_names)
423
+ else:
424
+ self.assertFalse(hasattr(dut, 'get_writable_registers'))
425
+
426
+ child_reg_names = {field.inst_name for field in dut.get_registers(unroll=True)}
427
+ self.assertEqual(readable_registers.unrolled | writeable_registers.unrolled,
428
+ child_reg_names)
429
+ child_reg_names = {field.inst_name for field in dut.get_registers(unroll=False)}
430
+ self.assertEqual(readable_registers.rolled | writeable_registers.rolled,
431
+ child_reg_names)
432
+
433
+ # The register file and addrmap have other items in their child map so it has to be
434
+ # tested at the next level up, however, a memory only has child registers
435
+ if isinstance(dut, (MemoryReadOnly, MemoryReadOnlyLegacy,
436
+ MemoryWriteOnly, MemoryWriteOnlyLegacy,
437
+ MemoryReadWrite, MemoryReadWriteLegacy,
438
+ MemoryAsyncReadOnly, MemoryAsyncReadOnlyLegacy,
439
+ MemoryAsyncWriteOnly, MemoryAsyncWriteOnlyLegacy,
440
+ MemoryAsyncReadWrite, MemoryAsyncReadWriteLegacy)):
441
+ # Check the child name map
442
+ self.__test_name_map(dut=dut,
443
+ child_names=readable_registers.rolled |
444
+ writeable_registers.rolled)
445
+
446
+
447
+ def _test_memory_iterators(self,
448
+ dut: Union[AddressMap, AsyncAddressMap],
449
+ memories: NodeIterators) -> None:
450
+ child_mem_names = {reg.inst_name for reg in dut.get_memories(unroll=True)}
451
+ self.assertEqual(memories.unrolled, child_mem_names)
452
+ child_mem_names = {reg.inst_name for reg in dut.get_memories(unroll=False)}
453
+ self.assertEqual(memories.rolled, child_mem_names)
454
+
455
+ def __test_section_iterators(self,
456
+ dut: Union[AddressMap, AsyncAddressMap, RegFile, AsyncRegFile],
457
+ sections: NodeIterators) -> None:
458
+ child_section_names = {reg.inst_name for reg in dut.get_sections(unroll=True)}
459
+ self.assertEqual(sections.unrolled, child_section_names)
460
+ child_section_names = {reg.inst_name for reg in dut.get_sections(unroll=False)}
461
+ self.assertEqual(sections.rolled, child_section_names)
462
+
463
+ def _test_addrmap_iterators(self, *,
464
+ dut: Union[AddressMap, AsyncAddressMap],
465
+ memories: NodeIterators,
466
+ sections: NodeIterators,
467
+ readable_registers: NodeIterators,
468
+ writeable_registers: NodeIterators) -> None:
469
+ self._test_register_iterators(dut=dut,
470
+ readable_registers=readable_registers,
471
+ writeable_registers=writeable_registers)
472
+ self._test_memory_iterators(dut=dut,
473
+ memories=memories)
474
+ self.__test_section_iterators(dut=dut,
475
+ sections=sections)
476
+
477
+ # Check the child name map
478
+ self.__test_name_map(dut=dut, child_names=memories.rolled | readable_registers.rolled |
479
+ writeable_registers.rolled | sections.rolled)
480
+
481
+ def _test_regfile_iterators(self,
482
+ dut: Union[RegFile, AsyncRegFile],
483
+ sections: NodeIterators,
484
+ readable_registers: NodeIterators,
485
+ writeable_registers: NodeIterators) -> None:
486
+ self._test_register_iterators(dut=dut,
487
+ readable_registers=readable_registers,
488
+ writeable_registers=writeable_registers)
489
+ self.__test_section_iterators(dut=dut,
490
+ sections=sections)
491
+ self.assertFalse(hasattr(dut, 'get_memories'))
492
+
493
+ # Check the child name map
494
+ self.__test_name_map(dut=dut, child_names=readable_registers.rolled |
495
+ writeable_registers.rolled |
496
+ sections.rolled)