run_all.tcl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # run_all.tcl - Palladium Z2 Demo Script
  2. puts "INFO: Starting Palladium Z2 simulation..."
  3. set DESIGN_NAME "top"
  4. set WORK_DIR "./work"
  5. file mkdir $WORK_DIR
  6. cd $WORK_DIR
  7. # 加载设计(示例,实际需替换为你的编译命令)
  8. puts "INFO: Loading design into Palladium Z2..."
  9. if {[catch {load_design -format verilog -top $DESIGN_NAME} err]} {
  10. puts "ERROR: Failed to load design: $err"
  11. exit 1
  12. }
  13. # 配置波形数据库
  14. puts "INFO: Setting up waveform database..."
  15. database -open waves -shm
  16. probe -create -all -depth all -database waves
  17. # 运行仿真
  18. puts "INFO: Running simulation for 1000 cycles..."
  19. run 1000
  20. # 调试信息
  21. if {[task_exists show_cpu_pc]} {
  22. show_cpu_pc
  23. } else {
  24. puts "WARNING: show_cpu_pc task not found"
  25. }
  26. # 保存波形
  27. if {[file exists waves.shm]} {
  28. puts "INFO: Saving waveform traces..."
  29. trace -name basic -database waves -add *
  30. trace -save -database waves ./wave_debug.trn
  31. } else {
  32. puts "WARNING: No waveform database found"
  33. }
  34. puts "INFO: Simulation completed successfully."
  35. exit 0