diff options
author | Wade Fife <wade.fife@ettus.com> | 2019-10-16 16:42:41 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:33 -0800 |
commit | 73911aca191d18c0a5ddb946ec618fc91b85f3f1 (patch) | |
tree | 2c2b2575fd3f26071064de8b7910f8824895f749 /host/utils/rfnoc_blocktool/rfnoc_create_verilog.py | |
parent | 8fb790c8c310e2a711fe3da9fb587d6fbf99b230 (diff) | |
download | uhd-73911aca191d18c0a5ddb946ec618fc91b85f3f1.tar.gz uhd-73911aca191d18c0a5ddb946ec618fc91b85f3f1.tar.bz2 uhd-73911aca191d18c0a5ddb946ec618fc91b85f3f1.zip |
utils: blocktool: Fix blocktool
- Fix mako paths to run from anywhere
- Correct code errors and clean up generated code
- Add support for port parameters
- Add support for axis_data interface
- Fix NoC shell reset handling
- Replace Python functions with Verilog $clog2
- Allow input and output to share port name
Diffstat (limited to 'host/utils/rfnoc_blocktool/rfnoc_create_verilog.py')
-rw-r--r-- | host/utils/rfnoc_blocktool/rfnoc_create_verilog.py | 8 |
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 |