Skip to content

Commit

Permalink
Add more default net types
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
caryr authored and steveicarus committed Jun 7, 2009
1 parent 6297422 commit 364cf99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion elab_net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ NetNet* PEIdent::make_implicit_net_(Design*des, NetScope*scope) const
assert(nettype != NetNet::NONE);

NetNet*sig = new NetNet(scope, peek_tail_name(path_),
NetNet::IMPLICIT, 1);
nettype, 1);
sig->set_line(*this);
/* Implicit nets are always scalar logic. */
sig->data_type(IVL_VT_LOGIC);
Expand Down
23 changes: 22 additions & 1 deletion lexor.lex
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,34 @@ S [afpnumkKMGT]
if (strcmp(yytext,"wire") == 0) {
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) {
net_type = NetNet::NONE;

} else {
cerr << yylloc.text << ":" << yylloc.first_line
<< ": error: Net type " << yytext
<< " is not a valid (and supported)"
<< " is not a valid (or supported)"
<< " default net type." << endl;
net_type = NetNet::WIRE;
error_count += 1;
Expand Down

0 comments on commit 364cf99

Please sign in to comment.