Vivado Red MCP

v0.5.0
io.github.sinemortal/vivado-red-mcp Checked 16 hours ago Published 1 month ago

Drive AMD Vivado from AI assistants, with Red Pitaya STEMlab 125-14 build and deploy flows.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

start_session

Start a persistent Vivado TCL session. Must be called before project/design tools. Vivado startup is ~30s; the session is reused across tool calls.

ParameterTypeDescription
vivado_pathstringPath to vivado(.bat) executable (default: 'vivado' from PATH).

stop_session

Stop the Vivado TCL session and free resources.

session_status

Get statistics for the current Vivado session (commands run, timing, errors).

check_session_health

Verify the Vivado process is responsive. With auto_recover=true the session is restarted if it hangs.

ParameterTypeDescription
auto_recoverbooleanRestart session if unhealthy (default: true)

get_host_status

Get host hostname, free memory, and session state. Useful to check there is enough RAM before launching synthesis/implementation.

open_project

Open an existing Vivado project (.xpr file).

ParameterTypeDescription
project_path *stringPath to .xpr project file

close_project

Close the currently open project.

get_project_info

Get name, part, target language, directory of the open project.

create_project

Create a new Vivado project on disk in project mode. Defaults to the Red Pitaya STEMlab 125-14 part (xc7z010clg400-1). Call add_sources / add_constraints next, then run_synthesis.

ParameterTypeDescription
directory *stringParent directory; project created at <directory>/<name>
name *stringProject name
forcebooleanOverwrite existing project (default: true)
partstringXilinx part number (default: xc7z010clg400-1)
target_languagestringVerilog or VHDL (default: Verilog)

add_sources

Add HDL source files (.v/.sv/.vhd) to the current project. Optionally sets the top module and updates compile order.

ParameterTypeDescription
files *arrayAbsolute paths to HDL source files
filesetstringTarget fileset (default: sources_1)
set_topstringIf given, set this module as project top after adding files

add_constraints

Add XDC constraint files to the current project.

ParameterTypeDescription
files *arrayAbsolute paths to .xdc files
filesetstringTarget fileset (default: constrs_1)

list_boards

List boards with bundled XDC + metadata. No Vivado session required.

get_board_info

Get bundled metadata for a board: part, LED pinout, absolute XDC paths, default synth flags. Use the returned absolute_path values with add_constraints. No Vivado session required.

ParameterTypeDescription
board *stringBoard identifier, e.g. 'red_pitaya_125_14'

run_synthesis

Run synthesis on the current project (reset_run -> launch_runs synth_1 -> wait_on_run). Returns ground-truth status from the run object, not just text parsing.

ParameterTypeDescription
jobsintegerParallel jobs (default: 4)
timeoutintegerTimeout seconds (default: 2400 = 40min). Increase for large designs.

run_implementation

Run implementation (opt_design -> place_design -> route_design). Returns ground-truth status from the impl_1 run object.

ParameterTypeDescription
jobsintegerParallel jobs (default: 4)
timeoutintegerTimeout seconds (default: 5400 = 90min).

generate_bitstream

Generate bitstream — `launch_runs impl_1 -to_step write_bitstream` -> wait_on_run. Returns ground-truth run status and the .bit path.

ParameterTypeDescription
timeoutintegerTimeout in seconds (default: 3600)

set_run_strategy

Set the strategy of a synthesis or implementation run (e.g. synth_1 'Flow_PerfOptimized_high', impl_1 'Performance_NetDelay_high'). On an unknown name, Vivado's error lists the valid strategies.

ParameterTypeDescription
run *stringRun name (e.g. synth_1, impl_1)
strategy *stringStrategy name

get_timing_summary

Get timing summary (WNS, TNS, WHS, THS). Returns parsed metrics by default. Use generate_full_report for raw output.

ParameterTypeDescription
detail_levelstringsummary | standard (+ truncated raw) | full (+ complete raw)
report_typestringsummary (default), setup, hold, or all

get_timing_paths

Get failing/critical timing paths. Returns structured summary by default; use detail_level=standard|full for the raw text too.

ParameterTypeDescription
clockstringFilter by clock domain
detail_levelstringsummary (default) | standard | full
from_pinstringFilter -from pattern
num_pathsintegerNumber of paths (default: 10)
path_typestringsetup (default) or hold
slack_thresholdnumberOnly show paths with slack < this (default: 0 = failing paths)
throughstringFilter -through pattern
to_pinstringFilter -to pattern

get_utilization

Resource utilization (LUT/FF/BRAM/DSP/IO). Parsed only by default.

