ncsim stop in Tcl proc problem?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
tcl stop command

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
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…