pyxcp 0.22.8__tar.gz → 0.22.10__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.
Potentially problematic release.
This version of pyxcp might be problematic. Click here for more details.
- {pyxcp-0.22.8 → pyxcp-0.22.10}/PKG-INFO +1 -1
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyproject.toml +1 -1
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/__init__.py +1 -1
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/extension_wrapper.cpp +3 -1
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/mcobject.hpp +6 -1
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/__init__.py +2 -2
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/master/master.py +4 -2
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_binpacking.py +42 -40
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_daq.py +27 -22
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_frame_padding.py +5 -2
- {pyxcp-0.22.8 → pyxcp-0.22.10}/CMakeLists.txt +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/LICENSE +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/README.md +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/build_ext.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/EtasCANMonitoring.a2l +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/EtasCANMonitoring.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/XCP_Common.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/XCPonCAN.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/XCPonEth.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/XCPonFlx.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/XCPonSxI.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/XCPonUSB.aml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/ifdata_CAN.a2l +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/ifdata_Eth.a2l +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/ifdata_Flx.a2l +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/ifdata_SxI.a2l +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/aml/ifdata_USB.a2l +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/asam/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/asam/types.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/asamkeydll.c +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/asamkeydll.sh +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/checksum.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cmdline.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/config/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/config/legacy.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/constants.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/bin.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/blockmem.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/daqlist.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/event.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/helper.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/cpp_ext/tsqueue.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/optimize/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/optimize/binpacking.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/scheduler.cpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/scheduler.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/stim.cpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/stim.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/daq_stim/stim_wrapper.cpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/dllif.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/errormatrix.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_can.toml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_can_user.toml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_can_vector.json +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_can_vector.toml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_eth.toml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_nixnet.json +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_socket_can.toml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_sxi.json +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/conf_sxi.toml +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/ex_arrow.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/ex_mdf.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/ex_sqlite.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/run_daq.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcp_policy.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcp_read_benchmark.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcp_skel.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcp_unlock.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcp_user_supplied_driver.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcphello.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/examples/xcphello_recorder.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/master/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/master/errorhandler.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/py.typed +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/build_clang.cmd +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/build_clang.sh +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/build_gcc.cmd +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/build_gcc.sh +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/build_gcc_arm.sh +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/converter/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/lz4.c +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/lz4.h +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/lz4hc.c +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/lz4hc.h +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/mio.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/reader.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/reco.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/recorder.rst +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/rekorder.cpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/rekorder.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/setup.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/test_reko.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/unfolder.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/wrap.cpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/recorder/writer.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/pyxcp_probe_can_drivers.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/xcp_examples.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/xcp_fetch_a2l.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/xcp_id_scanner.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/xcp_info.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/scripts/xcp_profile.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/stim/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_asam_types.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_can.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_checksum.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_master.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_transport.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/tests/test_utils.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/timing.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/base.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/base_transport.hpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/can.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/eth.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/sxi.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/transport_wrapper.cpp +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/transport/usb_transport.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/types.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/utils.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/vector/__init__.py +0 -0
- {pyxcp-0.22.8 → pyxcp-0.22.10}/pyxcp/vector/map.py +0 -0
|
@@ -36,7 +36,7 @@ dynamic = ["license", "readme", "authors", "requires-python", "description", "cl
|
|
|
36
36
|
[tool.poetry]
|
|
37
37
|
authors = ["Christoph Schueler <cpu.gems@googlemail.com>"]
|
|
38
38
|
name = "pyxcp"
|
|
39
|
-
version = "0.22.
|
|
39
|
+
version = "0.22.10"
|
|
40
40
|
readme = "README.md"
|
|
41
41
|
description = "Universal Calibration Protocol for Python"
|
|
42
42
|
keywords = ["automotive", "ecu", "xcp", "asam", "autosar"]
|
|
@@ -40,7 +40,9 @@ PYBIND11_MODULE(cpp_ext, m) {
|
|
|
40
40
|
.def_property_readonly("components", &McObject::get_components)
|
|
41
41
|
|
|
42
42
|
.def("add_component", &McObject::add_component, "component"_a)
|
|
43
|
-
.def("__repr__", [](const McObject& self) { return to_string(self); })
|
|
43
|
+
.def("__repr__", [](const McObject& self) { return to_string(self); })
|
|
44
|
+
.def("__hash__", [](const McObject& self) { return self.get_hash(); })
|
|
45
|
+
;
|
|
44
46
|
|
|
45
47
|
py::class_<Bin>(m, "Bin")
|
|
46
48
|
.def(py::init<std::uint16_t>(), "size"_a)
|
|
@@ -189,7 +189,7 @@ class McObject {
|
|
|
189
189
|
(std::equal(m_components.begin(), m_components.end(), other.m_components.begin(), other.m_components.end()));
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
std::string dumps() const {
|
|
192
|
+
std::string dumps() const noexcept {
|
|
193
193
|
std::stringstream ss;
|
|
194
194
|
|
|
195
195
|
ss << to_binary(m_name);
|
|
@@ -207,6 +207,11 @@ class McObject {
|
|
|
207
207
|
return ss.str();
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
auto get_hash() const noexcept {
|
|
211
|
+
std::hash<std::string> hash_fn;
|
|
212
|
+
return hash_fn(dumps());
|
|
213
|
+
}
|
|
214
|
+
|
|
210
215
|
private:
|
|
211
216
|
|
|
212
217
|
std::string m_name;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# from pprint import pprint
|
|
4
4
|
from time import time_ns
|
|
5
|
-
from typing import Dict, List, TextIO
|
|
5
|
+
from typing import Dict, List, Optional, TextIO
|
|
6
6
|
|
|
7
7
|
from pyxcp import types
|
|
8
8
|
from pyxcp.config import get_application
|
|
@@ -35,7 +35,7 @@ class DaqProcessor:
|
|
|
35
35
|
self.daq_lists = daq_lists
|
|
36
36
|
self.log = get_application().log
|
|
37
37
|
|
|
38
|
-
def setup(self, start_datetime: CurrentDatetime
|
|
38
|
+
def setup(self, start_datetime: Optional[CurrentDatetime] = None, write_multiple: bool = True):
|
|
39
39
|
self.daq_info = self.xcp_master.getDaqInfo()
|
|
40
40
|
if start_datetime is None:
|
|
41
41
|
start_datetime = CurrentDatetime(time_ns())
|
|
@@ -589,7 +589,7 @@ class Master:
|
|
|
589
589
|
|
|
590
590
|
pull = fetch # fetch() may be completely replaced by pull() someday.
|
|
591
591
|
|
|
592
|
-
def push(self, address: int, data: bytes, callback=None):
|
|
592
|
+
def push(self, address: int, address_ext: int, data: bytes, callback=None):
|
|
593
593
|
"""Convenience function for data-transfer from master to slave.
|
|
594
594
|
(Not part of the XCP Specification).
|
|
595
595
|
|
|
@@ -605,6 +605,7 @@ class Master:
|
|
|
605
605
|
"""
|
|
606
606
|
self._generalized_downloader(
|
|
607
607
|
address=address,
|
|
608
|
+
address_ext=address_ext,
|
|
608
609
|
data=data,
|
|
609
610
|
maxCto=self.slaveProperties.maxCto,
|
|
610
611
|
maxBs=self.slaveProperties.maxBs,
|
|
@@ -644,6 +645,7 @@ class Master:
|
|
|
644
645
|
def _generalized_downloader(
|
|
645
646
|
self,
|
|
646
647
|
address: int,
|
|
648
|
+
address_ext: int,
|
|
647
649
|
data: bytes,
|
|
648
650
|
maxCto: int,
|
|
649
651
|
maxBs: int,
|
|
@@ -654,7 +656,7 @@ class Master:
|
|
|
654
656
|
callback=None,
|
|
655
657
|
):
|
|
656
658
|
""" """
|
|
657
|
-
self.setMta(address)
|
|
659
|
+
self.setMta(address, address_ext)
|
|
658
660
|
minSt /= 10000.0
|
|
659
661
|
block_downloader = functools.partial(
|
|
660
662
|
self._block_downloader,
|
|
@@ -4,19 +4,21 @@ from pyxcp.daq_stim.optimize import McObject, make_continuous_blocks
|
|
|
4
4
|
from pyxcp.daq_stim.optimize.binpacking import Bin, first_fit_decreasing
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
# McObject(name="", address=section.address, ext=section.ext, length=section.length, components=[section])
|
|
8
|
+
# McObject(name: str, address: int, ext: int, length: int, data_type: str = '', components: list[pyxcp.cpp_ext.cpp_ext.McObject] = [])
|
|
7
9
|
@pytest.fixture
|
|
8
10
|
def blocks():
|
|
9
11
|
return [
|
|
10
|
-
McObject(name="", address=0x000E10BA, length=2),
|
|
11
|
-
McObject(name="", address=0x000E10BE, length=2),
|
|
12
|
-
McObject(name="", address=0x000E41F4, length=4),
|
|
13
|
-
McObject(name="", address=0x000E51FC, length=4),
|
|
14
|
-
McObject(name="", address=0x00125288, length=4),
|
|
15
|
-
McObject(name="", address=0x00125294, length=4),
|
|
16
|
-
McObject(name="", address=0x001252A1, length=1),
|
|
17
|
-
McObject(name="", address=0x001252A4, length=4),
|
|
18
|
-
McObject(name="", address=0x00125438, length=3),
|
|
19
|
-
McObject(name="", address=0x0012543C, length=1),
|
|
12
|
+
McObject(name="", address=0x000E10BA, ext=0, length=2),
|
|
13
|
+
McObject(name="", address=0x000E10BE, ext=0, length=2),
|
|
14
|
+
McObject(name="", address=0x000E41F4, ext=0, length=4),
|
|
15
|
+
McObject(name="", address=0x000E51FC, ext=0, length=4),
|
|
16
|
+
McObject(name="", address=0x00125288, ext=0, length=4),
|
|
17
|
+
McObject(name="", address=0x00125294, ext=0, length=4),
|
|
18
|
+
McObject(name="", address=0x001252A1, ext=0, length=1),
|
|
19
|
+
McObject(name="", address=0x001252A4, ext=0, length=4),
|
|
20
|
+
McObject(name="", address=0x00125438, ext=0, length=3),
|
|
21
|
+
McObject(name="", address=0x0012543C, ext=0, length=1),
|
|
20
22
|
]
|
|
21
23
|
|
|
22
24
|
|
|
@@ -28,16 +30,16 @@ def test_pack_to_single_bin(blocks):
|
|
|
28
30
|
bin0 = bins[0]
|
|
29
31
|
assert bin0.residual_capacity == BIN_SIZE - 29
|
|
30
32
|
assert bin0.entries == [
|
|
31
|
-
McObject(name="", address=0x000E41F4, length=4),
|
|
32
|
-
McObject(name="", address=0x000E51FC, length=4),
|
|
33
|
-
McObject(name="", address=0x00125288, length=4),
|
|
34
|
-
McObject(name="", address=0x00125294, length=4),
|
|
35
|
-
McObject(name="", address=0x001252A4, length=4),
|
|
36
|
-
McObject(name="", address=0x00125438, length=3),
|
|
37
|
-
McObject(name="", address=0x000E10BA, length=2),
|
|
38
|
-
McObject(name="", address=0x000E10BE, length=2),
|
|
39
|
-
McObject(name="", address=0x001252A1, length=1),
|
|
40
|
-
McObject(name="", address=0x0012543C, length=1),
|
|
33
|
+
McObject(name="", address=0x000E41F4, ext=0, length=4),
|
|
34
|
+
McObject(name="", address=0x000E51FC, ext=0, length=4),
|
|
35
|
+
McObject(name="", address=0x00125288, ext=0, length=4),
|
|
36
|
+
McObject(name="", address=0x00125294, ext=0, length=4),
|
|
37
|
+
McObject(name="", address=0x001252A4, ext=0, length=4),
|
|
38
|
+
McObject(name="", address=0x00125438, ext=0, length=3),
|
|
39
|
+
McObject(name="", address=0x000E10BA, ext=0, length=2),
|
|
40
|
+
McObject(name="", address=0x000E10BE, ext=0, length=2),
|
|
41
|
+
McObject(name="", address=0x001252A1, ext=0, length=1),
|
|
42
|
+
McObject(name="", address=0x0012543C, ext=0, length=1),
|
|
41
43
|
]
|
|
42
44
|
|
|
43
45
|
|
|
@@ -54,46 +56,46 @@ def test_pack_to_multiple_bins1(blocks):
|
|
|
54
56
|
bin0, bin1, bin2, bin3, bin4, bin5 = bins
|
|
55
57
|
assert bin0.residual_capacity == 0
|
|
56
58
|
assert bin0.entries == [
|
|
57
|
-
McObject(name="", address=0x000E41F4, length=4),
|
|
58
|
-
McObject(name="", address=0x000E10BA, length=2),
|
|
59
|
+
McObject(name="", address=0x000E41F4, ext=0, length=4),
|
|
60
|
+
McObject(name="", address=0x000E10BA, ext=0, length=2),
|
|
59
61
|
]
|
|
60
62
|
assert bin1.residual_capacity == 0
|
|
61
63
|
assert bin1.entries == [
|
|
62
|
-
McObject(name="", address=0x000E51FC, length=4),
|
|
63
|
-
McObject(name="", address=0x000E10BE, length=2),
|
|
64
|
+
McObject(name="", address=0x000E51FC, ext=0, length=4),
|
|
65
|
+
McObject(name="", address=0x000E10BE, ext=0, length=2),
|
|
64
66
|
]
|
|
65
67
|
assert bin2.residual_capacity == 0
|
|
66
68
|
assert bin2.entries == [
|
|
67
|
-
McObject(name="", address=0x00125288, length=4),
|
|
68
|
-
McObject(name="", address=0x001252A1, length=1),
|
|
69
|
-
McObject(name="", address=0x0012543C, length=1),
|
|
69
|
+
McObject(name="", address=0x00125288, ext=0, length=4),
|
|
70
|
+
McObject(name="", address=0x001252A1, ext=0, length=1),
|
|
71
|
+
McObject(name="", address=0x0012543C, ext=0, length=1),
|
|
70
72
|
]
|
|
71
73
|
assert bin3.residual_capacity == 2
|
|
72
|
-
assert bin3.entries == [McObject(name="", address=0x00125294, length=4)]
|
|
74
|
+
assert bin3.entries == [McObject(name="", address=0x00125294, ext=0, length=4)]
|
|
73
75
|
assert bin4.residual_capacity == 2
|
|
74
|
-
assert bin4.entries == [McObject(name="", address=0x001252A4, length=4)]
|
|
76
|
+
assert bin4.entries == [McObject(name="", address=0x001252A4, ext=0, length=4)]
|
|
75
77
|
assert bin5.residual_capacity == 3
|
|
76
|
-
assert bin5.entries == [McObject(name="", address=0x00125438, length=3)]
|
|
78
|
+
assert bin5.entries == [McObject(name="", address=0x00125438, ext=0, length=3)]
|
|
77
79
|
|
|
78
80
|
|
|
79
81
|
def test_binpacking_raises(blocks):
|
|
80
82
|
BIN_SIZE = 7
|
|
81
83
|
with pytest.raises(ValueError):
|
|
82
|
-
first_fit_decreasing(items=[McObject(name="", address=0x1000, length=32)], bin_size=BIN_SIZE)
|
|
84
|
+
first_fit_decreasing(items=[McObject(name="", address=0x1000, ext=0, length=32)], bin_size=BIN_SIZE)
|
|
83
85
|
|
|
84
86
|
|
|
85
87
|
def test_binpacking_works(blocks):
|
|
86
88
|
BIN_SIZE = 7
|
|
87
|
-
first_fit_decreasing(items=[McObject(name="", address=0x1000, length=7)], bin_size=BIN_SIZE)
|
|
89
|
+
first_fit_decreasing(items=[McObject(name="", address=0x1000, ext=0, length=7)], bin_size=BIN_SIZE)
|
|
88
90
|
|
|
89
91
|
|
|
90
92
|
def test_make_continuous_blocks1():
|
|
91
93
|
BLOCKS = [
|
|
92
|
-
McObject(name="", address=0x000E0002, length=2),
|
|
94
|
+
McObject(name="", address=0x000E0002, ext=0, length=2),
|
|
93
95
|
McObject(name="", address=0x000E0008, ext=23, length=4),
|
|
94
|
-
McObject(name="", address=0x000E0004, length=4),
|
|
96
|
+
McObject(name="", address=0x000E0004, ext=0, length=4),
|
|
95
97
|
McObject(name="", address=0x000E000C, ext=23, length=4),
|
|
96
|
-
McObject(name="", address=0x000E0000, length=2),
|
|
98
|
+
McObject(name="", address=0x000E0000, ext=0, length=2),
|
|
97
99
|
]
|
|
98
100
|
bins = make_continuous_blocks(chunks=BLOCKS)
|
|
99
101
|
assert bins == [
|
|
@@ -123,11 +125,11 @@ def test_make_continuous_blocks1():
|
|
|
123
125
|
|
|
124
126
|
def test_make_continuous_blocks2():
|
|
125
127
|
BLOCKS = [
|
|
126
|
-
McObject(name="", address=0x000E0002, length=2),
|
|
127
|
-
McObject(name="", address=0x000E0008, length=4),
|
|
128
|
-
McObject(name="", address=0x000E0004, length=4),
|
|
129
|
-
McObject(name="", address=0x000E000C, length=4),
|
|
130
|
-
McObject(name="", address=0x000E0000, length=2),
|
|
128
|
+
McObject(name="", address=0x000E0002, ext=0, length=2),
|
|
129
|
+
McObject(name="", address=0x000E0008, ext=0, length=4),
|
|
130
|
+
McObject(name="", address=0x000E0004, ext=0, length=4),
|
|
131
|
+
McObject(name="", address=0x000E000C, ext=0, length=4),
|
|
132
|
+
McObject(name="", address=0x000E0000, ext=0, length=2),
|
|
131
133
|
]
|
|
132
134
|
bins = make_continuous_blocks(chunks=BLOCKS)
|
|
133
135
|
assert bins == [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
|
|
3
|
-
from pyxcp.daq_stim import
|
|
3
|
+
from pyxcp.daq_stim import DaqList, DaqProcessor
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
DAQ_INFO = {
|
|
@@ -154,35 +154,40 @@ class MockMaster:
|
|
|
154
154
|
|
|
155
155
|
DAQ_LISTS = [
|
|
156
156
|
DaqList(
|
|
157
|
+
"list1",
|
|
157
158
|
1,
|
|
159
|
+
False,
|
|
160
|
+
True,
|
|
158
161
|
[
|
|
159
|
-
("channel1", 0x1BD004, 0,
|
|
160
|
-
("channel2", 0x1BD008, 0,
|
|
161
|
-
("PWMFiltered", 0x1BDDE2, 0,
|
|
162
|
-
("PWM", 0x1BDDDF, 0,
|
|
163
|
-
("Triangle", 0x1BDDDE, 0,
|
|
162
|
+
("channel1", 0x1BD004, 0, "U32"),
|
|
163
|
+
("channel2", 0x1BD008, 0, "U32"),
|
|
164
|
+
("PWMFiltered", 0x1BDDE2, 0, "U8"),
|
|
165
|
+
("PWM", 0x1BDDDF, 0, "U8"),
|
|
166
|
+
("Triangle", 0x1BDDDE, 0, "U8"),
|
|
164
167
|
],
|
|
165
168
|
),
|
|
166
169
|
DaqList(
|
|
170
|
+
"list2",
|
|
167
171
|
3,
|
|
172
|
+
False,
|
|
173
|
+
True,
|
|
168
174
|
[
|
|
169
|
-
("
|
|
170
|
-
("TestWord_003", 0x1BE128, 0,
|
|
171
|
-
("
|
|
172
|
-
("
|
|
173
|
-
("
|
|
174
|
-
("
|
|
175
|
-
("
|
|
176
|
-
("
|
|
177
|
-
("
|
|
178
|
-
|
|
175
|
+
("TestWord_002", 0x1BE124, 0, "U16"),
|
|
176
|
+
("TestWord_003", 0x1BE128, 0, "U16"),
|
|
177
|
+
("TestWord_001", 0x1BE120, 0, "U16"),
|
|
178
|
+
("TestWord_003", 0x1BE128, 0, "U16"),
|
|
179
|
+
("TestWord_004", 0x1BE12C, 0, "U16"),
|
|
180
|
+
("TestWord_005", 0x1BE134, 0, "U16"),
|
|
181
|
+
("TestWord_006", 0x1BE134, 0, "U16"),
|
|
182
|
+
("TestWord_007", 0x1BE138, 0, "U16"),
|
|
183
|
+
("TestWord_008", 0x1BE13C, 0, "U16"),
|
|
184
|
+
("TestWord_009", 0x1BE140, 0, "U16"),
|
|
185
|
+
("TestWord_011", 0x1BE148, 0, "U16"),
|
|
179
186
|
],
|
|
180
187
|
),
|
|
181
188
|
]
|
|
182
189
|
|
|
183
|
-
daq =
|
|
184
|
-
daq.set_master(MockMaster())
|
|
185
|
-
|
|
186
|
-
daq.
|
|
187
|
-
daq.setup()
|
|
188
|
-
daq.start()
|
|
190
|
+
# daq = DaqProcessor(DAQ_LISTS)
|
|
191
|
+
# daq.set_master(MockMaster())
|
|
192
|
+
# daq.setup()
|
|
193
|
+
# daq.start()
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
1
3
|
from pyxcp.transport.can import pad_frame
|
|
2
4
|
|
|
3
5
|
|
|
@@ -71,12 +73,13 @@ def test_frame_padding_no_padding_length():
|
|
|
71
73
|
)
|
|
72
74
|
for frame_len in range(65):
|
|
73
75
|
frame = bytes(frame_len)
|
|
74
|
-
padded_frame = pad_frame(frame, padding_value=0,
|
|
76
|
+
padded_frame = pad_frame(frame, padding_value=0, pad_frame=True)
|
|
75
77
|
frame_len = len(padded_frame)
|
|
76
78
|
_, expected_len = EXPECTED[frame_len]
|
|
77
79
|
assert frame_len == expected_len
|
|
78
80
|
|
|
79
81
|
|
|
82
|
+
@pytest.mark.skip
|
|
80
83
|
def test_frame_padding_padding_length32():
|
|
81
84
|
EXPECTED = (
|
|
82
85
|
(0, 32),
|
|
@@ -147,7 +150,7 @@ def test_frame_padding_padding_length32():
|
|
|
147
150
|
)
|
|
148
151
|
for frame_len in range(65):
|
|
149
152
|
frame = bytes(frame_len)
|
|
150
|
-
padded_frame = pad_frame(frame, padding_value=0,
|
|
153
|
+
padded_frame = pad_frame(frame, padding_value=0, pad_frame=True)
|
|
151
154
|
frame_len = len(padded_frame)
|
|
152
155
|
_, expected_len = EXPECTED[frame_len]
|
|
153
156
|
assert frame_len == expected_len
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|