Skip to content
Snippets Groups Projects
Commit e1a6d83b authored by Magnus.Ersdal's avatar Magnus.Ersdal
Browse files

fixed length parsing ( '{0:{length}b}'.format(int(item[1], 16), length =...

fixed length parsing ( '{0:{length}b}'.format(int(item[1], 16), length = length) ) in _data_sub_parse in svf_interpreter.py
parent e974f076
No related branches found
No related tags found
No related merge requests found
......@@ -141,6 +141,9 @@ class interface(): # can have multiple inheritance to hide methods.
self._write_TMS_TDI(TMSvect, 'TMS', True)
self._write_TMS_TDI(TDIvect, 'TDI', True)
self._bus_cycle()
def read_TDO(self):
pass
def _bus_cycle(self):
if self.tms_cycle and self.tdi_cycle: # we will cycle the bus
......
......@@ -148,9 +148,9 @@ class svfinterpreter():
length = int(arg.pop(0))
#[[TDI, 123], [TDO, 123]]
if len(arg) != 0:
self._data_sub_parse(arg, None, mode, sig)
self._data_sub_parse(arg, None, mode, sig, length)
def _data_sub_parse(self, arg, sequence=None, mode='', sig=None):
def _data_sub_parse(self, arg, sequence=None, mode='', sig=None, length = 0):
# print("data_sub called in mode:",mode,"with arg, seq:",arg,",",sequence)
# the alternatives for "sig" variable are self.bus.TDI
if isinstance(arg, str):
......@@ -167,7 +167,7 @@ class svfinterpreter():
elif isinstance(arg, list):
for item in arg:
# format into binary. svf format is hex
bsequence = '{0:b}'.format(int(item[1], 16))
bsequence = '{0:{length}b}'.format(int(item[1], 16), length = length)
self._data_sub_parse(item[0], bsequence, mode, sig)
def dummy(self, arg=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment