#----- tcl start -----
proc phy_state_trans {phy_state stop_name} {
# below three puts work OK
puts "phy_state is $phy_state\n"
puts "stop_name is $stop_name\n"
puts "!!! enter proc\n"
run 1us
stop -name $stop_name -silent -cont -cond { #$DLR_ref.PCLK == 1'b1 } -exec {
# Tcl run here and report error $stop_name cannot be read
puts "!!! stop_name is $stop_name"
force dlr_pkg.dlr_INST.PHY_STATE = $phy_state
}
puts "OK_3 state is $phy_state\n"
run 1us
stop -delete "$stop_name"
force dlr_pkg.dlr_INST.PHY_STATE = $PHY_STATE_L0
run 1us
}
phy_state_trans PHY_STATE_L1 Trans_Stop
#----- tcl end -----