Add more default net types

Previously Icarus only supported a default net type of wire or none.
This patch adds the rest of the supported net types (all except
uwire and trireg) to the `default_nettype directive. It also fixes
make_implicit_net_() to use the default_nettype instead of always
using implicit (the same as wire).
This commit is contained in:
Cary R 2009-05-26 16:45:22 -07:00 committed by Stephen Williams
parent 6297422427
commit 364cf99a67
2 changed files with 23 additions and 2 deletions

View File

@ -179,7 +179,7 @@ NetNet* PEIdent::make_implicit_net_(Design*des, NetScope*scope) const
assert(nettype != NetNet::NONE); assert(nettype != NetNet::NONE);
NetNet*sig = new NetNet(scope, peek_tail_name(path_), NetNet*sig = new NetNet(scope, peek_tail_name(path_),
NetNet::IMPLICIT, 1); nettype, 1);
sig->set_line(*this); sig->set_line(*this);
/* Implicit nets are always scalar logic. */ /* Implicit nets are always scalar logic. */
sig->data_type(IVL_VT_LOGIC); sig->data_type(IVL_VT_LOGIC);

View File

@ -485,13 +485,34 @@ S [afpnumkKMGT]
if (strcmp(yytext,"wire") == 0) { if (strcmp(yytext,"wire") == 0) {
net_type = NetNet::WIRE; net_type = NetNet::WIRE;
} else if (strcmp(yytext,"tri") == 0) {
net_type = NetNet::TRI;
} else if (strcmp(yytext,"tri0") == 0) {
net_type = NetNet::TRI0;
} else if (strcmp(yytext,"tri1") == 0) {
net_type = NetNet::TRI1;
} else if (strcmp(yytext,"wand") == 0) {
net_type = NetNet::WAND;
} else if (strcmp(yytext,"triand") == 0) {
net_type = NetNet::TRIAND;
} else if (strcmp(yytext,"wor") == 0) {
net_type = NetNet::WOR;
} else if (strcmp(yytext,"trior") == 0) {
net_type = NetNet::TRIOR;
} else if (strcmp(yytext,"none") == 0) { } else if (strcmp(yytext,"none") == 0) {
net_type = NetNet::NONE; net_type = NetNet::NONE;
} else { } else {
cerr << yylloc.text << ":" << yylloc.first_line cerr << yylloc.text << ":" << yylloc.first_line
<< ": error: Net type " << yytext << ": error: Net type " << yytext
<< " is not a valid (and supported)" << " is not a valid (or supported)"
<< " default net type." << endl; << " default net type." << endl;
net_type = NetNet::WIRE; net_type = NetNet::WIRE;
error_count += 1; error_count += 1;