Files
tcad-devsim_triac/gui1d/test_run.py
T
pchang718 44b41698e8 feat(gui1d, physics): implement interactive 1D simulator GUI & fix avalanche generation sign bug
- gui1d:
  - Created interactive 1D Diode simulator dashboard (gui1d/app.py, solve_1d.py).
  - Redesigned doping process step editor, layout, and centered legend plots.
  - Implemented state caching for I-V sweeps and grid spacing optimization.
  - Doubled voltage step resolution: 0.05V step for V < 1V, and V/20 step for V >= 1V.
- physics (avalanche bug fix):
  - Fixed charge sign in Hole Continuity Equation for avalanche generation.
  - Created AvalancheGeneration_p in physics/new_physics.py to correctly act as a hole source.
  - Resolved physical breakdown current polarity and negative current leakage at high reverse bias.
2026-06-17 23:08:05 +08:00

53 lines
1.2 KiB
Python

# gui1d/test_run.py
from solve_1d import build_and_solve_1d
print("Running test solve at V = -50.0V (Avalanche ON) with process steps...")
steps = [
{
'enabled': True,
'type': 'p',
'dopant': 'Boron',
'method': 'Implant',
'surface': 'Top',
'energy': 80.0,
'dose': 1e12,
'temp': 1000.0,
'time': 60.0
}
]
try:
print("Call 1...")
res = build_and_solve_1d(
bias_target=50.0,
substrate_type='n',
substrate_doping=1e14,
length=30.0,
process_steps=steps,
enable_avalanche=True
)
print("Call 2...")
res2 = build_and_solve_1d(
bias_target=50.0,
substrate_type='n',
substrate_doping=1e14,
length=30.0,
process_steps=steps,
enable_avalanche=False
)
print("Call 3...")
res3 = build_and_solve_1d(
bias_target=5.0,
substrate_type='n',
substrate_doping=1e14,
length=30.0,
process_steps=steps,
enable_avalanche=False
)
print("All 3 calls passed successfully!")
except Exception as e:
print("Test failed with error:")
import traceback
traceback.print_exc()