- Introduced `kicad_cli.sh` for local and Docker-based kicad-cli execution. - Created `schops.py` for schematic operations including ERC, BOM, netlist exports, and bulk edits. - Added README.md for schops with installation and usage instructions. - Included requirements.txt for necessary Python packages. - Implemented rules engine for applying field defaults and renaming nets. - Added tests for rules engine functionality. - Introduced scope guard script to enforce file modification policies based on PR labels. - Created watch script to monitor KiCad files and trigger hardware gate on changes.
55 lines
1.3 KiB
Markdown
55 lines
1.3 KiB
Markdown
# Hardware quickstart (KiCad)
|
|
|
|
## Prérequis
|
|
- KiCad 9 installé (inclut `kicad-cli`)
|
|
- Python 3.11+
|
|
- (optionnel) venv
|
|
|
|
## Install tools
|
|
```bash
|
|
python -m venv .venv && source .venv/bin/activate
|
|
pip install -r tools/hw/schops/requirements.txt
|
|
```
|
|
|
|
## Checks
|
|
```bash
|
|
bash tools/hw/hw_check.sh hardware/kicad/<project>/<project>.kicad_sch
|
|
```
|
|
|
|
## Bulk edits
|
|
|
|
### Champs / propriétés
|
|
```bash
|
|
python tools/hw/schops/schops.py apply-fields \
|
|
--schematic hardware/kicad/<project>/<project>.kicad_sch \
|
|
--rules hardware/rules/fields.yaml
|
|
```
|
|
|
|
### Footprints
|
|
```bash
|
|
python tools/hw/schops/schops.py apply-footprints \
|
|
--schematic hardware/kicad/<project>/<project>.kicad_sch \
|
|
--map hardware/rules/footprints.csv
|
|
```
|
|
|
|
### Renommage de nets
|
|
```bash
|
|
python tools/hw/schops/schops.py rename-nets \
|
|
--schematic hardware/kicad/<project>/<project>.kicad_sch \
|
|
--rules hardware/rules/nets_rename.yaml
|
|
```
|
|
|
|
## Design Blocks (briques)
|
|
- stocker sous `hardware/blocks/<lib>.kicad_blocks/`
|
|
- créer via `schops block-make ...` (dossier `*.kicad_block` contenant `.kicad_sch` + `.json`)
|
|
|
|
Exemple :
|
|
```bash
|
|
python tools/hw/schops/schops.py block-make \
|
|
--name uart_header \
|
|
--from-sheet hardware/kicad/headers/headers.kicad_sch \
|
|
--lib hardware/blocks/connectors.kicad_blocks \
|
|
--description "Header UART (GND/VCC/TX/RX)" \
|
|
--keywords "uart,header,connector"
|
|
```
|