# operands are the name of the variable and a Value node containing the
# value of the variable.
def build_config_file(target, source, env):
- (variable, value) = [s.get_contents() for s in source]
+ (variable, value) = [s.get_contents().decode('utf-8') for s in source]
with open(str(target[0]), 'w') as f:
print('#define', variable, value, file=f)
return None
env.ConfigFile(opt)
def makeTheISA(source, target, env):
- isas = [ src.get_contents() for src in source ]
+ isas = [ src.get_contents().decode('utf-8') for src in source ]
target_isa = env['TARGET_ISA']
def define(isa):
return isa.upper() + '_ISA'
# Generate Python file containing a dict specifying the current
# buildEnv flags.
def makeDefinesPyFile(target, source, env):
- build_env = source[0].get_contents()
+ build_env = source[0].get_contents().decode('utf-8')
code = code_formatter()
code("""
def body(target, source, env):
assert len(target) == 1 and len(source) == 1
- name = str(source[0].get_contents())
+ name = source[0].get_contents().decode('utf-8')
obj = sim_objects[name]
code = code_formatter()
import re
import sys
+from six import string_types
+
from . import convert
from . import jobfile
def make_version_list(v):
if isinstance(v, (list,tuple)):
return v
- elif isinstance(v, str):
+ elif isinstance(v, string_types):
return map(lambda x: int(re.match('\d+', x).group()), v.split('.'))
else:
raise TypeError()
return exception
raise
- return subp.communicate()[0]
+ return subp.communicate()[0].decode('utf-8')
def makeDir(path):
"""Make a directory if it doesn't exist. If the path does exist,