ParameterTypeDescription
detail_levelstring
hierarchicalbooleanHierarchical breakdown (default: false)
module_filterstringWildcard for hierarchical filter
threshold_percentnumberMark resources below this util%% as below_threshold

get_clocks

Get clock information and constraints (report_clocks).

get_messages

Get Vivado messages filtered by severity (error/critical/warning/all).

ParameterTypeDescription
severitystringall (default) | error | critical | warning

get_design_hierarchy

Get the design hierarchy (modules and instances), optionally filtered.

ParameterTypeDescription
instance_patternstringWildcard pattern (e.g., '*cpu*', 'core/alu/*')
max_depthintegerMax hierarchy depth (default: 3)

get_ports

Get top-level I/O ports of the design.

get_nets

Search for nets by pattern (default '*').

ParameterTypeDescription
limitintegerMax results (default: 100)
patternstringWildcard pattern (default: '*')

get_cells

Search for cells/instances by pattern.

ParameterTypeDescription
limitintegerMax results (default: 100)
patternstringWildcard pattern (default: '*')

launch_simulation

Launch xsim in behavioral/post-synth/post-impl mode.

ParameterTypeDescription
modestringSimulation mode (default: behavioral)

run_simulation

Run the simulation for a specified time (e.g. 100ns, 1us, all).

ParameterTypeDescription
time *string100ns | 1us | 10ms | all

restart_simulation

Restart the simulation from time 0.

close_simulation

Close the current simulation.

get_simulation_time

Get the current simulation time (current_time).

get_signal_value

Get current value of a signal in simulation.

ParameterTypeDescription
signal *stringHierarchical signal path
radixstringDisplay radix (default: hex)

get_signal_values

Get values of multiple signals matching a wildcard pattern (max 50).

