D
Davy
Guest
Hi all,
I want to write a proc to encapsulate a stop command (Cadence NCsim).
The tcl list below. But it seems the input(phy_state, stop_name) cannot
be access/read in the stop -exec {}, why? Is it related to scope?
Thanks!
Code:
#----- 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 -----
Best regards,
Davy
I want to write a proc to encapsulate a stop command (Cadence NCsim).
The tcl list below. But it seems the input(phy_state, stop_name) cannot
be access/read in the stop -exec {}, why? Is it related to scope?
Thanks!
Code:
#----- 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 -----
Best regards,
Davy