Enforce rules for non-4-state wires (issue #1087)
When using the Icarus extension for wire types, only logic (4-state) wires may have multiple drivers (as documented in extensions.rst). Other types of wire should be treated as unresolved wires. When the Icarus extension is disabled, only 4-state wires are allowed (IEEE 1800-2017 section 6.7.1).
This commit is contained in:
parent
18720fe060
commit
82516c28e2
13
elab_sig.cc
13
elab_sig.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 / Stephen Williams (steve@icarus.com)
|
* Copyright CERN 2012 / Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
|
|
@ -98,6 +98,17 @@ static void sig_check_data_type(Design*des, NetScope*scope,
|
||||||
if (!type)
|
if (!type)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ((sig->type() == NetNet::WIRE) && (sig->data_type() != IVL_VT_LOGIC)) {
|
||||||
|
if (gn_cadence_types_flag) {
|
||||||
|
sig->type(NetNet::UNRESOLVED_WIRE);
|
||||||
|
} else {
|
||||||
|
cerr << wire->get_fileline() << ": error: Net `"
|
||||||
|
<< wire->basename() << "` can not be of type `"
|
||||||
|
<< sig->data_type() << "`." << endl;
|
||||||
|
des->errors++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (type->packed()) {
|
if (type->packed()) {
|
||||||
switch (type->base_type()) {
|
switch (type->base_type()) {
|
||||||
case IVL_VT_LOGIC: // 4-state packed is allowed by the standard
|
case IVL_VT_LOGIC: // 4-state packed is allowed by the standard
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue