pub fn translates(
_variable: VariableMeta<(), ()>,
) -> FnResult<TranslationPreference>
Expand description
Returns a translation preference for the specified variable, which allows the translator to opt out of translating certain signals which it does not support.
For example, a translator which translates 32 bit floating point values should return
[TranslationPreference::Yes] for bit variables with num_bits == 32
and
[TranslationPreference::No] for other signals.
Translators also have the option of returning [TranslationPreference::Prefer] to not only allow their use on a signal, but make it the default translator for that signal. This should be used with caution and only in cases where the translator is sure that the translator is a sane default. A prototypical example is translators for custom HDLs where it is known that the signal came from the custom HDL.