restructure: code+libs under src/, runtime resources under data/

Separate the two concerns the repo root was mixing:
- src/   — bs/, modules/, libs/ (code + vendored libs)
- data/  — fpga_registry.yaml, probes.yaml, bsdl_files/, bscan_proxies/,
           scripts/ (everything the tool reads at runtime, CWD-relative)
- doc/   — kept at the root

CMake: repoint DIR_MODULES/DIR_LIBS and add_subdirectory at src/; emit
the binary at the build/ root (build/bs) via CMAKE_RUNTIME_OUTPUT_DIRECTORY
instead of the nested build/src/bs/. The jtag_core ../../libs path still
resolves since modules and libs moved together.

Runtime default paths now point under data/ (fpga.c, probes.c, script.c
bsdl_files lookup, init.c config.script). Docs (README/tutorial/CLAUDE)
updated for the new layout, src/ module paths, and ./build/bs.

Validated on the IGLOO2/FlashPro: profiles, autoinit, and svf_play all
work run from the repo root.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 15:03:25 +02:00
parent cc2ee5d92c
commit d1bdce91dc
84 changed files with 138 additions and 129 deletions

View File

@@ -0,0 +1,87 @@
#ifndef _BSDL_LOADER_H
#define _BSDL_LOADER_H
/*
* JTAG Core library
* Copyright (c) 2008 - 2024 Viveris Technologies
*
* JTAG Core library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* JTAG Core library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with JTAG Core library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file bsdl_loader.h
* @brief bsdl file parser header
* @author Jean-François DEL NERO <Jean-Francois.DELNERO@viveris.fr>
*/
#include "jtag_core/jtag_core.h"
#define MAX_ELEMENT_SIZE (64+1)
typedef struct _pin_ctrl
{
char pinname[MAX_ELEMENT_SIZE];
int pintype;
char physical_pin[MAX_ELEMENT_SIZE];
int ctrl_bit_number;
int out_bit_number;
int in_bit_number;
}pin_ctrl;
typedef struct _jtag_chain
{
int bit_index;
int bit_cell_type; // BC_1,BC_2,...
char pinname[MAX_ELEMENT_SIZE]; // Pin name.
int bit_type; // None , ctrl , in, out.
int safe_state; // Default - Safe state. (0,1,-1)
int control_bit_index; // Indicate the associated control bit. -1 if no control bit.
int control_disable_state;
int control_disable_result;
}jtag_chain;
typedef struct _jtag_bsdl
{
unsigned long chip_id;
unsigned long chip_id_mask;
char src_filename[512];
char entity_name[512];
int number_of_chainbits;
jtag_chain * chain_list;
int number_of_pins;
pin_ctrl * pins_list;
int number_of_bits_per_instruction;
char IDCODE_Instruction[MAX_ELEMENT_SIZE];
char EXTEST_Instruction[MAX_ELEMENT_SIZE];
char BYPASS_Instruction[MAX_ELEMENT_SIZE];
char SAMPLE_Instruction[MAX_ELEMENT_SIZE];
}jtag_bsdl;
jtag_bsdl * load_bsdlfile(jtag_core * jc,char *filename);
void unload_bsdlfile(jtag_core * jc, jtag_bsdl * bsdl);
#endif