aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py
diff options
context:
space:
mode:
Diffstat (limited to 'host/utils/rfnoc_blocktool/rfnoc_create_verilog.py')
-rw-r--r--host/utils/rfnoc_blocktool/rfnoc_create_verilog.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py b/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py
index 7b4f6cdeb..ce8d4cae7 100644
--- a/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py
+++ b/host/utils/rfnoc_blocktool/rfnoc_create_verilog.py
@@ -18,7 +18,6 @@ import os
import re
import sys
from collections import namedtuple
-import six
import mako.template
import mako.lookup
from mako import exceptions
@@ -93,8 +92,11 @@ class BlockGenerator:
final filename is derived from the template file by substitute template
by the module name from the YAML configuration.
"""
- lookup = mako.lookup.TemplateLookup(directories=['.'])
- filename = os.path.join("templates", self.template_file)
+ # Create absolute paths for templates so run location doesn't matter
+ template_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
+ "templates"))
+ lookup = mako.lookup.TemplateLookup(directories=[template_dir])
+ filename = os.path.join(template_dir, self.template_file)
tpl = mako.template.Template(filename=filename, lookup=lookup,
strict_undefined=True)
# Render and return