Allow setting driver debug_threshold in SCT file

This commit is contained in:
Douglas Clowes
2014-05-28 11:59:30 +10:00
parent 6a9b64d3d6
commit 28ea3befb6

View File

@ -82,6 +82,7 @@ reserved = {
'DRIVER_PROPERTY' : 'DRIVER_PROPERTY',
'CLASS' : 'CLASS',
'SIMULATION_GROUP' : 'SIMULATION_GROUP',
'DEBUG_THRESHOLD' : 'DEBUG_THRESHOLD',
'CODE' : 'CODE',
'ADD_ARGS' : 'ADD_ARGS',
'MAKE_ARGS' : 'MAKE_ARGS',
@ -314,6 +315,7 @@ def p_driver_assignment(p):
| ADD_ARGS EQUALS text_string
| MAKE_ARGS EQUALS text_string
| PROTOCOL_ARGS EQUALS text_string
| DEBUG_THRESHOLD EQUALS value
'''
p[0] = { p[1] : p[3] }
@ -822,7 +824,7 @@ def put_preamble(MyDriver):
txt += ['#']
txt += ['']
txt += ['namespace eval %s {' % MyDriver['namespace']]
txt += [' set debug_threshold 5']
txt += [' set debug_threshold %s' % str( MyDriver['debug_threshold'])]
if len(MyDriver['Permlink']) > 0:
if 'make_args' in MyDriver and 'id' in MyDriver['make_args'].split():
pass
@ -1322,7 +1324,7 @@ def put_mkDriver(MyDriver):
txt += put_group(MyDriver, MyDriver['Groups'][group])
txt += [' hsetprop ${scobj_hpath} klass %s' % MyDriver['class']]
txt += [' hsetprop ${scobj_hpath} debug_threshold 5']
txt += [' hsetprop ${scobj_hpath} debug_threshold %s' % str(MyDriver['debug_threshold'])]
func = 'mkDriver'
if func in MyDriver['Funcs']:
txt += ['# %s hook code starts' % func]
@ -1504,6 +1506,7 @@ def process_drivers(TheDrivers):
for driver in TheDrivers:
MyDriver = {'name':driver}
MyDriver['namespace'] = '::scobj::%s' % driver
MyDriver['debug_threshold'] = '5'
MyDriver['Groups'] = {}
MyDriver['Funcs'] = {}
MyDriver['Permlink'] = {}