| name | dv-flow-manager |
| description | Create and modify DV Flow Manager (dfm) YAML-based build flows for silicon design and verification projects. Use when working with flow.yaml, flow.dv files, or dfm commands. Use when this capability is needed. |
| metadata | {"author":"dv-flow"} |
DV Flow Manager (dfm)
DV Flow Manager is a YAML-based build system and execution engine designed for silicon design and verification projects. It orchestrates tasks through declarative workflows with dataflow-based dependency management.
When to Use This Skill
Use this skill when:
- Creating or modifying
flow.yaml or flow.dv files
- Writing task definitions for HDL compilation, simulation, or verification
- Configuring dataflow between tasks using
needs, consumes, produces, passthrough
- Discovering tasks by their outputs using
produces patterns
- Validating dataflow compatibility between producer and consumer tasks
- Setting up package parameters and configurations
- Running
dfm commands (run, show, graph, validate)
- Debugging build flow issues
- Working with standard library tasks (std.FileSet, std.Message, etc.)
- Executing shell commands with
shell: bash and run:
- Executing dfm commands from within an LLM-driven Agent task
Quick Reference
Minimal Flow Example
package:
name: my_project
tasks:
- name: rtl_files
uses: std.FileSet
with:
type: systemVerilogSource
include: "*.sv"
produces:
- type: std.FileSet
filetype: systemVerilogSource
- name: sim
uses: hdlsim.vlt.SimImage
needs: [rtl_files]
consumes:
- type: std.FileSet
filetype: systemVerilogSource
with:
top: [my_top]
Key Commands
dfm run [tasks...]
dfm run -j 4
dfm run --clean
dfm run -c debug
dfm run -D param=value
dfm show packages
dfm show packages --json
dfm show tasks
dfm show tasks --search kw
dfm show task std.FileSet
dfm show types
dfm show project
dfm context --json
dfm show tasks --produces "type=std.FileSet,filetype=verilog"
dfm show tasks --produces "type=std.FileSet" --json
dfm graph task -o flow.dot
dfm validate
dfm validate --json
Expression Syntax
Use ${{ }} for dynamic parameter evaluation:
msg: "Building version ${{ version }}"
iff: ${{ debug_level > 0 }}
command: ${{ "make debug" if debug else "make release" }}
LLM Call Interface (Running Inside Agent Tasks)
When running inside an LLM-driven std.Agent task, the dfm command automatically
connects to the parent DFM session via a Unix socket. This enables LLMs to:
- Execute tasks that share resources with the parent session
- Query project state and task information
- Validate configurations before execution
Environment Detection
When DFM_SERVER_SOCKET environment variable is set, dfm runs in client mode:
dfm run task1 task2
dfm show tasks
dfm context --json
dfm validate
dfm ping
Running Tasks from Within a Prompt
When an LLM needs to compile or simulate code it generated:
cat > counter.sv << 'EOF'
module counter(input clk, rst_n, output logic [7:0] count);
always_ff @(posedge clk or negedge rst_n)
if (!rst_n) count <= 0;
else count <= count + 1;
endmodule
EOF
dfm run hdlsim.vlt.SimImage -D hdlsim.vlt.SimImage.top=counter
Querying Project State
dfm context --json
dfm show task my_project.build --json
Benefits of Server Mode
- Resource Sharing: Respects parent session's parallelism limits (
-j)
- State Consistency: Sees outputs from tasks already completed
- Cache Sharing: Uses same memento cache for incremental builds
- Unified Logging: All task output appears in parent session's logs
Using Produces/Consumes for Task Discovery (AI Assistants)
When helping users build workflows, use produces/consumes to identify compatible tasks:
Finding Tasks by Output Type
dfm show tasks --produces "type=std.FileSet,filetype=verilog" --json
dfm show tasks --produces "type=std.FileSet" --json
dfm show tasks --produces "type=std.FileSet,filetype=verilog,stage=compiled"
Understanding Task Relationships
When a task needs specific inputs, find compatible producers:
dfm show tasks --produces "type=std.FileSet,filetype=verilog" --json
dfm show task VerilogCompiler --json
dfm validate --json
Matching Logic
OR Logic: If ANY consume pattern matches ANY produce pattern → compatible
Subset Matching: Consumer can be less specific than producer
produces:
- type: std.FileSet
filetype: verilog
vendor: synopsys
optimization: speed
consumes:
- type: std.FileSet
filetype: verilog
Building Compatible Workflows
- Identify user's goal - What output do they need?
- Find producers -
dfm show tasks --produces "type=..."
- Check consumer requirements -
dfm show task ConsumerTask → look at consumes
- Validate -
dfm validate to check compatibility
- Suggest workflow - Connect producer → consumer via
needs
Example: Building a Compilation Pipeline
dfm show tasks --produces "type=std.FileSet,filetype=verilog" --json
dfm show task Simulator --json
Pattern Attribute Matching
Match patterns by any attributes defined in produces/consumes:
filetype: verilog|systemVerilog|vhdl|...
stage: preprocessed|compiled|optimized
vendor: synopsys|cadence|mentor|...
optimization: speed|area|power
format: json|xml|ucdb|...
produces:
- type: custom.BuildArtifact
language: python
arch: x86_64
debug: true
Validation Warnings
If validation shows warnings, help fix them:
$ dfm validate
WARNING: Task 'Consumer' consumes [{'type': 'std.FileSet', 'filetype': 'vhdl'}]
but 'Producer' produces [{'type': 'std.FileSet', 'filetype': 'verilog'}].
Solutions:
- Change consumer to accept verilog:
filetype: verilog
- Find different producer that outputs vhdl
- Add converter task in between
- Check if parameter can adjust producer's output
Detailed Documentation
For comprehensive documentation, see the following reference files:
Flow File Format
DV Flow uses YAML files (flow.yaml or flow.dv) to define workflows. The file structure is validated against a JSON Schema located at dv.flow.schema.json.
Schema Validation
To validate your flow file or generate the schema:
dfm util schema > flow.schema.json
The schema defines two root types:
- package - Full project definition with tasks, types, configs, and imports
- fragment - Reusable partial definition for inclusion in packages
Core Concepts Summary
Tasks
Fundamental units of behavior. Tasks accept data from dependencies (needs) and produce outputs. Most tasks inherit from existing tasks using uses:
- name: my_task
uses: std.Message
with:
msg: "Hello!"
Task Visibility
Control which tasks are entry points and which are API boundaries:
| Scope | Behavior |
|---|
root | Entry point - shown in dfm run listing |
export | Visible outside package for needs references |
local | Only visible within its declaration fragment |
| (none) | Package-visible only (default) |
- root: build
desc: "Build project"
run: make build
- export: compile
run: ./compile.sh
- name: main
scope: [root, export]
run: ./main.sh
Best Practices:
- Mark user-facing tasks as
root so they appear in dfm run listing
- Mark tasks other packages should depend on as
export
- Use
local for helper tasks in compound task bodies
- Tasks without scope are only visible within the same package
Packages
Parameterized namespaces that organize tasks. Defined in flow.yaml or flow.dv:
package:
name: my_package
with:
debug:
type: bool
value: false
tasks:
- name: task1
uses: std.Message
Dataflow & Produces/Consumes
Tasks communicate via typed data items, not global variables:
needs: [task1, task2] - Specify dependencies
produces: [patterns] - Declare what output datasets this task creates
consumes: all|none|[patterns] - Control what inputs reach implementation
passthrough: all|none|unused|[patterns] - Control what inputs forward to output
Produces/Consumes enable:
- Task Discovery - Find tasks that produce specific outputs
- Dependency Validation - Check dataflow compatibility
- Relationship Understanding - Identify which tasks can work together
- name: VerilogCompiler
produces:
- type: std.FileSet
filetype: verilog
run: compile_verilog.sh
- name: Simulator
needs: [VerilogCompiler]
consumes:
- type: std.FileSet
filetype: verilog
run: simulate.sh
File Structure
project/
├── flow.yaml # Main package definition
├── rundir/ # Task execution workspace (created by dfm)
│ ├── cache/ # Task mementos and artifacts
│ └── log/ # Execution traces
└── packages/ # Optional sub-packages
Installation
pip install dv-flow-mgr
pip install dv-flow-libhdlsim
Detailed Documentation
For comprehensive documentation, see the following reference files:
For dataflow and produces/consumes:
- See the User Guide: Dataflow & Produces (docs/userguide/dataflow.rst) for complete documentation
- See docs/produces.md for quick reference
Converted and distributed by TomeVault — claim your Tome and manage your conversions.