peakrdl-python 2.2.0__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/PKG-INFO +2 -2
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/pyproject.toml +1 -1
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/__about__.py +1 -1
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/exporter.py +12 -10
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/field.py +91 -40
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/register.py +43 -11
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/simulator.py +2 -2
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/systemrdl_node_utility_functions.py +20 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +2 -2
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +17 -2
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python.egg-info/PKG-INFO +2 -2
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python.egg-info/SOURCES.txt +2 -1
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python.egg-info/requires.txt +1 -1
- peakrdl_python-2.3.0/tests/testcases/overlapping_registers_and_fields.rdl +39 -0
- peakrdl_python-2.3.0/tests/unit_tests/test_sim.py +257 -0
- peakrdl_python-2.2.0/tests/testcases/shared_register_issue_202 +0 -24
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/.github/workflows/action.yaml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/.gitignore +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/.readthedocs.yaml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/LICENSE +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/MANIFEST.in +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/README.md +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/api.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/api_components.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/command_line.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/conf.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/customisation.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/design_decisions.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/design_tools.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/generated_package.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/genindex.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/index.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/installation.rst +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/docs/requirements.txt +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/array_access/array_access.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/array_access/demo_array_access.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/enumerated_fields/demo_enumerated_fields.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/enumerated_fields/enumerated_fields.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/optimised_access/demo_optimised_access.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/optimised_access/demo_optimised_array_access.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/optimised_access/optimised_access.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/optimised_access/optimised_array_access.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/overridden_names/demo_over_ridden_names.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/overridden_names/overridden_names.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/simulating_callbacks/flashing_the_LED.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/tranversing_address_map/dumping_register_state_to_json_file.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/tranversing_address_map/reg_dump.json +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/tranversing_address_map/reseting_registers.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/user_defined_properties/demo_user_defined_properties.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/user_defined_properties/user_defined_properties.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/why_ral/__init__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/why_ral/gpio.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/why_ral/with_hal.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/why_ral/with_ral.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/example/why_ral/without_ral.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/generate_and_test.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/generate_testcases.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/setup.cfg +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/.coveragerc +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/__init__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/__peakrdl__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/_deploy_package.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/_node_walkers.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/class_names.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/compiler_udp.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/__init__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/async_memory.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/async_register_and_field.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/base.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/base_field.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/base_register.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/callbacks.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/field_encoding.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/memory.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/py.typed +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/register_and_field.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/sections.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/lib/utility_functions.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/py.typed +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/safe_name_utility.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/__init__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/_callbacks.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/base.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/dummy_callbacks.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/memory.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/sim_lib/py.typed +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/systemrdl_node_hashes.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/__init__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_field.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_memory.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_register.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_system_rdl_name_mapping.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_tb.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_udp_property.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/addrmap_universal_property.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/baseclass_simulation_tb.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/baseclass_tb.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/child_definitions.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/example.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/field_enums.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/header.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/property_enums.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/templates/template_ultilities.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/unique_component_iterator.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python.egg-info/top_level.txt +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates/header.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates/header_tb.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates_dynamic/header.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates_dynamic/header_tb.py.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates_dynamic_toml/header_check.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates_dynamic_toml/peakrdl.toml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates_toml/header_check.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/alternative_templates_toml/peakrdl.toml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/pathological_register_maps/pathalogical_rdl_builder.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/pathological_register_maps/templates/pathological_template.rdl.jinja +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/RDLFormatCode_example.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/addr_map.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/aliases.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/all_register_access_types.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/basic.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/block_a.xml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/block_b.xml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/deduplicated_field.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/different_array_types.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/enum_example.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/example_issue_106.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/extended_memories.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/extended_sizes_registers_array.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/field_scope.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/field_with_overridden_reset.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/fields_with_HW_write.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/fields_with_reset_values.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/hidden_property.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/large_field_combinations.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/memories.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/memories_with_registers.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/msb0_and_lsb0.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/multi_block.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/multifile.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/name_clash.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/name_desc_all_levels.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/name_desc_option_deduplicate.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/name_desc_stress_test.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/overridden_python_name.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/parametrised_top.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/reg_name_stress.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/regfile_and_arrays.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/reserved_elements.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/same_but_different_enum.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/simple.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/simple.xml +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/simulator_test.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/sizes_registers.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/sizes_registers_array.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/sparse_enum_issue_200.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/user_defined_properties.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/__init__.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/simple_components.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_array_indexing.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_building_inner_addrmap.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_export.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_field.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_name_desc_export.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_optimised_reg_array.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/tests/unit_tests/test_reg.py +0 -0
- {peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/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: 2.
|
|
3
|
+
Version: 2.3.0
|
|
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.
|
|
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"
|
|
@@ -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.
|
|
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
|
|
@@ -46,7 +46,7 @@ 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, simulator_field_definition
|
|
50
50
|
from .unique_component_iterator import UniqueComponents
|
|
51
51
|
from .unique_component_iterator import PeakRDLPythonUniqueRegisterComponents
|
|
52
52
|
from .unique_component_iterator import PeakRDLPythonUniqueMemoryComponents
|
|
@@ -675,16 +675,17 @@ class PythonExporter:
|
|
|
675
675
|
raise TypeError(f'node should be a register, got {type(node)}')
|
|
676
676
|
reg_addr = node.absolute_address
|
|
677
677
|
if reg_addr in reg_dict:
|
|
678
|
+
if not node.has_overlaps:
|
|
679
|
+
raise RuntimeError('A non-overlaping node should not have a duplicate address')
|
|
678
680
|
existing_entry = reg_dict[reg_addr]
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
elif isinstance(existing_entry, RegNode):
|
|
683
|
-
reg_dict[reg_addr] = [existing_entry, node]
|
|
684
|
-
else:
|
|
685
|
-
raise TypeError(f'exiting entry of unexpected type: {type(existing_entry)}')
|
|
681
|
+
if not isinstance(existing_entry, list):
|
|
682
|
+
raise RuntimeError('A overlapping entry should have been made as list')
|
|
683
|
+
existing_entry.append(node)
|
|
686
684
|
else:
|
|
687
|
-
|
|
685
|
+
if node.has_overlaps:
|
|
686
|
+
reg_dict[reg_addr] = [node,]
|
|
687
|
+
else:
|
|
688
|
+
reg_dict[reg_addr] = node
|
|
688
689
|
|
|
689
690
|
|
|
690
691
|
context = {
|
|
@@ -696,7 +697,8 @@ class PythonExporter:
|
|
|
696
697
|
'asyncoutput': asyncoutput,
|
|
697
698
|
'skip_lib_copy': skip_lib_copy,
|
|
698
699
|
'legacy_block_access': legacy_block_access,
|
|
699
|
-
'list': list
|
|
700
|
+
'list': list,
|
|
701
|
+
'simulator_field_definition': simulator_field_definition,
|
|
700
702
|
}
|
|
701
703
|
|
|
702
704
|
module_name = top_block.inst_name
|
|
@@ -20,7 +20,8 @@ peakrdl-python tool. It provides a set of base classes used by the autogenerated
|
|
|
20
20
|
"""
|
|
21
21
|
from dataclasses import dataclass
|
|
22
22
|
from typing import TYPE_CHECKING
|
|
23
|
-
from typing import Optional
|
|
23
|
+
from typing import Optional, Union
|
|
24
|
+
from enum import Enum, auto
|
|
24
25
|
|
|
25
26
|
from ..lib.utility_functions import swap_msb_lsb_ordering
|
|
26
27
|
|
|
@@ -33,19 +34,8 @@ if TYPE_CHECKING:
|
|
|
33
34
|
|
|
34
35
|
# pylint: disable=too-many-instance-attributes,too-many-arguments
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class FieldDefinition:
|
|
39
|
-
"""
|
|
40
|
-
Class for an entry in the list of memories in the simulator
|
|
41
|
-
"""
|
|
42
|
-
high: int
|
|
43
|
-
low: int
|
|
44
|
-
msb: int
|
|
45
|
-
lsb: int
|
|
46
|
-
inst_name: str
|
|
47
|
-
|
|
48
|
-
class Field(Base):
|
|
37
|
+
#pylint:disable-next=too-few-public-methods
|
|
38
|
+
class _FieldBase(Base):
|
|
49
39
|
"""
|
|
50
40
|
class for all fields
|
|
51
41
|
|
|
@@ -58,7 +48,7 @@ class Field(Base):
|
|
|
58
48
|
'__bitmask', '__inverse_bitmask',
|
|
59
49
|
'__msb0', '__lsb0',
|
|
60
50
|
'__parent_register','__parent_width',
|
|
61
|
-
'
|
|
51
|
+
'_read_callback', '_write_callback']
|
|
62
52
|
|
|
63
53
|
def __init__(self, *, low: int, high: int, msb: int, lsb: int,
|
|
64
54
|
parent_register: 'BaseRegister', parent_width: int, inst_name: str):
|
|
@@ -94,30 +84,8 @@ class Field(Base):
|
|
|
94
84
|
parent_max_value = (2 ** parent_width) - 1
|
|
95
85
|
self.__inverse_bitmask = parent_max_value ^ self.__bitmask
|
|
96
86
|
|
|
97
|
-
self.
|
|
98
|
-
self.
|
|
99
|
-
|
|
100
|
-
@property
|
|
101
|
-
def read_callback(self) -> Optional[FieldReadCallback]:
|
|
102
|
-
"""
|
|
103
|
-
Callback made during each read operation
|
|
104
|
-
"""
|
|
105
|
-
return self.__read_callback
|
|
106
|
-
|
|
107
|
-
@read_callback.setter
|
|
108
|
-
def read_callback(self, callback: Optional[FieldReadCallback]) -> None:
|
|
109
|
-
self.__read_callback = callback
|
|
110
|
-
|
|
111
|
-
@property
|
|
112
|
-
def write_callback(self) -> Optional[FieldWriteCallback]:
|
|
113
|
-
"""
|
|
114
|
-
Callback made during each write operation
|
|
115
|
-
"""
|
|
116
|
-
return self.__write_callback
|
|
117
|
-
|
|
118
|
-
@write_callback.setter
|
|
119
|
-
def write_callback(self, callback: Optional[FieldWriteCallback]) -> None:
|
|
120
|
-
self.__write_callback = callback
|
|
87
|
+
self._write_callback: Optional[FieldWriteCallback] = None
|
|
88
|
+
self._read_callback: Optional[FieldReadCallback] = None
|
|
121
89
|
|
|
122
90
|
@property
|
|
123
91
|
def __width(self) -> int:
|
|
@@ -149,6 +117,89 @@ class Field(Base):
|
|
|
149
117
|
self.__parent_register.value = value
|
|
150
118
|
else:
|
|
151
119
|
# do a read, modify write
|
|
152
|
-
reg_value = self.__parent_register.
|
|
120
|
+
reg_value = self.__parent_register.value
|
|
153
121
|
self.__parent_register.value = (reg_value & self.__inverse_bitmask) | \
|
|
154
122
|
(value << self.__low)
|
|
123
|
+
|
|
124
|
+
class ReadOnlyField(_FieldBase):
|
|
125
|
+
"""
|
|
126
|
+
Simulation of a read-only field
|
|
127
|
+
"""
|
|
128
|
+
__slots__: list[str] = []
|
|
129
|
+
|
|
130
|
+
@property
|
|
131
|
+
def read_callback(self) -> Optional[FieldReadCallback]:
|
|
132
|
+
"""
|
|
133
|
+
Callback made during each read operation
|
|
134
|
+
"""
|
|
135
|
+
return self._read_callback
|
|
136
|
+
|
|
137
|
+
@read_callback.setter
|
|
138
|
+
def read_callback(self, callback: Optional[FieldReadCallback]) -> None:
|
|
139
|
+
self._read_callback = callback
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class WriteOnlyField(_FieldBase):
|
|
143
|
+
"""
|
|
144
|
+
Simulation of a write-only field
|
|
145
|
+
"""
|
|
146
|
+
__slots__:list[str] = []
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
@property
|
|
152
|
+
def write_callback(self) -> Optional[FieldWriteCallback]:
|
|
153
|
+
"""
|
|
154
|
+
Callback made during each write operation
|
|
155
|
+
"""
|
|
156
|
+
return self._write_callback
|
|
157
|
+
|
|
158
|
+
@write_callback.setter
|
|
159
|
+
def write_callback(self, callback: Optional[FieldWriteCallback]) -> None:
|
|
160
|
+
self._write_callback = callback
|
|
161
|
+
|
|
162
|
+
class ReadWriteField(ReadOnlyField, WriteOnlyField):
|
|
163
|
+
"""
|
|
164
|
+
Simulation of a read/write field
|
|
165
|
+
"""
|
|
166
|
+
__slots__:list[str] = []
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
Field = Union[ReadOnlyField, WriteOnlyField, ReadWriteField]
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class FieldType(Enum):
|
|
173
|
+
"""
|
|
174
|
+
types of register field to be simulated based on the software access
|
|
175
|
+
"""
|
|
176
|
+
READONLY = auto()
|
|
177
|
+
WRITEONLY = auto()
|
|
178
|
+
READWRITE = auto()
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
_class_type_map: dict[FieldType, Union[type[ReadOnlyField],
|
|
182
|
+
type[WriteOnlyField],
|
|
183
|
+
type[ReadWriteField]]] = {
|
|
184
|
+
FieldType.READONLY: ReadOnlyField,
|
|
185
|
+
FieldType.WRITEONLY: WriteOnlyField,
|
|
186
|
+
FieldType.READWRITE: ReadWriteField}
|
|
187
|
+
|
|
188
|
+
@dataclass
|
|
189
|
+
class FieldDefinition:
|
|
190
|
+
"""
|
|
191
|
+
Class for an entry in the list of memories in the simulator
|
|
192
|
+
"""
|
|
193
|
+
high: int
|
|
194
|
+
low: int
|
|
195
|
+
msb: int
|
|
196
|
+
lsb: int
|
|
197
|
+
inst_name: str
|
|
198
|
+
field_type: FieldType
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def class_type(self) -> Union[type[ReadOnlyField], type[WriteOnlyField], type[ReadWriteField]]:
|
|
202
|
+
"""
|
|
203
|
+
Classtype to be used base on the fieldtype
|
|
204
|
+
"""
|
|
205
|
+
return _class_type_map[self.field_type]
|
|
@@ -19,13 +19,23 @@ This module is intended to distributed as part of automatically generated code b
|
|
|
19
19
|
peakrdl-python tool. It provides a set of base classes used by the autogenerated code
|
|
20
20
|
"""
|
|
21
21
|
from abc import ABC, abstractmethod
|
|
22
|
-
from typing import Optional
|
|
22
|
+
from typing import Optional, Union
|
|
23
|
+
import sys
|
|
24
|
+
from collections.abc import Iterator
|
|
23
25
|
|
|
24
26
|
from .memory import Memory
|
|
25
27
|
from .base import Base
|
|
26
|
-
from .field import FieldDefinition,
|
|
28
|
+
from .field import FieldDefinition, ReadOnlyField, WriteOnlyField, ReadWriteField
|
|
27
29
|
from ._callbacks import RegisterReadCallback,RegisterWriteCallback
|
|
28
30
|
|
|
31
|
+
# pylint: disable=duplicate-code
|
|
32
|
+
if sys.version_info >= (3, 10):
|
|
33
|
+
# type guarding was introduced in python 3.10
|
|
34
|
+
from typing import TypeGuard
|
|
35
|
+
else:
|
|
36
|
+
from typing_extensions import TypeGuard
|
|
37
|
+
# pylint: enable=duplicate-code
|
|
38
|
+
|
|
29
39
|
# pylint: disable=too-many-arguments
|
|
30
40
|
|
|
31
41
|
class BaseRegister(Base, ABC):
|
|
@@ -46,13 +56,13 @@ class BaseRegister(Base, ABC):
|
|
|
46
56
|
self._width = width
|
|
47
57
|
self._readable = readable
|
|
48
58
|
self._writable = writable
|
|
49
|
-
self.fields =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
self.fields = tuple(field_def.class_type(low=field_def.low,
|
|
60
|
+
high=field_def.high,
|
|
61
|
+
msb=field_def.msb,
|
|
62
|
+
lsb=field_def.lsb,
|
|
63
|
+
inst_name=field_def.inst_name,
|
|
64
|
+
parent_register=self,
|
|
65
|
+
parent_width=width) for field_def in fields)
|
|
56
66
|
self.__read_callback: Optional[RegisterReadCallback] = None
|
|
57
67
|
self.__write_callback: Optional[RegisterWriteCallback] = None
|
|
58
68
|
|
|
@@ -85,7 +95,7 @@ class BaseRegister(Base, ABC):
|
|
|
85
95
|
# pylint: disable-next=not-callable
|
|
86
96
|
self.read_callback(value=self.value)
|
|
87
97
|
|
|
88
|
-
for field in self.
|
|
98
|
+
for field in self.readable_fields:
|
|
89
99
|
if field.read_callback is not None:
|
|
90
100
|
field.read_callback(value=field.value)
|
|
91
101
|
|
|
@@ -96,7 +106,7 @@ class BaseRegister(Base, ABC):
|
|
|
96
106
|
# pylint: disable-next=not-callable
|
|
97
107
|
self.write_callback(value=self.value)
|
|
98
108
|
|
|
99
|
-
for field in self.
|
|
109
|
+
for field in self.writable_fields:
|
|
100
110
|
if field.write_callback is not None:
|
|
101
111
|
field.write_callback(value=field.value)
|
|
102
112
|
|
|
@@ -135,6 +145,28 @@ class BaseRegister(Base, ABC):
|
|
|
135
145
|
def value(self, value:int) -> None:
|
|
136
146
|
...
|
|
137
147
|
|
|
148
|
+
@property
|
|
149
|
+
def writable_fields(self) -> Iterator[Union[WriteOnlyField, ReadWriteField]]:
|
|
150
|
+
"""
|
|
151
|
+
Iterator of the Writable fields
|
|
152
|
+
"""
|
|
153
|
+
def is_writable(field: Union[WriteOnlyField, ReadWriteField, ReadOnlyField]) -> \
|
|
154
|
+
TypeGuard[Union[WriteOnlyField, ReadWriteField]]:
|
|
155
|
+
return isinstance(field, (WriteOnlyField, ReadWriteField))
|
|
156
|
+
|
|
157
|
+
return filter(is_writable, self.fields)
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
def readable_fields(self) -> Iterator[Union[ReadOnlyField, ReadWriteField]]:
|
|
161
|
+
"""
|
|
162
|
+
Iterator of the Readable fields
|
|
163
|
+
"""
|
|
164
|
+
def is_readable(field: Union[WriteOnlyField, ReadWriteField, ReadOnlyField]) -> \
|
|
165
|
+
TypeGuard[Union[ReadOnlyField, ReadWriteField]]:
|
|
166
|
+
return isinstance(field, (ReadOnlyField, ReadWriteField))
|
|
167
|
+
|
|
168
|
+
return filter(is_readable, self.fields)
|
|
169
|
+
|
|
138
170
|
|
|
139
171
|
class Register(BaseRegister):
|
|
140
172
|
"""
|
|
@@ -137,8 +137,8 @@ class BaseSimulator(ABC):
|
|
|
137
137
|
return memory_entry
|
|
138
138
|
|
|
139
139
|
def _read(self, addr: int,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
width: int, # pylint: disable=unused-argument
|
|
141
|
+
accesswidth: int) -> int: # pylint: disable=unused-argument
|
|
142
142
|
"""
|
|
143
143
|
function to simulate a device read, this needs to match the protocol for the callbacks
|
|
144
144
|
"""
|
{peakrdl_python-2.2.0 → peakrdl_python-2.3.0}/src/peakrdl_python/systemrdl_node_utility_functions.py
RENAMED
|
@@ -35,6 +35,7 @@ from systemrdl.node import SignalNode
|
|
|
35
35
|
from systemrdl.rdltypes.user_enum import UserEnumMeta
|
|
36
36
|
|
|
37
37
|
from .lib.utility_functions import calculate_bitmask
|
|
38
|
+
from .sim_lib.field import FieldType
|
|
38
39
|
|
|
39
40
|
class HideNodeCallback(Protocol):
|
|
40
41
|
"""
|
|
@@ -480,3 +481,22 @@ def full_slice_accessor(node: AddressableNode) -> str:
|
|
|
480
481
|
if dimensions is None:
|
|
481
482
|
raise RuntimeError('array node should have dimensions')
|
|
482
483
|
return '[' + ','.join([':' for _ in range(len(dimensions))]) + ']'
|
|
484
|
+
|
|
485
|
+
def simulator_field_definition(node: FieldNode) -> str:
|
|
486
|
+
"""
|
|
487
|
+
Based on whether the field is readable and/or writeable, returns the value of the FieldType
|
|
488
|
+
to use
|
|
489
|
+
"""
|
|
490
|
+
if not isinstance(node, FieldNode):
|
|
491
|
+
raise TypeError(f'This should only be called on an FieldNode, got {type(node)}')
|
|
492
|
+
|
|
493
|
+
if node.is_sw_readable and node.is_sw_writable:
|
|
494
|
+
return FieldType.READWRITE.name
|
|
495
|
+
|
|
496
|
+
if node.is_sw_readable and not node.is_sw_writable:
|
|
497
|
+
return FieldType.READONLY.name
|
|
498
|
+
|
|
499
|
+
if not node.is_sw_readable and node.is_sw_writable:
|
|
500
|
+
return FieldType.WRITEONLY.name
|
|
501
|
+
|
|
502
|
+
raise RuntimeError('Encountered a field node that was neither readable or writable')
|
|
@@ -27,7 +27,7 @@ from typing import Union
|
|
|
27
27
|
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.register import Register, MemoryRegister
|
|
28
28
|
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.memory import Memory
|
|
29
29
|
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.simulator import MemoryEntry
|
|
30
|
-
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.field import FieldDefinition
|
|
30
|
+
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.field import FieldDefinition, FieldType
|
|
31
31
|
{% if asyncoutput -%}
|
|
32
32
|
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.simulator import AsyncSimulator{% if legacy_block_access %}Legacy{% endif %} as Simulator{% if legacy_block_access %}Legacy{% endif %}
|
|
33
33
|
{% else %}
|
|
@@ -39,7 +39,7 @@ from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.simulator import Simulator{%
|
|
|
39
39
|
fields=[
|
|
40
40
|
|
|
41
41
|
{%- for field in node.fields() -%}
|
|
42
|
-
FieldDefinition(high={{field.high}}, low={{field.low}}, msb={{field.msb}}, lsb={{field.lsb}}, inst_name='{{field.inst_name}}'),
|
|
42
|
+
FieldDefinition(high={{field.high}}, low={{field.low}}, msb={{field.msb}}, lsb={{field.lsb}}, inst_name='{{field.inst_name}}', field_type=FieldType.{{simulator_field_definition(field)}}),
|
|
43
43
|
{%- endfor %}
|
|
44
44
|
])
|
|
45
45
|
{%- endmacro %}
|
|
@@ -40,7 +40,7 @@ from enum import IntEnum
|
|
|
40
40
|
{% endif %}
|
|
41
41
|
|
|
42
42
|
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.register import Register,MemoryRegister
|
|
43
|
-
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.field import
|
|
43
|
+
from {{ peakrdl_python_sim_lib(depth=lib_depth) }}.field import ReadOnlyField, WriteOnlyField, ReadWriteField
|
|
44
44
|
|
|
45
45
|
from ._{{top_node.inst_name}}_sim_test_base import {{top_node.inst_name}}_SimTestCase, {{top_node.inst_name}}_SimTestCase_BlockAccess
|
|
46
46
|
from ._{{top_node.inst_name}}_sim_test_base import __name__ as base_name
|
|
@@ -129,7 +129,16 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_SimTestCase): # typ
|
|
|
129
129
|
sim_register = self.sim.register_by_full_name('{{'.'.join(node.parent.get_path_segments())}}')
|
|
130
130
|
self.assertIsInstance(sim_register, (Register,MemoryRegister))
|
|
131
131
|
sim_field = self.sim.field_by_full_name('{{'.'.join(node.get_path_segments())}}')
|
|
132
|
-
|
|
132
|
+
{% if node.is_sw_readable and node.is_sw_writable -%}
|
|
133
|
+
if not isinstance(sim_field, ReadWriteField):
|
|
134
|
+
raise TypeError(f'should be a simulated read/write field got {type(sim_field)}')
|
|
135
|
+
{% elif node.is_sw_readable and not node.is_sw_writable -%}
|
|
136
|
+
if not isinstance(sim_field, ReadOnlyField):
|
|
137
|
+
raise TypeError(f'should be a simulated read/write field got {type(sim_field)}')
|
|
138
|
+
{% elif not node.is_sw_readable and node.is_sw_writable -%}
|
|
139
|
+
if not isinstance(sim_field, WriteOnlyField):
|
|
140
|
+
raise TypeError(f'should be a simulated read/write field got {type(sim_field)}')
|
|
141
|
+
{% endif %}
|
|
133
142
|
register_read_callback = Mock()
|
|
134
143
|
register_write_callback = Mock()
|
|
135
144
|
field_read_callback = Mock()
|
|
@@ -178,7 +187,9 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_SimTestCase): # typ
|
|
|
178
187
|
sim_register.read_callback = register_read_callback
|
|
179
188
|
sim_register.write_callback = register_write_callback
|
|
180
189
|
sim_field.read_callback = field_read_callback
|
|
190
|
+
{% if node.is_sw_writable -%}
|
|
181
191
|
sim_field.write_callback = field_write_callback
|
|
192
|
+
{% endif %}
|
|
182
193
|
self.assertEqual({% if asyncoutput %}await {%endif %}self.dut.{{'.'.join(get_python_path_segments(node))}}.read(), random_field_value)
|
|
183
194
|
register_write_callback.assert_not_called()
|
|
184
195
|
register_read_callback.assert_called_once_with(value=random_value)
|
|
@@ -196,7 +207,9 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_SimTestCase): # typ
|
|
|
196
207
|
sim_register.read_callback = None
|
|
197
208
|
sim_register.write_callback = None
|
|
198
209
|
sim_field.read_callback = None
|
|
210
|
+
{% if node.is_sw_writable -%}
|
|
199
211
|
sim_field.write_callback = None
|
|
212
|
+
{% endif %}
|
|
200
213
|
{%- if 'encode' in node.list_properties() %}
|
|
201
214
|
random_field_value = random_enum_reg_value(self.dut.{{'.'.join(get_python_path_segments(node))}}.enum_cls)
|
|
202
215
|
random_value = (random.randrange(0, {{get_reg_max_value_hex_string(node.parent)}}+1) & {{get_field_inv_bitmask_hex_string(node)}}) | ({% if node.msb == node.high %}random_field_value.value{% else %}self._reverse_bits(value=random_field_value.value, number_bits={{node.width}}){% endif %} << {{node.low}})
|
|
@@ -245,7 +258,9 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_SimTestCase): # typ
|
|
|
245
258
|
# hook up the call backs
|
|
246
259
|
sim_register.read_callback = None
|
|
247
260
|
sim_register.write_callback = register_write_callback
|
|
261
|
+
{% if node.is_sw_readable -%}
|
|
248
262
|
sim_field.read_callback = None
|
|
263
|
+
{% endif %}
|
|
249
264
|
sim_field.write_callback = field_write_callback
|
|
250
265
|
{%- if 'encode' in node.list_properties() %}
|
|
251
266
|
random_field_value = random_enum_reg_value(self.dut.{{'.'.join(get_python_path_segments(node))}}.enum_cls)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: peakrdl-python
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
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.
|
|
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"
|
|
@@ -144,6 +144,7 @@ tests/testcases/name_clash.rdl
|
|
|
144
144
|
tests/testcases/name_desc_all_levels.rdl
|
|
145
145
|
tests/testcases/name_desc_option_deduplicate.rdl
|
|
146
146
|
tests/testcases/name_desc_stress_test.rdl
|
|
147
|
+
tests/testcases/overlapping_registers_and_fields.rdl
|
|
147
148
|
tests/testcases/overridden_python_name.rdl
|
|
148
149
|
tests/testcases/parametrised_readonly_and_readwrite.rdl
|
|
149
150
|
tests/testcases/parametrised_top.rdl
|
|
@@ -151,7 +152,6 @@ tests/testcases/reg_name_stress.rdl
|
|
|
151
152
|
tests/testcases/regfile_and_arrays.rdl
|
|
152
153
|
tests/testcases/reserved_elements.rdl
|
|
153
154
|
tests/testcases/same_but_different_enum.rdl
|
|
154
|
-
tests/testcases/shared_register_issue_202
|
|
155
155
|
tests/testcases/signals_definitions_at_various_levels.rdl
|
|
156
156
|
tests/testcases/simple.rdl
|
|
157
157
|
tests/testcases/simple.xml
|
|
@@ -170,4 +170,5 @@ tests/unit_tests/test_field.py
|
|
|
170
170
|
tests/unit_tests/test_name_desc_export.py
|
|
171
171
|
tests/unit_tests/test_optimised_reg_array.py
|
|
172
172
|
tests/unit_tests/test_reg.py
|
|
173
|
+
tests/unit_tests/test_sim.py
|
|
173
174
|
tests/unit_tests/test_system_rdl_enum.py
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This test was introduced as part of #202 to resolve issues with overlapping registers at the
|
|
3
|
+
same address. It was extended in #255
|
|
4
|
+
*/
|
|
5
|
+
addrmap overlapping_registers_and_fields {
|
|
6
|
+
|
|
7
|
+
reg {
|
|
8
|
+
field { fieldwidth=1; sw=rw; } enable;
|
|
9
|
+
} control ;
|
|
10
|
+
|
|
11
|
+
reg {
|
|
12
|
+
field { fieldwidth=16; sw=w; hw=r; } data;
|
|
13
|
+
} tx @ 4;
|
|
14
|
+
|
|
15
|
+
reg {
|
|
16
|
+
field { fieldwidth=16; sw=r; hw=w; } data;
|
|
17
|
+
} rx @ 4;
|
|
18
|
+
|
|
19
|
+
reg {
|
|
20
|
+
field { fieldwidth=8; sw=r; hw=w; } count;
|
|
21
|
+
} rx_fifo_fill;
|
|
22
|
+
|
|
23
|
+
reg {
|
|
24
|
+
field { fieldwidth=8; sw=r; hw=w; } count;
|
|
25
|
+
} tx_fifo_fill;
|
|
26
|
+
|
|
27
|
+
reg {
|
|
28
|
+
field {sw = r;} ro_field[15:0];
|
|
29
|
+
field {sw = w;} wo_field[15:0];
|
|
30
|
+
} overlapping_single_reg;
|
|
31
|
+
|
|
32
|
+
reg {
|
|
33
|
+
field {sw = r;} ro_field[15:0];
|
|
34
|
+
field {sw = w;} wo_field[15:0];
|
|
35
|
+
field {sw = rw;} rw_field[31:16];
|
|
36
|
+
} mixed_overlapping_and_noneoverlapping;
|
|
37
|
+
|
|
38
|
+
};
|
|
39
|
+
|