VS Code extension
Building a module
Describe a module and get RTL, a testbench and verified results as files in your workspace.
Building from scratch is the simplest way to use the extension. You describe a module, and a few minutes later the RTL and its testbench are open in your editor, simulated and checked against synthesis.
Your first module
- 1
Open a folder
Generated files are saved inside the folder you have open in VS Code. Any folder works; a fresh one is fine.
- 2
Start a new chat and pick From scratch
It is the default on a new chat.
- 3
Describe the module
Say what it does, its ports and widths, and how it resets. The more of that you include, the closer the first result is to what you had in mind. See Writing a good spec.
Example 8-bit up counter with synchronous active-low reset and an enable input. It wraps to 0 after 255. - 4
Press Enter
In Plan mode you are asked a few questions first; see below. In Agent mode the run starts straight away.
- 5
Read the result
When the run finishes, the module and its testbench open in the editor and the turn in the panel sums up what was built.
Balanced modelcompleted
An 8-bit up counter with synchronous reset and an enable. The testbench covers reset, hold and wrap-around.
✓ tests pass
SimulationpassedSynthesisSynthesized cleanlycounter.sv tb_counter.svSaved to silicode/8-bit-counter/
A finished build in the panel.
Where the files go
Each chat gets its own folder under silicode/ in your workspace, named after the chat, for example silicode/8-bit-counter/. The module and its testbench are saved there as counter.sv and tb_counter.sv (or .vhd files for VHDL). The folder name can be changed in Settings.
- Click a file name under a turn to open that file. Files from older turns open as read-only copies, so you can look back without touching the current version.
- Ask for a change and the next version replaces the file. VS Code opens a diff of the previous version against the new one, so you see exactly what changed.
- The compare button next to the file names reopens that diff whenever you want it.
- Written files are ordinary files. Edit them, commit them, or move them wherever your project needs them.
Reading the result
| Part of the turn | What it tells you |
|---|---|
| Summary | What was built and anything worth knowing about it. |
| Test line | ✓ tests pass or ✕ tests failing, from the testbench that was run against the module. |
| Simulation | A collapsible section with the pass and fail counts, compile errors and failing checks. Show raw output gives you the full log. |
| Synthesis | A collapsible section with the resource estimate and any warnings, such as inferred latches, grouped so they are easy to read. |
These are the same results the web app shows; see Files and the code panel for what each number means.
Clarifying questions in Plan mode
In Plan mode a short list of questions appears before the run starts. Each one comes with a recommended answer. Press Use this to accept one, Tab in an empty answer to do the same, or Use all to accept every recommendation at once. Then press Continue. See Clarifying questions.
Bringing in code from the editor
To ask about code you already have, select it in the editor and either use the paperclip and Add selection from editor, or right-click the selection and choose SiliCode: Add Selection to Chat. It shows up as a chip above the message box and is sent with your next message. With nothing selected, the whole active file is added.
Follow-ups
Keep asking in the same chat to refine the module: add a port, change the reset, widen a counter. Each follow-up builds on the latest version, and each new version arrives as a diff against the one before.
Tip