Apply selected strategies to rewrite HLS source code. Use when you need optimized variants after KG strategy selection.
Use this skill to guide two rewrite stages:
pragma-tuning / pragma-dse only tune parametersIf later hardware validation / pragma-tuning / pragma-dse reports structural HLS errors, revise the hardware rewrite instead of forcing more pragmas onto a broken base design.
agentskl/skills/rewrite/references/rewrite_rules.md.agentskl/skills/rewrite/references/dataflow_circuit_patterns.md.references/dataflow_circuit_structural_strategy.md and are available.references/dataflow_circuit_legality_checks.mdreferences/auto_learned_lessons.md; load them when present.rewrite_rules.md.references/auto_learned_lessons.md.dataflow_circuit_structural_strategy.md and dataflow_circuit_legality_checks.md.<analysis>.<optimized_code> when the caller explicitly requests a concrete rewrite stage.m_axi traffic, and align ARRAY_PARTITION/RESHAPE with the actual parallel access pattern before adding more DATAFLOW or aggressive UNROLL.PIPELINE / UNROLL factors match the real number of concurrent accesses.PIPELINE II targets before expanding task-level parallelism.DATAFLOW only when the kernel naturally decomposes into legal producer/consumer stages with isolated external-memory access.
DATAFLOW + STREAM + PIPELINE is often useful, but only after memory interfaces are isolated cleanly.baseline_tied pragma-DSE results as a signal that the current code shape exposes weak tuning knobs.
In the next hardware rewrite, change code structure or memory staging instead of adding more pragmas of the same family.INLINE at file scope.PIPELINE / UNROLL tuning.m_axi port, do not partition the top-level m_axi array. Stage the data locally first, then partition/reshape the local buffer with a factor aligned to the real parallel access count.DATAFLOW, do not let multiple DATAFLOW processes directly read the same external m_axi port/bundle without local staging.pragma-tuning should adjust only parameters of existing pragma sites such as II, factor, or depth, not invent new pragma locations.