peakrdl-python 1.1.0__tar.gz → 1.2.0rc1__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-1.1.0 → peakrdl_python-1.2.0rc1}/.github/workflows/action.yaml +12 -5
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/PKG-INFO +11 -2
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/README.md +8 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/api_components.rst +12 -12
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/generated_package.rst +26 -2
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/tranversing_address_map/dumping_register_state_to_json_file.py +2 -2
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/tranversing_address_map/reg_dump.json +15 -15
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/generate_and_test.py +10 -5
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/generate_testcases.py +18 -11
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/__about__.py +1 -1
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/__peakrdl__.py +10 -1
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/exporter.py +23 -10
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/__init__.py +2 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/async_memory.py +0 -1
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/async_register_and_field.py +0 -1
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/base.py +14 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/base_field.py +4 -15
- peakrdl_python-1.2.0rc1/src/peakrdl_python/lib/field_encoding.py +79 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/memory.py +0 -2
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap.py.jinja +56 -42
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_field.py.jinja +8 -5
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_memory.py.jinja +3 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_register.py.jinja +8 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_simulation_tb.py.jinja +20 -10
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_tb.py.jinja +88 -27
- peakrdl_python-1.2.0rc1/src/peakrdl_python/templates/addrmap_universal_property.py.jinja +31 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/baseclass_simulation_tb.py.jinja +3 -3
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/baseclass_tb.py.jinja +15 -15
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/example.py.jinja +1 -1
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/sim_addrmap.py.jinja +6 -6
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python.egg-info/PKG-INFO +11 -2
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python.egg-info/SOURCES.txt +7 -1
- peakrdl_python-1.2.0rc1/tests/testcases/name_desc_all_levels.rdl +61 -0
- peakrdl_python-1.2.0rc1/tests/testcases/reg_name_stress.rdl +32 -0
- peakrdl_python-1.2.0rc1/tests/unit_tests/test_name_desc_export.py +127 -0
- peakrdl_python-1.2.0rc1/tests/unit_tests/test_system_rdl_enum.py +88 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/.gitignore +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/.readthedocs.yaml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/LICENSE +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/MANIFEST.in +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/api.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/command_line.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/conf.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/customisation.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/design_decisions.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/design_tools.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/genindex.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/index.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/installation.rst +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/docs/requirements.txt +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/array_access/array_access.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/array_access/demo_array_access.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/enumerated_fields/demo_enumerated_fields.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/enumerated_fields/enumerated_fields.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/optimised_access/demo_optimised_access.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/optimised_access/demo_optimised_array_access.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/optimised_access/optimised_access.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/optimised_access/optimised_array_access.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/overridden_names/demo_over_ridden_names.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/overridden_names/overridden_names.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/simulating_callbacks/chip_with_a_GPIO.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/simulating_callbacks/flashing_the_LED.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/tranversing_address_map/chip_with_registers.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/tranversing_address_map/reseting_registers.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/tranversing_address_map/writing_register_state_from_json_file.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/user_defined_properties/demo_user_defined_properties.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/user_defined_properties/user_defined_properties.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/why_ral/__init__.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/why_ral/gpio.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/why_ral/with_hal.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/why_ral/with_ral.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/why_ral/without_ral.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/pyproject.toml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/setup.cfg +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/.coveragerc +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/__init__.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/_node_walkers.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/compiler_udp.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/base_register.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/callbacks.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/py.typed +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/register_and_field.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/utility_functions.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/py.typed +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/safe_name_utility.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/__init__.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/_callbacks.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/base.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/dummy_callbacks.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/field.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/memory.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/py.typed +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/register.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/sim_lib/simulator.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/systemrdl_node_utility_functions.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/__init__.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_simulation.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/addrmap_udp_property.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/header.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/header_tb.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/templates/reg_definitions.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python.egg-info/dependency_links.txt +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python.egg-info/entry_points.txt +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python.egg-info/requires.txt +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python.egg-info/top_level.txt +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates/header.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates/header_tb.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates_dynamic/header.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates_dynamic/header_tb.py.jinja +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates_dynamic_toml/header_check.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates_dynamic_toml/peakrdl.toml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates_toml/header_check.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/alternative_templates_toml/peakrdl.toml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/RDLFormatCode_example.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/addr_map.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/all_register_access_types.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/basic.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/block_a.xml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/block_b.xml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/different_array_types.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/enum_example.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/example_issue_106.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/extended_memories.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/extended_sizes_registers_array.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/field_scope.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/field_with_overridden_reset.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/fields_with_HW_write.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/fields_with_reset_values.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/hidden_property.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/memories.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/memories_with_registers.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/msb0_and_lsb0.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/multi_block.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/multifile.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/name_clash.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/overridden_python_name.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/parametrised_readonly_and_readwrite.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/parametrised_top.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/regfile_and_arrays.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/reserved_elements.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/same_but_different_enum.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/signals_definitions_at_various_levels.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/simple.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/simple.xml +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/simulator_test.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/sizes_registers.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/sizes_registers_array.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/user_defined_properties.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/testcases/write_only_enum_with_undefined_reset.rdl +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/unit_tests/__init__.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/unit_tests/simple_components.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/unit_tests/test_array_indexing.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/unit_tests/test_export.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/unit_tests/test_optimised_reg_array.py +0 -0
- {peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/tests/unit_tests/test_reg.py +0 -0
|
@@ -120,6 +120,8 @@ jobs:
|
|
|
120
120
|
python -m pip uninstall peakrdl-python -y
|
|
121
121
|
# peakrdl-ipxact is needed for some of the test cases so is imported by the
|
|
122
122
|
# generate_and_test script
|
|
123
|
+
|
|
124
|
+
PYTHONPATH=/src
|
|
123
125
|
|
|
124
126
|
|
|
125
127
|
# retrieve the example code from the systemRDL compiler
|
|
@@ -132,6 +134,8 @@ jobs:
|
|
|
132
134
|
python -m generate_and_test --RDL_source_file tests/testcases/simulator_test.rdl --root_node simulator_test --async
|
|
133
135
|
|
|
134
136
|
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map
|
|
137
|
+
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map --legacy_block_access
|
|
138
|
+
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map --legacy_enum_type
|
|
135
139
|
|
|
136
140
|
python -m generate_and_test --RDL_source_file tests/testcases/user_defined_properties.rdl --root_node user_defined_properties --udp bool_property_to_include
|
|
137
141
|
python -m generate_and_test --RDL_source_file tests/testcases/user_defined_properties.rdl --root_node user_defined_properties --udp bool_property_to_include enum_property_to_include
|
|
@@ -182,10 +186,16 @@ jobs:
|
|
|
182
186
|
peakrdl python tests/testcases/hidden_property.rdl -o peakrdl_out/raw_async/ --async
|
|
183
187
|
peakrdl python tests/testcases/hidden_property.rdl -o peakrdl_out/raw_async/show_hidden/ --show_hidden --async
|
|
184
188
|
python -m unittest discover -s peakrdl_out/raw_async
|
|
185
|
-
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/
|
|
186
|
-
python -m unittest discover -s peakrdl_out/
|
|
189
|
+
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/raw_legacy_block/ --legacy_block_access
|
|
190
|
+
python -m unittest discover -s peakrdl_out/raw_legacy_block
|
|
187
191
|
|
|
188
192
|
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/no_test/ --skip_test_case_generation
|
|
193
|
+
|
|
194
|
+
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/no_lib/ --skip_library_copy
|
|
195
|
+
python -m unittest discover -s peakrdl_out/no_lib
|
|
196
|
+
|
|
197
|
+
peakrdl python tests/testcases/enum_example.rdl -o peakrdl_out/raw_legacy_enum/ --legacy_enum_type
|
|
198
|
+
python -m unittest discover -s peakrdl_out/raw_legacy_enum
|
|
189
199
|
|
|
190
200
|
# test a TOMl file that passes in overridden templates
|
|
191
201
|
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/simple_user_template/ --peakrdl-cfg tests/alternative_templates_toml/peakrdl.toml
|
|
@@ -193,9 +203,6 @@ jobs:
|
|
|
193
203
|
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/dynamic_user_template/ --peakrdl-cfg tests/alternative_templates_dynamic_toml/peakrdl.toml
|
|
194
204
|
python tests/alternative_templates_dynamic_toml/header_check.py --generated_package_location peakrdl_out/dynamic_user_template/ --top_name basic
|
|
195
205
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
206
|
- name: Check Examples
|
|
200
207
|
run: |
|
|
201
208
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: peakrdl-python
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0rc1
|
|
4
4
|
Summary: Generate Python Register Access Layer (RAL) from SystemRDL
|
|
5
5
|
Author: Keith Brady
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -713,6 +713,7 @@ Requires-Dist: peakrdl; extra == "peakrdl"
|
|
|
713
713
|
Provides-Extra: unit-test
|
|
714
714
|
Requires-Dist: peakrdl; extra == "unit-test"
|
|
715
715
|
Requires-Dist: tomli; python_version < "3.11" and extra == "unit-test"
|
|
716
|
+
Dynamic: license-file
|
|
716
717
|
|
|
717
718
|

|
|
718
719
|
[](https://pypi.org/project/peakrdl-python)
|
|
@@ -736,4 +737,12 @@ Users are encouraged to upgrade in order to avoid this limitation. However, ther
|
|
|
736
737
|
to support users with existing designs, see: _Legacy Block Callback and Block Access_ in the
|
|
737
738
|
documentation
|
|
738
739
|
|
|
740
|
+
## Upgrading from pre 1.2.0
|
|
741
|
+
|
|
742
|
+
Version 1.2 introduced a new way to define the enumerations for the field encoding. This allows
|
|
743
|
+
metadata from the systemRDL to propogate through to the generated code. This may break advanced
|
|
744
|
+
usage of the python enumerations. User are encouraged to use the new feature, however, if there
|
|
745
|
+
are problems with the old enumeation types (based on `IntEnum`) can be used, see
|
|
746
|
+
_Legacy Enumeration Types_ in the documentation
|
|
747
|
+
|
|
739
748
|
|
|
@@ -20,4 +20,12 @@ Users are encouraged to upgrade in order to avoid this limitation. However, ther
|
|
|
20
20
|
to support users with existing designs, see: _Legacy Block Callback and Block Access_ in the
|
|
21
21
|
documentation
|
|
22
22
|
|
|
23
|
+
## Upgrading from pre 1.2.0
|
|
24
|
+
|
|
25
|
+
Version 1.2 introduced a new way to define the enumerations for the field encoding. This allows
|
|
26
|
+
metadata from the systemRDL to propogate through to the generated code. This may break advanced
|
|
27
|
+
usage of the python enumerations. User are encouraged to use the new feature, however, if there
|
|
28
|
+
are problems with the old enumeation types (based on `IntEnum`) can be used, see
|
|
29
|
+
_Legacy Enumeration Types_ in the documentation
|
|
30
|
+
|
|
23
31
|
|
|
@@ -67,27 +67,27 @@ Memories
|
|
|
67
67
|
Registers
|
|
68
68
|
=========
|
|
69
69
|
|
|
70
|
-
.. autoclass:: peakrdl_python.lib.
|
|
70
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.RegReadOnly
|
|
71
71
|
:members:
|
|
72
72
|
:inherited-members:
|
|
73
73
|
|
|
74
|
-
.. autoclass:: peakrdl_python.lib.
|
|
74
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.RegWriteOnly
|
|
75
75
|
:members:
|
|
76
76
|
:inherited-members:
|
|
77
77
|
|
|
78
|
-
.. autoclass:: peakrdl_python.lib.
|
|
78
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.RegReadWrite
|
|
79
79
|
:members:
|
|
80
80
|
:inherited-members:
|
|
81
81
|
|
|
82
|
-
.. autoclass:: peakrdl_python.lib.
|
|
82
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.RegReadOnlyArray
|
|
83
83
|
:members:
|
|
84
84
|
:inherited-members:
|
|
85
85
|
|
|
86
|
-
.. autoclass:: peakrdl_python.lib.
|
|
86
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.RegWriteOnlyArray
|
|
87
87
|
:members:
|
|
88
88
|
:inherited-members:
|
|
89
89
|
|
|
90
|
-
.. autoclass:: peakrdl_python.lib.
|
|
90
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.RegReadWriteArray
|
|
91
91
|
:members:
|
|
92
92
|
:inherited-members:
|
|
93
93
|
|
|
@@ -95,26 +95,26 @@ Register Fields
|
|
|
95
95
|
^^^^^^^^^^^^^^^
|
|
96
96
|
A register will always have fields within it
|
|
97
97
|
|
|
98
|
-
.. autoclass:: peakrdl_python.lib.
|
|
98
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.FieldReadOnly
|
|
99
99
|
:members:
|
|
100
100
|
:inherited-members:
|
|
101
101
|
|
|
102
|
-
.. autoclass:: peakrdl_python.lib.
|
|
102
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.FieldWriteOnly
|
|
103
103
|
:members:
|
|
104
104
|
:inherited-members:
|
|
105
105
|
|
|
106
|
-
.. autoclass:: peakrdl_python.lib.
|
|
106
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.FieldReadWrite
|
|
107
107
|
:members:
|
|
108
108
|
:inherited-members:
|
|
109
109
|
|
|
110
|
-
.. autoclass:: peakrdl_python.lib.
|
|
110
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.FieldEnumReadOnly
|
|
111
111
|
:members:
|
|
112
112
|
:inherited-members:
|
|
113
113
|
|
|
114
|
-
.. autoclass:: peakrdl_python.lib.
|
|
114
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.FieldEnumWriteOnly
|
|
115
115
|
:members:
|
|
116
116
|
:inherited-members:
|
|
117
117
|
|
|
118
|
-
.. autoclass:: peakrdl_python.lib.
|
|
118
|
+
.. autoclass:: peakrdl_python.lib.register_and_field.FieldEnumReadWrite
|
|
119
119
|
:members:
|
|
120
120
|
:inherited-members:
|
|
@@ -20,9 +20,9 @@ will be based on the top level address map name with the package was generated
|
|
|
20
20
|
In the folder structure above:
|
|
21
21
|
|
|
22
22
|
- ``<root_name>.py`` - This is the register access layer code for the design
|
|
23
|
-
- ``lib`` - This is a package of base classes used by the register access layer
|
|
24
23
|
- ``test_<root_name>.py`` - This is a set of autogenerated unittests to verify the register access layer
|
|
25
|
-
|
|
24
|
+
- ``lib`` - This is a package of base classes used by the register access layer (The copy of this can be skipped, see :ref:`skipping-lib-copy`)
|
|
25
|
+
- ``sim_lib`` - This is a package of base classes used by the register access layer simulator (The copy of this can be skipped, see :ref:`skipping-lib-copy`)
|
|
26
26
|
|
|
27
27
|
Running the Unit Tests
|
|
28
28
|
======================
|
|
@@ -134,6 +134,19 @@ Legacy Block Callback and Block Access
|
|
|
134
134
|
* ``NormalCallbackSetLegacy`` for standard python function callbacks
|
|
135
135
|
* ``AsyncCallbackSetLegacy`` for async python function callbacks, these are called from the library using ``await``
|
|
136
136
|
|
|
137
|
+
Legacy Enumeration Types
|
|
138
|
+
------------------------
|
|
139
|
+
|
|
140
|
+
.. versionchanged:: 1.2.0
|
|
141
|
+
|
|
142
|
+
Previous versions of PeakRDL Python used `IntEnum` for the the field encoding. This had a
|
|
143
|
+
limitation that the metadata from the system RDL code, notably the ``name`` and ``desc``
|
|
144
|
+
property could not be included. A new data type for the enumerations was introduced in
|
|
145
|
+
version 1.2.0.
|
|
146
|
+
|
|
147
|
+
There was a small risk this may impact some users code, in the case of advanced usage of the
|
|
148
|
+
enumeration. The old behaviour can be brought back using the ``legacy_enum_type`` build option.
|
|
149
|
+
|
|
137
150
|
|
|
138
151
|
Using the Register Access Layer
|
|
139
152
|
===============================
|
|
@@ -549,3 +562,14 @@ fully described by the systemRDL.
|
|
|
549
562
|
design. It does not simulate the hardware, it is intended as a simple tool for
|
|
550
563
|
development and testing of the python wrappers or code that uses them.
|
|
551
564
|
|
|
565
|
+
.. _skipping-lib-copy:
|
|
566
|
+
|
|
567
|
+
Skipping the Library Copy
|
|
568
|
+
=========================
|
|
569
|
+
|
|
570
|
+
In some cases it may be desirable to skip the copy of the library from the generated pacakge.
|
|
571
|
+
This may be useful in development of PeakRDL-python. It can also be used to avoid distributing
|
|
572
|
+
licensed code.
|
|
573
|
+
|
|
574
|
+
.. warning:: If the libraries are not distributed with the package, it is very important to
|
|
575
|
+
ensure users download the matching version of the PeakRDL-python package to use it
|
|
@@ -7,7 +7,7 @@ from chip_with_registers.sim.chip_with_registers import chip_with_registers_simu
|
|
|
7
7
|
from chip_with_registers.lib import NormalCallbackSet, RegReadOnly, RegReadWrite, \
|
|
8
8
|
MemoryReadOnly, MemoryReadWrite, RegFile, AddressMap, RegReadOnlyArray, RegReadWriteArray, \
|
|
9
9
|
AddressMapArray, RegFileArray, MemoryReadOnlyArray, MemoryReadWriteArray
|
|
10
|
-
|
|
10
|
+
from chip_with_registers.lib import RegisterFieldJSONEncoder
|
|
11
11
|
|
|
12
12
|
class RegisterDumper:
|
|
13
13
|
|
|
@@ -40,7 +40,7 @@ class RegisterDumper:
|
|
|
40
40
|
|
|
41
41
|
"""
|
|
42
42
|
with open(filename, encoding='utf-8', mode='w') as fp:
|
|
43
|
-
json.dump(self.registers, fp, indent=4)
|
|
43
|
+
json.dump(self.registers, fp, indent=4, cls=RegisterFieldJSONEncoder)
|
|
44
44
|
|
|
45
45
|
@staticmethod
|
|
46
46
|
def _process_registers(node: Union[MemoryReadOnly, MemoryReadWrite, RegFile, AddressMap]):
|
{peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/example/tranversing_address_map/reg_dump.json
RENAMED
|
@@ -3,48 +3,48 @@
|
|
|
3
3
|
{
|
|
4
4
|
"single_reg": {
|
|
5
5
|
"first_field": 0,
|
|
6
|
-
"second_field":
|
|
6
|
+
"second_field": "VALUE1"
|
|
7
7
|
},
|
|
8
8
|
"reg_array": [
|
|
9
9
|
{
|
|
10
10
|
"first_field": 0,
|
|
11
|
-
"second_field":
|
|
11
|
+
"second_field": "VALUE1"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"first_field": 0,
|
|
15
|
-
"second_field":
|
|
15
|
+
"second_field": "VALUE1"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"first_field": 0,
|
|
19
|
-
"second_field":
|
|
19
|
+
"second_field": "VALUE1"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"first_field": 0,
|
|
23
|
-
"second_field":
|
|
23
|
+
"second_field": "VALUE1"
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"single_reg": {
|
|
29
29
|
"first_field": 0,
|
|
30
|
-
"second_field":
|
|
30
|
+
"second_field": "VALUE1"
|
|
31
31
|
},
|
|
32
32
|
"reg_array": [
|
|
33
33
|
{
|
|
34
34
|
"first_field": 0,
|
|
35
|
-
"second_field":
|
|
35
|
+
"second_field": "VALUE1"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"first_field": 0,
|
|
39
|
-
"second_field":
|
|
39
|
+
"second_field": "VALUE1"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"first_field": 0,
|
|
43
|
-
"second_field":
|
|
43
|
+
"second_field": "VALUE1"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"first_field": 0,
|
|
47
|
-
"second_field":
|
|
47
|
+
"second_field": "VALUE1"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
50
|
}
|
|
@@ -52,24 +52,24 @@
|
|
|
52
52
|
"single_regfile": {
|
|
53
53
|
"single_reg": {
|
|
54
54
|
"first_field": 0,
|
|
55
|
-
"second_field":
|
|
55
|
+
"second_field": "VALUE1"
|
|
56
56
|
},
|
|
57
57
|
"reg_array": [
|
|
58
58
|
{
|
|
59
59
|
"first_field": 0,
|
|
60
|
-
"second_field":
|
|
60
|
+
"second_field": "VALUE1"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"first_field": 0,
|
|
64
|
-
"second_field":
|
|
64
|
+
"second_field": "VALUE1"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"first_field": 0,
|
|
68
|
-
"second_field":
|
|
68
|
+
"second_field": "VALUE1"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"first_field": 0,
|
|
72
|
-
"second_field":
|
|
72
|
+
"second_field": "VALUE1"
|
|
73
73
|
}
|
|
74
74
|
]
|
|
75
75
|
}
|
|
@@ -23,7 +23,6 @@ the peakrdl command line tool. However, when developing and debugging it is conv
|
|
|
23
23
|
peakrdl and call the exporter directly.
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
import os
|
|
27
26
|
import time
|
|
28
27
|
import argparse
|
|
29
28
|
import pathlib
|
|
@@ -67,14 +66,14 @@ CommandLineParser.add_argument('--suppress_cleanup', action='store_true', dest='
|
|
|
67
66
|
'files found in the directory where the package will be'
|
|
68
67
|
' generated. This is normally useful if the user is '
|
|
69
68
|
'generating over the top of an existing package and prevents '
|
|
70
|
-
'problems when the
|
|
69
|
+
'problems when the structure of the register map changes. '
|
|
71
70
|
'However, if additional python files are added by the user '
|
|
72
71
|
'(not recommended) this cleanup will need to be suppressed '
|
|
73
72
|
'and managed by the user')
|
|
74
73
|
CommandLineParser.add_argument('--copy_libraries', action='store_true', dest='copy_libraries',
|
|
75
74
|
help='by default peakrdl python copies all the libraries over'
|
|
76
75
|
'to the generated package along with the generated code. '
|
|
77
|
-
'However, that is
|
|
76
|
+
'However, that is potentiality problematic when developing'
|
|
78
77
|
'and debugging as multiple copies of the libraries can cause'
|
|
79
78
|
'confusion. Therefore by default this script does not copy '
|
|
80
79
|
'them over.')
|
|
@@ -92,6 +91,11 @@ CommandLineParser.add_argument('--full_inst_file', dest='full_inst_file',
|
|
|
92
91
|
type=pathlib.Path, required=False,
|
|
93
92
|
help='export a text file with a list of the all qualified instance'
|
|
94
93
|
'names in the systemRDL')
|
|
94
|
+
CommandLineParser.add_argument('--legacy_enum_type', action='store_true',
|
|
95
|
+
dest='legacy_enum_type',
|
|
96
|
+
help='peakrdl python has ways to define field encoding as enums a '
|
|
97
|
+
'a new method and an old method based on IntEnum. Setting '
|
|
98
|
+
'this to true will restore the old behaviour')
|
|
95
99
|
|
|
96
100
|
|
|
97
101
|
def build_logging_cong(logfilepath:str):
|
|
@@ -185,7 +189,8 @@ if __name__ == '__main__':
|
|
|
185
189
|
skip_library_copy=not CommandLineArgs.copy_libraries,
|
|
186
190
|
legacy_block_access=CommandLineArgs.legacy_block_access,
|
|
187
191
|
user_defined_properties_to_include=CommandLineArgs.udp,
|
|
188
|
-
hidden_inst_name_regex=CommandLineArgs.hide_regex
|
|
192
|
+
hidden_inst_name_regex=CommandLineArgs.hide_regex,
|
|
193
|
+
legacy_enum_type=CommandLineArgs.legacy_enum_type)
|
|
189
194
|
print(f'generation time {time.time() - start_time}s')
|
|
190
195
|
|
|
191
196
|
if not CommandLineArgs.export_only:
|
|
@@ -210,7 +215,7 @@ if __name__ == '__main__':
|
|
|
210
215
|
peakrdl_python_package = __import__('generate_and_test_output.' + CommandLineArgs.root_node + '.lib',
|
|
211
216
|
globals(), locals(), ['CallbackSet'], 0)
|
|
212
217
|
else:
|
|
213
|
-
peakrdl_python_package = __import__('
|
|
218
|
+
peakrdl_python_package = __import__('peakrdl_python.lib',
|
|
214
219
|
globals(), locals(), ['CallbackSet'], 0)
|
|
215
220
|
|
|
216
221
|
if CommandLineArgs.asyncoutput is True:
|
|
@@ -20,7 +20,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
20
20
|
script to generate all the test cases from the test set
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
import sys
|
|
24
23
|
import os
|
|
25
24
|
|
|
26
25
|
from glob import glob
|
|
@@ -77,7 +76,8 @@ def compile_rdl(infile: str,
|
|
|
77
76
|
def generate(root: Node, outdir: str,
|
|
78
77
|
asyncoutput: bool = False,
|
|
79
78
|
skip_test_case_generation: bool = False,
|
|
80
|
-
legacy_block_access: bool = True
|
|
79
|
+
legacy_block_access: bool = True,
|
|
80
|
+
legacy_enum_type: bool = True) -> List[str]:
|
|
81
81
|
"""
|
|
82
82
|
Generate a PeakRDL output package from compiled systemRDL
|
|
83
83
|
|
|
@@ -88,6 +88,8 @@ def generate(root: Node, outdir: str,
|
|
|
88
88
|
clean it up. This can slow down large jobs or mask problems
|
|
89
89
|
legacy_block_access: If set to True the code build a register model the legacy array block
|
|
90
90
|
access as opposed to the newer list based
|
|
91
|
+
legacy_enum_type: If set to True the code with build with the old style IntEnum rather than
|
|
92
|
+
the new style SystemRDLEnum
|
|
91
93
|
|
|
92
94
|
Returns:
|
|
93
95
|
List of strings with the module names generated
|
|
@@ -97,7 +99,8 @@ def generate(root: Node, outdir: str,
|
|
|
97
99
|
modules = PythonExporter().export(root, outdir, # type: ignore[no-untyped-call]
|
|
98
100
|
asyncoutput=asyncoutput,
|
|
99
101
|
skip_test_case_generation=skip_test_case_generation,
|
|
100
|
-
legacy_block_access=legacy_block_access
|
|
102
|
+
legacy_block_access=legacy_block_access,
|
|
103
|
+
legacy_enum_type=legacy_enum_type)
|
|
101
104
|
|
|
102
105
|
return modules
|
|
103
106
|
|
|
@@ -131,21 +134,25 @@ if __name__ == '__main__':
|
|
|
131
134
|
root = compile_rdl(rdl_file)
|
|
132
135
|
|
|
133
136
|
for build_options, folder_name in \
|
|
134
|
-
[({'asyncoutput': True, '
|
|
135
|
-
({'asyncoutput': False, '
|
|
136
|
-
({'asyncoutput': True, '
|
|
137
|
-
({'asyncoutput': False, '
|
|
137
|
+
[({'asyncoutput': True, 'legacy_block':False, 'legacy_enum': False}, 'raw_async'),
|
|
138
|
+
({'asyncoutput': False, 'legacy_block':False, 'legacy_enum': False}, 'raw'),
|
|
139
|
+
({'asyncoutput': True, 'legacy_block': True, 'legacy_enum': False}, 'raw_async_legacy_block'),
|
|
140
|
+
({'asyncoutput': False, 'legacy_block': True, 'legacy_enum': False}, 'raw_legacy_block'),
|
|
141
|
+
({'asyncoutput': True, 'legacy_block': False, 'legacy_enum': True}, 'raw_async_legacy_enum'),
|
|
142
|
+
({'asyncoutput': False, 'legacy_block': False, 'legacy_enum': True}, 'raw_legacy_enum'),
|
|
143
|
+
({'asyncoutput': True, 'legacy_block': True, 'legacy_enum': True}, 'raw_async_legacy_block_legacy_enum'),
|
|
144
|
+
({'asyncoutput': False, 'legacy_block': True, 'legacy_enum': True}, 'raw_legacy_block_legacy_enum')
|
|
138
145
|
]:
|
|
139
146
|
|
|
140
147
|
# test cases that use the extended widths an not be tested in the non-legacy modes
|
|
141
148
|
if (testcase_name in ['extended_memories', 'extended_sizes_registers_array']) and \
|
|
142
|
-
(build_options['
|
|
149
|
+
(build_options['legacy_block'] is True):
|
|
143
150
|
continue
|
|
144
151
|
|
|
145
152
|
_ = generate(root, str(output_path / folder_name),
|
|
146
153
|
asyncoutput=build_options['asyncoutput'],
|
|
147
|
-
legacy_block_access=build_options['
|
|
148
|
-
)
|
|
154
|
+
legacy_block_access=build_options['legacy_block'],
|
|
155
|
+
legacy_enum_type=build_options['legacy_enum'])
|
|
149
156
|
|
|
150
157
|
module_fqfn = output_path / folder_name / '__init__.py'
|
|
151
158
|
with open(module_fqfn, 'w', encoding='utf-8') as fid:
|
|
@@ -153,4 +160,4 @@ if __name__ == '__main__':
|
|
|
153
160
|
|
|
154
161
|
print("\n-----------------------------------------------------------------\n")
|
|
155
162
|
|
|
156
|
-
print("\tALL TESTS COMPLETED\n")
|
|
163
|
+
print("\tALL TESTS COMPLETED\n")
|
|
@@ -86,6 +86,13 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
86
86
|
arg_group.add_argument('--hide_regex', dest='hide_regex', type=str,
|
|
87
87
|
help='A regex that will cause any matching fully qualified node to '
|
|
88
88
|
'be hidden')
|
|
89
|
+
arg_group.add_argument('--skip_library_copy', action='store_true',
|
|
90
|
+
help='skip the copy of the library code into the generated package')
|
|
91
|
+
arg_group.add_argument('--legacy_enum_type', action='store_true',
|
|
92
|
+
dest='legacy_enum_type',
|
|
93
|
+
help='peakrdl python has two ways to define field encoding as '
|
|
94
|
+
'enums new method and an old method based on IntEnum. '
|
|
95
|
+
'Setting this to true will restore the old behaviour')
|
|
89
96
|
|
|
90
97
|
def do_export(self, top_node: 'AddrmapNode', options: 'argparse.Namespace') -> None:
|
|
91
98
|
"""
|
|
@@ -117,5 +124,7 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
117
124
|
legacy_block_access=options.legacy_block_access,
|
|
118
125
|
show_hidden=options.show_hidden,
|
|
119
126
|
user_defined_properties_to_include=options.udp,
|
|
120
|
-
hidden_inst_name_regex=options.hide_regex
|
|
127
|
+
hidden_inst_name_regex=options.hide_regex,
|
|
128
|
+
skip_library_copy=options.skip_library_copy,
|
|
129
|
+
legacy_enum_type=options.legacy_enum_type
|
|
121
130
|
)
|
|
@@ -300,7 +300,8 @@ class PythonExporter:
|
|
|
300
300
|
asyncoutput: bool,
|
|
301
301
|
legacy_block_access: bool,
|
|
302
302
|
udp_to_include: Optional[list[str]],
|
|
303
|
-
hide_node_func: HideNodeCallback
|
|
303
|
+
hide_node_func: HideNodeCallback,
|
|
304
|
+
legacy_enum_type: bool) -> None:
|
|
304
305
|
|
|
305
306
|
context = {
|
|
306
307
|
'print': print,
|
|
@@ -350,7 +351,8 @@ class PythonExporter:
|
|
|
350
351
|
'dependent_property_enum':
|
|
351
352
|
self._get_dependent_property_enum(node=top_block,
|
|
352
353
|
udp_to_include=udp_to_include),
|
|
353
|
-
'hide_node_func': hide_node_func
|
|
354
|
+
'hide_node_func': hide_node_func,
|
|
355
|
+
'legacy_enum_type': legacy_enum_type
|
|
354
356
|
}
|
|
355
357
|
if legacy_block_access is True:
|
|
356
358
|
context['get_array_typecode'] = get_array_typecode
|
|
@@ -457,7 +459,9 @@ class PythonExporter:
|
|
|
457
459
|
asyncoutput: bool,
|
|
458
460
|
legacy_block_access: bool,
|
|
459
461
|
udp_to_include: Optional[list[str]],
|
|
460
|
-
hide_node_func: HideNodeCallback
|
|
462
|
+
hide_node_func: HideNodeCallback,
|
|
463
|
+
legacy_enum_type: bool
|
|
464
|
+
) -> None:
|
|
461
465
|
"""
|
|
462
466
|
|
|
463
467
|
Args:
|
|
@@ -540,7 +544,8 @@ class PythonExporter:
|
|
|
540
544
|
'dependent_property_enum':
|
|
541
545
|
self._get_dependent_property_enum(node=top_block,
|
|
542
546
|
udp_to_include=udp_to_include),
|
|
543
|
-
'hide_node_func': hide_node_func
|
|
547
|
+
'hide_node_func': hide_node_func,
|
|
548
|
+
'legacy_enum_type': legacy_enum_type
|
|
544
549
|
}
|
|
545
550
|
|
|
546
551
|
self.__stream_jinja_template(template_name="addrmap_tb.py.jinja",
|
|
@@ -570,7 +575,7 @@ class PythonExporter:
|
|
|
570
575
|
raise RuntimeError('It is not permitted to expose a property name used to'
|
|
571
576
|
' build the peakrdl-python wrappers: ' + reserved_name)
|
|
572
577
|
|
|
573
|
-
# pylint: disable-next=too-many-arguments
|
|
578
|
+
# pylint: disable-next=too-many-arguments,too-many-locals
|
|
574
579
|
def export(self, node: Union[RootNode, AddrmapNode], path: str, *,
|
|
575
580
|
asyncoutput: bool = False,
|
|
576
581
|
skip_test_case_generation: bool = False,
|
|
@@ -579,7 +584,8 @@ class PythonExporter:
|
|
|
579
584
|
legacy_block_access: bool = True,
|
|
580
585
|
show_hidden: bool = False,
|
|
581
586
|
user_defined_properties_to_include: Optional[list[str]] = None,
|
|
582
|
-
hidden_inst_name_regex: Optional[str] = None
|
|
587
|
+
hidden_inst_name_regex: Optional[str] = None,
|
|
588
|
+
legacy_enum_type: bool = True) -> str:
|
|
583
589
|
"""
|
|
584
590
|
Generated Python Code and Testbench
|
|
585
591
|
|
|
@@ -594,8 +600,10 @@ class PythonExporter:
|
|
|
594
600
|
operations
|
|
595
601
|
skip_library_copy (bool): skip copy the libraries to the generated package, this is
|
|
596
602
|
useful to turn off when developing peakrdl python to avoid
|
|
597
|
-
editing the wrong copy of the library.
|
|
598
|
-
|
|
603
|
+
editing the wrong copy of the library. It also avoids the
|
|
604
|
+
GPL code being part of the package for distribution,
|
|
605
|
+
However, this means the end-user is responsible for
|
|
606
|
+
installing the libraries.
|
|
599
607
|
legacy_block_access (bool): version 0.8 changed the block access methods from using
|
|
600
608
|
arrays to to lists. This allows memory widths of other
|
|
601
609
|
than 8, 16, 32, 64 to be supported which are legal in
|
|
@@ -613,6 +621,9 @@ class PythonExporter:
|
|
|
613
621
|
hidden_inst_name_regex (str) : A regular expression which will hide any fully
|
|
614
622
|
qualified instance name that matches, set to None to
|
|
615
623
|
for this to have no effect
|
|
624
|
+
legacy_enum_type (bool): version 1.2 introduced a new Enum type that allows system
|
|
625
|
+
rdl ``name`` and ``desc`` properties on field encoding
|
|
626
|
+
to be included. The legacy mode uses python IntEnum.
|
|
616
627
|
|
|
617
628
|
|
|
618
629
|
Returns:
|
|
@@ -668,7 +679,8 @@ class PythonExporter:
|
|
|
668
679
|
skip_lib_copy=skip_library_copy,
|
|
669
680
|
legacy_block_access=legacy_block_access,
|
|
670
681
|
udp_to_include=user_defined_properties_to_include,
|
|
671
|
-
hide_node_func=hide_node_func
|
|
682
|
+
hide_node_func=hide_node_func,
|
|
683
|
+
legacy_enum_type=legacy_enum_type)
|
|
672
684
|
|
|
673
685
|
self.__export_simulator(top_block=top_block, package=package, asyncoutput=asyncoutput,
|
|
674
686
|
skip_lib_copy=skip_library_copy,
|
|
@@ -688,7 +700,8 @@ class PythonExporter:
|
|
|
688
700
|
skip_lib_copy=skip_library_copy,
|
|
689
701
|
legacy_block_access=legacy_block_access,
|
|
690
702
|
udp_to_include=user_defined_properties_to_include,
|
|
691
|
-
hide_node_func=hide_node_func
|
|
703
|
+
hide_node_func=hide_node_func,
|
|
704
|
+
legacy_enum_type=legacy_enum_type)
|
|
692
705
|
|
|
693
706
|
return top_block.inst_name
|
|
694
707
|
|
|
@@ -76,6 +76,8 @@ from .register_and_field import FieldEnumReadOnly
|
|
|
76
76
|
from .register_and_field import FieldEnumWriteOnly
|
|
77
77
|
from .register_and_field import FieldEnumReadWrite
|
|
78
78
|
from .base_field import FieldEnum
|
|
79
|
+
from .field_encoding import SystemRDLEnum, SystemRDLEnumEntry
|
|
80
|
+
from .field_encoding import RegisterFieldJSONEncoder
|
|
79
81
|
|
|
80
82
|
from .async_register_and_field import FieldAsyncReadOnly
|
|
81
83
|
from .async_register_and_field import FieldAsyncWriteOnly
|
|
@@ -70,7 +70,6 @@ class AsyncMemory(BaseMemory, ABC):
|
|
|
70
70
|
Initialise the class
|
|
71
71
|
|
|
72
72
|
Args:
|
|
73
|
-
callbacks: set of callback to be used for accessing the hardware or simulator
|
|
74
73
|
address: address of the register
|
|
75
74
|
width: width of the register in bits
|
|
76
75
|
logger_handle: name to be used logging messages associate with thisobject
|
{peakrdl_python-1.1.0 → peakrdl_python-1.2.0rc1}/src/peakrdl_python/lib/async_register_and_field.py
RENAMED
|
@@ -116,7 +116,6 @@ class RegAsyncReadOnly(AsyncReg, ABC):
|
|
|
116
116
|
class for an async read only register
|
|
117
117
|
|
|
118
118
|
Args:
|
|
119
|
-
callbacks: set of callback to be used for accessing the hardware or simulator
|
|
120
119
|
address: address of the register
|
|
121
120
|
width: width of the register in bits
|
|
122
121
|
accesswidth: minimum access width of the register in bits
|
|
@@ -118,6 +118,20 @@ class Base(ABC):
|
|
|
118
118
|
"""
|
|
119
119
|
return {}
|
|
120
120
|
|
|
121
|
+
@property
|
|
122
|
+
def rdl_name(self) -> Optional[str]:
|
|
123
|
+
"""
|
|
124
|
+
The systemRDL name property for the item
|
|
125
|
+
"""
|
|
126
|
+
return None
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def rdl_desc(self) -> Optional[str]:
|
|
130
|
+
"""
|
|
131
|
+
The systemRDL desc property for the item
|
|
132
|
+
"""
|
|
133
|
+
return None
|
|
134
|
+
|
|
121
135
|
|
|
122
136
|
class Node(Base, ABC):
|
|
123
137
|
"""
|