Dane Sabo cebf8c167a Initial umbrella repo: thesis + FRET pipeline + plant model with first controllers
Folds three previously-separate pieces into one preliminary-example repo
for the HAHACS thesis:

- thesis/ (submodule) → gitea Thesis.git — the PhD proposal
- fret-pipeline/ — FRET requirements to AIGER controller (was
  ~/Documents/fret_processing/; prior single-commit history abandoned
  per user decision)
- plant-model/ — 10-state PKE + lumped T/H PWR model (was
  ~/Documents/PKE_Playground/; never version-controlled before)
- presentations/2026DICE/ (submodule) → gitea 2026DICE.git
- reachability/, hardware/ — empty placeholders for Thrust 3 and HIL
- docs/architecture.md — how the discrete and continuous layers compose
- claude_memory/ — session notes and scratch knowledge pattern

Plant model refactored to thesis naming (x, plant, u, ref); pke_th_rhs
now takes u as an explicit arg instead of reading rho_ext from the
params struct. First two controllers built to the contract
u = ctrl_<mode>(t, x, plant, ref): ctrl_null (baseline) and
ctrl_operation (stabilizing, proportional on T_avg). Validated under a
100% -> 80% Q_sg step: ctrl_operation reduces steady-state T_avg drift
~47% vs. the unforced plant.

Root CLAUDE.md emphasizes that CLAUDE.md files are living documents and
that any knowledge not captured before a session ends is lost forever;
claude_memory/ holds the session-level notes that haven't stabilized
enough to graduate into a CLAUDE.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-16 16:24:11 -04:00

62 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Visualize an AIGER circuit as SVG using aigtodot + graphviz, or yosys.
#
# Usage: ./scripts/visualize.sh circuits/DRC.aag [output_dir] [method]
#
# Methods:
# dot - aigtodot + graphviz (default, requires aiger tools + graphviz)
# yosys - yosys show command (requires yosys + graphviz)
set -euo pipefail
AAG_FILE="${1:?Usage: $0 <circuit.aag> [output_dir] [dot|yosys]}"
OUTPUT_DIR="${2:-diagrams}"
METHOD="${3:-dot}"
BASENAME=$(basename "$AAG_FILE" .aag)
mkdir -p "$OUTPUT_DIR"
case "$METHOD" in
dot)
if ! command -v aigtodot &>/dev/null; then
echo "Error: aigtodot not found."
echo "Install AIGER tools: https://github.com/arminbiere/aiger"
echo " git clone https://github.com/arminbiere/aiger && cd aiger && ./configure.sh && make"
exit 1
fi
if ! command -v dot &>/dev/null; then
echo "Error: graphviz not found. Install with: brew install graphviz"
exit 1
fi
echo "Generating DOT from AIGER..."
aigtodot "$AAG_FILE" | dot -Tsvg -o "$OUTPUT_DIR/${BASENAME}.svg"
echo "SVG written to: $OUTPUT_DIR/${BASENAME}.svg"
# Also generate PNG for quick viewing
aigtodot "$AAG_FILE" | dot -Tpng -o "$OUTPUT_DIR/${BASENAME}.png"
echo "PNG written to: $OUTPUT_DIR/${BASENAME}.png"
;;
yosys)
if ! command -v yosys &>/dev/null; then
echo "Error: yosys not found. Install with: brew install yosys"
exit 1
fi
if ! command -v dot &>/dev/null; then
echo "Error: graphviz not found. Install with: brew install graphviz"
exit 1
fi
echo "Generating schematic with Yosys..."
yosys -p "read_aiger $AAG_FILE; show -format svg -prefix $OUTPUT_DIR/${BASENAME}"
echo "SVG written to: $OUTPUT_DIR/${BASENAME}.svg"
;;
*)
echo "Unknown method: $METHOD (use 'dot' or 'yosys')"
exit 1
;;
esac
echo ""
echo "Open with: open $OUTPUT_DIR/${BASENAME}.svg"