peakrdl-python 3.0.0rc2__tar.gz → 3.0.0rc4__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.0rc2 → peakrdl_python-3.0.0rc4}/.github/workflows/action.yaml +2 -3
  2. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/PKG-INFO +1 -1
  3. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/generate_testcases.py +8 -15
  4. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/__about__.py +1 -1
  5. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib_test/_common_base_test_class.py +28 -2
  6. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib_test/async_reg_base_test_class.py +391 -19
  7. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib_test/base_reg_test_class.py +384 -7
  8. peakrdl_python-3.0.0rc4/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +200 -0
  9. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_tb.py.jinja +5 -31
  10. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/baseclass_tb.py.jinja +14 -0
  11. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python.egg-info/PKG-INFO +1 -1
  12. peakrdl_python-3.0.0rc2/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +0 -437
  13. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/.gitignore +0 -0
  14. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/.readthedocs.yaml +0 -0
  15. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/LICENSE +0 -0
  16. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/MANIFEST.in +0 -0
  17. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/README.md +0 -0
  18. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/api.rst +0 -0
  19. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/api_components.rst +0 -0
  20. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/command_line.rst +0 -0
  21. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/conf.py +0 -0
  22. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/customisation.rst +0 -0
  23. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/design_decisions.rst +0 -0
  24. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/design_tools.rst +0 -0
  25. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/generated_package.rst +0 -0
  26. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/genindex.rst +0 -0
  27. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/index.rst +0 -0
  28. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/installation.rst +0 -0
  29. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/docs/requirements.txt +0 -0
  30. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/array_access/array_access.rdl +0 -0
  31. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/array_access/demo_array_access.py +0 -0
  32. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/enumerated_fields/demo_enumerated_fields.py +0 -0
  33. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/enumerated_fields/enumerated_fields.rdl +0 -0
  34. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/optimised_access/demo_optimised_access.py +0 -0
  35. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/optimised_access/demo_optimised_array_access.py +0 -0
  36. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/optimised_access/optimised_access.rdl +0 -0
  37. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/optimised_access/optimised_array_access.rdl +0 -0
  38. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/overridden_names/demo_over_ridden_names.py +0 -0
  39. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/overridden_names/overridden_names.rdl +0 -0
  40. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
  41. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/simulating_callbacks/flashing_the_LED.py +0 -0
  42. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
  43. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/tranversing_address_map/dumping_register_state_to_json_file.py +0 -0
  44. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/tranversing_address_map/reg_dump.json +0 -0
  45. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/tranversing_address_map/reseting_registers.py +0 -0
  46. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
  47. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/user_defined_properties/demo_user_defined_properties.py +0 -0
  48. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/user_defined_properties/user_defined_properties.rdl +0 -0
  49. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/why_ral/__init__.py +0 -0
  50. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/why_ral/gpio.rdl +0 -0
  51. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/why_ral/with_hal.py +0 -0
  52. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/why_ral/with_ral.py +0 -0
  53. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/example/why_ral/without_ral.py +0 -0
  54. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/generate_and_test.py +0 -0
  55. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/pyproject.toml +0 -0
  56. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/setup.cfg +0 -0
  57. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/.coveragerc +0 -0
  58. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/__init__.py +0 -0
  59. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/__peakrdl__.py +0 -0
  60. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/_deploy_package.py +0 -0
  61. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/_node_walkers.py +0 -0
  62. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/class_names.py +0 -0
  63. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/compiler_udp.py +0 -0
  64. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/exporter.py +0 -0
  65. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/__init__.py +0 -0
  66. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/async_memory.py +0 -0
  67. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/async_register_and_field.py +0 -0
  68. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/base.py +0 -0
  69. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/base_field.py +0 -0
  70. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/base_register.py +0 -0
  71. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/callbacks.py +0 -0
  72. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/field_encoding.py +0 -0
  73. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/memory.py +0 -0
  74. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/py.typed +0 -0
  75. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/register_and_field.py +0 -0
  76. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/sections.py +0 -0
  77. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib/utility_functions.py +0 -0
  78. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib_test/__init__.py +0 -0
  79. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/lib_test/utilities.py +0 -0
  80. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/py.typed +0 -0
  81. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/safe_name_utility.py +0 -0
  82. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/__init__.py +0 -0
  83. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/_callbacks.py +0 -0
  84. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/base.py +0 -0
  85. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/dummy_callbacks.py +0 -0
  86. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/field.py +0 -0
  87. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/memory.py +0 -0
  88. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/py.typed +0 -0
  89. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/register.py +0 -0
  90. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/sim_lib/simulator.py +0 -0
  91. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/systemrdl_node_hashes.py +0 -0
  92. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/systemrdl_node_utility_functions.py +0 -0
  93. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/__init__.py +0 -0
  94. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap.py.jinja +0 -0
  95. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_field.py.jinja +0 -0
  96. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_memory.py.jinja +0 -0
  97. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_register.py.jinja +0 -0
  98. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +0 -0
  99. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_system_rdl_name_mapping.py.jinja +0 -0
  100. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_udp_property.py.jinja +0 -0
  101. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/addrmap_universal_property.py.jinja +0 -0
  102. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/baseclass_simulation_tb.py.jinja +0 -0
  103. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/child_definitions.py.jinja +0 -0
  104. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/example.py.jinja +0 -0
  105. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/field_enums.py.jinja +0 -0
  106. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/header.py.jinja +0 -0
  107. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
  108. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/property_enums.py.jinja +0 -0
  109. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
  110. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/templates/template_ultilities.py.jinja +0 -0
  111. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python/unique_component_iterator.py +0 -0
  112. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python.egg-info/SOURCES.txt +0 -0
  113. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
  114. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
  115. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python.egg-info/requires.txt +0 -0
  116. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/src/peakrdl_python.egg-info/top_level.txt +0 -0
  117. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates/header.py.jinja +0 -0
  118. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates/header_tb.py.jinja +0 -0
  119. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates_dynamic/header.py.jinja +0 -0
  120. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates_dynamic/header_tb.py.jinja +0 -0
  121. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates_dynamic_toml/header_check.py +0 -0
  122. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates_dynamic_toml/peakrdl.toml +0 -0
  123. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates_toml/header_check.py +0 -0
  124. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/alternative_templates_toml/peakrdl.toml +0 -0
  125. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/pathological_register_maps/pathalogical_rdl_builder.py +0 -0
  126. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/pathological_register_maps/templates/pathological_template.rdl.jinja +0 -0
  127. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/RDLFormatCode_example.rdl +0 -0
  128. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/addr_map.rdl +0 -0
  129. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/aliases.rdl +0 -0
  130. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/all_register_access_types.rdl +0 -0
  131. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/basic.rdl +0 -0
  132. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/block_a.xml +0 -0
  133. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/block_b.xml +0 -0
  134. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/deduplicated_field.rdl +0 -0
  135. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/different_array_types.rdl +0 -0
  136. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/enum_example.rdl +0 -0
  137. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/example_issue_106.rdl +0 -0
  138. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/extended_memories.rdl +0 -0
  139. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/extended_sizes_registers_array.rdl +0 -0
  140. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/field_scope.rdl +0 -0
  141. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/field_with_overridden_reset.rdl +0 -0
  142. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/fields_with_HW_write.rdl +0 -0
  143. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/fields_with_reset_values.rdl +0 -0
  144. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/hidden_property.rdl +0 -0
  145. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/large_field_combinations.rdl +0 -0
  146. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/memories.rdl +0 -0
  147. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/memories_with_registers.rdl +0 -0
  148. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/msb0_and_lsb0.rdl +0 -0
  149. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/multi_block.rdl +0 -0
  150. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/multifile.rdl +0 -0
  151. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/name_clash.rdl +0 -0
  152. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/name_desc_all_levels.rdl +0 -0
  153. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/name_desc_option_deduplicate.rdl +0 -0
  154. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/name_desc_stress_test.rdl +0 -0
  155. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/overridden_python_name.rdl +0 -0
  156. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
  157. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/parametrised_top.rdl +0 -0
  158. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/reg_name_stress.rdl +0 -0
  159. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/regfile_and_arrays.rdl +0 -0
  160. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/reserved_elements.rdl +0 -0
  161. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/same_but_different_enum.rdl +0 -0
  162. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/shared_register_issue_202 +0 -0
  163. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
  164. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/simple.rdl +0 -0
  165. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/simple.xml +0 -0
  166. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/simulator_test.rdl +0 -0
  167. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/sizes_registers.rdl +0 -0
  168. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/sizes_registers_array.rdl +0 -0
  169. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/sparse_enum_issue_200.rdl +0 -0
  170. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/user_defined_properties.rdl +0 -0
  171. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
  172. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/__init__.py +0 -0
  173. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/simple_components.py +0 -0
  174. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_array_indexing.py +0 -0
  175. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_building_inner_addrmap.py +0 -0
  176. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_export.py +0 -0
  177. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_field.py +0 -0
  178. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_name_desc_export.py +0 -0
  179. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_optimised_reg_array.py +0 -0
  180. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_reg.py +0 -0
  181. {peakrdl_python-3.0.0rc2 → peakrdl_python-3.0.0rc4}/tests/unit_tests/test_system_rdl_enum.py +0 -0
