Research-Stack/4-Infrastructure/hardware/metamanifold_prover_gowin_simple.cst
2026-05-05 21:09:48 -05:00

84 lines
2.2 KiB
Text

// Constraint file for Meta-Manifold Prover on Gowin GW1NR-9 / Tang Nano 9K
// Using known valid pins from Tang Nano 9K board
// Clock
IO_LOC "clk" 52;
IO_PORT "clk" IO_TYPE=LVCMOS33 PULL_MODE=NONE;
// Reset (active low, button)
IO_LOC "rst_n" 4;
IO_PORT "rst_n" IO_TYPE=LVCMOS33 PULL_MODE=UP;
// Control signals (buttons)
IO_LOC "start" 3;
IO_PORT "start" IO_TYPE=LVCMOS33 PULL_MODE=UP;
// Status LEDs
IO_LOC "busy" 10;
IO_PORT "busy" IO_TYPE=LVCMOS33;
IO_LOC "done" 11;
IO_PORT "done" IO_TYPE=LVCMOS33;
// Operation select (dip switches)
IO_LOC "op_select[0]" 13;
IO_LOC "op_select[1]" 14;
IO_LOC "op_select[2]" 15;
IO_PORT "op_select[0]" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
IO_PORT "op_select[1]" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
IO_PORT "op_select[2]" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
// Mass Number gate inputs (simplified to 8 bits each for demo)
IO_LOC "admissible[0]" 16;
IO_LOC "admissible[1]" 17;
IO_LOC "admissible[2]" 18;
IO_LOC "admissible[3]" 19;
IO_LOC "admissible[4]" 20;
IO_LOC "admissible[5]" 21;
IO_LOC "admissible[6]" 22;
IO_LOC "admissible[7]" 23;
IO_PORT "admissible" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
IO_LOC "residual[0]" 24;
IO_LOC "residual[1]" 25;
IO_LOC "residual[2]" 26;
IO_LOC "residual[3]" 27;
IO_LOC "residual[4]" 28;
IO_LOC "residual[5]" 29;
IO_LOC "residual[6]" 30;
IO_LOC "residual[7]" 31;
IO_PORT "residual" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
IO_LOC "threshold[0]" 32;
IO_LOC "threshold[1]" 33;
IO_LOC "threshold[2]" 34;
IO_LOC "threshold[3]" 35;
IO_LOC "threshold[4]" 36;
IO_LOC "threshold[5]" 37;
IO_LOC "threshold[6]" 38;
IO_LOC "threshold[7]" 39;
IO_PORT "threshold" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
// Mass Number gate output
IO_LOC "mass_le_result" 40;
IO_PORT "mass_le_result" IO_TYPE=LVCMOS33;
// Torus coordinates (simplified to 5 bits each)
IO_LOC "coord1[0]" 41;
IO_LOC "coord1[1]" 42;
IO_LOC "coord1[2]" 43;
IO_LOC "coord1[3]" 44;
IO_LOC "coord1[4]" 45;
IO_PORT "coord1" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
IO_LOC "coord2[0]" 46;
IO_LOC "coord2[1]" 47;
IO_LOC "coord2[2]" 48;
IO_LOC "coord2[3]" 49;
IO_LOC "coord2[4]" 50;
IO_PORT "coord2" IO_TYPE=LVCMOS33 PULL_MODE=DOWN;
// Torus distance output
IO_LOC "torus_distance[0]" 51;
IO_LOC "torus_distance[1]" 52;
IO_LOC "torus_distance[2]" 53;
IO_PORT "torus_distance" IO_TYPE=LVCMOS33;