cg_example
Find a verified circuit base to adapt for hardware design, reducing the need to synthesize hard kernels from scratch. Curated code is matched by specificity-scored lookup.
Instructions
Get a VERIFIED C⏚ base to seed-and-adapt from (don't synthesize hard
kernels from scratch — adapt a known-good one). This is a curated
dictionary of validated code with scored lazy lookup, NOT free-form
search. No pattern → a compact index (name + kind + use_when + tags). A
pattern → the single best-matching source plus its metadata and 1-2
runners_up so you can self-correct on an ambiguous query. k>1 also
returns the next sources when the task implies composition.
Matching is specificity-weighted (exact name ≫ name word ≫ full tag
phrase ≫ partial overlap), so e.g. "1/sqrt" → RSqrt while a bare "sqrt"
→ FixedSqrt. kind distinguishes general PRIMITIVES (the reusable
library: Recip, Divide, SeqDiv, FixedSqrt, RSqrt, SqrDist, DotProduct,
Fir, Integ, Distance, Counter) from application EXAMPLES (Force,
GalaxyForce). Every entry passes simulate + generate + iverilog + yosys.
Workflow: cg_example → edit only the dataflow → cg_check → cg_simulate →
cg_generate_verilog → cg_synth.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| pattern | No |