How to quickly fix compilation problems using DVT AI Assistant in VS Code
Overview
This video demonstrates how to easily fix compilation errors and warnings and explain complex issues using the DVT AI Assistant. It also shows how to customize prompts in order to apply your preferred fixing approach for specific problems.
This video was made with DVT version 25.3.19.
Details
Introduction
You can easily fix compilation errors and warnings using the DVT AI Assistant.
Fixing a compilation problem
Let's take this "UNDEFINED_OPERATOR" error for example.
To fix it, either click on the "Quick Fix" link in the tooltip or place the editor cursor on the error line, press "Ctrl + ." and select "Fix using DVT AI Assistant".
Notice the fix being inserted in the editor. When done, DVT's incremental compilation automatically validates the changes. As you can see, the problem has already been cleared.
By the way, if you ever get an erroneous reply, you can use the compare editor to revert it.
Explaining a compilation problem
The underlying reasons that lead to compilation problems are not always immediately clear.
In such situations, you can select the "Explain using DVT AI Assistant" option to gain more insight.
When prompting the model for a fix or explanation, DVT AI Assistant includes a carefully crafted context for the problem.
Notice how the explanation is streamed in the chat, this time containing several fix suggestions. For our particular case, the alternative fix seems more appropriate so let's inject it in the editor straight from the chat.
Customizing problem auto-correct prompts
Now let's take another example - this "FEEDTHROUGH" warning detected in the design.
It looks like our model favors adding a register to break the combinational path, however we'd prefer removing the feedthrough altogether.
To tweak the prompt for particular scenarios such as this one, from the AI Assistant commands list select "Create New Problem Auto-correct Blueprint".
Let's give the newly created blueprint a meaningful name, configure the message patterns list to match only "feedthrough" problems and add specific instructions in the prompt.
Now, when fixing with AI Assistant, the newly added blueprint has an associated entry in the proposals list, and our preferred approach is applied.