odxtools 10.1.0__py3-none-any.whl → 10.2.0__py3-none-any.whl

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 (107) hide show
  1. odxtools/addrdeffilter.py +33 -0
  2. odxtools/addrdefphyssegment.py +33 -0
  3. odxtools/checksum.py +67 -0
  4. odxtools/checksumresult.py +7 -0
  5. odxtools/cli/compare.py +143 -170
  6. odxtools/database.py +24 -4
  7. odxtools/datablock.py +153 -0
  8. odxtools/datafile.py +23 -0
  9. odxtools/dataformat.py +39 -0
  10. odxtools/dataformatselection.py +9 -0
  11. odxtools/description.py +2 -5
  12. odxtools/diagdatadictionaryspec.py +1 -3
  13. odxtools/direction.py +7 -0
  14. odxtools/ecumem.py +71 -0
  15. odxtools/ecumemconnector.py +136 -0
  16. odxtools/encryptcompressmethod.py +39 -0
  17. odxtools/encryptcompressmethodtype.py +13 -0
  18. odxtools/expectedident.py +40 -0
  19. odxtools/externflashdata.py +34 -0
  20. odxtools/filter.py +32 -0
  21. odxtools/flash.py +88 -0
  22. odxtools/flashclass.py +32 -0
  23. odxtools/flashdata.py +70 -0
  24. odxtools/fwchecksum.py +7 -0
  25. odxtools/fwsignature.py +7 -0
  26. odxtools/identdesc.py +54 -0
  27. odxtools/identvalue.py +32 -0
  28. odxtools/identvaluetype.py +14 -0
  29. odxtools/internflashdata.py +33 -0
  30. odxtools/loadfile.py +1 -1
  31. odxtools/mem.py +80 -0
  32. odxtools/modification.py +3 -2
  33. odxtools/negoffset.py +21 -0
  34. odxtools/ownident.py +38 -0
  35. odxtools/physicaltype.py +12 -10
  36. odxtools/physmem.py +52 -0
  37. odxtools/physsegment.py +42 -0
  38. odxtools/posoffset.py +21 -0
  39. odxtools/security.py +42 -0
  40. odxtools/securitymethod.py +7 -0
  41. odxtools/segment.py +63 -0
  42. odxtools/session.py +88 -0
  43. odxtools/sessiondesc.py +101 -0
  44. odxtools/sessionsubelemtype.py +14 -0
  45. odxtools/sizedeffilter.py +33 -0
  46. odxtools/sizedefphyssegment.py +33 -0
  47. odxtools/specialdata.py +2 -1
  48. odxtools/targetaddroffset.py +13 -0
  49. odxtools/templates/comparam-spec.odx-c.xml.jinja2 +1 -0
  50. odxtools/templates/comparam-subset.odx-cs.xml.jinja2 +1 -0
  51. odxtools/templates/diag_layer_container.odx-d.xml.jinja2 +2 -1
  52. odxtools/templates/flash.odx-f.xml.jinja2 +42 -0
  53. odxtools/templates/macros/printAdminData.xml.jinja2 +4 -4
  54. odxtools/templates/macros/printAudience.xml.jinja2 +3 -3
  55. odxtools/templates/macros/printChecksum.xml.jinja2 +36 -0
  56. odxtools/templates/macros/printComparam.xml.jinja2 +1 -1
  57. odxtools/templates/macros/printComparamRef.xml.jinja2 +1 -3
  58. odxtools/templates/macros/printCompuMethod.xml.jinja2 +1 -1
  59. odxtools/templates/macros/printDOP.xml.jinja2 +3 -3
  60. odxtools/templates/macros/printDatablock.xml.jinja2 +78 -0
  61. odxtools/templates/macros/printDiagComm.xml.jinja2 +2 -2
  62. odxtools/templates/macros/printDiagLayer.xml.jinja2 +2 -1
  63. odxtools/templates/macros/printDiagVariable.xml.jinja2 +4 -4
  64. odxtools/templates/macros/printDynDefinedSpec.xml.jinja2 +3 -3
  65. odxtools/templates/macros/printDynamicEndmarkerField.xml.jinja2 +2 -2
  66. odxtools/templates/macros/printDynamicLengthField.xml.jinja2 +2 -2
  67. odxtools/templates/macros/printEcuMem.xml.jinja2 +24 -0
  68. odxtools/templates/macros/printEcuMemConnector.xml.jinja2 +58 -0
  69. odxtools/templates/macros/printEndOfPdu.xml.jinja2 +1 -1
  70. odxtools/templates/macros/printEnvDataDesc.xml.jinja2 +1 -1
  71. odxtools/templates/macros/printExpectedIdent.xml.jinja2 +21 -0
  72. odxtools/templates/macros/printFlashdata.xml.jinja2 +43 -0
  73. odxtools/templates/macros/printIdentDesc.xml.jinja2 +17 -0
  74. odxtools/templates/macros/printMem.xml.jinja2 +35 -0
  75. odxtools/templates/macros/printMux.xml.jinja2 +3 -3
  76. odxtools/templates/macros/printOdxCategory.xml.jinja2 +4 -4
  77. odxtools/templates/macros/printOwnIdent.xml.jinja2 +17 -0
  78. odxtools/templates/macros/printParam.xml.jinja2 +4 -4
  79. odxtools/templates/macros/printParentRef.xml.jinja2 +1 -5
  80. odxtools/templates/macros/printPhysMem.xml.jinja2 +20 -0
  81. odxtools/templates/macros/printPhysSegment.xml.jinja2 +33 -0
  82. odxtools/templates/macros/printPreConditionStateRef.xml.jinja2 +1 -1
  83. odxtools/templates/macros/printProtStack.xml.jinja2 +1 -1
  84. odxtools/templates/macros/printProtocol.xml.jinja2 +1 -1
  85. odxtools/templates/macros/printSecurity.xml.jinja2 +37 -0
  86. odxtools/templates/macros/printSegment.xml.jinja2 +31 -0
  87. odxtools/templates/macros/printService.xml.jinja2 +3 -3
  88. odxtools/templates/macros/printSession.xml.jinja2 +45 -0
  89. odxtools/templates/macros/printSessionDesc.xml.jinja2 +40 -0
  90. odxtools/templates/macros/printSingleEcuJob.xml.jinja2 +3 -3
  91. odxtools/templates/macros/printSpecialData.xml.jinja2 +2 -2
  92. odxtools/templates/macros/printStateTransitionRef.xml.jinja2 +1 -1
  93. odxtools/templates/macros/printStaticField.xml.jinja2 +1 -1
  94. odxtools/templates/macros/printSubComponent.xml.jinja2 +3 -3
  95. odxtools/templates/macros/printTable.xml.jinja2 +6 -6
  96. odxtools/templates/macros/printUnitSpec.xml.jinja2 +2 -2
  97. odxtools/text.py +2 -6
  98. odxtools/utils.py +22 -1
  99. odxtools/validityfor.py +30 -0
  100. odxtools/version.py +2 -2
  101. odxtools/writepdxfile.py +70 -21
  102. {odxtools-10.1.0.dist-info → odxtools-10.2.0.dist-info}/METADATA +1 -1
  103. {odxtools-10.1.0.dist-info → odxtools-10.2.0.dist-info}/RECORD +107 -50
  104. {odxtools-10.1.0.dist-info → odxtools-10.2.0.dist-info}/WHEEL +1 -1
  105. {odxtools-10.1.0.dist-info → odxtools-10.2.0.dist-info}/entry_points.txt +0 -0
  106. {odxtools-10.1.0.dist-info → odxtools-10.2.0.dist-info}/licenses/LICENSE +0 -0
  107. {odxtools-10.1.0.dist-info → odxtools-10.2.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,36 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
7
+
8
+ {%- macro printChecksum(checksum) -%}
9
+ <CHECKSUM {{-peid.printElementIdAttribs(checksum)|indent(2) }}{# -#}>
10
+ {{ peid.printElementIdSubtags(checksum)|indent(2) }}
11
+ {%- if checksum.fillbyte is not none %}
12
+ {%- set num_nibbles = (checksum.fillbyte.bit_length() + 7) // 8 * 2 %}
13
+ <FILLBYTE>{{ ("%%0%dX" | format(num_nibbles | int)) | format(checksum.fillbyte | int) }}</FILLBYTE>
14
+ {%- endif %}
15
+ {%- set num_nibbles = (checksum.source_start_address.bit_length() + 7) // 8 * 2 %}
16
+ <SOURCE-START-ADDRESS>{{ ("%%0%dX" | format(num_nibbles | int)) | format(checksum.source_start_address | int) }}</SOURCE-START-ADDRESS>
17
+ {%- if checksum.compressed_size is not none %}
18
+ <COMPRESSED-SIZE>{{ checksum.compressed_size }}</COMPRESSED-SIZE>
19
+ {%- endif %}
20
+ {%- if checksum.checksum_alg is not none %}
21
+ <CHECKSUM-ALG>{{checksum.checksum_alg}}</CHECKSUM-ALG>
22
+ {%- endif %}
23
+ {%- if checksum.source_end_address is not none %}
24
+ {%- set num_nibbles = (checksum.source_end_address.bit_length() + 7) // 8 * 2 %}
25
+ <SOURCE-END-ADDRESS>{{ ("%%0%dX" | format(num_nibbles | int)) | format(checksum.source_end_address | int) }}</SOURCE-END-ADDRESS>
26
+ {%- endif %}
27
+ {%- if checksum.uncompressed_size is not none %}
28
+ <UNCOMPRESSED-SIZE>{{ checksum.uncompressed_size }}</UNCOMPRESSED-SIZE>
29
+ {%- endif %}
30
+ <CHECKSUM-RESULT
31
+ {%- if checksum.checksum_result.value_type is not none %}
32
+ {#- #} TYPE="{{ checksum.checksum_result.value_type.value }}"
33
+ {%- endif %}
34
+ {#- #}>{{checksum.checksum_result.value}}</CHECKSUM-RESULT>
35
+ </CHECKSUM>
36
+ {%- endmacro -%}
@@ -45,7 +45,7 @@
45
45
  CPUSAGE="{{cp.cpusage.value}}">
46
46
  {{ peid.printElementIdSubtags(cp)|indent(1) }}
47
47
  <PHYSICAL-DEFAULT-VALUE>{{cp.physical_default_value_raw}}</PHYSICAL-DEFAULT-VALUE>
48
- <DATA-OBJECT-PROP-REF ID-REF="{{cp.dop_ref.ref_id}}" />
48
+ <DATA-OBJECT-PROP-REF {{make_ref_attribs(cp.dop_ref)}} />
49
49
  </COMPARAM>
50
50
  {%- endmacro %}
51
51
 
@@ -7,9 +7,7 @@
7
7
  {#- -#}
8
8
 
9
9
  {%- macro printComparamRef(cp) %}
10
- <COMPARAM-REF ID-REF="{{cp.spec_ref.ref_id}}"
11
- DOCREF="{{cp.spec_ref.ref_docs[0].doc_name}}"
12
- DOCTYPE="COMPARAM-SUBSET">
10
+ <COMPARAM-REF {{make_ref_attribs(cp.spec_ref)}}>
13
11
  {%- if cp.value is string %}
14
12
  <SIMPLE-VALUE>{{cp.value}}</SIMPLE-VALUE>
15
13
  {{ pd.printDescription(cp.description) }}
@@ -103,7 +103,7 @@
103
103
  {%- if pc.library_refs %}
104
104
  <LIBRARY-REFS>
105
105
  {%- for libref in pc.library_refs %}
106
- <LIBRARY-REF ID-REF="{{libref.ref_id}}" />
106
+ <LIBRARY-REF {{make_ref_attribs(libref)}} />
107
107
  {%- endfor %}
108
108
  </LIBRARY-REFS>
109
109
  {%- endif %}
@@ -113,7 +113,7 @@
113
113
  {{- printInternalConstr(dop.internal_constr, False)|indent(1) }}
114
114
  {%- endif %}
115
115
  {%- if dop.unit_ref %}
116
- <UNIT-REF ID-REF="{{ dop.unit_ref.ref_id }}" />
116
+ <UNIT-REF {{make_ref_attribs(dop.unit_ref)}} />
117
117
  {%- endif %}
118
118
  {%- if dop.physical_constr %}
119
119
  {{- printInternalConstr(dop.internal_constr, True)|indent(1) }}
@@ -131,7 +131,7 @@
131
131
  <DTCS>
132
132
  {%- for dtc in dop.dtcs_raw %}
133
133
  {%- if hasattr(dtc, "ref_id") %}
134
- <DTC-REF ID-REF="{{dtc.ref_id}}" />
134
+ <DTC-REF {{make_ref_attribs(dtc)}} />
135
135
  {%- else %}
136
136
  <DTC {{-peid.printElementIdAttribs(dtc)}}>
137
137
  <SHORT-NAME>{{dtc.short_name}}</SHORT-NAME>
@@ -159,7 +159,7 @@
159
159
  {%- endfor %}
160
160
  </NOT-INHERITED-DTC-SNREFS>
161
161
  {%- endif %}
162
- <DTC-DOP-REF ID-REF="{{linked_dtc_dop.dtc_dop_ref.ref_id}}" />
162
+ <DTC-DOP-REF {{make_ref_attribs(linked_dtc_dop.dtc_dop_ref)}} />
163
163
  </LINKED-DTC-DOP>
164
164
  {%- endfor %}
165
165
  </LINKED-DTC-DOPS>
@@ -0,0 +1,78 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
7
+ {%- import('macros/printOwnIdent.xml.jinja2') as poi %}
8
+ {%- import('macros/printSecurity.xml.jinja2') as psec %}
9
+ {%- import('macros/printSegment.xml.jinja2') as pseg %}
10
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
11
+
12
+ {%- macro printDatablock(datablock) -%}
13
+ <DATABLOCK {{peid.printElementIdAttribs(datablock)}} TYPE="{{datablock.data_type}}">
14
+ {{ peid.printElementIdSubtags(datablock)|indent(1) }}
15
+ {%- if datablock.logical_block_index is not none %}
16
+ {%- set num_nibbles = (datablock.logical_block_index.bit_length() + 7) // 8 * 2 %}
17
+ <LOGICAL-BLOCK-INDEX>{{("%%0%dX" | format(num_nibbles | int)) | format(datablock.logical_block_index | int)}}</LOGICAL-BLOCK-INDEX>
18
+ {%- endif %}
19
+ {%- if datablock.flashdata_ref is not none %}
20
+ <FLASHDATA-REF {{make_ref_attribs(datablock.flashdata_ref)}} />
21
+ {%- endif %}
22
+ {%- if datablock.filters %}
23
+ <FILTERS>
24
+ {%- for filter in datablock.filters %}
25
+ {%- if filter.filter_end %}
26
+ <FILTER xsi:type="ADDRDEF-FILTER">
27
+ {%- set num_nibbles = (filter.filter_start.bit_length() + 7) // 8 * 2 %}
28
+ <FILTER-START>{{ ("%%0%dX" | format(num_nibbles | int)) | format(filter.filter_start | int) }}</FILTER-START>
29
+ {%- set num_nibbles = (filter.filter_end.bit_length() + 7) // 8 * 2 %}
30
+ <FILTER-END>{{ ("%%0%dX" | format(num_nibbles | int)) | format(filter.filter_end | int) }}</FILTER-END>
31
+ </FILTER>
32
+ {%- elif filter.filter_size %}
33
+ <FILTER xsi:type="SIZEDEF-FILTER">
34
+ {%- set num_nibbles = (filter.filter_start.bit_length() + 7) // 8 * 2 %}
35
+ <FILTER-START>{{ ("%%0%dX" | format(num_nibbles | int)) | format(filter.filter_start | int) }}</FILTER-START>
36
+ <FILTER-SIZE>{{filter.filter_size}}</FILTER-SIZE>
37
+ </FILTER>
38
+ {%- endif %}
39
+ {%- endfor %}
40
+ </FILTERS>
41
+ {%- endif %}
42
+ {%- if datablock.segments %}
43
+ <SEGMENTS>
44
+ {%- for segment in datablock.segments %}
45
+ {{ pseg.printSegment(segment) | indent(4) }}
46
+ {%- endfor %}
47
+ </SEGMENTS>
48
+ {%- endif %}
49
+ {%- if datablock.target_addr_offset is not none %}
50
+ {%- if datablock.target_addr_offset.positive_offset is defined %}
51
+ <TARGET-ADDR-OFFSET xsi:type="POS-OFFSET">
52
+ {%- set num_nibbles = (datablock.target_addr_offset.positive_offset.bit_length() + 7) // 8 * 2 %}
53
+ <POSITIVE-OFFSET>{{("%%0%dX" | format(num_nibbles | int)) | format(datablock.target_addr_offset.positive_offset | int)}}</POSITIVE-OFFSET>
54
+ </TARGET-ADDR-OFFSET>
55
+ {%- elif datablock.target_addr_offset.negative_offset is defined %}
56
+ <TARGET-ADDR-OFFSET xsi:type="NEG-OFFSET">
57
+ {%- set num_nibbles = (datablock.target_addr_offset.negative_offset.bit_length() + 7) // 8 * 2 %}
58
+ <NEGATIVE-OFFSET>{{("%%0%dX" | format(num_nibbles | int)) | format(datablock.target_addr_offset.negative_offset | int)}}</NEGATIVE-OFFSET>
59
+ </TARGET-ADDR-OFFSET>
60
+ {%- endif %}
61
+ {%- endif %}
62
+ {%- if datablock.own_idents %}
63
+ <OWN-IDENTS>
64
+ {%- for own_ident in datablock.own_idents %}
65
+ {{ poi.printOwnIdent(own_ident)|indent(4) }}
66
+ {%- endfor %}
67
+ </OWN-IDENTS>
68
+ {%- endif %}
69
+ {%- if datablock.securities %}
70
+ <SECURITYS>
71
+ {%- for security in datablock.securities %}
72
+ {{ psec.printSecurity(security)|indent(4) }}
73
+ {%- endfor %}
74
+ </SECURITYS>
75
+ {%- endif %}
76
+ {{- psd.printSpecialDataGroups(datablock.sdgs)|indent(2, first=True) }}{#- #}
77
+ </DATABLOCK>
78
+ {%- endmacro -%}
@@ -28,7 +28,7 @@
28
28
  {%- if dc.functional_class_refs %}
29
29
  <FUNCT-CLASS-REFS>
30
30
  {%- for ref in dc.functional_class_refs %}
31
- <FUNCT-CLASS-REF ID-REF="{{ref.ref_id}}" />
31
+ <FUNCT-CLASS-REF {{make_ref_attribs(ref)}} />
32
32
  {%- endfor %}
33
33
  </FUNCT-CLASS-REFS>
34
34
  {%- endif%}
@@ -45,7 +45,7 @@
45
45
  {%- if dc.related_diag_comm_refs %}
46
46
  <RELATED-DIAG-COMM-REFS>
47
47
  {%- for ref in dc.related_diag_comm_refs %}
48
- <RELATED-DIAG-COMM-REF ID-REF="{{ref.ref_id}}">
48
+ <RELATED-DIAG-COMM-REF {{make_ref_attribs(ref)}}>
49
49
  <RELATION-TYPE>{{ref.relation_type}}</RELATION-TYPE>
50
50
  </RELATED-DIAG-COMM-REF>
51
51
  {%- endfor %}
@@ -33,6 +33,7 @@
33
33
  {%- endmacro -%}
34
34
 
35
35
  {%- macro printDiagLayerSubtags(dl) -%}
36
+ {{- set_layer_docfrag(dl.short_name) }}
36
37
  {%- set dlr = dl.diag_layer_raw %}
37
38
  {{ peid.printElementIdSubtags(dlr)|indent(1) }}
38
39
  {%- if dlr.admin_data is not none %}
@@ -149,7 +150,7 @@
149
150
 
150
151
  {%- if hasattr(dc, "ref_id") %}
151
152
  {#- -> reference to a diag-comm object #}
152
- <DIAG-COMM-REF ID-REF="{{dc.ref_id}}" />
153
+ <DIAG-COMM-REF {{make_ref_attribs(dc)}} />
153
154
  {%- elif hasattr(dc, "request") %}
154
155
  {#- -> service #}
155
156
  {{ ps.printService(dc)|indent(2) }}
@@ -14,7 +14,7 @@
14
14
  {%- if diag_variable.admin_data is not none %}
15
15
  {{ pad.printAdminData(diag_variable.admin_data)|indent(2) }}
16
16
  {%- endif %}
17
- <VARIABLE-GROUP-REF ID-REF="{{ diag_var.ref_id }}" />
17
+ <VARIABLE-GROUP-REF {{make_ref_attribs(diag_var)}} />
18
18
  {%- if diag_variable.sw_variables %}
19
19
  <SW-VARIABLES>
20
20
  {%- for sw_var in diag_variable.sw_variables %}
@@ -34,19 +34,19 @@
34
34
  {{ pd.printDescription(comm_relation.description) }}
35
35
  <RELATION-TYPE>{{comm_relation.relation_type}}</RELATION-TYPE>
36
36
  {%- if comm_relation.diag_comm_ref is not none %}
37
- <DIAG-COMM-REF ID-REF="{{comm_relation.diag_comm_ref.ref_id}}" />
37
+ <DIAG-COMM-REF {{make_ref_attribs(comm_relation.diag_comm_ref)}} />
38
38
  {%- endif %}
39
39
  {%- if comm_relation.diag_comm_snref is not none %}
40
40
  <DIAG-COMM-SNREF SHORT-NAME="{{comm_relation.diag_comm_snref}}" />
41
41
  {%- endif %}
42
42
  {%- if comm_relation.in_param_if_ref is not none %}
43
- <IN-PARAM-IF-REF ID-REF="{{comm_relation.in_param_if_ref.ref_id}}" />
43
+ <IN-PARAM-IF-REF {{make_ref_attribs(comm_relation.in_param_if_ref)}} />
44
44
  {%- endif %}
45
45
  {%- if comm_relation.in_param_if_snref is not none %}
46
46
  <IN-PARAM-IF-SNREF SHORT-NAME="{{comm_relation.in_param_if_snref}}" />
47
47
  {%- endif %}
48
48
  {%- if comm_relation.out_param_if_ref is not none %}
49
- <OUT-PARAM-IF-REF ID-REF="{{comm_relation.out_param_if_ref.ref_id}}" />
49
+ <OUT-PARAM-IF-REF {{make_ref_attribs(comm_relation.out_param_if_ref)}} />
50
50
  {%- endif %}
51
51
  {%- if comm_relation.out_param_if_snref is not none %}
52
52
  <OUT-PARAM-IF-SNREF SHORT-NAME="{{comm_relation.out_param_if_snref}}" />
@@ -11,13 +11,13 @@
11
11
  <DYN-ID-DEF-MODE-INFO>
12
12
  <DEF-MODE>{{ diddmi.def_mode }}</DEF-MODE>
13
13
  {%- if diddmi.clear_dyn_def_message_ref is not none %}
14
- <CLEAR-DYN-DEF-MESSAGE-REF ID-REF="{{diddmi.clear_dyn_def_message_ref.ref_id}}" />
14
+ <CLEAR-DYN-DEF-MESSAGE-REF {{make_ref_attribs(diddmi.clear_dyn_def_message_ref)}} />
15
15
  {%- endif %}
16
16
  {%- if diddmi.clear_dyn_def_message_snref is not none %}
17
17
  <CLEAR-DYN-DEF-MESSAGE-SNREF SHORT-NAME="{{diddmi.clear_dyn_def_message_snref}}" />
18
18
  {%- endif %}
19
19
  {%- if diddmi.read_dyn_def_message_ref is not none %}
20
- <READ-DYN-DEF-MESSAGE-REF ID-REF="{{diddmi.read_dyn_def_message_ref.ref_id}}" />
20
+ <READ-DYN-DEF-MESSAGE-REF {{make_ref_attribs(diddmi.read_dyn_def_message_ref)}} />
21
21
  {%- endif %}
22
22
  {%- if diddmi.read_dyn_def_message_snref is not none %}
23
23
  <READ-DYN-DEF-MESSAGE-SNREF SHORT-NAME="{{diddmi.read_dyn_def_message_snref}}" />
@@ -33,7 +33,7 @@
33
33
  <SELECTION-TABLE-REFS>
34
34
  {%- for seltref in diddmi.selection_table_refs %}
35
35
  {%- if hasattr(seltref, "ref_id") %}
36
- <SELECTION-TABLE-REF ID-REF="{{ seltref.ref_id }}" />
36
+ <SELECTION-TABLE-REF {{make_ref_attribs(seltref)}} />
37
37
  {%- else %}
38
38
  <SELECTION-TABLE-SNREF SHORT-NAME="{{ seltref }}" />
39
39
  {%- endif %}
@@ -8,8 +8,8 @@
8
8
  {%- macro printStaticField(demf) -%}
9
9
  <DYNAMIC-ENDMARKER-FIELD {{-peid.printElementIdAttribs(demf)}}>
10
10
  {{ peid.printElementIdSubtags(demf)|indent(1) }}
11
- <BASIC-STRUCTURE-REF ID-REF="{{demf.structure_ref.ref_id}}" />
12
- <DYN-END-DOP-REF ID-REF="{{demf.dyn_end_dop_ref.ref_id}}">
11
+ <BASIC-STRUCTURE-REF {{make_ref_attribs(demf.structure_ref)}} />
12
+ <DYN-END-DOP-REF {{make_ref_attribs(demf.dyn_end_dop_ref)}}>
13
13
  <TERMINATION-VALUE>{{demf.dyn_end_dop_ref.termination_value_raw}}</TERMINATION-VALUE>
14
14
  </DYN-END-DOP-REF>
15
15
  </DYNAMIC-ENDMARKER-FIELD>
@@ -8,7 +8,7 @@
8
8
  {%- macro printDynamicLengthField(dlf) -%}
9
9
  <DYNAMIC-LENGTH-FIELD {{-peid.printElementIdAttribs(dlf)}}>
10
10
  {{ peid.printElementIdSubtags(dlf)|indent(1) }}
11
- <BASIC-STRUCTURE-REF ID-REF="{{dlf.structure_ref.ref_id}}" />
11
+ <BASIC-STRUCTURE-REF {{make_ref_attribs(dlf.structure_ref)}} />
12
12
  <OFFSET>{{dlf.offset}}</OFFSET>
13
13
  <DETERMINE-NUMBER-OF-ITEMS>
14
14
  {%- set dni = dlf.determine_number_of_items %}
@@ -16,7 +16,7 @@
16
16
  {%- if dni.bit_position is not none %}
17
17
  <BIT-POSITION>{{dni.bit_position}}</BIT-POSITION>
18
18
  {%- endif %}
19
- <DATA-OBJECT-PROP-REF ID-REF="{{dni.dop_ref.ref_id}}" />
19
+ <DATA-OBJECT-PROP-REF {{make_ref_attribs(dni.dop_ref)}} />
20
20
  </DETERMINE-NUMBER-OF-ITEMS>
21
21
  </DYNAMIC-LENGTH-FIELD>
22
22
  {%- endmacro -%}
@@ -0,0 +1,24 @@
1
+ 1{#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printAdminData.xml.jinja2') as pad %}
7
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
8
+ {%- import('macros/printMem.xml.jinja2') as pm %}
9
+ {%- import('macros/printPhysMem.xml.jinja2') as ppm %}
10
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
11
+
12
+ {%- macro printEcuMem(ecu_mem) -%}
13
+ <ECU-MEM {{peid.printElementIdAttribs(ecu_mem) | indent(1) }}>
14
+ {{peid.printElementIdSubtags(ecu_mem)|indent(2) }}
15
+ {%- if ecu_mem.admin_data is not none %}
16
+ {{ pad.printAdminData(ecu_mem.admin_data)|indent(2) }}
17
+ {%- endif %}
18
+ {{ pm.printMem(ecu_mem.mem)|indent(2) }}
19
+ {%- if ecu_mem.phys_mem is not none %}
20
+ {{ ppm.printPhysMem(ecu_mem.phys_mem)|indent(2) }}
21
+ {%- endif %}
22
+ {{- psd.printSpecialDataGroups(ecu_mem.sdgs)|indent(2, first=True) }}{#- #}
23
+ </ECU-MEM>
24
+ {%- endmacro -%}
@@ -0,0 +1,58 @@
1
+ 1{#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printAdminData.xml.jinja2') as pad %}
7
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
8
+ {%- import('macros/printIdentDesc.xml.jinja2') as pidd %}
9
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
10
+ {%- import('macros/printSessionDesc.xml.jinja2') as psesd %}
11
+
12
+ {%- macro printEcuMemConnector(ecu_mem_connector) -%}
13
+ <ECU-MEM-CONNECTOR {{peid.printElementIdAttribs(ecu_mem_connector)}}>
14
+ {{peid.printElementIdSubtags(ecu_mem_connector)|indent(2) }}
15
+ {%- if ecu_mem_connector.admin_data is not none %}
16
+ {{ pad.printAdminData(ecu_mem_connector.admin_data)|indent(2) }}
17
+ {%- endif %}
18
+ {%- if ecu_mem_connector.flash_classes %}
19
+ <FLASH-CLASSS>
20
+ {%- for flash_class in ecu_mem_connector.flash_classes %}
21
+ <FLASH-CLASS {{peid.printElementIdAttribs(flash_class)}}>
22
+ {{peid.printElementIdSubtags(flash_class)|indent(6) }}
23
+ </FLASH-CLASS>
24
+ {%- endfor %}
25
+ </FLASH-CLASSS>
26
+ {%- endif %}
27
+ {%- if ecu_mem_connector.session_descs %}
28
+ <SESSION-DESCS>
29
+ {%- for session_desc in ecu_mem_connector.session_descs %}
30
+ {{psesd.printSessionDesc(session_desc)}}
31
+ {%- endfor %}
32
+ </SESSION-DESCS>
33
+ {%- endif %}
34
+ {%- if ecu_mem_connector.ident_descs %}
35
+ <IDENT-DESCS>
36
+ {%- for ident_desc in ecu_mem_connector.ident_descs %}
37
+ {{pidd.printIdentDesc(ident_desc)}}
38
+ {%- endfor %}
39
+ </IDENT-DESCS>
40
+ {%- endif %}
41
+ <ECU-MEM-REF {{make_ref_attribs(ecu_mem_connector.ecu_mem_ref)}} />
42
+ {%- if ecu_mem_connector.layer_refs %}
43
+ <LAYER-REFS>
44
+ {%- for layer_ref in ecu_mem_connector.layer_refs %}
45
+ <LAYER-REF {{make_ref_attribs(layer_ref)}} />
46
+ {%- endfor %}
47
+ </LAYER-REFS>
48
+ {%- endif %}
49
+ {%- if ecu_mem_connector.all_variant_refs %}
50
+ <ALL-VARIANT-REFS>
51
+ {%- for all_variant_ref in ecu_mem_connector.all_variant_refs %}
52
+ <ALL-VARIANT-REF {{make_ref_attribs(all_variant_ref)}} />
53
+ {%- endfor %}
54
+ </ALL-VARIANT-REFS>
55
+ {%- endif %}
56
+ {{- psd.printSpecialDataGroups(ecu_mem_connector.sdgs)|indent(2, first=True) }}{#- #}
57
+ </ECU-MEM-CONNECTOR>
58
+ {%- endmacro -%}
@@ -8,7 +8,7 @@
8
8
  {%- macro printEndOfPdu(eopdu) -%}
9
9
  <END-OF-PDU-FIELD {{-peid.printElementIdAttribs(eopdu)}}>
10
10
  {{ peid.printElementIdSubtags(eopdu)|indent(1) }}
11
- <BASIC-STRUCTURE-REF ID-REF="{{eopdu.structure_ref.ref_id}}" />
11
+ <BASIC-STRUCTURE-REF {{make_ref_attribs(eopdu.structure_ref)}} />
12
12
  {%- if eopdu.max_number_of_items is not none %}
13
13
  <MAX-NUMBER-OF-ITEMS>{{eopdu.max_number_of_items}}</MAX-NUMBER-OF-ITEMS>
14
14
  {%- endif %}
@@ -11,7 +11,7 @@
11
11
  <PARAM-SNREF SHORT-NAME="{{env_data_desc.param_snref}}"/>
12
12
  <ENV-DATA-REFS>
13
13
  {%- for env_data_ref in env_data_desc.env_data_refs %}
14
- <ENV-DATA-REF ID-REF="{{env_data_ref.ref_id}}"/>
14
+ <ENV-DATA-REF {{make_ref_attribs(env_data_ref)}}/>
15
15
  {%- endfor %}
16
16
  </ENV-DATA-REFS>
17
17
  </ENV-DATA-DESC>
@@ -0,0 +1,21 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
7
+
8
+ {%- macro printExpectedIdent(expected_ident) -%}
9
+ <EXPECTED-IDENT {{-peid.printElementIdAttribs(expected_ident)}} >
10
+ {{ peid.printElementIdSubtags(expected_ident)}}
11
+ <IDENT-VALUES>
12
+ {%- for ident_value in expected_ident.ident_values %}
13
+ <IDENT-VALUE
14
+ {%- if ident_value.value_type is not none %}
15
+ {#- #} TYPE="{{ ident_value.value_type.value }}"
16
+ {%- endif %}
17
+ {#- #}>{{ident_value.value}}</IDENT-VALUE>
18
+ {%- endfor %}
19
+ </IDENT-VALUES>
20
+ </EXPECTED-IDENT>
21
+ {%- endmacro -%}
@@ -0,0 +1,43 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
7
+ {%- import('macros/printOwnIdent.xml.jinja2') as poi %}
8
+ {%- import('macros/printSegment.xml.jinja2') as pseg %}
9
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
10
+
11
+ {%- macro printFlashdata(flashdata) -%}
12
+ <FLASHDATA {{peid.printElementIdAttribs(flashdata)}}
13
+ {%- if flashdata.datafile is defined %}
14
+ {#- #} xsi:type="EXTERN-FLASHDATA"
15
+ {%- elif flashdata.data is defined %}
16
+ {#- #} xsi:type="INTERN-FLASHDATA"
17
+ {%- endif %}
18
+ {#- #}>
19
+ {{ peid.printElementIdSubtags(flashdata)|indent(2) }}
20
+ {%- if flashdata.size_length is not none %}
21
+ <SIZE-LENGTH>{{flashdata.size_length}}</SIZE-LENGTH>
22
+ {%- endif %}
23
+ {%- if flashdata.address_length is not none %}
24
+ <ADDRESS-LENGTH>{{flashdata.address_length}}</ADDRESS-LENGTH>
25
+ {%- endif %}
26
+ <DATAFORMAT {{ make_xml_attrib("SELECTION", flashdata.dataformat.selection.value) }}
27
+ {#- #} {{ make_xml_attrib("USER-SELECTION", flashdata.dataformat.user_selection) }} />
28
+ {%- if flashdata.encrypt_compress_method is not none %}
29
+ <ENCRYPT-COMPRESS-METHOD
30
+ {%- if flashdata.encrypt_compress_method.value_type is not none %}
31
+ {#- #} TYPE="{{ flashdata.encrypt_compress_method.value_type.value }}"
32
+ {%- endif %}
33
+ {#- #}>{{flashdata.encrypt_compress_method.value}}</ENCRYPT-COMPRESS-METHOD>
34
+ {%- endif %}
35
+ {%- if flashdata.datafile is defined %}
36
+ <DATAFILE {{ make_bool_xml_attrib("LATEBOUND-DATAFILE", flashdata.latebound_datafile) }}>
37
+ {#- #}{{flashdata.datafile.value}}
38
+ {#- #}</DATAFILE>
39
+ {%- elif flashdata.data is defined %}
40
+ <DATA>{{flashdata.data}}</DATA>
41
+ {%- endif %}
42
+ </FLASHDATA>
43
+ {%- endmacro -%}
@@ -0,0 +1,17 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- macro printIdentDesc(ident_desc) -%}
7
+ <IDENT-DESC>
8
+ <DIAG-COMM-SNREF SHORT-NAME="{{ident_desc.diag_comm_snref}}" />
9
+ <IDENT-IF-SNREF SHORT-NAME="{{ident_desc.ident_if_snref}}" />
10
+ {%- if ident_desc.out_param_if_snref is not none %}
11
+ <OUT-PARAM-IF-SNREF SHORT-NAME="{{ident_desc.out_param_if_snref}}" />
12
+ {%- endif %}
13
+ {%- if ident_desc.out_param_if_snpathref is not none %}
14
+ <OUT-PARAM-IF-SNPATHREF SHORT-NAME-PATH="{{ident_desc.out_param_if_snpathref}}" />
15
+ {%- endif %}
16
+ </IDENT-DESC>
17
+ {%- endmacro -%}
@@ -0,0 +1,35 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printDatablock.xml.jinja2') as pdbl %}
7
+ {%- import('macros/printFlashdata.xml.jinja2') as pfd %}
8
+ {%- import('macros/printSession.xml.jinja2') as pses %}
9
+ {%- import('macros/printSpecialData.xml.jinja2') as psd %}
10
+
11
+ {%- macro printMem(mem) -%}
12
+ <MEM>
13
+ {%- if mem.sessions %}
14
+ <SESSIONS>
15
+ {%- for session in mem.sessions %}
16
+ {{ pses.printSession(session) | indent(4) }}
17
+ {%- endfor %}
18
+ </SESSIONS>
19
+ {%- endif %}
20
+ {%- if mem.datablocks %}
21
+ <DATABLOCKS>
22
+ {%- for datablock in mem.datablocks %}
23
+ {{ pdbl.printDatablock(datablock) | indent(4) }}
24
+ {%- endfor %}
25
+ </DATABLOCKS>
26
+ {%- endif %}
27
+ {%- if mem.flashdatas %}
28
+ <FLASHDATAS>
29
+ {%- for flashdata in mem.flashdatas %}
30
+ {{ pfd.printFlashdata(flashdata) | indent(4) }}
31
+ {%- endfor %}
32
+ </FLASHDATAS>
33
+ {%- endif %}
34
+ </MEM>
35
+ {%- endmacro -%}
@@ -18,13 +18,13 @@
18
18
  {%- if mux.switch_key.bit_position is not none %}
19
19
  <BIT-POSITION>{{mux.switch_key.bit_position}}</BIT-POSITION>
20
20
  {%- endif %}
21
- <DATA-OBJECT-PROP-REF ID-REF="{{mux.switch_key.dop_ref.ref_id}}"/>
21
+ <DATA-OBJECT-PROP-REF {{make_ref_attribs(mux.switch_key.dop_ref)}}/>
22
22
  </SWITCH-KEY>
23
23
  {%- if mux.default_case is not none %}
24
24
  <DEFAULT-CASE>
25
25
  {{ peid.printElementIdSubtags(mux.default_case)|indent(4) }}
26
26
  {%- if mux.default_case.structure_ref is not none %}
27
- <STRUCTURE-REF ID-REF="{{mux.default_case.structure_ref.ref_id}}"/>
27
+ <STRUCTURE-REF {{make_ref_attribs(mux.default_case.structure_ref)}}/>
28
28
  {%- endif %}
29
29
  {%- if mux.default_case.structure_snref is not none %}
30
30
  <STRUCTURE-SNREF SHORT_NAME="{{mux.default_case.structure_snref}}"/>
@@ -37,7 +37,7 @@
37
37
  <CASE>
38
38
  {{ peid.printElementIdSubtags(case)|indent(6) }}
39
39
  {%- if case.structure_ref is not none %}
40
- <STRUCTURE-REF ID-REF="{{case.structure_ref.ref_id}}"/>
40
+ <STRUCTURE-REF {{make_ref_attribs(case.structure_ref)}}/>
41
41
  {%- endif %}
42
42
  {%- if case.structure_snref is not none %}
43
43
  <STRUCTURE-SNREF SHORT_NAME="{{case.structure_snref}}"/>
@@ -12,17 +12,17 @@
12
12
  {#- #} {{- peid.printElementIdAttribs(obj) }}
13
13
  {%- endmacro -%}
14
14
 
15
- {%- macro printOdxCategorySubtags(obj) -%}
15
+ {%- macro printOdxCategorySubtags(obj) %}
16
16
  {{ peid.printElementIdSubtags(obj) }}
17
17
  {%- if obj.admin_data %}
18
- {{pad.printAdminData(obj.admin_data)|indent(2)}}
18
+ {{pad.printAdminData(obj.admin_data)}}
19
19
  {%- endif %}
20
20
  {%- if obj.company_datas %}
21
21
  <COMPANY-DATAS>
22
22
  {%- for cd in obj.company_datas %}
23
- {{pcd.printCompanyData(cd)|indent(3)}}
23
+ {{pcd.printCompanyData(cd)|indent(2)}}
24
24
  {%- endfor %}
25
25
  </COMPANY-DATAS>
26
26
  {%- endif %}
27
- {{- psd.printSpecialDataGroups(obj.sdgs)|indent(2, first=True) }}
27
+ {{- psd.printSpecialDataGroups(obj.sdgs) }}{#- #}
28
28
  {%- endmacro -%}
@@ -0,0 +1,17 @@
1
+ {#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ -#}
5
+
6
+ {%- import('macros/printElementId.xml.jinja2') as peid %}
7
+
8
+ {%- macro printOwnIdent(own_ident) -%}
9
+ <OWN-IDENT {{-peid.printElementIdAttribs(own_ident)}} >
10
+ {{ peid.printElementIdSubtags(own_ident)}}
11
+ <IDENT-VALUE
12
+ {%- if own_ident.ident_value.value_type is not none %}
13
+ {#- #} TYPE="{{ own_ident.ident_value.value_type.value }}"
14
+ {%- endif %}
15
+ {#- #}>{{own_ident.ident_value.value}}</IDENT-VALUE>
16
+ </OWN-IDENT>
17
+ {%- endmacro -%}
@@ -49,7 +49,7 @@
49
49
  <PHYSICAL-DEFAULT-VALUE>{{param.physical_default_value_raw | e}}</PHYSICAL-DEFAULT-VALUE>
50
50
  {%- endif %}
51
51
  {%- if param.dop_ref %}
52
- <DOP-REF ID-REF="{{param.dop_ref.ref_id}}"/>
52
+ <DOP-REF {{make_ref_attribs(param.dop_ref)}}/>
53
53
  {%- elif param.dop_snref %}
54
54
  <DOP-SNREF SHORT-NAME="{{param.dop_snref}}"/>
55
55
  {%- elif param.diag_coded_type is defined %}
@@ -59,7 +59,7 @@
59
59
  {%- endif %}
60
60
  {%- if param.parameter_type == "TABLE-KEY" %}
61
61
  {%- if param.table_ref %}
62
- <TABLE-REF ID-REF="{{param.table_ref.ref_id}}"/>
62
+ <TABLE-REF {{make_ref_attribs(param.table_ref)}}/>
63
63
  {%- endif %}
64
64
  {%- if param.table_snref %}
65
65
  <TABLE-SNREF SHORT-NAME="{{param.table_snref}}"/>
@@ -68,12 +68,12 @@
68
68
  <TABLE-ROW-SNREF SHORT-NAME="{{param.table_row_snref}}"/>
69
69
  {%- endif %}
70
70
  {%- if param.table_row_ref %}
71
- <TABLE-ROW-REF ID-REF="{{param.table_row_ref.ref_id}}"/>
71
+ <TABLE-ROW-REF {{make_ref_attribs(param.table_row_ref)}}/>
72
72
  {%- endif %}
73
73
  {%- endif %}
74
74
  {%- if param.parameter_type == "TABLE-STRUCT" %}
75
75
  {%- if param.table_key_ref %}
76
- <TABLE-KEY-REF ID-REF="{{param.table_key_ref.ref_id}}"/>
76
+ <TABLE-KEY-REF {{make_ref_attribs(param.table_key_ref)}}/>
77
77
  {%- endif %}
78
78
  {%- if param.table_key_snref %}
79
79
  <TABLE-KEY-SNREF SHORT-NAME="{{param.table_key_snref}}"/>
@@ -4,11 +4,7 @@
4
4
  -#}
5
5
 
6
6
  {%- macro printParentRef(par) -%}
7
- <PARENT-REF ID-REF="{{par.layer.odx_id.local_id}}"
8
- {%- if par.layer_ref.ref_docs|length == 1 %}
9
- DOCREF="{{par.layer_ref.ref_docs[0].doc_name}}"
10
- DOCTYPE="CONTAINER"
11
- {%- endif %}
7
+ <PARENT-REF {{make_ref_attribs(par.layer_ref)}}
12
8
  xsi:type="{{par.layer.variant_type.value}}-REF">
13
9
  {%- if par.not_inherited_diag_comms %}
14
10
  <NOT-INHERITED-DIAG-COMMS>