Skip to content

Commit

Permalink
Task/functions can have signed ports.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Jun 13, 2003
1 parent 83dfce0 commit dc90f0d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
29 changes: 21 additions & 8 deletions parse.y
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if HAVE_CVS_IDENT
#ident "$Id: parse.y,v 1.177 2003/04/28 17:50:57 steve Exp $"
#ident "$Id: parse.y,v 1.178 2003/06/13 00:27:09 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -992,20 +992,30 @@ expr_primary
function_item
: K_input range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, $2, $3,
= pform_make_task_ports(NetNet::PINPUT, false,
$2, $3,
@1.text, @1.first_line);
$$ = tmp;
}
| K_input K_signed range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, true,
$3, $4,
@1.text, @1.first_line);
$$ = tmp;
}
| K_output range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, $2, $3,
= pform_make_task_ports(NetNet::PINPUT, false,
$2, $3,
@1.text, @1.first_line);
$$ = tmp;
yyerror(@1, "Functions may not have output ports.");
}
| K_inout range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, $2, $3,
= pform_make_task_ports(NetNet::PINPUT, false,
$2, $3,
@1.text, @1.first_line);
$$ = tmp;
yyerror(@1, "Functions may not have inout ports.");
Expand Down Expand Up @@ -2717,19 +2727,22 @@ task_item
{ $$ = new svector<PWire*>(0); }
| K_input range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, $2,
$3, @1.text, @1.first_line);
= pform_make_task_ports(NetNet::PINPUT, false,
$2, $3,
@1.text, @1.first_line);
$$ = tmp;
}
| K_output range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::POUTPUT, $2, $3,
= pform_make_task_ports(NetNet::POUTPUT, false,
$2, $3,
@1.text, @1.first_line);
$$ = tmp;
}
| K_inout range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINOUT, $2, $3,
= pform_make_task_ports(NetNet::PINOUT, false,
$2, $3,
@1.text, @1.first_line);
$$ = tmp;
}
Expand Down
8 changes: 7 additions & 1 deletion pform.cc
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: pform.cc,v 1.113 2003/04/28 17:50:57 steve Exp $"
#ident "$Id: pform.cc,v 1.114 2003/06/13 00:27:09 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -1121,6 +1121,7 @@ void pform_set_port_type(const char*nm, NetNet::PortType pt,
* no output or inout ports.
*/
svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
bool signed_flag,
svector<PExpr*>*range,
list<char*>*names,
const char* file,
Expand All @@ -1146,6 +1147,8 @@ svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
pform_cur_module->add_wire(curw);
}

curw->set_signed(signed_flag);

/* If there is a range involved, it needs to be set. */
if (range)
curw->set_range((*range)[0], (*range)[1]);
Expand Down Expand Up @@ -1466,6 +1469,9 @@ int pform_parse(const char*path, FILE*file)

/*
* $Log: pform.cc,v $
* Revision 1.114 2003/06/13 00:27:09 steve
* Task/functions can have signed ports.
*
* Revision 1.113 2003/04/28 17:50:57 steve
* More 2001 port declaration support.
*
Expand Down
6 changes: 5 additions & 1 deletion pform.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: pform.h,v 1.70 2003/04/28 17:50:57 steve Exp $"
#ident "$Id: pform.h,v 1.71 2003/06/13 00:27:09 steve Exp $"
#endif

# include "netlist.h"
Expand Down Expand Up @@ -264,6 +264,7 @@ extern void pform_make_pgassign_list(svector<PExpr*>*alist,
/* Given a port type and a list of names, make a list of wires that
can be used as task port information. */
extern svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
bool signed_flag,
svector<PExpr*>*range,
list<char*>*names,
const char* file,
Expand All @@ -280,6 +281,9 @@ extern void pform_dump(ostream&out, Module*mod);

/*
* $Log: pform.h,v $
* Revision 1.71 2003/06/13 00:27:09 steve
* Task/functions can have signed ports.
*
* Revision 1.70 2003/04/28 17:50:57 steve
* More 2001 port declaration support.
*
Expand Down

0 comments on commit dc90f0d

Please sign in to comment.