@@ -339,7 +339,6 @@ jobs:
339
339
  matrix:
340
340
  python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
341
341
  lib_copy: [true, false]
342
- hashing_mode: ["PYTHONHASH", "SHA256"]
343
342
 
344
343
  steps:
345
344
  - uses: actions/checkout@v4
@@ -365,12 +364,12 @@ jobs:
365
364
  - name: Generate testcases (lib_copy true)
366
365
  if: matrix.lib_copy == true
367
366
  run: |
368
- python generate_testcases.py --copy_libraries --output testcase_output --hashing_mode ${{ matrix.hashing_mode }}
367
+ python generate_testcases.py --copy_libraries --output testcase_output
369
368
 
370
369
  - name: Generate testcases (lib_copy false)
371
370
  if: matrix.lib_copy == false
372
371
  run: |
373
- python generate_testcases.py --output testcase_output --hashing_mode ${{ matrix.hashing_mode }}
372
+ python generate_testcases.py --output testcase_output
374
373
 
375
374
  - name: Static checks
376
375
  run: |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peakrdl-python
3
- Version: 3.0.0rc2
3
+ Version: 3.0.0rc4
4
4
  Summary: Generate Python Register Access Layer (RAL) from SystemRDL
5
5
  Author: Keith Brady
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -49,16 +49,6 @@ CommandLineParser.add_argument('--copy_libraries', action='store_true', dest='co
49
49
  'and debugging as multiple copies of the libraries can cause'
50
50
  'confusion. Therefore by default this script does not copy '
51
51
  'them over.')
