xilinx/ross-ai-assistant/hls-array-to-stream
Claude Code and agent skill by xilinx/ross-ai-assistant
- community
Checking that the SKILL.md file is still in the repository.
Analyze 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
Install
npx vskill@latest install xilinx/ross-ai-assistant/hls-array-to-streamSKILL.md
You are focused on analyzing whether code follows the recommended coding style for array-to-stream conversion.
Concepts:
- Array-to-stream conversion: Converting arrays to streaming interfaces for efficient data transfer
- Stream pragma:
#pragma HLS stream variable=A type=T depth=D - Interface pragma:
#pragma HLS interface [mode=ap_fifo|axis] port=A(modeis optional; for example,mode=ap_fifoor justap_fifo) - Top function: the top-level HLS function, get it via argument
<TOP_FUNCTION>, if not provided, call/hls-component-basic-infoskill to get top_function which is the top-level function name - dataflow region: dataflow region is a function or for-loop that contains a #pragma HLS dataflow.
- Top function arguments: Parameters of the top-level function
Scope:
- Strictly follow rules 1–6; do not extend
- Must get
<TOP_FUNCTION>value which is the top-level function name (e.g.Kernel)
Analysis Steps:
1. Pragma Presence Validate that the code contains at least one of the following two array-to-stream pragmas:
- Stream pragma:
#pragma HLS stream variable=A type=T depth=D - Interface pragma:
#pragma HLS interface [mode=ap_fifo|axis] port=A(modeis optional; for example,mode=ap_fifoor justap_fifo)
2. Stream Pragma Rules (check if #pragma HLS stream variable=<VAR> [type=<T>] [depth=<D>] is used)
- 2.1 It must be a legal HLS stream pragma with the form
#pragma HLS stream variable=<VAR> [type=<T>] [depth=<D>] - 2.2
<VAR>can be: - An array (single or multi-dimensional)
- A scalar variable
- 2.3
<VAR>must be a local variable or a global variable - 2.4
<VAR>must be passed within the dataflow region - 2.5
<VAR>cannot be a top-level function argument - 2.6
type=<T>is optional: - If omitted, defaults to "fifo"
- If provided,
<T>must be "fifo" - 2.7
depth=<D>is optional: - If omitted, uses default depth
- If provided,
<D>must be a positive integer literal or const expression that evaluates to a positive integer
3. Interface Pragma Rules (check if #pragma HLS interface [mode=ap_fifo|axis] port=A is used; mode is optional; for example, mode=ap_fifo or just ap_fifo)
- 3.1
Amust be an array (possibly multi-dimensional) or a scalar - 3.2
Amust be passed within the dataflow region - 3.3
Amust be a top function argument - 3.4
modemust be eitherap_fifooraxis
4. Struct Element Type Rules (skip if array element type is not a struct type) If the array element type is a struct type, ensure that the whole struct is prepared in a separate struct variable and then stored at once in the array.
5. Struct Copy Assignment Rules (skip if array element type is not a struct type) If the array element type is a struct type, ensure that no custom copy assignment operator is defined (such as A& operator=(const A& a)) except mark it as default (such as A& operator=(const A& a) = default) for that struct type.
6. Stream Pragma Access Pattern Rules (check only if stream pragma #pragma HLS stream variable=A type=T depth=D is used) Ensure that each accessed array element is read exactly once, written exactly once, and that the read/write order is consistent:
- 6.1 Ensure that each element is accessed exactly once and not more than once (no repeated access to any element)
- 6.2 Ensure that the array is accessed in the same order and range on both reading and writing sides
- 6.3 Ensure the iteration order must be the same (e.g., both ascending or both descending)
- 6.4 Each side must access the same number of elements (e.g., if write accesses N-1 elements, read must also access N-1 elements, not N)
Verdict:
If all applicable criteria are met, the code follows the recommended coding style for array-to-stream conversion. Otherwise, it does not follow the recommended coding style.
When Asked to Fix Code to Follow Array-to-Stream Style
If the user asks you to fix code so it follows the recommended array-to-stream style:
- Identify the failing rule(s)
- Apply the minimal fix while preserving behavior
- Output the complete fixed code in a fenced code block:
``` `cpp // fixed code here ` ```
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hls-array-to-stream/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xilinx/ross-ai-assistant/hls-array-to-stream)