From 56f457d65eeca73ec4f87a080d2065a07c294e1b Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 28 Jan 2024 14:33:17 +0000 Subject: [PATCH] Allow force assignments on unresolved wire array words. A force doesn't require resolution. We already allow this for individual unresolved wires. --- PExpr.h | 4 ++-- elab_lval.cc | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PExpr.h b/PExpr.h index 0f19820db..cf37d768d 100644 --- a/PExpr.h +++ b/PExpr.h @@ -1,7 +1,7 @@ #ifndef IVL_PExpr_H #define IVL_PExpr_H /* - * Copyright (c) 1998-2021 Stephen Williams + * Copyright (c) 1998-2024 Stephen Williams * Copyright CERN 2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -428,7 +428,7 @@ class PEIdent : public PExpr { NetNet *reg, ivl_type_t data_type, pform_name_t tail_path) const; NetAssign_*elaborate_lval_net_word_(Design*, NetScope*, NetNet*, - bool need_const_idx) const; + bool need_const_idx, bool is_force) const; bool elaborate_lval_net_bit_(Design*, NetScope*, NetAssign_*, bool need_const_idx) const; bool elaborate_lval_net_part_(Design*, NetScope*, NetAssign_*) const; diff --git a/elab_lval.cc b/elab_lval.cc index 6b2927602..c688a9af9 100644 --- a/elab_lval.cc +++ b/elab_lval.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2023 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2024 Stephen Williams (steve@icarus.com) * Copyright CERN 2012-2013 / Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it @@ -306,7 +306,7 @@ NetAssign_*PEIdent::elaborate_lval_var_(Design *des, NetScope *scope, bool need_const_idx = is_cassign || is_force || (reg->type()==NetNet::UNRESOLVED_WIRE); if (reg->unpacked_dimensions() > 0) - return elaborate_lval_net_word_(des, scope, reg, need_const_idx); + return elaborate_lval_net_word_(des, scope, reg, need_const_idx, is_force); // This must be after the array word elaboration above! if (reg->get_scalar() && @@ -366,7 +366,8 @@ NetAssign_*PEIdent::elaborate_lval_var_(Design *des, NetScope *scope, NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des, NetScope*scope, NetNet*reg, - bool need_const_idx) const + bool need_const_idx, + bool is_force) const { const name_component_t&name_tail = path_.back(); ivl_assert(*this, !name_tail.index.empty()); @@ -448,7 +449,7 @@ NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des, << "canon_index=" << *canon_index << endl; } - if (reg->type()==NetNet::UNRESOLVED_WIRE) { + if ((reg->type()==NetNet::UNRESOLVED_WIRE) && !is_force) { cerr << get_fileline() << ": error: " << "Unable to assign words of unresolved wire array." << endl; des->errors += 1;