You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add backward compatibility for new instruction schema format (#1092)
This pull request enhances support for a new instruction schema in the
code generator by adding logic to interpret and convert the newer
`format` field into the legacy `encoding` format when loading
instructions. This ensures backward compatibility and smoother migration
to the new schema without breaking existing functionality.
**Support for new instruction schema:**
* Added a new function `build_match_from_format` in `generator.py` to
construct a match string from the `format` field, supporting 16-, 32-,
and 48-bit instructions. This function interprets opcode and variable
bit locations and values to generate the appropriate match string.
* Updated the instruction loading logic in `load_instructions` to detect
when only a `format` field (and not an `encoding` field) is present. If
found, it uses `build_match_from_format` to synthesize an `encoding`
entry, allowing the rest of the pipeline to function unchanged. If
conversion fails, the instruction is filtered out with an error log.
---------
Signed-off-by: Afonso Oliveira <[email protected]>
Co-authored-by: Afonso Oliveira <[email protected]>
0 commit comments