Handle integers at task parameters.
This commit is contained in:
parent
a6c6ac2191
commit
287d21f300
9
PWire.cc
9
PWire.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: PWire.cc,v 1.1 1999/06/17 05:34:42 steve Exp $"
|
#ident "$Id: PWire.cc,v 1.2 1999/09/10 05:02:09 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "PWire.h"
|
# include "PWire.h"
|
||||||
|
|
@ -41,6 +41,10 @@ bool PWire::set_wire_type(NetNet::Type t)
|
||||||
case NetNet::IMPLICIT:
|
case NetNet::IMPLICIT:
|
||||||
type_ = t;
|
type_ = t;
|
||||||
return true;
|
return true;
|
||||||
|
case NetNet::IMPLICIT_REG:
|
||||||
|
if (t == NetNet::REG) { type_ = t; return true; }
|
||||||
|
if (t == NetNet::INTEGER) {type_ = t; return true; }
|
||||||
|
return false;
|
||||||
case NetNet::REG:
|
case NetNet::REG:
|
||||||
if (t == NetNet::REG) return true;
|
if (t == NetNet::REG) return true;
|
||||||
if (t == NetNet::INTEGER) {type_ = t; return true; }
|
if (t == NetNet::INTEGER) {type_ = t; return true; }
|
||||||
|
|
@ -96,6 +100,9 @@ void PWire::set_memory_idx(PExpr*ldx, PExpr*rdx)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: PWire.cc,v $
|
* $Log: PWire.cc,v $
|
||||||
|
* Revision 1.2 1999/09/10 05:02:09 steve
|
||||||
|
* Handle integers at task parameters.
|
||||||
|
*
|
||||||
* Revision 1.1 1999/06/17 05:34:42 steve
|
* Revision 1.1 1999/06/17 05:34:42 steve
|
||||||
* Clean up interface of the PWire class,
|
* Clean up interface of the PWire class,
|
||||||
* Properly match wire ranges.
|
* Properly match wire ranges.
|
||||||
|
|
|
||||||
39
parse.y
39
parse.y
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: parse.y,v 1.62 1999/09/02 01:59:27 steve Exp $"
|
#ident "$Id: parse.y,v 1.63 1999/09/10 05:02:09 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "parse_misc.h"
|
# include "parse_misc.h"
|
||||||
|
|
@ -165,8 +165,17 @@ source_file
|
||||||
;
|
;
|
||||||
|
|
||||||
block_item_decl
|
block_item_decl
|
||||||
: K_reg range_opt register_variable_list ';'
|
: K_reg range register_variable_list ';'
|
||||||
|
{ pform_set_net_range($3, $2);
|
||||||
|
delete $2;
|
||||||
|
delete $3;
|
||||||
|
}
|
||||||
|
| K_reg register_variable_list ';'
|
||||||
|
{ delete $2; }
|
||||||
| K_integer list_of_variables ';'
|
| K_integer list_of_variables ';'
|
||||||
|
{ pform_set_reg_integer($2);
|
||||||
|
delete $2;
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
block_item_decls
|
block_item_decls
|
||||||
|
|
@ -675,7 +684,8 @@ func_body
|
||||||
function_item
|
function_item
|
||||||
: K_input range_opt list_of_variables ';'
|
: K_input range_opt list_of_variables ';'
|
||||||
{ svector<PWire*>*tmp
|
{ svector<PWire*>*tmp
|
||||||
= pform_make_task_ports(NetNet::PINPUT, $2, $3);
|
= pform_make_task_ports(NetNet::PINPUT, $2, $3,
|
||||||
|
@1.text, @1.first_line);
|
||||||
delete $2;
|
delete $2;
|
||||||
delete $3;
|
delete $3;
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
|
|
@ -991,17 +1001,7 @@ module_item
|
||||||
}
|
}
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
| K_reg range register_variable_list ';'
|
| block_item_decl
|
||||||
{ pform_set_net_range($3, $2);
|
|
||||||
delete $2;
|
|
||||||
delete $3;
|
|
||||||
}
|
|
||||||
| K_reg register_variable_list ';'
|
|
||||||
{ delete $2; }
|
|
||||||
| K_integer register_variable_list ';'
|
|
||||||
{ pform_set_reg_integer($2);
|
|
||||||
delete $2;
|
|
||||||
}
|
|
||||||
| K_defparam defparam_assign_list ';'
|
| K_defparam defparam_assign_list ';'
|
||||||
| K_event list_of_variables ';'
|
| K_event list_of_variables ';'
|
||||||
{ yyerror(@1, "Sorry, named events not supported.");
|
{ yyerror(@1, "Sorry, named events not supported.");
|
||||||
|
|
@ -1678,24 +1678,27 @@ task_body
|
||||||
|
|
||||||
task_item
|
task_item
|
||||||
: block_item_decl
|
: block_item_decl
|
||||||
{ $$ = 0; }
|
{ $$ = new svector<PWire*>(0); }
|
||||||
| K_input range_opt list_of_variables ';'
|
| K_input range_opt list_of_variables ';'
|
||||||
{ svector<PWire*>*tmp
|
{ svector<PWire*>*tmp
|
||||||
= pform_make_task_ports(NetNet::PINPUT, $2, $3);
|
= pform_make_task_ports(NetNet::PINPUT, $2,
|
||||||
|
$3, @1.text, @1.first_line);
|
||||||
delete $2;
|
delete $2;
|
||||||
delete $3;
|
delete $3;
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
}
|
}
|
||||||
| K_output range_opt list_of_variables ';'
|
| K_output range_opt list_of_variables ';'
|
||||||
{ svector<PWire*>*tmp
|
{ svector<PWire*>*tmp
|
||||||
= pform_make_task_ports(NetNet::POUTPUT, $2, $3);
|
= pform_make_task_ports(NetNet::POUTPUT, $2, $3,
|
||||||
|
@1.text, @1.first_line);
|
||||||
delete $2;
|
delete $2;
|
||||||
delete $3;
|
delete $3;
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
}
|
}
|
||||||
| K_inout range_opt list_of_variables ';'
|
| K_inout range_opt list_of_variables ';'
|
||||||
{ svector<PWire*>*tmp
|
{ svector<PWire*>*tmp
|
||||||
= pform_make_task_ports(NetNet::PINOUT, $2, $3);
|
= pform_make_task_ports(NetNet::PINOUT, $2, $3,
|
||||||
|
@1.text, @1.first_line);
|
||||||
delete $2;
|
delete $2;
|
||||||
delete $3;
|
delete $3;
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
|
|
|
||||||
15
pform.cc
15
pform.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: pform.cc,v 1.41 1999/08/31 22:38:29 steve Exp $"
|
#ident "$Id: pform.cc,v 1.42 1999/09/10 05:02:09 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "compiler.h"
|
# include "compiler.h"
|
||||||
|
|
@ -483,8 +483,11 @@ void pform_set_port_type(const string&name, NetNet::PortType pt)
|
||||||
*/
|
*/
|
||||||
svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
||||||
const svector<PExpr*>*range,
|
const svector<PExpr*>*range,
|
||||||
const list<string>*names)
|
const list<string>*names,
|
||||||
|
const string& file,
|
||||||
|
unsigned lineno)
|
||||||
{
|
{
|
||||||
|
assert(names);
|
||||||
svector<PWire*>*res = new svector<PWire*>(0);
|
svector<PWire*>*res = new svector<PWire*>(0);
|
||||||
for (list<string>::const_iterator cur = names->begin()
|
for (list<string>::const_iterator cur = names->begin()
|
||||||
; cur != names->end() ; cur ++ ) {
|
; cur != names->end() ; cur ++ ) {
|
||||||
|
|
@ -498,6 +501,8 @@ svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
||||||
curw->set_port_type(pt);
|
curw->set_port_type(pt);
|
||||||
} else {
|
} else {
|
||||||
curw = new PWire(name, NetNet::IMPLICIT_REG, pt);
|
curw = new PWire(name, NetNet::IMPLICIT_REG, pt);
|
||||||
|
curw->set_file(file);
|
||||||
|
curw->set_lineno(lineno);
|
||||||
pform_cur_module->add_wire(curw);
|
pform_cur_module->add_wire(curw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -616,8 +621,9 @@ void pform_set_port_type(list<string>*names, NetNet::PortType pt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pform_set_reg_integer(const string&name)
|
static void pform_set_reg_integer(const string&nm)
|
||||||
{
|
{
|
||||||
|
string name = scoped_name(nm);
|
||||||
PWire*cur = pform_cur_module->get_wire(name);
|
PWire*cur = pform_cur_module->get_wire(name);
|
||||||
assert(cur);
|
assert(cur);
|
||||||
bool rc = cur->set_wire_type(NetNet::INTEGER);
|
bool rc = cur->set_wire_type(NetNet::INTEGER);
|
||||||
|
|
@ -687,6 +693,9 @@ int pform_parse(const char*path, map<string,Module*>&modules,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.cc,v $
|
* $Log: pform.cc,v $
|
||||||
|
* Revision 1.42 1999/09/10 05:02:09 steve
|
||||||
|
* Handle integers at task parameters.
|
||||||
|
*
|
||||||
* Revision 1.41 1999/08/31 22:38:29 steve
|
* Revision 1.41 1999/08/31 22:38:29 steve
|
||||||
* Elaborate and emit to vvm procedural functions.
|
* Elaborate and emit to vvm procedural functions.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
9
pform.h
9
pform.h
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: pform.h,v 1.30 1999/08/27 15:08:37 steve Exp $"
|
#ident "$Id: pform.h,v 1.31 1999/09/10 05:02:09 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "netlist.h"
|
# include "netlist.h"
|
||||||
|
|
@ -157,7 +157,9 @@ extern void pform_make_pgassign_list(svector<PExpr*>*alist,
|
||||||
can be used as task port information. */
|
can be used as task port information. */
|
||||||
extern svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
extern svector<PWire*>*pform_make_task_ports(NetNet::PortType pt,
|
||||||
const svector<PExpr*>*range,
|
const svector<PExpr*>*range,
|
||||||
const list<string>*names);
|
const list<string>*names,
|
||||||
|
const string& file,
|
||||||
|
unsigned lineno);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -172,6 +174,9 @@ extern void pform_dump(ostream&out, Module*mod);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.h,v $
|
* $Log: pform.h,v $
|
||||||
|
* Revision 1.31 1999/09/10 05:02:09 steve
|
||||||
|
* Handle integers at task parameters.
|
||||||
|
*
|
||||||
* Revision 1.30 1999/08/27 15:08:37 steve
|
* Revision 1.30 1999/08/27 15:08:37 steve
|
||||||
* continuous assignment lists.
|
* continuous assignment lists.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue