Research-Stack/4-Infrastructure/hardware/morphic_scalar_fpga_optimized.cst

85 lines
4.9 KiB
Text

// Morphic Scalar FPGA Implementation - Gowin Constraint File
// Target: Gowin GW1NR-9 (Tang Nano 9K)
// Pin mapping based on actual hardware pinout
// ═══════════════════════════════════════════════════════════════════════════
// Clock and Reset
// ═══════════════════════════════════════════════════════════════════════════
IO_LOC "clk" 52;
IO_PORT "clk" IO_TYPE=LVCMOS33 PULL_MODE=NONE;
IO_LOC "rst_n" 4;
IO_PORT "rst_n" PULL_MODE=UP;
// ═══════════════════════════════════════════════════════════════════════════
// User Button
// ═══════════════════════════════════════════════════════════════════════════
IO_LOC "user_btn" 3;
IO_PORT "user_btn" PULL_MODE=UP;
// ═══════════════════════════════════════════════════════════════════════════
// LED Outputs (Status Indicators)
// ═══════════════════════════════════════════════════════════════════════════
IO_LOC "led[5]" 16;
IO_PORT "led[5]" PULL_MODE=UP DRIVE=8;
IO_LOC "led[4]" 15;
IO_PORT "led[4]" PULL_MODE=UP DRIVE=8;
IO_LOC "led[3]" 14;
IO_PORT "led[3]" PULL_MODE=UP DRIVE=8;
IO_LOC "led[2]" 13;
IO_PORT "led[2]" PULL_MODE=UP DRIVE=8;
IO_LOC "led[1]" 11;
IO_PORT "led[1]" PULL_MODE=UP DRIVE=8;
IO_LOC "led[0]" 10;
IO_PORT "led[0]" PULL_MODE=UP DRIVE=8;
// ═══════════════════════════════════════════════════════════════════════════
// UART Debug Interface
// ═══════════════════════════════════════════════════════════════════════════
IO_LOC "uart_tx" 17;
IO_PORT "uart_tx" IO_TYPE=LVCMOS33 PULL_MODE=UP DRIVE=8;
IO_LOC "uart_rx" 18;
IO_PORT "uart_rx" IO_TYPE=LVCMOS33 PULL_MODE=UP;
// ═══════════════════════════════════════════════════════════════════════════
// MEMS Microphone (SPH0645)
// ═══════════════════════════════════════════════════════════════════════════
IO_LOC "pdm_data" 77;
IO_PORT "pdm_data" IO_TYPE=LVCMOS33 PULL_MODE=UP;
IO_LOC "pdm_clk" 76;
IO_PORT "pdm_clk" IO_TYPE=LVCMOS33 PULL_MODE=UP DRIVE=8;
// ═══════════════════════════════════════════════════════════════════════════
// State Machine Control Inputs
// ═══════════════════════════════════════════════════════════════════════════
IO_LOC "state_transition" 2;
IO_PORT "state_transition" PULL_MODE=UP;
IO_LOC "target_state[0]" 5;
IO_PORT "target_state[0]" PULL_MODE=UP;
IO_LOC "target_state[1]" 6;
IO_PORT "target_state[1]" PULL_MODE=UP;
IO_LOC "target_state[2]" 7;
IO_PORT "target_state[2]" PULL_MODE=UP;
IO_LOC "target_state[3]" 8;
IO_PORT "target_state[3]" PULL_MODE=UP;
IO_LOC "operator_available" 9;
IO_PORT "operator_available" PULL_MODE=UP;
// ═══════════════════════════════════════════════════════════════════════════
// OEPI Inputs (32-bit Q16.16 each)
// ═══════════════════════════════════════════════════════════════════════════
// Note: These would typically be connected to external sensors or
// internal modules. For testing, these can be tied to constants or
// connected to GPIO pins on the 2x24P header.