CIRCT
23.0.0git
Loading...
Searching...
No Matches
lib
Dialect
ESI
runtime
tests
integration
test_serialization_probes.py
Go to the documentation of this file.
1
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2
# See https://llvm.org/LICENSE.txt for license information.
3
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
"""Pytest harness for the SerializationProbes integration test.
5
6
This builds the C++ driver under ``sw/serialization_probes.cpp`` against
7
generated ESI facade headers and runs it against a cosim-driven instance of
8
``hw/serialization_probes.py``. Each probe asserts an exact, position-revealing
9
result so any drift in the host serializer or deserializer (vs hardware)
10
fails loudly.
11
"""
12
13
from
__future__
import
annotations
14
15
from
pathlib
import
Path
16
17
from
esiaccel.cosim.pytest
import
cosim_test
18
19
from
.conftest
import
HW_DIR, build_cpp_test, run_probe
20
21
PROBES = [
22
"byte_rotate1"
,
23
"byte_pattern_const"
,
24
"byte_pattern_echo_eq"
,
25
"sign_probe"
,
26
"sign_probe13"
,
27
"pack_probe"
,
28
"bit_pack_probe"
,
29
"array_probe"
,
30
]
31
32
33
@cosim_test(HW_DIR / "serialization_probes.py")
34
class
TestSerializationProbes
:
35
"""End-to-end serialization-correctness probes."""
36
37
def
test_serialization_probes_cpp
(self, host: str, port: int,
38
sources_dir: Path) ->
None
:
39
binary = build_cpp_test(sources_dir,
"serialization_probes_test"
,
40
"serialization_probes"
)
41
for
probe
in
PROBES:
42
run_probe(binary, host, port, probe)
tests.integration.test_serialization_probes.TestSerializationProbes
Definition
test_serialization_probes.py:34
tests.integration.test_serialization_probes.TestSerializationProbes.test_serialization_probes_cpp
None test_serialization_probes_cpp(self, str host, int port, Path sources_dir)
Definition
test_serialization_probes.py:38
Generated on Sat May 23 2026 00:26:29 for CIRCT by
1.9.8