file copy -force "./src/stimulus/wave.do" "./$Prjname/simulation/wave.do"
file copy -force "./src/stimulus/subsystem.bfm" "./$Prjname/simulation/subsystem.bfm"
import_files -stimulus "./src/stimulus/testbench.v"


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