Skip to content

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Feb 26, 2025

Problem:

  • All runtime arguments to logs are assumed by the mipi encoder to be std::uint32_t.
  • In reality, the mipi spec supports 64-bit values as well. (See MIPI-SyS-T spec table 16.) In particular, logging a time value (from a std::chrono::duration) needs to account for 64 bits.

Solution:

  • Pack integral values properly according to the spec. Anything 32 bits or less is packed as 32 bits. If it's 64-bits, it's packed that way.
  • The XML output strings use the appropriate (printf-like) specifiers.
  • The JSON output retains the C++ types, as does the generated C++.

Notes:

  • Table 16 allows 64-bit integral values even when the catalog message subtype is *_P32.
  • Floating point and pointer values are supported by MIPI but not by this code. Maybe in future, if there is a use case.

@elbeno elbeno force-pushed the fix-mipi-arg-encoding branch from c555269 to 378b488 Compare February 26, 2025 22:46
@elbeno elbeno force-pushed the fix-mipi-arg-encoding branch 2 times, most recently from 5913ac4 to e8f119d Compare February 28, 2025 22:23
Problem:
- All runtime arguments to logs are assumed by the mipi encoder to be
  `std::uint32_t`.
- In reality, the mipi spec supports 64-bit values as well. (See MIPI-SyS-T spec
  table 16.) In particular, logging a time value (from a
  `std::chrono::duration`) needs to account for 64 bits.

Solution:
- Pack integral values properly according to the spec. Anything 32 bits or less
  is packed as 32 bits. If it's 64-bits, it's packed that way.
- The XML output strings use the appropriate (printf-like) specifiers.
- The JSON output retains the C++ types, as does the generated C++.

Notes:
- Table 16 allows 64-bit integral values even when the catalog message subtype
  is *_P32.
- Floating point and pointer values are supported by MIPI but not by this code.
  Maybe in future, if there is a use case.
@elbeno elbeno force-pushed the fix-mipi-arg-encoding branch from e8f119d to 68b18cd Compare March 3, 2025 21:02
@lukevalenty lukevalenty enabled auto-merge March 4, 2025 17:34
@lukevalenty lukevalenty merged commit 45052f1 into intel:main Mar 4, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants