diff --git a/elab_sig.cc b/elab_sig.cc index 01871f622..c060f9bdc 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2015 Stephen Williams (steve@icarus.com) * Copyright CERN 2012 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -1063,6 +1063,7 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const // put all the packed dimensions there. if (use_lidx==0 && use_ridx==0) { netvector_t*vec = new netvector_t(packed_dimensions, data_type_); + vec->set_signed(get_signed()); packed_dimensions.clear(); ivl_assert(*this, netdarray==0); netdarray = new netdarray_t(vec); diff --git a/netdarray.h b/netdarray.h index e97465b5b..326f07d4c 100644 --- a/netdarray.h +++ b/netdarray.h @@ -1,7 +1,7 @@ #ifndef IVL_netdarray_H #define IVL_netdarray_H /* - * Copyright (c) 2012-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2012-2015 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -33,6 +33,9 @@ class netdarray_t : public netarray_t { // IVL_VT_DARRAY for dynamic arrays? ivl_variable_type_t base_type() const; + // A dynamic array may have a type that is signed. + inline bool get_signed() const { return element_type()->get_signed(); } + // This is the base_type() of the element of the array. We // need this in some cases in order to get the base type of // the element, and not the IVL_VT_DARRAY of the array itself.