We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently the cpp_transpiler only converts type definitions for use in C++:
xls/xls/dslx/cpp_transpiler/cpp_transpiler.cc
Lines 107 to 108 in fe11876
It would be useful to also convert constants so that the C++ is aware of the parametrization of DSLX types.
In some cases, you could make fake types in the DSLX library that would generate what you want as a side effect. For example:
const FOO = u32:32; // constant I care about type FooBits = bits[FOO];
would generate something like
using FooBits = uint32_t; constexpr int64_t kFooBitsWidth = 32; // hurray!
Alternatively, the constants can be redefined in the consumer C++ library, but this creates multiples sources of truth.
Emit DSLX const definitions in the C++ generated library.
const
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What's hard to do? (limit 100 words)
Currently the cpp_transpiler only converts type definitions for use in C++:
xls/xls/dslx/cpp_transpiler/cpp_transpiler.cc
Lines 107 to 108 in fe11876
It would be useful to also convert constants so that the C++ is aware of the parametrization of DSLX types.
Current best alternative workaround (limit 100 words)
In some cases, you could make fake types in the DSLX library that would generate what you want as a side effect. For example:
would generate something like
Alternatively, the constants can be redefined in the consumer C++ library, but this creates multiples sources of truth.
Your view of the "best case XLS enhancement" (limit 100 words)
Emit DSLX
const
definitions in the C++ generated library.The text was updated successfully, but these errors were encountered: