fpga: load registry from yaml at runtime, not compile-time
- registry moves from the array in fpga.c to fpga_registry.yaml at the repo root, parsed via libyaml (pkg-config yaml-0.1); adding a part is now a YAML edit, no rebuild - looked up CWD-relative (like bsdl_files/), overridable with $BS_FPGA_REGISTRY, loaded lazily once; public API unchanged - fpga_list shows the source file (fpga_registry_source()) - add microsemi_igloo2/smartfusion2 and lattice_machxo2/3 families, ready for the non-Xilinx targets - docs updated: CLAUDE.md, README, tutorial "add a target" walkthrough Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2779,17 +2779,20 @@ static int cmd_get_pins_list(script_ctx *ctx, char *line)
|
||||
|
||||
const char *cmd_fpga_list_help[] = {
|
||||
"",
|
||||
"Lists the FPGA targets known to this build (registry in modules/fpga/).",
|
||||
"Lists the FPGA targets in the registry (loaded from fpga_registry.yaml).",
|
||||
""};
|
||||
static int cmd_fpga_list(script_ctx *ctx, char *line)
|
||||
{
|
||||
int i, n;
|
||||
const fpga_target *t;
|
||||
const char *src;
|
||||
|
||||
(void)line;
|
||||
|
||||
n = fpga_get_target_count();
|
||||
ctx->script_printf(ctx, MSG_INFO_0, "%d FPGA target(s) registered:\n", n);
|
||||
src = fpga_registry_source();
|
||||
ctx->script_printf(ctx, MSG_INFO_0, "%d FPGA target(s) registered (from %s):\n",
|
||||
n, src ? src : "<no registry loaded>");
|
||||
for (i = 0; i < n; i++) {
|
||||
t = fpga_get_target_by_index(i);
|
||||
ctx->script_printf(ctx, MSG_NONE,
|
||||
|
||||
Reference in New Issue
Block a user