xilinx/ross-ai-assistant/hls-architect

Claude Code and agent skill by xilinx/ross-ai-assistant

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Convert input code to a multi-stage HLS dataflow, validate with the other hls skills, then hand off to optimize.

Install

npx vskill@latest install xilinx/ross-ai-assistant/hls-architect

SKILL.md

HLS Design Architecture

Sources: "Parallel Programming for FPGAs" (Kastner et al.) + AMD UG1399 (Vitis HLS User Guide)

Preamble — Parse Arguments and Print Summary

Vitis environment

The Step 2e g++ verification depends on $XILINX_VITIS to locate ap_fixed.h.

  • When called by `/hls-matlab-to-cpp` (the normal flow): the environment was sourced

in that skill's preamble — do NOT source it again, just verify it is set.

  • When called standalone: source Vitis first via ./reference/setup.md Step 1 or ensure $XILINX_VITIS is set

Verify before proceeding:

bash
echo "XILINX_VITIS=$XILINX_VITIS" && ls $XILINX_VITIS/include/ap_fixed.h
Parse arguments

Parse $ARGUMENTS at the very start:

  • Everything before part= is the THROUGHPUT_TARGET (may be empty)
  • part=<value> → XPART
  • clock=<value> → CLOCK_NS

If XPART or CLOCK_NS are missing from $ARGUMENTS, ask the user for the missing values before proceeding.

Input Discovery — Find or Create Workspace

The architect looks for an existing workspace, or creates one if needed. Detection is based solely on filesystem state (not context variables).

Step 1: Check for existing frame_based/ workspace

bash
# Search for existing frame_based/kernel.cpp (from hls-matlab-to-cpp or previous run)
EXISTING_KERNEL=$(find . -maxdepth 3 -path "*/frame_based/kernel.cpp" -type f | head -1)
if [ -n "$EXISTING_KERNEL" ]; then
# Found existing workspace - extract design_name from path
design_name=$(echo "$EXISTING_KERNEL" | cut -d'/' -f2)
MODE=existing
else
# No workspace found - need to create one
MODE=new
fi

Step 2a: If MODE=existing (workspace found)

bash
# Verify testbench also exists
if [ ! -f "$design_name/frame_based/testbench.cpp" ]; then
ERROR: "Found frame_based/kernel.cpp but testbench.cpp is missing"
fi
# Print confirmation
echo "Found existing workspace: $design_name/frame_based/"
echo " ✓ kernel.cpp"
echo " ✓ testbench.cpp"

Proceed to Interface Selection.

Step 2b: If MODE=new (no workspace found)

  1. Ask user for input file paths:
  • "Where is your C++ kernel source file?" → USER_KERNEL_PATH
  • "Where is your testbench file?" → USER_TESTBENCH_PATH
  1. Ask user for design name (or derive from kernel filename):
  • "What should the design workspace be named?" → design_name
  • Default suggestion: extract basename without extension from kernel path
  1. Create workspace and copy files:

```bash # Create frame_based/ directory mkdir -p "$design_name/frame_based"

# Copy user files into canonical locations cp "$USER_KERNEL_PATH" "$design_name/frame_based/kernel.cpp" cp "$USER_TESTBENCH_PATH" "$design_name/frame_based/testbench.cpp" ```

  1. Print confirmation:

`` ───────────────────────────────────────────────────── [architect] New Workspace Created Design name : <design_name> Kernel copied : <USER_KERNEL_PATH> → <design_name>/frame_based/kernel.cpp TB copied : <USER_TESTBENCH_PATH> → <design_name>/frame_based/testbench.cpp ───────────────────────────────────────────────────── ``

After Input Discovery completes (both modes):

  • design_name/frame_based/kernel.cpp exists ← INPUT to architect
  • design_name/frame_based/testbench.cpp exists

Proceed to Interface Selection.

Interface Selection

In interactive mode: ask the user which top-level interface the kernel should use. Present the options clearly:

[architect] Interface Selection — choose one:
1. m_axi Data in/out via AXI4 burst master (arrays in DDR/HBM).
Best for: frame buffers, large lookup tables, batch processing.
load_input() reads a full frame from memory before compute starts.
Example: peakPicker reading xcorr[] and threshold[] arrays.
2. axis Data in/out via AXI4-Stream (pixel/sample streaming, no buffering).
Best for: real-time pipelines, video, DSP chains.
load_input() forwards stream samples directly into compute.
Example: demosaic receiving a pixel stream from a camera sensor.
3. m_axi + axis Mixed — one port streams in, another bursts from memory (or vice versa).
Best for: kernels that stream output but need a lookup table from DDR.
4. m_axi + s_axilite Data arrays via m_axi; scalar parameters (thresholds, sizes) via
AXI-Lite control register. Most common for standalone Vitis kernels.
Which interface fits your design?

If `autoconfirm=true` is in `$ARGUMENTS`: do NOT ask — infer IFACE_TYPE automatically from the top-level function signature:

  • Pointer/array arguments (float*, int[]) with no hls::stream args → m_axi
  • hls::stream arguments only → axis
  • Mix of pointer and hls::stream → m_axi + axis
  • Pointer args alongside scalar-only control args → m_axi + s_axilite

Print the inferred choice:

[architect] Interface inferred: m_axi (autoconfirm; pointer args detected)

Store the answer as IFACE_TYPE. Use it when writing #pragma HLS INTERFACE pragmas and when deciding whether load_input / store_output use hls::stream ports or m_axi pointer arguments.

Print confirmation:

─────────────────────────────────────────────────────
[architect] Starting — <design_name>
Throughput target : <THROUGHPUT_TARGET or "none — will derive from II=1 floor">
FPGA part : <XPART>
Clock : <CLOCK_NS> ns
Interface : <IFACE_TYPE>
─────────────────────────────────────────────────────

