
file copy -force "./src/stimulus/wave.do" "./$Prjname/simulation/wave.do"



import_files -stimulus "./src/stimulus/top.v"
import_files -stimulus "./src/stimulus/interface.sv"
import_files -stimulus "./src/stimulus/arch_defines.v"
import_files -stimulus "./src/stimulus/proj_package.sv"
import_files -stimulus "./src/stimulus/arch_package.sv"
import_files -stimulus "./src/stimulus/timing_tasks.sv"
import_files -stimulus "./src/stimulus/ddr4.sv"
import_files -stimulus "./src/stimulus/StateTable.svp"
import_files -stimulus "./src/stimulus/StateTableCore.svp"
import_files -stimulus "./src/stimulus/ddr4_model.svp"
import_files -stimulus "./src/stimulus/MemoryArray.svp"


build_design_hierarchy
organize_tool_files -tool {SIM_PRESYNTH} -file ./${Prjname}/stimulus/top.v -module {top::work} -input_type {stimulus}
set_modelsim_options -use_automatic_do_file 1 -sim_runtime $SimTime \
					 -tb_module_name {FAE_DDR4_Demo_tb} \
					 -log_all_signals 1 \
					 -include_do_file 1\
					 -disable_pulse_filtering 1 \
					 -resolution {1ps} \
					 -timeunit 1 \
					 -timeunit_base {ns} \
					 -precision 1 \
					 -precision_base {ps}			
					 
catch [run_tool -name {SIM_PRESYNTH}]
save_project
puts "Simulation completed successfully\n"