ParameterTypeDescription
pattern *stringSignal pattern, e.g. /tb/dut/*
radixstring

add_signals_to_wave

Add signals to the waveform viewer.

ParameterTypeDescription
signals *array

set_simulation_top

Set the top-level testbench module for simulation.

ParameterTypeDescription
top_module *string
filesetstringdefault: sim_1

get_simulation_objects

List simulation objects in a scope (signals/ports/internal).

ParameterTypeDescription
filterstring
scopestringdefault: /

get_scopes

List child scopes (hierarchy) in the simulation.

ParameterTypeDescription
parentstringdefault: /

step_simulation

Step simulation by delta cycles.

ParameterTypeDescription
countintegerdefault: 1

add_breakpoint

Add a breakpoint on signal edge or change.

ParameterTypeDescription
signal *string
conditionstring

remove_breakpoints

Remove all breakpoints (remove_bps -all).

get_simulation_messages

Get simulation log messages filtered by severity.

ParameterTypeDescription
severitystring

run_tcl

Execute a raw TCL command in Vivado. Use for advanced ops not covered by other tools.

ParameterTypeDescription
command *stringTCL command to execute
timeoutintegerOptional command timeout in seconds

run_tcl_script

Source a .tcl script file in the Vivado session (uses `source` under the hood). Helpful for replaying canonical Red Pitaya / Xilinx reference scripts.

ParameterTypeDescription
path *stringAbsolute path to .tcl script
timeoutintegerOptional script timeout in seconds

create_block_design

Create a new block design and make it current. Optionally sets the board_part property on the project beforehand (board_part requires the BSP to be installed in Vivado).

ParameterTypeDescription
name *stringBlock design name (no .bd)
board_partstringOptional vendor:board:part string (e.g. 'digilentinc.com:arty-a7-35:part0:1.0')

save_bd_design

Save the currently open block design to disk.

close_bd_design

Close the currently open block design (without deleting).

list_bd_cells

List cells in the current block design (optionally filtered).

ParameterTypeDescription
filterstringWildcard pattern, default '*'

add_ip_to_bd

Add an IP core to the current block design (`create_bd_cell -type ip -vlnv ...`). If `config` is provided, the CONFIG.* keys are applied via set_property -dict.

ParameterTypeDescription
cell_name *stringInstance name (e.g. 'processing_system7_0')
vlnv *stringVendor:Library:Name:Version (e.g. 'xilinx.com:ip:processing_system7:5.5')
configobjectDict of CONFIG.* properties (e.g. {'CONFIG.PCW_USE_M_AXI_GP0': '1'})

create_bd_port

Create a top-level port on the current block design. Scalar or vector (`from`/`to`) via create_bd_port, or an interface port when `vlnv` is given (create_bd_intf_port, e.g. the XADC 'xilinx.com:interface:diff_analog_io_rtl:1.0'). Port names must match the constraints (XDC) of the board.

ParameterTypeDescription
name *stringPort name (e.g. 'led_o')
directionstringDirection for a plain port (default: I)
fromintegerMSB index for a vector port (e.g. 7)
modestringInterface mode (default: Slave): Master, Slave, ...
tointegerLSB index for a vector port (default: 0)
typestringOptional port type: clk, rst, ce, intr, data, undef
vlnvstringInterface VLNV: creates an interface port instead

add_module_to_bd

Add an RTL module (Verilog/VHDL already in the project, see add_sources) to the current block design as a module-reference cell (`create_bd_cell -type module -reference`). Optional `config` sets its parameters, e.g. {'CONFIG.WIDTH': '8'}; string parameters keep their quotes, e.g. {'CONFIG.init': '"0011"'}.

ParameterTypeDescription
cell_name *stringInstance name in the BD
module *stringTop module name of the RTL
configobjectDict of CONFIG.* parameters

configure_bd_cell

Set CONFIG.* properties on an existing block-design cell (set_property -dict). Use for settings that must be applied after creation or in a separate step, e.g. importing a PS7 board preset: {'CONFIG.PCW_IMPORT_BOARD_PRESET': '<path>/red_pitaya.xml'}.

ParameterTypeDescription
cell_name *string
config *objectDict of CONFIG.* properties

connect_bd_net

Connect two scalar pins/ports in the current block design.

ParameterTypeDescription
pin_from *stringe.g. 'processing_system7_0/FCLK_CLK0'
pin_to *stringe.g. 'axi_gpio_0/s_axi_aclk'

connect_bd_intf_net

Connect two AXI/interface pins in the current block design.

ParameterTypeDescription
intf_from *stringe.g. 'processing_system7_0/M_AXI_GP0'
intf_to *stringe.g. 'axi_gpio_0/S_AXI'

auto_connect_axi

Use `apply_bd_automation -rule xilinx.com:bd_rule:axi4` to wire an AXI master to a slave (inserts AXI interconnect + clock/reset hookups).

ParameterTypeDescription
master *stringAXI master intf pin
slave *stringAXI slave intf pin
optionsobjectOptional extra -config key/value pairs (e.g. {'Clk_master': 'Auto'})

apply_ps7_preset

Apply the Zynq-7000 processing_system7 board preset to a PS7 cell — wires FIXED_IO / DDR / clocks per the board definition. Equivalent to clicking 'Run Block Automation' on a freshly added PS7 in the GUI.

ParameterTypeDescription
apply_board_presetbooleanWhether to apply the current board preset (default: true)
cellstringPS7 cell name (default: 'processing_system7_0')

validate_block_design

Run validate_bd_design and return parsed status. Failures include unconnected pins, conflicting CONFIG values, or missing assignments.

regenerate_bd_layout

Regenerate the block design layout (cosmetic; useful before save).

assign_bd_address

Auto-assign addresses in the BD address editor (assign_bd_address).

generate_bd_wrapper

Generate the HDL wrapper for a block design and (by default) add it to sources_1 and set it as project top. Implements the canonical pattern: make_wrapper -files <bd> -top; add_files -norecurse <wrapper>; set_property top <wrapper> [current_fileset]; update_compile_order.

ParameterTypeDescription
bd_name *stringBlock design name (no .bd)
set_topbooleanAlso set the wrapper as project top (default: true)

create_ip

Create an IP from the Xilinx IP catalog. Generates a .xci file in the project's IP sources fileset. Use configure_ip + generate_ip_target afterwards, then run synth_ip if you want out-of-context synthesis.

ParameterTypeDescription
ip_name *stringCatalog name (e.g. 'clk_wiz')
module_name *stringInstance/module name on disk (e.g. 'clk_wiz_0')
librarystringdefault: ip
vendorstringdefault: xilinx.com
versionstringOptional explicit version

configure_ip

Set CONFIG.* properties on an existing IP via set_property -dict.

ParameterTypeDescription
config *objectDict of CONFIG.* keys to values (e.g. {'CONFIG.PRIM_IN_FREQ': '125'})
module_name *string

generate_ip_target

Generate IP output products (synthesis + simulation by default).

ParameterTypeDescription
module_name *string
targetsarraydefault: ['synthesis', 'simulation']

synth_ip

Run out-of-context (OOC) synthesis on an IP.

ParameterTypeDescription
module_name *string

upgrade_ip

Upgrade IP version (no-op if already at latest).

ParameterTypeDescription
module_namestringSpecific IP to upgrade; if omitted, upgrades all in project

report_ip_status

Get a structured snapshot of the project's IP and their upgrade status.

open_hw_manager

Open the Hardware Manager (no JTAG connection yet).

close_hw_manager

Close the Hardware Manager.

connect_hw_server

Connect to a hw_server (cs_server). Default URL is localhost:3121 — the value Vivado uses when running hw_server locally.

ParameterTypeDescription
urlstringhost:port (default: localhost:3121)

refresh_hw_device

Refresh the currently selected hardware device (re-reads JTAG chain state). Call after re-plugging a cable.

program_device

Program a .bit onto the first device on the JTAG chain. Sequence: open_hw_target -> set PROGRAM.FILE -> program_hw_devices. The hardware must already be connected (`open_hw_manager` + `connect_hw_server`).

ParameterTypeDescription
bit_file *stringAbsolute path to .bit
probes_filestringOptional ILA probes .ltx file

report_power

Run report_power and return parsed totals (total/dynamic/static W) + a truncated raw block. Full output stored at /tmp/vivado_red_mcp/.

report_drc

Run report_drc and return parsed violations list (severity/code/message). Use after place_design/route_design to catch design-rule problems.

report_methodology

Run report_methodology (UltraFast methodology checks). Returns violation list grouped by severity.

report_qor_assessment

Run report_qor_assessment (overall design quality score).

report_clock_interaction

Run report_clock_interaction to find cross-clock paths (timed/async/unconstrained).

load_board_xdc

Resolve a bundled board XDC and attach it to the current project. Standalone wrapper over get_board_info + add_constraints.

ParameterTypeDescription
board *stringBoard id, e.g. 'red_pitaya_125_14'
variantstringXDC variant id (e.g. 'leds_min', 'full'). Default: 'full'

generate_cfgmem

Convert a .bit into a raw binary image (.bit.bin) loadable via /dev/xdevcfg on the Red Pitaya. Use after generate_bitstream.

ParameterTypeDescription
bit_file *stringAbsolute path to input .bit
outputstringOutput .bit.bin path (default: <bit_file>.bin)

get_synthesis_errors_parsed

Return structured errors and critical warnings from a run's log (default: synth_1), plus those of every failed run (e.g. out-of-context IP runs). Use after run_synthesis fails to get a clean actionable list.

ParameterTypeDescription
max_itemsintegerdefault: 50
runstringdefault: synth_1

create_redpitaya_project_rtl

One-shot composite: create project -> add HDL sources -> apply XDC -> synth -> impl -> write_bitstream -> generate .bit.bin. Stops on the first failing stage and returns a structured payload.

ParameterTypeDescription
directory *string
name *string
top_module *string
verilog_files *array
boardstringdefault: red_pitaya_125_14
extra_xdc_filesarray
impl_timeoutinteger
jobsinteger
synth_flagsstring
synth_timeoutinteger
xdc_variantstring

rp_fetch_repo

Download the RedPitaya-FPGA repo from GitHub as a source zip and extract it (no git required, stdlib only). Returns repo_path to feed into rp_setup_workspace. Idempotent — pass force=true to redownload. No Vivado session required.

ParameterTypeDescription
dest_pathstringDirectory to extract into. Default: current working directory.
forcebooleanIf true, delete an existing extracted dir and redownload (default: false).
refstringBranch or tag to fetch (default: master). Extracted dir is RedPitaya-FPGA-<ref>.
timeoutintegerDownload timeout in seconds (default: 600).
urlstringOverride the full zip URL (e.g. a tag or a fork). If set, ref is used only for the expected dir name.

rp_setup_workspace

Copy a RedPitaya-FPGA repo into an isolated workspace so builds don't touch the pristine checkout. The copy is patched to run on the installed Vivado release (block-design version check) and without git. Idempotent — pass force=true to recopy. No Vivado session required.

ParameterTypeDescription
repo_path *stringPath to the RedPitaya-FPGA checkout (contains prj/, rtl/, brd/, *.tcl)
forcebooleanIf true, delete and recopy an existing workspace (default: false)
workspace_pathstringDestination workspace dir. Default: <repo_parent>/redpitaya_mcp_workspace

rp_list_projects

List projects under prj/ of a RedPitaya workspace or repo. Flags which are Z10-capable (have ip/system.tcl or legacy ip/systemZ10.tcl). No Vivado session required.

ParameterTypeDescription
path *stringWorkspace or repo root (the dir that contains prj/)

rp_workspace_info

Report workspace state: projects present and which already have a built bitstream.

ParameterTypeDescription
workspace_path *string

rp_create_custom_project

Clone an existing prj/<base> into prj/<name> inside the workspace, ready for custom PL logic. Returns the rtl/ dir and red_pitaya_top path to edit. No Vivado session required.

ParameterTypeDescription
base_project *stringExisting project to clone (e.g. 'v0.94', 'barebones')
name *stringNew project name
workspace_path *string

rp_build_project

Build a RedPitaya PS+PL project end-to-end: run the repo's project setup TCL (creates the PS7 block design from ip/system.tcl), then synthesis, implementation and write_bitstream, then generate the .bit.bin. Returns {stage, xpr_path, bit_path, bin_path, timing}. Requires start_session first.

ParameterTypeDescription
project *stringProject under prj/ to build (e.g. 'v0.94', 'barebones')
workspace_path *string
definesstringExtra Verilog defines passed as tclarg 1 (default: empty)
impl_timeoutintegerImplementation timeout s (default: 5400)
jobsintegerParallel jobs for synth/impl (default: 4)
modelstringBoard model — only 'Z10' supported (default: Z10)
setup_timeoutintegerProject-setup TCL timeout s (default: 900)
synth_flagsstringExtra synth_design flags via STEPS.SYNTH_DESIGN.ARGS.MORE_OPTIONS. Default empty. RedPitaya canonical for reproducibility: '-flatten_hierarchy none -bufg 16 -keep_equivalent_registers' (NOTE: those pr…
synth_timeoutintegerSynthesis timeout s (default: 2400)

deploy_to_redpitaya

Copy a .bit.bin to a Red Pitaya over SSH/SCP and load it into the FPGA. Uses /dev/xdevcfg (works on Red Pitaya OS 1.04 + 2.00) or fpgautil (OS 2.00). No Vivado session required.

ParameterTypeDescription
bit_bin_path *stringAbsolute path to the local .bit.bin produced by generate_cfgmem
host *stringRed Pitaya IP or hostname (e.g. '192.168.1.100' or 'rp-f0abcd.local')
connect_timeoutintegerSSH connect timeout in seconds (default: 10)
keep_remotebooleanLeave the .bit.bin on the board after loading (default: false → rm)
key_filenamestringPath to an SSH private key. If set, overrides password auth.
methodstringLoader: 'xdevcfg' (default, both OS) or 'fpgautil' (OS 2.00)
passwordstringSSH password (default: 'root' — Red Pitaya factory default)
portintegerSSH port (default: 22)
remote_pathstringRemote .bit.bin path (default: /tmp/<basename>)
userstringSSH user (default: 'root')

ssh_redpitaya_exec

Run an arbitrary shell command on a Red Pitaya over SSH and return stdout/stderr/exit code. Useful for status checks, dmesg reads, manual loader invocations.

ParameterTypeDescription
command *stringShell command to execute
host *string
connect_timeoutinteger
exec_timeoutintegerCommand timeout (default: 30s)
key_filenamestring
passwordstring
portinteger
userstring

get_vivado_doc

Look up a topical Vivado documentation summary bundled with this server. Returns markdown content + upstream URL. Known topics: block_design, ps7_zynq, timing_constraints, synthesis_strategies, simulation_xsim, red_pitaya_125_14, redpitaya_ps_pl_flow, tcl_quoting, hw_manager, ip_integrator, pitfalls_2020_1.

ParameterTypeDescription
topic *stringTopic name; see KNOWN_TOPICS in the tool description
versionstringTarget Vivado version (cosmetic, default '2020.1')

list_vivado_docs

List the bundled Vivado documentation topics.

request_feature

Submit a feature request for the Vivado MCP server (persisted on disk).

ParameterTypeDescription
description *stringWhat you need and why
title *stringShort title
prioritystring
use_casestringTask that prompted the request

list_feature_requests

List all submitted feature requests.

generate_full_report

Generate a full Vivado report to a file. Use when inline reports get truncated or you need the complete output. Returns a report_id usable with read_report_section.

ParameterTypeDescription
report_type *string
optionsobjectReport-specific options (e.g. {hierarchical: true})
output_filestringOptional custom output path

read_report_section

Read a section of a previously generated report. Provide report_id (from generate_full_report) or a direct file_path.

ParameterTypeDescription
file_pathstring
num_linesintegerdefault: 100
report_idstring
search_patternstringRegex to locate a section; returns context around first match
start_lineinteger1-indexed (default: 1)