Directory Layout

After Input Discovery, the canonical workspace structure is:

design_name/
├── frame_based/ ← INPUT (always exists after Input Discovery)
│ ├── kernel.cpp ← Plain C++ kernel (created by hls-matlab-to-cpp OR copied in standalone mode)
│ └── testbench.cpp ← Testbench (created by hls-matlab-to-cpp OR copied in standalone mode)
└── rearchitect/
└── v1/ ← OUTPUT (created by architect via design-layout.md)
├── src/
│ └── kernel_hls.cpp ← HLS dataflow architecture
├── tb/
│ └── testbench.cpp ← Copied from frame_based/ unchanged
└── hls_config.cfg ← Generated config file
└── vitis-comp.json ← Generated hls component file

Optional directories (only present if called from /hls-matlab-to-cpp):

design_name/
├── golden/ ← MATLAB source files + golden bins
├── sample_based/ ← Refactor 1 (line-by-line MATLAB → C++)

All directories under rearchitect/ are created via ./reference/design-layout.md — never create directories manually.


Handoff Protocol

Every step ends with a → HANDOFF block. No step may begin until the previous step's Condition is satisfied.

→ HANDOFF to Step X
Produces : <artifact>
Condition: <what must be true>
Blocked if: <what causes a loop-back or stop>

Flow Overview

Print this immediately after the confirmation banner so the user can track progress:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[architect] Pipeline — <design_name>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 1 Study domain patterns (./reference/vitis-libraries.md)
Step 2a Draw activity timeline + choose paradigm
Step 2b Generate fixed top-level (load → compute → store)
Step 2c Decompose compute() — hierarchical or monolithic
Step 2d Write to rearchitect/ + pragma audit
Step 2e G++ functional verification
Step 3a Validate with hls* skills
Step 3b Architecture review (user approval)
Step 3c Write to perf_outcomes.md
Step 3d-1 Apply performance pragmas (if throughput)
Step 3d-2 Save baseline snapshot
Step 3e Hand off to /hls-optimize
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Re-print this after each step with ✓ on completed steps and ← NEXT on the upcoming one.


Workflow

Step 1 / 3 — Study Domain Patterns
─────────────────────────────────────────────────────
[architect] Step 1 / 3 — Study Domain Patterns (./reference/vitis-libraries.md)
─────────────────────────────────────────────────────

Invoke ./reference/vitis-libraries.md to study coding patterns from production HLS implementations before writing any code. Do NOT include or link Vitis Library headers in user designs — study, then write your own.

Print before proceeding:

─────────────────────────────────────────────────────
[architect] Step 1 done — Domain Patterns
Patterns found : <list patterns identified from ./reference/vitis-libraries.md>
Applies to : <how each pattern maps to this algorithm>
Gap : <any applicable pattern NOT found — or "none">
─────────────────────────────────────────────────────
✓ Step 1 Study domain patterns (./reference/vitis-libraries.md)
Step 2a Draw activity timeline + choose paradigm ← NEXT
Step 2b Generate fixed top-level (load → compute → store)
Step 2c Decompose compute() — hierarchical or monolithic
Step 2d Write to rearchitect/ + pragma audit
Step 2e G++ functional verification
Step 3a Validate with hls* skills
Step 3b Architecture review (user approval)
Step 3c Write to perf_outcomes.md
Step 3d-1 Apply performance pragmas (if throughput)
Step 3d-2 Save baseline snapshot
Step 3e Hand off to /hls-optimize
→ HANDOFF to Step 2
Produces : Domain pattern notes (in-context — coding patterns from ./reference/vitis-libraries.md)
Condition: At least one relevant HLS pattern identified for the input algorithm
Blocked if: No applicable pattern found → document why, proceed to Step 2 anyway

Step 2 / 3 — Generate Architecture
─────────────────────────────────────────────────────
[architect] Step 2 / 3 — Generate Architecture
─────────────────────────────────────────────────────

Apply the two paradigms when converting input code to HLS:

ParadigmWhat it meansHLS mapping
Producer-ConsumerN tasks, each with one responsibility, communicating through channelsOne static function per stage; top-level with #pragma HLS DATAFLOW
Streaming DataTasks exchange data via FIFOs (in-order, max overlap) or PIPOs (random-order, safer)hls::stream for sequential access; PIPO for random access; avoid wide channels

Draw the activity timeline before coding — shows when each stage executes across multiple invocations; reveals expected parallelism and bottlenecks.

Note: Loop-level pipelining (#pragma HLS PIPELINE) is NOT applied by the architect — see Pragma Rules below. The performance pragma handles throughput targets.
→ HANDOFF to Fixed Top-Level Structure
Produces : Activity timeline drawn; paradigm (producer-consumer / streaming) identified
Condition: At least one activity timeline sketched showing stage overlap across invocations
Blocked if: Timeline cannot be drawn → ask user for clarification on algorithm boundaries

Fixed Top-Level Structure

The top level always has exactly three functions connected by one #pragma HLS DATAFLOW:

load_input() → compute() → store_output()
  • load_input() — reads from AXI master port(s), writes to stream(s) or PIPO(s)
  • compute() — all algorithmic work; see decomposition rules below
  • store_output() — reads from stream(s) or PIPO(s), writes to AXI master port(s)
  • Channels: hls::stream for sequential access, local arrays (PIPO) for random access
  • All #pragma HLS INTERFACE pragmas on top-level function args only

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/xilinx/ross-ai-assistant/hls-architect/badge)](https://verified-skill.com/skills/xilinx/ross-ai-assistant/hls-architect)

Something wrong with this skill or its page? Tell us.