User task and function arguments can take an optional reg.

User task and function arguments can take an optional reg
property. This property is completely ignored by Icarus.
This commit is contained in:
Cary R 2008-08-08 17:22:54 -07:00 committed by Stephen Williams
parent f835c7569e
commit c918cf4a46
1 changed files with 30 additions and 24 deletions

54
parse.y
View File

@ -3734,29 +3734,34 @@ task_item
| task_port_item { $$ = $1; } | task_port_item { $$ = $1; }
; ;
reg_opt
: K_reg
|
;
task_port_item task_port_item
: K_input signed_opt range_opt list_of_identifiers ';' : K_input reg_opt signed_opt range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp { svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, = pform_make_task_ports(NetNet::PINPUT,
IVL_VT_NO_TYPE, $2, IVL_VT_NO_TYPE, $3,
$3, $4, $4, $5,
@1.text, @1.first_line); @1.text, @1.first_line);
$$ = tmp; $$ = tmp;
} }
| K_output signed_opt range_opt list_of_identifiers ';' | K_output reg_opt signed_opt range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp { svector<PWire*>*tmp
= pform_make_task_ports(NetNet::POUTPUT, = pform_make_task_ports(NetNet::POUTPUT,
IVL_VT_LOGIC, $2, IVL_VT_LOGIC, $3,
$3, $4, $4, $5,
@1.text, @1.first_line); @1.text, @1.first_line);
$$ = tmp; $$ = tmp;
} }
| K_inout signed_opt range_opt list_of_identifiers ';' | K_inout reg_opt signed_opt range_opt list_of_identifiers ';'
{ svector<PWire*>*tmp { svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINOUT, = pform_make_task_ports(NetNet::PINOUT,
IVL_VT_LOGIC, $2, IVL_VT_LOGIC, $3,
$3, $4, $4, $5,
@1.text, @1.first_line); @1.text, @1.first_line);
$$ = tmp; $$ = tmp;
} }
@ -3861,47 +3866,48 @@ task_item_list_opt
task_port_decl task_port_decl
: K_input signed_opt range_opt IDENTIFIER : K_input reg_opt signed_opt range_opt IDENTIFIER
{ port_declaration_context.port_type = NetNet::PINPUT; { port_declaration_context.port_type = NetNet::PINPUT;
port_declaration_context.var_type = IVL_VT_LOGIC; port_declaration_context.var_type = IVL_VT_LOGIC;
port_declaration_context.sign_flag = $2; port_declaration_context.sign_flag = $3;
delete port_declaration_context.range; delete port_declaration_context.range;
port_declaration_context.range = copy_range($3); port_declaration_context.range = copy_range($4);
svector<PWire*>*tmp svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINPUT, = pform_make_task_ports(NetNet::PINPUT,
IVL_VT_LOGIC, $2, IVL_VT_LOGIC, $3,
$3, list_from_identifier($4), $4, list_from_identifier($5),
@1.text, @1.first_line); @1.text, @1.first_line);
$$ = tmp; $$ = tmp;
} }
| K_output signed_opt range_opt IDENTIFIER | K_output reg_opt signed_opt range_opt IDENTIFIER
{ port_declaration_context.port_type = NetNet::POUTPUT; { port_declaration_context.port_type = NetNet::POUTPUT;
port_declaration_context.var_type = IVL_VT_LOGIC; port_declaration_context.var_type = IVL_VT_LOGIC;
port_declaration_context.sign_flag = $2; port_declaration_context.sign_flag = $3;
delete port_declaration_context.range; delete port_declaration_context.range;
port_declaration_context.range = copy_range($3); port_declaration_context.range = copy_range($4);
svector<PWire*>*tmp svector<PWire*>*tmp
= pform_make_task_ports(NetNet::POUTPUT, = pform_make_task_ports(NetNet::POUTPUT,
IVL_VT_LOGIC, $2, IVL_VT_LOGIC, $3,
$3, list_from_identifier($4), $4, list_from_identifier($5),
@1.text, @1.first_line); @1.text, @1.first_line);
$$ = tmp; $$ = tmp;
} }
| K_inout signed_opt range_opt IDENTIFIER | K_inout reg_opt signed_opt range_opt IDENTIFIER
{ port_declaration_context.port_type = NetNet::PINOUT; { port_declaration_context.port_type = NetNet::PINOUT;
port_declaration_context.var_type = IVL_VT_LOGIC; port_declaration_context.var_type = IVL_VT_LOGIC;
port_declaration_context.sign_flag = $2; port_declaration_context.sign_flag = $3;
delete port_declaration_context.range; delete port_declaration_context.range;
port_declaration_context.range = copy_range($3); port_declaration_context.range = copy_range($4);
svector<PWire*>*tmp svector<PWire*>*tmp
= pform_make_task_ports(NetNet::PINOUT, = pform_make_task_ports(NetNet::PINOUT,
IVL_VT_LOGIC, $2, IVL_VT_LOGIC, $3,
$3, list_from_identifier($4), $4, list_from_identifier($5),
@1.text, @1.first_line); @1.text, @1.first_line);
$$ = tmp; $$ = tmp;
} }
// Need to add time and realtime!
| K_input K_integer IDENTIFIER | K_input K_integer IDENTIFIER
{ svector<PExpr*>*range_stub { svector<PExpr*>*range_stub
= new svector<PExpr*>(2); = new svector<PExpr*>(2);