Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build and install Synopsys packages

  • Loading branch information...
commit 6b949c51b7b3e700361b18c1a08a7e3efa6ae15e 1 parent 6e42091
Nick Gasson authored
3  configure.ac
View
@@ -73,5 +73,6 @@ esac
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT([Makefile src/Makefile src/rt/Makefile test/Makefile \
- lib/Makefile lib/std/Makefile lib/ieee/Makefile])
+ lib/Makefile lib/std/Makefile lib/ieee/Makefile \
+ lib/synopsys/Makefile])
3  lib/Makefile.am
View
@@ -1,7 +1,8 @@
-SUBDIRS = std ieee
+SUBDIRS = std ieee synopsys
bootstrap:
@cd std && $(MAKE) $(AM_MAKEFLAGS) bootstrap
@cd ieee && $(MAKE) $(AM_MAKEFLAGS) bootstrap
+ @cd synopsys && $(MAKE) $(AM_MAKEFLAGS) bootstrap
.PHONY: bootstrap
21 lib/synopsys/Makefile.am
View
@@ -0,0 +1,21 @@
+nvc = $(top_builddir)/src/nvc
+
+# The Synopsys packages are not part of the IEEE standard but are
+# traditionally compiled into the IEEE library
+synopsysdir = $(pkgdatadir)/ieee
+ieee = ../ieee/ieee
+synopsys_DATA = $(ieee)/IEEE.STD_LOGIC_ARITH $(ieee)/IEEE.STD_LOGIC_ARITH-body \
+ $(ieee)/IEEE.STD_LOGIC_SIGNED $(ieee)/IEEE.STD_LOGIC_UNSIGNED
+
+lib = NVC_LIBPATH=../std
+
+bootstrap: $(synopsys_DATA)
+
+$(ieee)/IEEE.STD_LOGIC_ARITH: $(srcdir)/std_logic_arith.vhd
+ $(lib) $(nvc) --work=$(ieee) -a $<
+
+$(ieee)/IEEE.STD_LOGIC_UNSIGNED: $(srcdir)/std_logic_unsigned.vhd
+ $(lib) $(nvc) --work=$(ieee) -a $<
+
+$(ieee)/IEEE.STD_LOGIC_SIGNED: $(srcdir)/std_logic_signed.vhd
+ $(lib) $(nvc) --work=$(ieee) -a $<
2  src/cgen.c
View
@@ -1093,7 +1093,7 @@ static LLVMValueRef cgen_ref(tree_t t, struct cgen_ctx *ctx)
case T_VAR_DECL:
{
LLVMValueRef ptr = cgen_get_var(decl, ctx);
- if (type_kind(tree_type(decl)) == T_CARRAY)
+ if (type_is_array(tree_type(decl)))
return ptr;
else
return LLVMBuildLoad(builder, ptr, "");
13 src/lib.c
View
@@ -181,7 +181,16 @@ lib_t lib_find(const char *name, bool verbose, bool search)
const char *paths[MAX_SEARCH_PATHS];
size_t idx = 0;
- push_path(paths, &idx, ".");
+ char *name_copy = strdup(name);
+ char *sep = strrchr(name_copy, '/');
+ if (sep == NULL)
+ push_path(paths, &idx, ".");
+ else {
+ // Work library contains path
+ *sep = '\0';
+ push_path(paths, &idx, name_copy);
+ name = sep + 1;
+ }
char *env_copy = NULL;
if (search) {
@@ -201,6 +210,7 @@ lib_t lib_find(const char *name, bool verbose, bool search)
lib_t lib;
for (const char **p = paths; *p != NULL; p++) {
if ((lib = lib_find_at(name, *p))) {
+ free(name_copy);
free(env_copy);
return lib;
}
@@ -213,6 +223,7 @@ lib_t lib_find(const char *name, bool verbose, bool search)
}
}
+ free(name_copy);
free(env_copy);
return NULL;
}
Please sign in to comment.
Something went wrong with that request. Please try again.