A dynamic array can have a signed type so pass that correctly

This commit is contained in:
Cary R 2015-03-02 14:39:21 -08:00
parent 8e0ae733ca
commit ea1c07e234
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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.