powertrain-build 1.14.0__py3-none-any.whl → 1.14.1.dev3__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.
powertrain_build/build.py CHANGED
@@ -930,7 +930,7 @@ def build(
930
930
  if rte_dummy:
931
931
  LOG.info("******************************************************")
932
932
  LOG.info("Generating RTE dummy files")
933
- zc_rte = RteDummy(build_cfg, zc_nvm, composition_yaml.cal_class_info["tl"])
933
+ zc_rte = RteDummy(build_cfg, zc_core, zc_nvm, composition_yaml.cal_class_info["tl"])
934
934
  zc_rte.generate_rte_dummy()
935
935
 
936
936
  if code_generation_config["generateCalibrationInterfaceFiles"]:
powertrain_build/core.py CHANGED
@@ -371,7 +371,7 @@ class ZCCore(ProblemLogger):
371
371
  footer = [f'\n#endif /* {header_guard} */\n']
372
372
 
373
373
  body = [
374
- '/* enum EventStatus {passed=0, failed=1, prepassed=2, prefailed=3} */\n',
374
+ '/* EventStatus is an enumeration with members {passed=0, failed=1, prepassed=2, prefailed=3} */\n',
375
375
  '#define Dem_SetEventStatus(EventName, EventStatus)',
376
376
  ' ',
377
377
  'Rte_Call_Event_##EventName##_SetEventStatus(EventStatus)\n'
@@ -17,16 +17,18 @@ from pathlib import Path
17
17
  class RteDummy(ProblemLogger):
18
18
  """A class for RTE dummy file generation."""
19
19
 
20
- def __init__(self, build_cfg, nvm_def, calib_data):
20
+ def __init__(self, build_cfg, core, nvm_def, calib_data):
21
21
  """Init.
22
22
 
23
23
  Args:
24
24
  build_cfg (BuildProjConfig): Object with build configuration settings.
25
+ core (ZCCore): Object representing the core configuration data.
25
26
  nvm_def (ZCNVMDef): Object with NVM definition information.
26
27
  calib_data (dict): Dictionary containing calibration data for a ZoneController project.
27
28
  """
28
29
  super().__init__()
29
30
  self.build_cfg = build_cfg
31
+ self.dtcs = core.project_dtcs
30
32
  self.nvm_def = nvm_def
31
33
  self.calibration_variables = calib_data.get("class_info", {})
32
34
  mem_map_config = self.build_cfg.get_memory_map_config()
@@ -231,6 +233,28 @@ class RteDummy(ProblemLogger):
231
233
  lines_to_write.append("")
232
234
  return "\n".join(lines_to_write)
233
235
 
236
+ def _get_core_header_dummy(self):
237
+ """Get core header dummy code."""
238
+ if not self.dtcs:
239
+ return ""
240
+
241
+ lines_to_write = []
242
+ for dtc in self.dtcs:
243
+ lines_to_write.append(f"UInt8 Rte_Call_Event_{dtc}_SetEventStatus(UInt8 EventStatus);")
244
+ lines_to_write.append("")
245
+ return "\n".join(lines_to_write)
246
+
247
+ def _get_core_source_dummy(self):
248
+ """Get core source dummy code."""
249
+ if not self.dtcs:
250
+ return ""
251
+
252
+ lines_to_write = []
253
+ for dtc in self.dtcs:
254
+ lines_to_write.append(f"UInt8 Rte_Call_Event_{dtc}_SetEventStatus(UInt8 EventStatus) {{ return 0U; }}")
255
+ lines_to_write.append("")
256
+ return "\n".join(lines_to_write)
257
+
234
258
  def generate_rte_dummy(self):
235
259
  """Generate RTE dummy files."""
236
260
  src_code_dest_dir = self.build_cfg.get_src_code_dst_dir()
@@ -245,10 +269,12 @@ class RteDummy(ProblemLogger):
245
269
  with type_header_file.open(mode="w", encoding="utf-8") as type_header_fh:
246
270
  type_header_fh.write(self._get_type_header_header())
247
271
  type_header_fh.write(self._get_typedef_dummy())
272
+ type_header_fh.write(self._get_core_header_dummy())
248
273
  type_header_fh.write(self._get_nvm_header_dummy())
249
274
  type_header_fh.write(self._get_calibration_header_dummy())
250
275
  type_header_fh.write(self._get_type_header_footer())
251
276
  with source_file.open(mode="w", encoding="utf-8") as source_fh:
252
277
  source_fh.write(self._get_source_header())
278
+ source_fh.write(self._get_core_source_dummy())
253
279
  source_fh.write(self._get_nvm_source_dummy())
254
280
  source_fh.write(self._get_calibration_source_dummy())
@@ -15,7 +15,7 @@ class ZoneControllerCalibration(ProblemLogger):
15
15
  calibration_function_step_template = '{swc_name}_ZcCalibrationStep'
16
16
  trigger_read_rte_cdata_signal = {
17
17
  'name_template': 'c{swc_name}_TriggerReadRteCData',
18
- 'data_type': 'Float32'
18
+ 'data_type': 'UInt8'
19
19
  }
20
20
 
21
21
  def __init__(self, build_cfg, calib_data):
@@ -45,7 +45,22 @@ class ZoneControllerCalibration(ProblemLogger):
45
45
  for signal_name, signal_data in self.calibration_variables.items():
46
46
  rte_call = f'Rte_CData_{self.swc_name}_{signal_name}()'
47
47
  if isinstance(signal_data["width"], list):
48
- write_string_list.append(f'{"":{indent}}memcpy({signal_name}, {rte_call}, sizeof({signal_name}));\n')
48
+ # MAPs get typedef:ed to structs and need special data type mapping
49
+ if signal_name.startswith("m") and signal_name[-2:] not in ["_r", "_c"]:
50
+ write_string_list.append(
51
+ f'{"":{indent}}const {signal_data["autosar_type"]} *{signal_name}_ptr = {rte_call};\n'
52
+ )
53
+ write_string_list.append(
54
+ f'{"":{indent}}memcpy('
55
+ f'{signal_name}, '
56
+ f'{signal_name}_ptr->{signal_data["autosar_type"]}, '
57
+ f'sizeof({signal_name})'
58
+ ');\n'
59
+ )
60
+ else:
61
+ write_string_list.append(
62
+ f'{"":{indent}}memcpy({signal_name}, {rte_call}, sizeof({signal_name}));\n'
63
+ )
49
64
  else:
50
65
  write_string_list.append(f'{"":{indent}}{signal_name} = {rte_call};\n')
51
66
  return write_string_list
@@ -123,7 +138,7 @@ class ZoneControllerCalibration(ProblemLogger):
123
138
  lines_to_write.append('\n')
124
139
  for signal_name, signal_data in self.calibration_variables.items():
125
140
  if isinstance(signal_data["width"], list):
126
- # MAPs get typedef:ed to structs and need special data type mapping in calibration.py
141
+ # MAPs get typedef:ed to structs and need special data type mapping
127
142
  if signal_name.startswith("m") and signal_name[-2:] not in ["_r", "_c"]:
128
143
  return_type = f'const {signal_data["autosar_type"]}*'
129
144
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: powertrain-build
3
- Version: 1.14.0
3
+ Version: 1.14.1.dev3
4
4
  Summary: A Continuous Integration (CI) build system testing all configurations where a Simulink model is used.
5
5
  Home-page: https://opendev.org/volvocars/powertrain-build
6
6
  Download-URL: https://pypi.org/project/powertrain-build/
@@ -3,13 +3,13 @@ powertrain_build/__main__.py,sha256=KiSMgZgGBelcaf4uEIvdaNmCo2utZM9tWTkwHldhEXY,
3
3
  powertrain_build/a2l.py,sha256=7DBtaP2hOBPg0Q_GrgzD-SX7dodhaWfGajJBog_wBy8,23429
4
4
  powertrain_build/a2l_merge.py,sha256=k2Nv91TEXpiDmzNU5ufUhceWGjwFLcUJB42ppzWbELQ,31600
5
5
  powertrain_build/a2l_templates.py,sha256=Dn262lXFhHLH5OfCS9mK6tNyRaAEqI3RFTx11yEj8Yc,31720
6
- powertrain_build/build.py,sha256=TaJycIkp7ygbwBRnkwPJ7at7mDouTbUqi18JfsJ1prw,42786
6
+ powertrain_build/build.py,sha256=J6N8eUbhWetp182ytKQZq19Cwarp0mO8JlLLD5Szhs4,42795
7
7
  powertrain_build/build_defs.py,sha256=0uI4GPcF6sd6BZVKKT27fneU74u-41ox2LuJ-klS-Vg,16898
8
8
  powertrain_build/build_proj_config.py,sha256=uLvIrEIM4p74adej31OHop1GkXkznDcRW_FY8SJawNI,26234
9
9
  powertrain_build/check_interface.py,sha256=aHo7NL1kdZ_BdICMNHWxaBrjQkOnOHG96B6UMs-exoQ,23686
10
10
  powertrain_build/cli.py,sha256=Z72b5gMvIHHb9Yx2jMaQVHqlak8p75bdWMzBkbU4oq4,5566
11
11
  powertrain_build/config.py,sha256=8KrhMgsndGx3cDMM-KftnkpFl0YzswZaKMktiSdFqjE,20365
12
- powertrain_build/core.py,sha256=W4GmZqqjMDKmIHRrHXMfwbfVav3sxYGb7XsBSxP4lSA,16146
12
+ powertrain_build/core.py,sha256=JaBSVRAsagY044konqwGqfQWIvJqx9tVgQjkvYuXCrk,16172
13
13
  powertrain_build/core_dummy.py,sha256=kbv_lk8OoFr0dFC9E-f8KJubsNLI4dLPFMG2jkotPbI,18025
14
14
  powertrain_build/create_conversion_table.py,sha256=h63zWo6h646pOQL430pDoSTAn5hYLAHbjivccODboIQ,2289
15
15
  powertrain_build/dids.py,sha256=TTBE_7gaGU9KYFVqskVzGlf2wX-kvDMe3z5uP8oiFok,38322
@@ -29,7 +29,7 @@ powertrain_build/problem_logger.py,sha256=1jhUipQ3bwfMkNNYJM-GfFqbInQmVg2xoIanLq
29
29
  powertrain_build/pt_matlab.py,sha256=dqQvd4x-rg6ZKd9kVAVJEPCPxm3ORC7FkfVozVjUYcI,15132
30
30
  powertrain_build/pt_win32.py,sha256=R3v3IA7hMC5QyW-rVABALvqt-OqQq5x2ZzQ0xbvBsSU,5520
31
31
  powertrain_build/replace_compu_tab_ref.py,sha256=E4pN_SelWnvplgn4oVbZui0mC4NwWHjPmDQLbp6SeM8,4921
32
- powertrain_build/rte_dummy.py,sha256=JoC1VAc0Fg4BvOF_GgHS1HxZwD3D1gA2h_0BmhLJKz4,12505
32
+ powertrain_build/rte_dummy.py,sha256=2thQwSOmceBcv4gP1pzOMnvrZCDH0gfgdmuEqcyFeRw,13516
33
33
  powertrain_build/sched_funcs.py,sha256=qUFfYQnEx_OuyRctz2jlnaJVY3w06NM9P_AbBBFN3y4,10589
34
34
  powertrain_build/signal.py,sha256=r43eTOfAn_lZ5vZtMv07eZ3SelPWfNAUEM6SdGf25bQ,160
35
35
  powertrain_build/signal_if_html_rep.py,sha256=FjaeQ_FP4jCbdkkTpm5A3NNXlIznCqiyvO0Nr-vZOcg,7978
@@ -117,14 +117,14 @@ powertrain_build/matlab_scripts/helperFunctions/updateModels.m,sha256=3hD54qmo2V
117
117
  powertrain_build/templates/Index_SigCheck_All.html,sha256=psLtxiw5UChCs35tYGwVkGujXHJNw3ibFaZc-JMMPdg,1602
118
118
  powertrain_build/templates/Index_SigIf_All.html,sha256=7hwH6XSrrh5sDDJAnGdJTjzI7HwOeZFfve60Ke4Wa_Q,1433
119
119
  powertrain_build/zone_controller/__init__.py,sha256=tzftZINv5NTXFxXz5H_ptDywSCr49cll2CVFtv4HyF8,113
120
- powertrain_build/zone_controller/calibration.py,sha256=2QZOFJMl4UP9GYlK4ZmAS9VoSlqSqJ2jSmGtVrSML6s,8380
120
+ powertrain_build/zone_controller/calibration.py,sha256=JR2DqZPwgGvOidXWRyhO9Rz17NKRBmtFL7IADqKdT-0,9116
121
121
  powertrain_build/zone_controller/composition_yaml.py,sha256=0dCnmvFFh9GPjDgHqAQjKOl75DocqWwrueOOXql6rhY,41726
122
- powertrain_build-1.14.0.dist-info/licenses/AUTHORS,sha256=tP9V0duq5X9hw2pos8WTLXN7kNHmVnhJqpmBFqIdHKI,276
123
- powertrain_build-1.14.0.dist-info/licenses/LICENSE,sha256=0tJvKn_0AWjVNJ4hkDXhVQZLOdCNwR_2u0UcxVrToOg,10452
124
- powertrain_build-1.14.0.dist-info/licenses/NOTICE,sha256=NIT_NaKZs4t_tVT4VO_AtJl3X39O8nL8L3pGXn9jK8M,465187
125
- powertrain_build-1.14.0.dist-info/METADATA,sha256=rb7melarqsqdlrqJfFmIDmnS0dd4qFMGKf6TZBJgs90,5217
126
- powertrain_build-1.14.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
127
- powertrain_build-1.14.0.dist-info/entry_points.txt,sha256=CdE3i43zDAllglVE3fwvKa7i0jvNqvipZJu0GTS5VOg,63
128
- powertrain_build-1.14.0.dist-info/pbr.json,sha256=F6j756U0kYhlsyPaqe0eFZkrxM1E0vXAWKYMolu8IOY,46
129
- powertrain_build-1.14.0.dist-info/top_level.txt,sha256=wAaR8OQEH2mb8_gudmo4l_RoNXgWvnB845ckD1BsguA,17
130
- powertrain_build-1.14.0.dist-info/RECORD,,
122
+ powertrain_build-1.14.1.dev3.dist-info/licenses/AUTHORS,sha256=tP9V0duq5X9hw2pos8WTLXN7kNHmVnhJqpmBFqIdHKI,276
123
+ powertrain_build-1.14.1.dev3.dist-info/licenses/LICENSE,sha256=0tJvKn_0AWjVNJ4hkDXhVQZLOdCNwR_2u0UcxVrToOg,10452
124
+ powertrain_build-1.14.1.dev3.dist-info/licenses/NOTICE,sha256=NIT_NaKZs4t_tVT4VO_AtJl3X39O8nL8L3pGXn9jK8M,465187
125
+ powertrain_build-1.14.1.dev3.dist-info/METADATA,sha256=cjT1RHcdcd9nc0LrI4GTqfFA5kvAN79a2mS-gDkbBDA,5222
126
+ powertrain_build-1.14.1.dev3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
127
+ powertrain_build-1.14.1.dev3.dist-info/entry_points.txt,sha256=CdE3i43zDAllglVE3fwvKa7i0jvNqvipZJu0GTS5VOg,63
128
+ powertrain_build-1.14.1.dev3.dist-info/pbr.json,sha256=op5u0SksFkCv7AlO0hDUDsGxOtG4bjfvW77veTMott0,47
129
+ powertrain_build-1.14.1.dev3.dist-info/top_level.txt,sha256=wAaR8OQEH2mb8_gudmo4l_RoNXgWvnB845ckD1BsguA,17
130
+ powertrain_build-1.14.1.dev3.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "b5ec3fe", "is_release": false}
@@ -1 +0,0 @@
1
- {"git_version": "791f4c9", "is_release": true}