|
CIRCT 23.0.0git
|
Classes | |
| class | AckArgs |
| class | CallbackWindowedList |
| class | CallServiceCallback |
| class | ChannelWindowedListRead |
| class | ChannelWindowedListWrite |
| class | CustomServiceDeclChannel |
| class | EventStruct |
| class | HostComms |
| class | IndexedFuncGroup |
| class | MmioReadWrite |
| class | NotifyArgs |
| class | OddInner |
| class | OddStruct |
| class | StructArgs |
| class | StructResult |
| class | TelemetryMetric |
| class | Top |
| class | TransformListItem |
| class | TypedFuncArrayResult |
| class | TypedFuncMultiArg |
| class | TypedFuncNestedStruct |
| class | TypedFuncStruct |
| class | TypedFuncSubByteSigned |
| class | TypedFuncVoidArg |
| class | TypedFuncVoidResult |
| class | TypedFuncWindowedList |
| class | TypedReadChannelStruct |
| class | TypedWriteChannelByte |
| class | VoidComms |
Functions | |
| _build_harness_manifest () | |
| test_codegen_round_trip (tmp_path) | |
| str | _emit (type_table, str system_name="test_ns") |
| test_unbounded_field_skips_struct_with_comment () | |
Variables | |
| SendI8 = Bundle([BundledChannel("send", ChannelDirection.FROM, Bits(8))]) | |
| RecvI8 = Bundle([BundledChannel("recv", ChannelDirection.TO, Bits(8))]) | |
| SendI0 = Bundle([BundledChannel("send", ChannelDirection.FROM, Bits(0))]) | |
| RecvI0 = Bundle([BundledChannel("recv", ChannelDirection.TO, Bits(0))]) | |
| int | ArrayArg = SInt(8) * 1 |
| ArrayResult = TypeAlias(SInt(8) * 2, "ArrayResult") | |
| int | _TRANSFORM_LIST_BULK_WIDTH = 16 |
| int | _TRANSFORM_LIST_ITEMS_PER_FRAME = 1 |
| _TRANSFORM_LIST_STRUCT = StructType([("data", List(TransformListItem))]) | |
| _transform_list_window | |
| int | _WINDOW_PROBE_TAG = 0xCAFE |
| list | _WINDOW_PROBE_ITEMS = [10, 20, 30, 40] |
| int | _WINDOW_PROBE_BULK_WIDTH = 16 |
| int | _WINDOW_PROBE_ITEMS_PER_FRAME = 1 |
| _window_probe_struct | |
| _window_probe_window | |
| bsp = get_bsp(sys.argv[2] if len(sys.argv) > 2 else None) | |
| s = System(bsp(Top), name="TestCodegen", output_directory=sys.argv[1]) | |
| _HARNESS_DIR = Path(__file__).parent | |
| requires_cmake | |
| _uint1 = types.UIntType("ui1", 1) | |
| _uint2 = types.UIntType("ui2", 2) | |
| _uint3 = types.UIntType("ui3", 3) | |
| _uint7 = types.UIntType("ui7", 7) | |
| _uint8 = types.UIntType("ui8", 8) | |
| _uint12 = types.UIntType("ui12", 12) | |
| _uint16 = types.UIntType("ui16", 16) | |
| _uint24 = types.UIntType("ui24", 24) | |
| _uint32 = types.UIntType("ui32", 32) | |
| _uint64 = types.UIntType("ui64", 64) | |
| _sint5 = types.SIntType("si5", 5) | |
| _sint7 = types.SIntType("si7", 7) | |
| _sint8 = types.SIntType("si8", 8) | |
| _sint16 = types.SIntType("si16", 16) | |
| _sint24 = types.SIntType("si24", 24) | |
| _sint32 = types.SIntType("si32", 32) | |
| _sint64 = types.SIntType("si64", 64) | |
| _bits128 = types.BitsType("bits128", 128) | |
| _uint96 = types.UIntType("ui96", 96) | |
| _uint128 = types.UIntType("ui128", 128) | |
| _sint96 = types.SIntType("si96", 96) | |
| _sint128 = types.SIntType("si128", 128) | |
Hardware design for the codegen + port-kind coverage integration test. Where ``serialization_probes.py`` exercises wire-format invariants, this design exercises the *port-kind* surface area of the ESI runtime + facade codegen. Each probe module here is named for the codegen / runtime path it exercises so a regression in any single path lights up exactly one driver assertion.
End-to-end tests for `esiaccel.codegen`. The bulk of the verification is delegated to `codegen_harness.cpp` in this directory: the Python side generates a `types.h` from a representative manifest, compiles the harness against it, and runs the result. The harness exercises every accessor path (Path A / B / C, bool, nested struct, array, union, window) and checks both the user-visible round-trip and the underlying wire bytes. Reviewers can read the harness directly to see what the codegen is contracted to do. A small number of Python-level tests cover behaviours the harness can't exercise — ordering, name collisions, type aliases, and the "skip with a comment" path for unsupported / window-containing / fully-collapsed structs.
|
protected |
Build the type table the `codegen_harness.cpp` test program references. The aliases below give every emitted struct a stable, hand-written C++ name (e.g. `StdU`) so the harness can use plain identifiers rather than spelling the auto-generated mangled names.
Definition at line 70 of file test_codegen.py.
Referenced by test_codegen_round_trip().
|
protected |
Run the planner + emitter against `type_table` and return `types.h`.
Definition at line 392 of file test_codegen.py.
Referenced by test_unbounded_field_skips_struct_with_comment().
| test_codegen.test_codegen_round_trip | ( | tmp_path | ) |
Compile `codegen_harness.cpp` against a freshly-generated `types.h` and run it. The harness asserts every wire-format and accessor invariant end-to-end; this Python test just drives the cmake build and reports failures.
Definition at line 296 of file test_codegen.py.
References _build_harness_manifest().
| test_codegen.test_unbounded_field_skips_struct_with_comment | ( | ) |
A struct whose payload type has no bounded width (e.g. `!esi.any`) cannot be expressed in the raw-bytes layout; the codegen drops the whole struct and leaves an `Unsupported type` comment behind so callers see why the symbol they expected is missing.
Definition at line 401 of file test_codegen.py.
References _emit().
|
protected |
Definition at line 59 of file test_codegen.py.
|
protected |
Definition at line 31 of file test_codegen.py.
|
protected |
Definition at line 63 of file test_codegen.py.
|
protected |
Definition at line 50 of file test_codegen.py.
|
protected |
Definition at line 51 of file test_codegen.py.
|
protected |
Definition at line 52 of file test_codegen.py.
|
protected |
Definition at line 47 of file test_codegen.py.
|
protected |
Definition at line 53 of file test_codegen.py.
|
protected |
Definition at line 48 of file test_codegen.py.
|
protected |
Definition at line 49 of file test_codegen.py.
|
protected |
Definition at line 62 of file test_codegen.py.
|
protected |
Definition at line 521 of file test_codegen.py.
|
protected |
Definition at line 522 of file test_codegen.py.
|
protected |
Definition at line 529 of file test_codegen.py.
|
protected |
Definition at line 530 of file test_codegen.py.
|
protected |
Definition at line 37 of file test_codegen.py.
|
protected |
Definition at line 42 of file test_codegen.py.
|
protected |
Definition at line 61 of file test_codegen.py.
|
protected |
Definition at line 43 of file test_codegen.py.
|
protected |
Definition at line 38 of file test_codegen.py.
|
protected |
Definition at line 44 of file test_codegen.py.
|
protected |
Definition at line 39 of file test_codegen.py.
|
protected |
Definition at line 45 of file test_codegen.py.
|
protected |
Definition at line 46 of file test_codegen.py.
|
protected |
Definition at line 40 of file test_codegen.py.
|
protected |
Definition at line 41 of file test_codegen.py.
|
protected |
Definition at line 60 of file test_codegen.py.
|
protected |
Definition at line 595 of file test_codegen.py.
|
protected |
Definition at line 594 of file test_codegen.py.
|
protected |
Definition at line 596 of file test_codegen.py.
|
protected |
Definition at line 597 of file test_codegen.py.
|
protected |
Definition at line 593 of file test_codegen.py.
|
protected |
Definition at line 599 of file test_codegen.py.
| int test_codegen.ArrayArg = SInt(8) * 1 |
Definition at line 486 of file test_codegen.py.
| test_codegen.ArrayResult = TypeAlias(SInt(8) * 2, "ArrayResult") |
Definition at line 487 of file test_codegen.py.
Referenced by test_codegen.TypedFuncArrayResult.construct().
| test_codegen.bsp = get_bsp(sys.argv[2] if len(sys.argv) > 2 else None) |
Definition at line 882 of file test_codegen.py.
| test_codegen.RecvI0 = Bundle([BundledChannel("recv", ChannelDirection.TO, Bits(0))]) |
Definition at line 29 of file test_codegen.py.
| test_codegen.RecvI8 = Bundle([BundledChannel("recv", ChannelDirection.TO, Bits(8))]) |
Definition at line 27 of file test_codegen.py.
| test_codegen.requires_cmake |
Definition at line 33 of file test_codegen.py.
Definition at line 883 of file test_codegen.py.
| test_codegen.SendI0 = Bundle([BundledChannel("send", ChannelDirection.FROM, Bits(0))]) |
Definition at line 28 of file test_codegen.py.
| test_codegen.SendI8 = Bundle([BundledChannel("send", ChannelDirection.FROM, Bits(8))]) |
Definition at line 26 of file test_codegen.py.