Parse and elaborate named for/join blocks.

This commit is contained in:
steve 1999-09-22 04:30:04 +00:00
parent 357461b034
commit 12b9071f49
3 changed files with 42 additions and 10 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: elaborate.cc,v 1.94 1999/09/22 02:00:48 steve Exp $"
#ident "$Id: elaborate.cc,v 1.95 1999/09/22 04:30:04 steve Exp $"
#endif
/*
@ -1834,7 +1834,10 @@ NetProc* PAssignNB::elaborate(Design*des, const string&path) const
*/
NetProc* PBlock::elaborate(Design*des, const string&path) const
{
NetBlock*cur = new NetBlock(NetBlock::SEQU);
NetBlock::Type type = (bl_type_==PBlock::BL_PAR)
? NetBlock::PARA
: NetBlock::SEQU;
NetBlock*cur = new NetBlock(type);
bool fail_flag = false;
string npath = name_.length()? (path+"."+name_) : path;
@ -2613,6 +2616,9 @@ Design* elaborate(const map<string,Module*>&modules,
/*
* $Log: elaborate.cc,v $
* Revision 1.95 1999/09/22 04:30:04 steve
* Parse and elaborate named for/join blocks.
*
* Revision 1.94 1999/09/22 02:00:48 steve
* assignment with blocking event delay.
*

32
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: parse.y,v 1.65 1999/09/22 02:00:48 steve Exp $"
#ident "$Id: parse.y,v 1.66 1999/09/22 04:30:04 steve Exp $"
#endif
# include "parse_misc.h"
@ -1453,6 +1453,30 @@ statement
delete $2;
$$ = tmp;
}
| K_fork ':' IDENTIFIER
{ pform_push_scope($3); }
block_item_decls_opt
statement_list K_join
{ pform_pop_scope();
PBlock*tmp = new PBlock($3, PBlock::BL_PAR, *$6);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
delete $3;
delete $6;
$$ = tmp;
}
| K_fork K_join
{ PBlock*tmp = new PBlock(PBlock::BL_PAR);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
$$ = tmp;
}
| K_fork ':' IDENTIFIER K_join
{ PBlock*tmp = new PBlock(PBlock::BL_PAR);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
$$ = tmp;
}
| K_release lavalue ';'
{ yyerror(@1, "Sorry, release not supported.");
$$ = 0;
@ -1463,12 +1487,6 @@ statement
tmp->set_lineno(@1.first_line);
$$ = tmp;
}
| K_fork K_join
{ PBlock*tmp = new PBlock(PBlock::BL_PAR);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
$$ = tmp;
}
| K_case '(' expression ')' case_items K_endcase
{ PCase*tmp = new PCase($3, $5);
tmp->set_file(@1.text);

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: t-vvm.cc,v 1.42 1999/09/16 04:18:15 steve Exp $"
#ident "$Id: t-vvm.cc,v 1.43 1999/09/22 04:30:04 steve Exp $"
#endif
# include <iostream>
@ -1077,6 +1077,11 @@ void target_vvm::proc_assign_nb(ostream&os, const NetAssignNB*net)
void target_vvm::proc_block(ostream&os, const NetBlock*net)
{
if (net->type() == NetBlock::PARA) {
cerr << "internal error: vvm cannot emit parallel blocks."
<< endl;
return;
}
net->emit_recurse(os, this);
}
@ -1442,6 +1447,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.43 1999/09/22 04:30:04 steve
* Parse and elaborate named for/join blocks.
*
* Revision 1.42 1999/09/16 04:18:15 steve
* elaborate concatenation repeats.
*