Skip to content

Commit

Permalink
Fix for ISE 14.7 not handling escaped paths on windows 10 (similar to…
Browse files Browse the repository at this point in the history
… vivado fix) (#52)
  • Loading branch information
NickShaffner authored and cfelton committed Aug 16, 2016
1 parent 7cb31b5 commit 22bfe87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 4 additions & 0 deletions rhea/build/toolflow/toolflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ def program(self):
""" Program the board with the bit-stream
"""
raise NotImplementedError()

def escape_path(self, path):
# Vivado and ISE at least need to have backslashes in their tcl files escaped.
return path.replace('\\', '\\\\')
8 changes: 4 additions & 4 deletions rhea/build/toolflow/xilinx/ise.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, brd, top=None, path='xilinx/'):
self.ucf_file = ''

def create_constraints(self):
self.ucf_file = os.path.join(self.path, self.name+'.ucf')
self.ucf_file = self.escape_path(os.path.join(self.path, self.name+'.ucf'))
ustr = ""
ustr += "#\n"
for port_name, port in self.brd.ports.items():
Expand Down Expand Up @@ -97,7 +97,7 @@ def create_flow_script(self):
os.path.basename(sys.argv[0])
self.tcl_script += '#\n#\n'

fn = os.path.join(self.path, self.name+'.tcl')
fn = self.escape_path(os.path.join(self.path, self.name+'.tcl'))

self.tcl_script += '# set compile directory:\n'
self.tcl_script += 'set compile_directory %s\n' % '.'
Expand All @@ -112,7 +112,7 @@ def create_flow_script(self):
# @note: because the directory is changed everything
# is relative to self.path
self.tcl_script += '# change to the directory:\n'
self.tcl_script += 'cd %s\n' % self.path
self.tcl_script += 'cd %s\n' % self.escape_path(self.path)

# @todo: verify UCF file exists
bdir, ucffn = os.path.split(self.ucf_file)
Expand All @@ -133,7 +133,7 @@ def create_flow_script(self):
os.remove(pjfull)
# self.tcl_script += 'project open %s \n' % (pj_fn)
#else:
self.tcl_script += 'project new %s\n' % pj_fn
self.tcl_script += 'project new %s\n' % self.escape_path(pj_fn)

if self.brd.family:
self.tcl_script += 'project set family %s\n' % self.brd.family
Expand Down
4 changes: 1 addition & 3 deletions rhea/build/toolflow/xilinx/vivado.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ def create_constraints(self):
fid.write(line + '\n')


def escape_path(self, path):
# Vivado needs to have backslashes in it's tcl files escaped.
return path.replace('\\', '\\\\')


def create_flow_script(self):

Expand Down

0 comments on commit 22bfe87

Please sign in to comment.