diff --git a/driver/opae/Makefile b/driver/opae/Makefile index 1a8c6051..936bd068 100644 --- a/driver/opae/Makefile +++ b/driver/opae/Makefile @@ -74,7 +74,7 @@ json: ../../hw/opae/vortex_afu.json afu_json_mgr json-info --afu-json=$^ --c-hdr=$@ scope-defs.h: $(SCRIPT_DIR)/scope.json - $(SCRIPT_DIR)/scope.py $(RTL_INCLUDE) $(CONFIGS) -cc scope-defs.h -vl $(RTL_DIR)/scope-defs.vh $(SCRIPT_DIR)/scope.json + $(SCRIPT_DIR)/scope.py $(CONFIGS) -cc scope-defs.h -vl $(RTL_DIR)/scope-defs.vh $(SCRIPT_DIR)/scope.json # generate scope data scope: scope-defs.h diff --git a/hw/scripts/scope.json b/hw/scripts/scope.json index 7d7190b0..b5b4a11d 100644 --- a/hw/scripts/scope.json +++ b/hw/scripts/scope.json @@ -1,8 +1,9 @@ { "version": 1, "includes":[ + "../dpi/util_dpi.vh", "../rtl/VX_config.vh", - "../rtl/VX_platform.vh", + "../rtl/VX_platform.vh", "../rtl/VX_define.vh", "../rtl/cache/VX_cache_define.vh" ], diff --git a/hw/scripts/scope.py b/hw/scripts/scope.py index a2da6fc3..d7c1c631 100755 --- a/hw/scripts/scope.py +++ b/hw/scripts/scope.py @@ -125,6 +125,11 @@ def parse_func_args(text): return (args, l) +def load_include_path(dir): + if not dir in include_dirs: + print("*** include path: " + dir) + include_dirs.append(dir) + def resolve_include_path(filename, parent_dir): if os.path.basename(filename) in exclude_files: return None @@ -137,7 +142,7 @@ def resolve_include_path(filename, parent_dir): filepath = os.path.join(dir, filename) if os.path.isfile(filepath): return os.path.abspath(filepath) - raise Exception("couldn't find include file: " + filename) + raise Exception("couldn't find include file: " + filename + " in " + parent_dir) def remove_comments(text): text = re.sub(re.compile("/\*.*?\*/",re.DOTALL ), "", text) # multiline @@ -356,15 +361,11 @@ def parse_includes(includes): for include in includes: parse_include(include, 0) + load_include_path(os.path.dirname(include)) # restore current directory os.chdir(old_dir) -def load_include_dirs(dirs): - for dir in dirs: - #print("*** include dir: " + dir) - include_dirs.append(dir) - def load_defines(defines): for define in defines: key_value = define.split('=', 2) @@ -801,7 +802,8 @@ def main(): global br_stack if args.I: - load_include_dirs(args.I) + for dir in args.I: + load_include_path(dir) if args.D: load_defines(args.D)