Research-Stack/5-Applications/tools-scripts/tsm/tsm_v5_traces.py

65 lines
2.5 KiB
Python

# ==============================================================================
# COPYRIGHT NO ONE EVERYWHERE LLC (WYOMING HOLDING COMPANY)
# PROJECT: SOVEREIGN STACK
# This artifact is entirely proprietary and cryptographically proven.
# Open-Source usage requires explicit permission from Brandon Scott Schneider.
# ==============================================================================
import math
# --- PHYSICAL CONSTANTS ---
SPEED_OF_LIGHT = 299792458 # m/s
PICIC_CONST = 1.0e-12 # 1 picosecond
PLANCK_TIME = 5.39e-44 # 1 Planck second
# --- PCB MATERIAL CONSTANTS (FR-4) ---
# Er (Relative Permittivity) for FR-4 is typically 4.2 - 4.5
ER_FR4 = 4.2
VELOCITY_FACTOR = 1.0 / math.sqrt(ER_FR4)
V_PCB = SPEED_OF_LIGHT * VELOCITY_FACTOR # Velocity of signal in PCB traces
def calculate_flight_time(length_mm):
"""Calculates the time it takes for a signal to travel a given length on the PCB."""
length_m = length_mm / 1000.0
t = length_m / V_PCB
return t
def calculate_matched_length(delta_t_ps):
"""Calculates the trace length required for a specific delay in picoseconds."""
delta_t = delta_t_ps * PICIC_CONST
l_m = delta_t * V_PCB
return l_m * 1000.0 # return in mm
def audit_pcb_netlist():
print("--- TSM-VDP v5 PCB TRACE AUDIT (Ballistic Transport) ---")
print(f"Velocity Factor: {VELOCITY_FACTOR:.4f}")
print(f"Signal Speed (V_PCB): {V_PCB/1e6:.2f} mm/ns")
# Critical Nets
nets = [
{"name": "NET_Precision_CLOCK", "length_mm": 15.5},
{"name": "NET_SDR_IQ_I", "length_mm": 12.2},
{"name": "NET_SDR_IQ_Q", "length_mm": 12.25}, # Needs matching
{"name": "NET_SPI_SCK", "length_mm": 8.0},
{"name": "NET_SPI_MOSI", "length_mm": 7.8},
]
for net in nets:
t_ps = calculate_flight_time(net['length_mm']) / PICIC_CONST
print(f"\n[Net: {net['name']}]")
print(f" Length: {net['length_mm']} mm")
print(f" Flight Time: {t_ps:.2f} ps")
# Phase-Lock Match Check (SDR IQ)
delta_iq = abs(nets[1]['length_mm'] - nets[2]['length_mm'])
delta_t_iq = calculate_flight_time(delta_iq) / PICIC_CONST
print(f"\n[PHASE-LOCK ANALYSIS: SDR IQ]")
print(f" Length Mismatch: {delta_iq:.3f} mm")
print(f" Skew: {delta_t_iq:.2f} ps")
if delta_t_iq < 1.0:
print(" Status: COHERENT (Sub-picosecond skew)")
else:
print(f" Status: DECOHERENT (Skew > 1ps). Match req: {calculate_matched_length(1.0):.3f} mm max diff.")
if __name__ == "__main__":
audit_pcb_netlist()