52
- CommandLineParser.add_argument('--hashing_mode',
53
- dest='hashing_mode',
54
- type=str,
55
- choices=[item.name for item in NodeHashingMethod],
56
- default='PYTHONHASH',
57
- help='The method used to generate the hash of the node, in order to '
58
- 'deduplicate the register model. Set this to `SHA256` if '
59
- 'the python names need to stay consistent one export to the '
60
- 'next. However, this mode is slower')
61
-
62
52
 
63
53
  def compile_rdl(infile: str,
64
54
  incl_search_paths: Optional[List[str]] = None,
@@ -158,19 +148,22 @@ if __name__ == '__main__':
158
148
  options = {
159
149
  'asyncoutput': [True, False],
160
150
  'legacy': [True, False],
161
- 'skip_systemrdl_name_and_desc_in_docstring': [True, False]
151
+ 'skip_systemrdl_name_and_desc_in_docstring': [True, False],
152
+ 'hashing': list(NodeHashingMethod)
162
153
  }
163
154
 
164
- for asyncoutput, legacy, skip_name_and_desc_in_docstring in product(
155
+ for asyncoutput, legacy, skip_name_and_desc_in_docstring, hashing_method in product(
165
156
  options['asyncoutput'], options['legacy'],
166
- options['skip_systemrdl_name_and_desc_in_docstring'] ):
157
+ options['skip_systemrdl_name_and_desc_in_docstring'],
158
+ options['hashing']):
167
159
 
168
160
  # test cases that use the extended widths an not be tested in the non-legacy modes
169
161
  if (testcase_name in ['extended_memories', 'extended_sizes_registers_array']) and \
170
162
  (legacy is True):
171
163
  continue
172
164
 
173
- folder_parts = 'raw'
165
+ folder_parts = 'raw_'
166
+ folder_parts += hashing_method.name
174
167
  if asyncoutput:
175
168
  folder_parts += '_async'
176
169
  if legacy:
@@ -184,7 +177,7 @@ if __name__ == '__main__':
184
177
  legacy_enum_type=legacy,
185
178
  copy_library=CommandLineArgs.copy_libraries,
186
179
  skip_systemrdl_name_and_desc_in_docstring=skip_name_and_desc_in_docstring,
187
- hashing_mode=NodeHashingMethod[CommandLineArgs.hashing_mode])
180
+ hashing_mode=hashing_method)
188
181
 
189
182
  module_fqfn = output_path / folder_parts / '__init__.py'
190
183
  with open(module_fqfn, 'w', encoding='utf-8') as fid:
@@ -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.0rc2"
20
+ __version__ = "3.0.0rc4"
@@ -19,7 +19,7 @@ This package is intended to distributed as part of automatically generated code
19
19
  Python tool. It provide the base class common to both the async and non-async versions
20
20
  """
21
21
  import unittest
22
- from abc import ABC
22
+ from abc import ABC, abstractmethod
23
23
  from typing import Union, Optional
24
24
 
25
25
  from ..lib import FieldReadWrite, FieldReadOnly, FieldWriteOnly
@@ -27,14 +27,23 @@ from ..lib import FieldEnumReadWrite, FieldEnumReadOnly, FieldEnumWriteOnly
27
27
  from ..lib import FieldAsyncReadOnly, FieldAsyncWriteOnly, FieldAsyncReadWrite
28
28
  from ..lib import FieldEnumAsyncReadOnly, FieldEnumAsyncWriteOnly, FieldEnumAsyncReadWrite
29
29
  from ..lib.base_register import BaseReg
30
+ from ..lib import Base
30
31
  from .utilities import get_field_bitmask_int, get_field_inv_bitmask
32
+ from ..sim_lib.simulator import BaseSimulator
31
33
 
32
34
  class CommonTestBase(unittest.TestCase, ABC):
33
35
  """
