Wrap generated driver code in 'catch' and handle_exception blocks

This commit is contained in:
Douglas Clowes
2014-03-18 12:42:56 +11:00
parent 7269776484
commit 94e2e06f22
3 changed files with 408 additions and 333 deletions

View File

@@ -745,12 +745,14 @@ def put_preamble(MyDriver):
txt += ['}']
txt += ['']
txt += ['proc %s::debug_log {debug_level debug_string} {' % MyDriver['namespace']]
txt += [' if {${debug_level} >= ${%s::debug_threshold}} {' % MyDriver['namespace']]
txt += [' set fd [open "/tmp/%s.log" "a"]' % MyDriver['name']]
txt += [' set line "[clock format [clock seconds] -format "%T"] ${debug_string}"']
txt += [' puts ${fd} "${line}"']
txt += [' close ${fd}']
txt += [' }']
txt += [' set catch_status [ catch {']
txt += [' if {${debug_level} >= ${%s::debug_threshold}} {' % MyDriver['namespace']]
txt += [' set fd [open "/tmp/%s.log" "a"]' % MyDriver['name']]
txt += [' set line "[clock format [clock seconds] -format "%T"] ${debug_string}"']
txt += [' puts ${fd} "${line}"']
txt += [' close ${fd}']
txt += [' }']
txt += [' } catch_message ]']
txt += ['}']
emit(txt)
@@ -758,30 +760,33 @@ def put_write_function(MyDriver, func):
txt = ['']
txt += ['# function to write a parameter value on a device']
txt += ['proc %s::%s {tc_root nextState cmd_str} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"' % func]
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' hdelprop [sct] geterror']
txt += [' }']
txt += [' set par [sct target]']
txt += [' set cmd "${cmd_str}${par}"']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"' % func]
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' hdelprop [sct] geterror']
txt += [' }']
txt += [' set par [sct target]']
txt += [' set cmd "${cmd_str}${par}"']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' return -code error "[sct geterror]"']
txt += [' }']
txt += [' if { [hpropexists [sct] driving] } {']
txt += [' if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {']
txt += [' sct driving 1']
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' error "[sct geterror]"']
txt += [' }']
txt += [' if { [hpropexists [sct] driving] } {']
txt += [' if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } {']
txt += [' sct driving 1']
txt += [' }']
txt += [' }']
txt += [' }']
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
txt += [' if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {']
txt += [' sct send "${cmd}"']
txt += [' }']
txt += [' return ${nextState}']
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
txt += [' if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {']
txt += [' sct send "${cmd}"']
txt += [' }']
txt += [' return ${nextState}']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -789,12 +794,15 @@ def put_check_function(MyDriver, func):
txt = ['']
txt += ['# function to check the write parameter on a device']
txt += ['proc %s::%s {tc_root} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] resp=[sct result]"' % func]
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] resp=[sct result]"' % func]
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' return "idle"']
txt += [' return "idle"']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -802,22 +810,25 @@ def put_fetch_function(MyDriver, func):
txt = ['']
txt += ['# function to request the read of a parameter on a device']
txt += ['proc %s::%s {tc_root nextState cmd_str} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"' % func]
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' hdelprop [sct] geterror']
txt += [' }']
txt += [' set cmd "${cmd_str}"']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"' % func]
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' hdelprop [sct] geterror']
txt += [' }']
txt += [' set cmd "${cmd_str}"']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' return -code error "[sct geterror]"']
txt += [' }']
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
txt += [' sct send "${cmd}"']
txt += [' return ${nextState}']
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' error "[sct geterror]"']
txt += [' }']
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
txt += [' sct send "${cmd}"']
txt += [' return ${nextState}']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -825,32 +836,35 @@ def put_read_function(MyDriver, func):
txt = ['']
txt += ['# function to parse the read of a parameter on a device']
txt += ['proc %s::%s {tc_root} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] result=[sct result]"' % func]
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' hdelprop [sct] geterror']
txt += [' }']
txt += [' set data [sct result]']
txt += [' set nextState "idle"']
txt += [' if {[string equal -nocase -length 7 ${data} "ASCERR:"]} {']
txt += [' # the protocol driver has reported an error']
txt += [' sct geterror "${data}"']
txt += [' return -code error "[sct geterror]"']
txt += [' }']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] result=[sct result]"' % func]
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' hdelprop [sct] geterror']
txt += [' }']
txt += [' set data [sct result]']
txt += [' set nextState "idle"']
txt += [' if {[string equal -nocase -length 7 ${data} "ASCERR:"]} {']
txt += [' # the protocol driver has reported an error']
txt += [' sct geterror "${data}"']
txt += [' error "[sct geterror]"']
txt += [' }']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' return -code error "[sct geterror]"']
txt += [' }']
txt += [' if { ${data} != [sct oldval] } {']
txt += [' debug_log 1 "[sct] changed to new:${data}, from old:[sct oldval]"']
txt += [' sct oldval ${data}']
txt += [' sct update ${data}']
txt += [' sct utime readtime']
txt += [' }']
txt += [' return ${nextState}']
txt += [' if { [hpropexists [sct] geterror] } {']
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
txt += [' error "[sct geterror]"']
txt += [' }']
txt += [' if { ${data} != [sct oldval] } {']
txt += [' debug_log 1 "[sct] changed to new:${data}, from old:[sct oldval]"']
txt += [' sct oldval ${data}']
txt += [' sct update ${data}']
txt += [' sct utime readtime']
txt += [' }']
txt += [' return ${nextState}']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -858,28 +872,31 @@ def put_checkrange_function(MyDriver, func):
txt = ['']
txt += ['# check function for hset change']
txt += ['proc %s::%s {tc_root} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] target=[sct target]"' % func]
txt += [' set setpoint [sct target]']
txt += [' if { [hpropexists [sct] lowerlimit] } {']
txt += [' set lolimit [sct lowerlimit]']
txt += [' } else {']
txt += [' # lowerlimit not set, use target']
txt += [' set lolimit [sct target]']
txt += [' }']
txt += [' if { [hpropexists [sct] upperlimit] } {']
txt += [' set hilimit [sct upperlimit]']
txt += [' } else {']
txt += [' # upperlimit not set, use target']
txt += [' set hilimit [sct target]']
txt += [' }']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] target=[sct target]"' % func]
txt += [' set setpoint [sct target]']
txt += [' if { [hpropexists [sct] lowerlimit] } {']
txt += [' set lolimit [sct lowerlimit]']
txt += [' } else {']
txt += [' # lowerlimit not set, use target']
txt += [' set lolimit [sct target]']
txt += [' }']
txt += [' if { [hpropexists [sct] upperlimit] } {']
txt += [' set hilimit [sct upperlimit]']
txt += [' } else {']
txt += [' # upperlimit not set, use target']
txt += [' set hilimit [sct target]']
txt += [' }']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {']
txt += [' error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"']
txt += [' }']
txt += [' return OK']
txt += [' if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {']
txt += [' error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"']
txt += [' }']
txt += [' return OK']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -887,29 +904,32 @@ def put_checklimits_function(MyDriver, func):
txt = ['']
txt += ['# checklimits function for driveable interface']
txt += ['proc %s::%s {tc_root} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] target=[sct target]"' % func]
txt += [' set setpoint [sct target]']
txt += [' if { [hpropexists [sct] lowerlimit] } {']
txt += [' set lolimit [sct lowerlimit]']
txt += [' } else {']
txt += [' # lowerlimit not set, use target']
txt += [' set lolimit [sct target]']
txt += [' }']
txt += [' if { [hpropexists [sct] upperlimit] } {']
txt += [' set hilimit [sct upperlimit]']
txt += [' } else {']
txt += [' # upperlimit not set, use target']
txt += [' set hilimit [sct target]']
txt += [' }']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] target=[sct target]"' % func]
txt += [' set setpoint [sct target]']
txt += [' if { [hpropexists [sct] lowerlimit] } {']
txt += [' set lolimit [sct lowerlimit]']
txt += [' } else {']
txt += [' # lowerlimit not set, use target']
txt += [' set lolimit [sct target]']
txt += [' }']
txt += [' if { [hpropexists [sct] upperlimit] } {']
txt += [' set hilimit [sct upperlimit]']
txt += [' } else {']
txt += [' # upperlimit not set, use target']
txt += [' set hilimit [sct target]']
txt += [' }']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {']
txt += [' sct driving 0']
txt += [' error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"']
txt += [' }']
txt += [' return OK']
txt += [' if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } {']
txt += [' sct driving 0']
txt += [' error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]"']
txt += [' }']
txt += [' return OK']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -917,21 +937,24 @@ def put_checkstatus_function(MyDriver, func):
txt = ['']
txt += ['# checkstatus function for driveable interface']
txt += ['proc %s::%s {tc_root} {' % (MyDriver['namespace'], func)]
txt += [' set catch_status [ catch {']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' if {[sct driving]} {']
txt += [' set sp "[sct target]"']
txt += [' set pv "[hval ${tc_root}/[sct driveable]]"']
txt += [' if { ${pv} > ${sp} - [sct tolerance] && ${pv} < ${sp} + [sct tolerance] } {']
txt += [' sct driving 0']
txt += [' if {[sct driving]} {']
txt += [' set sp "[sct target]"']
txt += [' set pv "[hval ${tc_root}/[sct driveable]]"']
txt += [' if { ${pv} > ${sp} - [sct tolerance] && ${pv} < ${sp} + [sct tolerance] } {']
txt += [' sct driving 0']
txt += [' return "idle"']
txt += [' }']
txt += [' return "busy"']
txt += [' } else {']
txt += [' return "idle"']
txt += [' }']
txt += [' return "busy"']
txt += [' } else {']
txt += [' return "idle"']
txt += [' }']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -939,14 +962,17 @@ def put_halt_function(MyDriver, func):
txt = ['']
txt += ['# halt function for driveable interface']
txt += ['proc %s::%s {tc_root} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] driving=[sct driving]"' % func]
txt += [' ### TODO hset [sct] [hval [sct]]']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] driving=[sct driving]"' % func]
txt += [' ### TODO hset [sct] [hval [sct]]']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' sct driving 0']
txt += [' return "idle"']
txt += [' sct driving 0']
txt += [' return "idle"']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -954,25 +980,28 @@ def put_pid_function(MyDriver, func):
txt = ['']
txt += ['# pid function for PID control']
txt += ['proc %s::%s {tc_root sp pv} {' % (MyDriver['namespace'], func)]
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] pv=${pv} sp=${sp}"' % func]
txt += [' sct pid_error [expr ${sp} - ${pv}]']
txt += [' set p_value [expr [sct pid_pvalue] * [sct pid_error]]']
txt += [' set d_value [expr [sct pid_dvalue] * (${pv} - [sct oldval])]']
txt += [' sct pid_deriv [sct pid_error]']
txt += [' sct pid_integ [expr [sct pid_integ] + [sct pid_error]]']
txt += [' if { [sct pid_integ] > [sct pid_imax] } {']
txt += [' sct pid_integ [sct pid_imax]']
txt += [' }']
txt += [' if { [sct pid_integ] < -[sct pid_imax] } {']
txt += [' sct pid_integ -[sct pid_imax]']
txt += [' }']
txt += [' set i_value [expr [sct pid_ivalue] * [sct pid_integ]]']
txt += [' set pid [expr ${p_value} + ${i_value} + ${d_value}]']
txt += [' set catch_status [ catch {']
txt += [' debug_log 1 "%s tc_root=${tc_root} sct=[sct] pv=${pv} sp=${sp}"' % func]
txt += [' sct pid_error [expr ${sp} - ${pv}]']
txt += [' set p_value [expr [sct pid_pvalue] * [sct pid_error]]']
txt += [' set d_value [expr [sct pid_dvalue] * (${pv} - [sct oldval])]']
txt += [' sct pid_deriv [sct pid_error]']
txt += [' sct pid_integ [expr [sct pid_integ] + [sct pid_error]]']
txt += [' if { [sct pid_integ] > [sct pid_imax] } {']
txt += [' sct pid_integ [sct pid_imax]']
txt += [' }']
txt += [' if { [sct pid_integ] < -[sct pid_imax] } {']
txt += [' sct pid_integ -[sct pid_imax]']
txt += [' }']
txt += [' set i_value [expr [sct pid_ivalue] * [sct pid_integ]]']
txt += [' set pid [expr ${p_value} + ${i_value} + ${d_value}]']
if func in MyDriver['Funcs'] and len(MyDriver['Funcs'][func]['text']) > 0:
txt += ['# hook code starts']
txt += MyDriver['Funcs'][func]['text']
txt += ['# hook code ends']
txt += [' sct pid_output ${pid}']
txt += [' sct pid_output ${pid}']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += [' return ${pid}']
txt += ['}']
emit(txt)
@@ -1134,7 +1163,7 @@ def put_mk_sct_driver(MyDriver):
txt += MyDriver['Funcs']['mkDriver']['text']
txt += ['# hook code ends']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message} "in ${ns}::mk_sct_%s"' % MyDriver['name']]
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
emit(txt)
@@ -1150,37 +1179,40 @@ def put_postamble(MyDriver):
else:
line = 'proc add_%s {name IP port} {' % MyDriver['name']
txt += [line]
txt += [' set ns "%s"' % MyDriver['namespace']]
txt += [' ${ns}::debug_log 1 "add_%s ${name} ${IP} ${port}"' % MyDriver['name']]
txt += [' if {[SplitReply [%s]]=="false"} {' % MyDriver['simulation_group']]
txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {']
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} aqadapter ${port}"']
txt += [' makesctcontroller sct_${name} aqadapter ${port}']
txt += [' } else {']
txt += [' set catch_status [ catch {']
txt += [' set ns "%s"' % MyDriver['namespace']]
txt += [' ${ns}::debug_log 1 "add_%s ${name} ${IP} ${port}"' % MyDriver['name']]
txt += [' if {[SplitReply [%s]]=="false"} {' % MyDriver['simulation_group']]
txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {']
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} aqadapter ${port}"']
txt += [' makesctcontroller sct_${name} aqadapter ${port}']
txt += [' } else {']
if 'protocol_args' in MyDriver:
protocol_args = MyDriver['protocol_args'].replace('\\', '\\\\').replace('"', '\\"')
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} %s ${IP}:${port} %s"' % (MyDriver['protocol'], protocol_args)]
txt += [' makesctcontroller sct_${name} %s ${IP}:${port} %s' % (MyDriver['protocol'], MyDriver['protocol_args'])]
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} %s ${IP}:${port} %s"' % (MyDriver['protocol'], protocol_args)]
txt += [' makesctcontroller sct_${name} %s ${IP}:${port} %s' % (MyDriver['protocol'], MyDriver['protocol_args'])]
else:
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} %s ${IP}:${port}"' % MyDriver['protocol']]
txt += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']]
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} %s ${IP}:${port}"' % MyDriver['protocol']]
txt += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']]
txt += [' }']
txt += [' }']
txt += [' }']
make_args = ''
if 'make_args' in MyDriver:
for arg in MyDriver['make_args'].split():
if len(make_args) > 0:
make_args += ' '
make_args += '${' + arg + '}'
txt += [' ${ns}::debug_log 1 "mk_sct_%s sct_${name} ${name} %s"' % (MyDriver['name'], make_args)]
txt += [' ${ns}::mk_sct_%s sct_${name} ${name} %s' % (MyDriver['name'], make_args)]
txt += [' ${ns}::debug_log 1 "mk_sct_%s sct_${name} ${name} %s"' % (MyDriver['name'], make_args)]
txt += [' ${ns}::mk_sct_%s sct_${name} ${name} %s' % (MyDriver['name'], make_args)]
else:
txt += [' ${ns}::debug_log 1 "mk_sct_%s sct_${name} ${name}"' % MyDriver['name']]
txt += [' ${ns}::mk_sct_%s sct_${name} ${name}' % MyDriver['name']]
txt += [' ${ns}::debug_log 1 "mk_sct_%s sct_${name} ${name}"' % MyDriver['name']]
txt += [' ${ns}::mk_sct_%s sct_${name} ${name}' % MyDriver['name']]
# TODO
#txt += [' ${ns}::debug_log 1 "makesctemon ${name} /sics/${name}/emon/monmode /sics/${name}/emon/isintol /sics/${name}/emon/errhandler"']
# txt += [' makesctemon ${name} /sics/${name}/emon/monmode /sics/${name}/emon/isintol /sics/${name}/emon/errhandler']
txt += [' close ${fd}']
#txt += [' ${ns}::debug_log 1 "makesctemon ${name} /sics/${name}/emon/monmode /sics/${name}/emon/isintol /sics/${name}/emon/errhandler"']
# txt += [' makesctemon ${name} /sics/${name}/emon/monmode /sics/${name}/emon/isintol /sics/${name}/emon/errhandler']
txt += [' close ${fd}']
txt += [' } catch_message ]']
txt += [' handle_exception ${catch_status} ${catch_message}']
txt += ['}']
txt += ['']
txt += ['puts stdout "file evaluation of sct_%s.tcl"' % MyDriver['name']]