Normal Mode¶
This chapter starts a toffee-ut:ut verification task directly, with a single Super. OpenCode runs the model and calls verification tools over MCP. To open UCAgent first and specify the DUT in one sentence, see Global Agent.
This chapter uses a 64-bit adder example where the sum bit width is intentionally truncated. The example is used to illustrate the workflow; actual projects should replace it with their own RTL and verification requirements.
2.1 Prepare the DUT¶
Create the RTL input directory in the project directory:
Adder/Adder.v:
Also prepare Adder/README.md to clearly define the expected behavior, for example:
The RTL here intentionally provides one fewer bit for sum to demonstrate detecting inconsistencies with the specification. In actual projects, interfaces, timing, and constraints should be clearly documented; the README is a workflow input, and the Agent should not be allowed to guess the specification on its own.
2.2 Prepare the ToffeeUT Workspace¶
After installing the prerequisites, run this from the project directory:
To use the bundled example instead, run the command from the source repository root and replace --source Adder with --source examples/Adder. The prepared workspace contains:
Preparation preserves the RTL, specifications, and relative include paths. ToffeeUT inventories inputs, initializes the project, then invokes Picker and Verilator through BuildToffeeDUT during the build stage. For a complex DUT, register its specifications and build recipe using --config; workflow purposes and task recipes are in the ToffeeUT user guide (Chinese).
2.3 Configure the Model¶
If you already configured a model and authentication in OpenCode, reuse those settings. For an OpenAI-compatible service, you can also configure the connection through environment variables:
You can also write openai.model_name, openai.openai_api_key, and openai.openai_api_base in config.yaml. See Workflow Configuration for configuration loading order and override rules.
The built-in configuration treats --no-embed-tools as enabled by default, meaning embedded/retrieval tools are disabled. If you need to use these tools, pass it explicitly:
This only affects embedded tools, not regular file and test tools.
2.4 Start Verification¶
From the project directory, start verification in the output/toffee_Adder/ workspace prepared above:
--loop starts execution after the TUI is ready. If you omit it, enter loop or loop "additional requirements" in the console. To reopen the same task, use the same workspace, DUT, and output directory.
2.5 Intervention During Execution¶
Type status at the bottom of the TUI to view the phase status, and type current_tips to view guidance for the current phase. To intervene, press Ctrl+C to request foreground cancellation and wait for it to finish. Repair files or the environment, run tool_invoke Check, then wait for its result before entering loop. See Human-in-the-Loop Verification and TUI for complete commands and the human review process.
2.6 Result Locations¶
ToffeeUT writes to output/toffee_Adder/ut_project/ by default. Specifications and verification summaries are in docs/. Actual build and test logs, per-case results, coverage, and available waveforms are in results/. See Result Analysis and Workflow Summary for details.