Use os methods to expand env vars

This commit is contained in:
developandplay 2021-06-26 16:30:54 +02:00
parent b787ee4411
commit e3f6d8349b
1 changed files with 2 additions and 10 deletions

View File

@ -147,18 +147,10 @@ class BlackParrotRV64(CPU):
continue continue
elif ("+incdir+" in temp) : elif ("+incdir+" in temp) :
s1 = line.find('$') s1 = line.find('$')
s2 = line.find('/') vdir = os.path.expandvars(line[s1:]).strip()
dir_ = line[s1:s2]
a = os.popen('echo '+ str(dir_))
dir_start = a.read()
vdir = dir_start[:-1] + line[s2:-1]
platform.add_verilog_include_path(vdir) platform.add_verilog_include_path(vdir)
elif (temp[0]=='$') : elif (temp[0]=='$') :
s2 = line.find('/') vdir = os.path.expandvars(line).strip()
dir_ = line[0:s2]
a = os.popen('echo '+ str(dir_))
dir_start = a.read()
vdir = dir_start[:-1]+ line[s2:-1]
platform.add_source(vdir, "systemverilog") platform.add_source(vdir, "systemverilog")
elif (temp[0] == '/'): elif (temp[0] == '/'):
assert("No support for absolute path for now") assert("No support for absolute path for now")