34
- Base Test class for the autogenerated register test to be used for for the async and
36
+ Base Test class for the autogenerated register test to be used for the async and
35
37
  non-async cases
36
38
  """
37
39
 
40
+ @property
41
+ @abstractmethod
42
+ def simulator_instance(self) -> BaseSimulator:
43
+ """
44
+ Simulator configured for the DUT
45
+ """
46
+
38
47
  # pylint:disable-next=too-many-arguments
39
48
  def _single_field_property_test(self, *,
40
49
  fut: Union[FieldReadWrite,
@@ -99,3 +108,20 @@ class CommonTestBase(unittest.TestCase, ABC):
99
108
  self.assertEqual(rut.accesswidth, accesswidth)
100
109
  else:
101
110
  self.assertEqual(rut.accesswidth, width)
111
+
112
+ def _single_node_rdl_name_and_desc_test(self,
113
+ dut: Base,
114
+ rdl_name: Optional[str],
115
+ rdl_desc: Optional[str]) -> None:
116
+ """
117
+ Check the SystemRDL Name and Desc properties for a node
118
+ """
119
+ if rdl_name is None:
120
+ self.assertIsNone(dut.rdl_name)
121
+ else:
122
+ self.assertEqual(dut.rdl_name, rdl_name)
123
+
124
+ if rdl_desc is None:
125
+ self.assertIsNone(dut.rdl_desc)
126
+ else:
127
+ self.assertEqual(dut.rdl_desc, rdl_desc)
@@ -23,9 +23,9 @@ Python tool. It provide the base class for the autogenerated tests
23
23
  # pylint:disable=duplicate-code
24
24
 
25
25
  import unittest
26
- from abc import ABC
26
+ from abc import ABC, abstractmethod
27
27
  from typing import Union
28
- from unittest.mock import patch
28
+ from unittest.mock import patch, Mock
29
29
  from itertools import product, chain, combinations
30
30
  from collections.abc import Iterable
31
31
 
@@ -33,12 +33,14 @@ from ..lib import FieldAsyncReadOnly, FieldAsyncWriteOnly, FieldAsyncReadWrite
33
33
  from ..lib import FieldEnumAsyncReadOnly, FieldEnumAsyncWriteOnly, FieldEnumAsyncReadWrite
34
34
  from ..lib import RegAsyncReadOnly, RegAsyncReadWrite, RegAsyncWriteOnly
35
35
  from ..lib import RegisterWriteVerifyError
36
- from ..sim_lib.dummy_callbacks import async_dummy_read
37
- from ..sim_lib.dummy_callbacks import async_dummy_write
36
+ from ..sim_lib.register import Register as SimRegister
37
+ from ..sim_lib.register import MemoryRegister as SimMemoryRegister
38
+ from ..sim_lib.register import Field as SimField
38
39
 
39
40
  from .utilities import reverse_bits, expected_reg_write_data
40
41
  from .utilities import reg_value_for_field_read_with_random_base
41
42
  from .utilities import random_int_field_value, random_field_parent_reg_value
43
+ from .utilities import random_encoded_field_value,reg_value_for_field_read
42
44
  from .utilities import random_reg_value, RandomReg
43
45
  from .utilities import RegWriteTestSequence,RegWriteZeroStartTestSequence
44
46
 
@@ -59,10 +61,9 @@ class AsyncLibTestBase(unittest.IsolatedAsyncioTestCase, CommonTestBase, ABC):
59
61
  width=width,
60
62
  accesswidth=accesswidth)
61
63
 
64
+ @abstractmethod
62
65
  async def read_callback(self, addr: int, width: int, accesswidth: int) -> int:
63
- return await async_dummy_read(addr=addr,
64
- width=width,
65
- accesswidth=accesswidth)
66
+ ...
66
67
 
67
68
  async def outer_write_callback(self, addr: int,
68
69
  width: int, accesswidth: int,
@@ -72,11 +73,9 @@ class AsyncLibTestBase(unittest.IsolatedAsyncioTestCase, CommonTestBase, ABC):
72
73
  accesswidth=accesswidth,
73
74
  data=data)
74
75
 
76
+ @abstractmethod
75
77
  async def write_callback(self, addr: int, width: int, accesswidth: int, data: int) -> None:
76
- return await async_dummy_write(addr=addr,
77
- width=width,
78
- accesswidth=accesswidth,
79
- data=data)
78
+ ...
80
79
 
81
80
  # pylint:enable=missing-function-docstring
82
81
 
@@ -91,6 +90,10 @@ class AsyncLibTestBase(unittest.IsolatedAsyncioTestCase, CommonTestBase, ABC):
91
90
  # `test_field_properties` so do no need to checked here. Similarly, the properties of
92
91
  # parent register are checked as part of `test_register_properties`
93
92
 
93
+ await self.__single_int_field_simulator_read_and_write_test(fut=fut,
94
+ is_sw_readable=is_sw_readable,
95
+ is_sw_writable=is_sw_writable)
96
+
94
97
  if is_sw_readable:
95
98
  if not isinstance(fut, (FieldAsyncReadOnly, FieldAsyncReadWrite)):
96
99
  raise TypeError('Test can not proceed as the fut is not a readable field')
@@ -298,27 +301,35 @@ class AsyncLibTestBase(unittest.IsolatedAsyncioTestCase, CommonTestBase, ABC):
298
301
  # `test_field_properties` so do not need to checked here. Similarly, the properties of
299
302
  # parent register are checked as part of `test_register_properties`
300
303
 
304
+ await self.__single_enum_field_simulator_read_and_write_test(fut=fut,
305
+ is_sw_readable=is_sw_readable,
306
+ is_sw_writable=is_sw_writable)
307
+
301
308
  if is_sw_readable:
302
309
  if not isinstance(fut, (FieldEnumAsyncReadOnly, FieldEnumAsyncReadWrite)):
303
310
  raise TypeError('Test can not proceed as the fut is not a readable field')
304
311
  await self.__single_enum_field_read_test(fut=fut,
305
- enum_definition=enum_definition)
312
+ enum_definition=enum_definition)
306
313
 
307
314
  if is_sw_writable:
308
315
  if not isinstance(fut, (FieldEnumAsyncWriteOnly, FieldEnumAsyncReadWrite)):
309
316
  raise TypeError('Test can not proceed as the fut is not a writable field')
310
317
  await self.__single_enum_field_write_test(fut=fut,
311
- enum_definition=enum_definition)
318
+ enum_definition=enum_definition)
312
319
 
313
- async def _single_register_read_and_write_test(self,
314
- rut: Union[RegAsyncReadOnly,
315
- RegAsyncReadWrite,
316
- RegAsyncWriteOnly],
317
- has_sw_readable: bool,
318
- has_sw_writable: bool) -> None:
320
+ async def _single_register_read_and_write_test(
321
+ self,
322
+ rut: Union[RegAsyncReadOnly, RegAsyncReadWrite, RegAsyncWriteOnly],
323
+ has_sw_readable: bool,
324
+ has_sw_writable: bool) -> None:
319
325
 
320
326
  # the register properties are tested separately so are available to be used here
321
327
 
328
+ await self.__single_register_simulator_read_and_write_test(
329
+ rut=rut,
330
+ has_sw_readable=has_sw_readable,
331
+ has_sw_writable=has_sw_writable)
332
+
322
333
  if has_sw_readable:
323
334
  if not isinstance(rut, (RegAsyncReadOnly, RegAsyncReadWrite)):
324
335
  raise TypeError('Test can not proceed as the rut is not a readable register')
@@ -517,3 +528,364 @@ class AsyncLibTestBase(unittest.IsolatedAsyncioTestCase, CommonTestBase, ABC):
517
528
  read_callback_mock.assert_not_called()
518
529
  write_callback_mock.reset_mock()
519
530
  read_callback_mock.reset_mock()
531
+
532
+ async def __single_register_simulator_read_and_write_test(
533
+ self,
534
+ rut: Union[RegAsyncReadOnly,RegAsyncReadWrite,RegAsyncWriteOnly],
535
+ has_sw_readable: bool,
536
+ has_sw_writable: bool) -> None:
537
+
538
+ sim_register = self.simulator_instance.register_by_full_name(rut.full_inst_name)
539
+
540
+ self.assertIsInstance(sim_register, (SimRegister, SimMemoryRegister))
541
+ register_read_callback = Mock()
542
+ register_write_callback = Mock()
543
+
544
+ if has_sw_readable:
545
+ if not isinstance(rut, (RegAsyncReadOnly, RegAsyncReadWrite)):
546
+ raise TypeError('Test can not proceed as the rut is not a readable register')
547
+ # register read checks
548
+ # update the value via the backdoor in the simulator
549
+ random_value = random_reg_value(rut)
550
+ sim_register.value = random_value
551
+ self.assertEqual(await rut.read(), random_value)
552
+ # up to now the callback should not have been called
553
+ sim_register.read_callback = register_read_callback
554
+ sim_register.write_callback = register_write_callback
555
+ random_value = random_reg_value(rut)
556
+ sim_register.value = random_value
557
+ self.assertEqual(await rut.read(), random_value)
558
+ register_write_callback.assert_not_called()
559
+ register_read_callback.assert_called_once_with(value=random_value)
560
+ register_write_callback.reset_mock()
561
+ register_read_callback.reset_mock()
562
+ sim_register.value = random_value
563
+ sim_register.read_callback = None
564
+ sim_register.write_callback = None
565
+ self.assertEqual(await rut.read(), random_value)
566
+ register_write_callback.assert_not_called()
567
+ register_read_callback.assert_not_called()
568
+
569
+ if has_sw_writable:
570
+ if not isinstance(rut, (RegAsyncWriteOnly, RegAsyncReadWrite)):
571
+ raise TypeError('Test can not proceed as the rut is not a writable register')
572
+ # register write checks
573
+ random_value = random_reg_value(rut)
574
+ await rut.write(random_value)
575
+ self.assertEqual(sim_register.value, random_value)
576
+ # up to now the callback should not have been called
577
+ sim_register.read_callback = register_read_callback
578
+ sim_register.write_callback = register_write_callback
579
+ random_value = random_reg_value(rut)
580
+ await rut.write(random_value)
581
+ self.assertEqual(sim_register.value, random_value)
582
+ register_write_callback.assert_called_once_with(value=random_value)
583
+ register_read_callback.assert_not_called()
584
+ register_write_callback.reset_mock()
585
+ register_read_callback.reset_mock()
586
+ sim_register.read_callback = None
587
+ sim_register.write_callback = None
588
+ random_value = random_reg_value(rut)
589
+ await rut.write(random_value)
590
+ self.assertEqual(sim_register.value, random_value)
591
+ if has_sw_readable:
592
+ if not isinstance(rut, RegAsyncReadWrite):
593
+ raise TypeError('Test can not proceed as the rut is not a read '
594
+ 'and writable register')
595
+ self.assertEqual(await rut.read(), random_value)
596
+
597
+ async def __single_int_field_simulator_read_and_write_test(
598
+ self,
599
+ fut: Union[FieldAsyncReadOnly, FieldAsyncWriteOnly, FieldAsyncReadWrite],
600
+ is_sw_readable: bool,
601
+ is_sw_writable: bool) -> None:
602
+ #pylint:disable=too-many-statements
603
+
604
+ sim_register = self.simulator_instance.register_by_full_name(
605
+ fut.parent_register.full_inst_name)
606
+ self.assertIsInstance(sim_register, (SimRegister, SimMemoryRegister))
607
+ sim_field = self.simulator_instance.field_by_full_name(fut.full_inst_name)
608
+ self.assertIsInstance(sim_field, SimField)
609
+ register_read_callback = Mock()
610
+ register_write_callback = Mock()
611
+ field_read_callback = Mock()
612
+ field_write_callback = Mock()
613
+
614
+ # pylint:disable-next=protected-access
615
+ readable_reg = fut.parent_register._is_readable
616
+
617
+ if is_sw_readable:
618
+ # register read checks
619
+ # update the register value via the backdoor in the simulator
620
+ if not isinstance(fut, (FieldAsyncReadOnly, FieldAsyncReadWrite)):
621
+ raise TypeError('Test can not proceed as the fut is not a readable field')
622
+
623
+ random_field_value = random_int_field_value(fut)
624
+ random_value = reg_value_for_field_read_with_random_base(
625
+ fut=fut,
626
+ field_value=random_field_value)
627
+ sim_register.value = random_value
628
+ self.assertEqual(await fut.read(), random_field_value)
629
+ # update the field value via the backdoor in the simulator
630
+ previous_register_value = random_value
631
+
632
+ random_field_value = random_int_field_value(fut)
633
+ sim_field.value = random_field_value
634
+ random_value = reg_value_for_field_read(
635
+ fut=fut,
636
+ reg_base_value=previous_register_value,
637
+ field_value=random_field_value)
638
+ self.assertEqual(sim_register.value, random_value)
639
+ self.assertEqual(await fut.read(), random_field_value)
640
+ # hook up the callbacks to check they work correctly
641
+ random_field_value = random_int_field_value(fut)
642
+ random_value = reg_value_for_field_read_with_random_base(
643
+ fut=fut,
644
+ field_value=random_field_value)
645
+ sim_register.value = random_value
646
+ sim_register.read_callback = register_read_callback
647
+ sim_register.write_callback = register_write_callback
648
+ sim_field.read_callback = field_read_callback
649
+ sim_field.write_callback = field_write_callback
650
+ self.assertEqual(await fut.read(), random_field_value)
651
+ register_write_callback.assert_not_called()
652
+ register_read_callback.assert_called_once_with(value=random_value)
653
+ field_write_callback.assert_not_called()
654
+ field_read_callback.assert_called_once_with(value=random_field_value)
655
+ # revert the callbacks and check again
656
+ register_write_callback.reset_mock()
657
+ register_read_callback.reset_mock()
658
+ field_write_callback.reset_mock()
659
+ field_read_callback.reset_mock()
660
+ sim_register.read_callback = None
661
+ sim_register.write_callback = None
662
+ sim_field.read_callback = None
663
+ sim_field.write_callback = None
664
+ #random_field_value = random_int_field_value(fut)
665
+ random_value = reg_value_for_field_read_with_random_base(
666
+ fut=fut,
667
+ field_value=random_field_value)
668
+ sim_register.value = random_value
669
+ self.assertEqual(await fut.read(), random_field_value)
670
+ register_write_callback.assert_not_called()
671
+ register_read_callback.assert_not_called()
672
+ field_write_callback.assert_not_called()
673
+ field_read_callback.assert_not_called()
674
+
675
+ if is_sw_writable:
676
+ # register write checks
677
+ # update the register value via the backdoor in the simulator, then perform a field
678
+ # write and make sure it is updated
679
+
680
+ if not isinstance(fut, (FieldAsyncWriteOnly, FieldAsyncReadWrite)):
681
+ raise TypeError('Test can not proceed as the fut is not a writable field')
682
+
683
+ if readable_reg:
684
+ initial_reg_random_value = random_field_parent_reg_value(fut)
685
+ sim_register.value = initial_reg_random_value
686
+ else:
687
+ # if the register is not readable the write assumes the rest of the register is 0
688
+ initial_reg_random_value = 0
689
+
690
+ random_field_value = random_int_field_value(fut)
691
+ sim_field.value = random_field_value
692
+ random_value = reg_value_for_field_read(
693
+ fut=fut,
694
+ reg_base_value=initial_reg_random_value,
695
+ field_value=random_field_value)
696
+ await fut.write(random_field_value)
697
+ self.assertEqual(sim_register.value, random_value)
698
+
699
+ register_write_callback.assert_not_called()
700
+ register_read_callback.assert_not_called()
701
+ field_write_callback.assert_not_called()
702
+ field_read_callback.assert_not_called()
703
+ # hook up the call backs
704
+ sim_register.read_callback = None
705
+ sim_register.write_callback = register_write_callback
706
+ sim_field.read_callback = None
707
+ sim_field.write_callback = field_write_callback
708
+ random_field_value = random_int_field_value(fut)
709
+ await fut.write(random_field_value)
710
+ random_value = reg_value_for_field_read(
711
+ fut=fut,
712
+ reg_base_value=initial_reg_random_value,
713
+ field_value=random_field_value)
714
+ self.assertEqual(sim_register.value, random_value)
715
+ register_write_callback.assert_called_once_with(
716
+ value=random_value)
717
+ field_write_callback.assert_called_once_with(
718
+ value=random_field_value)
719
+ register_read_callback.assert_not_called()
720
+ field_read_callback.assert_not_called()
721
+ # revert the callbacks and check again
722
+ register_write_callback.reset_mock()
723
+ register_read_callback.reset_mock()
724
+ field_write_callback.reset_mock()
725
+ field_read_callback.reset_mock()
726
+ sim_register.write_callback = None
727
+ sim_field.write_callback = None
728
+ random_field_value = random_int_field_value(fut)
729
+ await fut.write(random_field_value)
730
+ random_value = reg_value_for_field_read(
731
+ fut=fut,
732
+ reg_base_value=initial_reg_random_value,
733
+ field_value=random_field_value)
734
+ self.assertEqual(sim_register.value, random_value)
735
+ register_write_callback.assert_not_called()
736
+ register_read_callback.assert_not_called()
737
+ field_write_callback.assert_not_called()
738
+ field_read_callback.assert_not_called()
739
+
740
+ async def __single_enum_field_simulator_read_and_write_test(
741
+ self,
742
+ fut: Union[FieldEnumAsyncReadOnly, FieldEnumAsyncWriteOnly, FieldEnumAsyncReadWrite],
743
+ is_sw_readable: bool,
744
+ is_sw_writable: bool) -> None:
745
+ # pylint:disable=too-many-statements
746
+
747
+ sim_register = self.simulator_instance.register_by_full_name(
748
+ fut.parent_register.full_inst_name)
749
+ self.assertIsInstance(sim_register, (SimRegister, SimMemoryRegister))
750
+ sim_field = self.simulator_instance.field_by_full_name(fut.full_inst_name)
751
+ self.assertIsInstance(sim_field, SimField)
752
+ register_read_callback = Mock()
753
+ register_write_callback = Mock()
754
+ field_read_callback = Mock()
755
+ field_write_callback = Mock()
756
+
757
+ # pylint:disable-next=protected-access
758
+ readable_reg = fut.parent_register._is_readable
759
+
760
+ if is_sw_readable:
761
+ # register read checks
762
+ # update the register value via the backdoor in the simulator
763
+
764
+ if not isinstance(fut, (FieldEnumAsyncReadOnly, FieldEnumAsyncReadWrite)):
765
+ raise TypeError('Test can not proceed as the fut is not a readable field')
766
+
767
+ random_field_value = random_encoded_field_value(fut)
768
+ random_value = reg_value_for_field_read_with_random_base(
769
+ fut=fut,
770
+ field_value=random_field_value.value)
771
+
772
+ sim_register.value = random_value
773
+ self.assertEqual(await fut.read(), random_field_value)
774
+ # update the field value via the backdoor in the simulator
775
+ previous_register_value = random_value
776
+ random_field_value = random_encoded_field_value(fut)
777
+ sim_field.value = random_field_value.value
778
+ random_value = reg_value_for_field_read(
779
+ fut=fut,
780
+ reg_base_value=previous_register_value,
781
+ field_value=random_field_value.value)
782
+ self.assertEqual(sim_register.value, random_value)
783
+ self.assertEqual(await fut.read(), random_field_value)
784
+
785
+
786
+ # hook up the callbacks to check they work correctly
787
+ random_field_value = random_encoded_field_value(fut)
788
+ random_value = reg_value_for_field_read_with_random_base(
789
+ fut=fut,
790
+ field_value=random_field_value.value)
791
+
792
+ sim_register.value = random_value
793
+ sim_register.read_callback = register_read_callback
794
+ sim_register.write_callback = register_write_callback
795
+ sim_field.read_callback = field_read_callback
796
+ sim_field.write_callback = field_write_callback
797
+ self.assertEqual(await fut.read(), random_field_value)
798
+ register_write_callback.assert_not_called()
799
+ register_read_callback.assert_called_once_with(value=random_value)
800
+ field_write_callback.assert_not_called()
801
+ field_read_callback.assert_called_once_with(value=random_field_value.value)
802
+
803
+ # revert the callbacks and check again
804
+ register_write_callback.reset_mock()
805
+ register_read_callback.reset_mock()
806
+ field_write_callback.reset_mock()
807
+ field_read_callback.reset_mock()
808
+ sim_register.read_callback = None
809
+ sim_register.write_callback = None
810
+ sim_field.read_callback = None
811
+ sim_field.write_callback = None
812
+ random_field_value = random_encoded_field_value(fut)
813
+ random_value = reg_value_for_field_read_with_random_base(
814
+ fut=fut,
815
+ field_value=random_field_value.value)
816
+
817
+ sim_register.value = random_value
818
+ self.assertEqual(await fut.read(), random_field_value)
819
+ register_write_callback.assert_not_called()
820
+ register_read_callback.assert_not_called()
821
+ field_write_callback.assert_not_called()
822
+ field_read_callback.assert_not_called()
823
+
824
+
825
+ if is_sw_writable:
826
+ # register write checks
827
+ # update the register value via the backdoor in the simulator, then perform a field
828
+ # write and make sure it is updated
829
+
830
+ if not isinstance(fut, (FieldEnumAsyncWriteOnly, FieldEnumAsyncReadWrite)):
831
+ raise TypeError('Test can not proceed as the fut is not a writable field')
832
+
833
+ if readable_reg:
834
+ initial_reg_random_value = random_field_parent_reg_value(fut)
835
+ sim_register.value = initial_reg_random_value
836
+ else:
837
+ # if the register is not readable the write assumes the rest of the register is 0
838
+ initial_reg_random_value = 0
839
+
840
+
841
+ random_field_value = random_encoded_field_value(fut)
842
+ sim_field.value = random_field_value.value
843
+ random_value = reg_value_for_field_read(
844
+ fut=fut,
845
+ reg_base_value=initial_reg_random_value,
846
+ field_value=random_field_value.value)
847
+ await fut.write(random_field_value)
848
+
849
+
850
+ self.assertEqual(sim_register.value, random_value)
851
+
852
+ register_write_callback.assert_not_called()
853
+ register_read_callback.assert_not_called()
854
+ field_write_callback.assert_not_called()
855
+ field_read_callback.assert_not_called()
856
+ # hook up the call backs
857
+ sim_register.read_callback = None
858
+ sim_register.write_callback = register_write_callback
859
+ sim_field.read_callback = None
860
+ sim_field.write_callback = field_write_callback
861
+ random_field_value = random_encoded_field_value(fut)
862
+ await fut.write(random_field_value)
863
+ random_value = reg_value_for_field_read(
864
+ fut=fut,
865
+ reg_base_value=initial_reg_random_value,
866
+ field_value=random_field_value.value)
867
+ self.assertEqual(sim_register.value, random_value)
868
+ register_write_callback.assert_called_once_with(
869
+ value=random_value)
870
+ field_write_callback.assert_called_once_with(
871
+ value=random_field_value.value)
872
+ register_read_callback.assert_not_called()
873
+ field_read_callback.assert_not_called()
874
+ # revert the callbacks and check again
875
+ register_write_callback.reset_mock()
876
+ register_read_callback.reset_mock()
877
+ field_write_callback.reset_mock()
878
+ field_read_callback.reset_mock()
879
+ sim_register.write_callback = None
880
+ sim_field.write_callback = None
881
+ random_field_value = random_encoded_field_value(fut)
882
+ await fut.write(random_field_value)
883
+ random_value = reg_value_for_field_read(
884
+ fut=fut,
885
+ reg_base_value=initial_reg_random_value,
886
+ field_value=random_field_value.value)
887
+ self.assertEqual(sim_register.value, random_value)
888
+ register_write_callback.assert_not_called()
889
+ register_read_callback.assert_not_called()
890
+ field_write_callback.assert_not_called()
891
+ field_read_callback.assert_not_called()