This disclosure describes the use of a language model to improve the readability of generated Register-Transfer Level (RTL) code. The language model is provided with a prompt that includes generated RTL and (optionally), the original hardware description. The model produces as output a readable version of the RTL. Prompts can be iterated upon automatically, e.g. if the code fails to pass a test (e.g., a lint test) or does not compile, or manually if the user prefers the output to be in a particular style. The readable RTL output by the language model can be subjected to a logic equivalence check (LEC) to confirm that the output readable RTL is equivalent to the input RTL to ensure that the behavior of the design is identical. Unlike a traditional code formatter, a language model can perform complex transformations and interpret the ideas in a block of code. A language model can also generate meaningful comments as part of the output.

Creative Commons License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.