Analyzes C/C++ code for canonical Vitis HLS dataflow regions, checking rules 1-10 for predictable performance and structure.
Ships in AMD Ross Agentic AI Assistant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are focused on analyzing whether a dataflow region follows the canonical dataflow coding style. A dataflow region defines a network of processes communicating through channels. The canonical coding style results in a dataflow network that directly matches the function calls given in the source code. It is thus more predictable for the user, in terms of both performance and structure. Unlike canonical regions, non-canonical dataflow regions are transformed by Vitis HLS by grouping instructions and control so that they become canonical regions. In particular, a loop in a dataflow region is extracted as a function call.
#pragma HLS dataflow or #pragma HLS dataflow disable_start_propagationstatic within a function#pragma HLS interface m_axi<TOP_FUNCTION>, if not provided, call /hls-component-basic-info skill to get top_function which is the top-level function namethis (and its member variables) as dataflow function arguments1. Pragma Presence
Validate that the code must contain #pragma HLS dataflow or #pragma HLS dataflow disable_start_propagation.
2. Pragma Location Validate that the dataflow pragma is in a loop body or function body.
3. Loop Dataflow Region Rules (skip if pragma is not inside a loop body)
for-loop.int type.4. Dataflow Region Content Rules (check line-by-line)
hls::task instantiations and class method calls), which become dataflow processeshls::task is present, it must be declared as hls_thread_local:
hls_thread_local hls::task t1(proc, arg1, arg2, arg3);
hls::task is present, hls::stream and hls::stream_of_blocks within it must be declared as hls_thread_local.std::complex) lead to implicit write processes. To avoid this, use the no_ctor attribute:
std::complex<float> arr[SIZE] __attribute__((no_ctor));
arg_mem[offset_var], mem[i], array[index]) as arguments. Only pass the entire array/pointer variable itself.i, not i + 1; use ptr, not ptr + offset).5. Multiple Invocation Rules If a function is invoked multiple times within a dataflow region, ensure static variables follow these rules:
6. Dataflow Function Argument Rules List dataflow function arguments before checking. If arguments are accessed within a loop, analyze only a single iteration.
hls::stream, ensure it is accessed (read or written) by only one dataflow process.7. Dataflow Function Global/Static Scalar Rule Ensure all scalar-type global/static variables accessed within an overlapping dataflow region follow the rule 6.4 (substituting scalar argument by global/static scalar variable).
8. Top Dataflow Function Scalar Argument Rules
If <TOP_FUNCTION> function is a top dataflow function, and a scalar argument of the top function is used in a dataflow region, recursively included in dataflow regions up to the top, ensure that if written, it is accessed (read or written) by only one process.
9. Global/Static Array Rule If an array-type global/static variable is accessed within the dataflow region, validate that no more than one dataflow process reads or writes the global/static array in the dataflow region.
10. Local Variable Rules Validate local variables within the dataflow region. For loop dataflow regions, analyze a single iteration only.
hls::stream, hls::stream_of_blocks, or a class containing any of these types.#pragma HLS bind_storage variable=... type=ram_1wnr, validate exactly one writer process and one or more reader processes, with the writer appearing lexically before all readers.#pragma HLS bind_storage variable=... type=ram_1wnr, validate exactly one writer process and one reader process, with the writer appearing lexically before the reader.hls::stream type, validate exactly one writer process and one reader process.hls::stream_of_blocks type, validate:
#include "hls_streamofblocks.h"
...
hls::stream_of_blocks<block_type, depth> block;
// or
hls::stream_of_blocks<block_type> block;
hls::write_lock lock(block) in the region that writeshls::read_lock lock(block) in the region that readsIf all criteria are met, the code forms a canonical dataflow region. Otherwise, it is not canonical.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
vitis-hls, dataflow, fpga, high-level-synthesis, code-analysis
/amd-ross-agentic-ai-assistant:hls-dataflow [<TOP_FUNCTION — top-level HLS function name e.g. 'Kernel'>]from AMD Ross Agentic AI Assistant
npx claudepluginhub xilinx/ross-ai-assistant --plugin amd-ross-agentic-ai-assistant50 skills in this plugin
/hls-architectConvert input code to a multi-stage HLS dataflow, validate with the other hls skills, then hand off to optimize./hls-array-to-streamAnalyze whether a given C/C++ code snippet follows the recommended coding style for array-to-stream conversion in Vitis HLS. Keywords: array, stream, HLS, pragma, ap_fifo, axis, interface/hls-burst-inferenceAnalyze whether burst inference optimization can be applied to a given C/C++ code snippet in Vitis HLS. Keywords: burst, HLS, pragma, m_axi, AXI, memory, optimizationOther plugins' skills for the same job