Parse edge sensitive paths without edge specifier.

This commit is contained in:
steve 2007-04-13 02:34:35 +00:00
parent 2229825783
commit f621448ced
5 changed files with 38 additions and 24 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PSpec.h,v 1.2 2007/02/12 01:52:21 steve Exp $"
#ident "$Id: PSpec.h,v 1.3 2007/04/13 02:34:35 steve Exp $"
#endif
# include "LineInfo.h"
@ -47,8 +47,8 @@ class PExpr;
* is the condition expression. If the condition expression is nil,
* then this is an ifnone conditional path.
*
* If edge != 0, then the path is edge sensitive and the optional
* data_source_expression may be present.
* If data_source_expression != nil, then the path is edge sensitive
* and the edge might not be 0.
*/
class PSpecPath : public LineInfo {

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elaborate.cc,v 1.367 2007/04/05 03:09:50 steve Exp $"
#ident "$Id: elaborate.cc,v 1.368 2007/04/13 02:34:35 steve Exp $"
#endif
# include "config.h"
@ -3007,7 +3007,6 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
}
ivl_assert(*this, conditional || (condition==0));
ivl_assert(*this, data_source_expression==0 || edge != 0);
ndelays = delays.size();
if (ndelays > 12)
@ -3099,8 +3098,13 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
src.size(), condit_sig);
path->set_line(*this);
if (edge > 0) path->set_posedge();
if (edge < 0) path->set_negedge();
// The presence of the data_source_expression indicates
// that this is an edge sensitive path. If so, then set
// the edges. Note that edge==0 is BOTH edges.
if (data_source_expression) {
if (edge >= 0) path->set_posedge();
if (edge <= 0) path->set_negedge();
}
switch (ndelays) {
case 12:
@ -3409,6 +3413,9 @@ Design* elaborate(list<perm_string>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.368 2007/04/13 02:34:35 steve
* Parse edge sensitive paths without edge specifier.
*
* Revision 1.367 2007/04/05 03:09:50 steve
* Allow implicit wires in assign l-value.
*

22
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: parse.y,v 1.233 2007/04/01 23:02:03 steve Exp $"
#ident "$Id: parse.y,v 1.234 2007/04/13 02:34:35 steve Exp $"
#endif
# include "config.h"
@ -2626,18 +2626,22 @@ specify_edge_path_decl
edge_operator : K_posedge { $$ = true; } | K_negedge { $$ = false; } ;
specify_edge_path
: '(' edge_operator specify_path_identifiers spec_polarity
K_EG specify_path_identifiers ')'
{ $$ = pform_make_specify_edge_path(@1, $2, $3, $4, false, $6, 0); }
: '(' specify_path_identifiers spec_polarity
K_EG '(' specify_path_identifiers polarity_operator expression ')' ')'
{ int edge_flag = 0;
$$ = pform_make_specify_edge_path(@1, edge_flag, $2, $3, false, $6, $8); }
| '(' edge_operator specify_path_identifiers spec_polarity
K_EG '(' specify_path_identifiers polarity_operator expression ')' ')'
{ $$ = pform_make_specify_edge_path(@1, $2, $3, $4, false, $7, $9);}
| '(' edge_operator specify_path_identifiers spec_polarity
K_SG specify_path_identifiers ')'
{ $$ = pform_make_specify_edge_path(@1, $2, $3, $4, true, $6, 0); }
{ int edge_flag = $2? 1 : -1;
$$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, false, $7, $9);}
| '(' specify_path_identifiers spec_polarity
K_SG '(' specify_path_identifiers polarity_operator expression ')' ')'
{ int edge_flag = 0;
$$ = pform_make_specify_edge_path(@1, edge_flag, $2, $3, true, $6, $8); }
| '(' edge_operator specify_path_identifiers spec_polarity
K_SG '(' specify_path_identifiers polarity_operator expression ')' ')'
{ $$ = pform_make_specify_edge_path(@1, $2, $3, $4, true, $7, $9); }
{ int edge_flag = $2? 1 : -1;
$$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, true, $7, $9); }
;
polarity_operator

View File

@ -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.142 2007/03/07 04:24:59 steve Exp $"
#ident "$Id: pform.cc,v 1.143 2007/04/13 02:34:35 steve Exp $"
#endif
# include "config.h"
@ -1563,16 +1563,13 @@ extern PSpecPath* pform_make_specify_path(const struct vlltype&li,
}
extern PSpecPath*pform_make_specify_edge_path(const struct vlltype&li,
bool edge_flag, /*posedge==true */
int edge_flag, /*posedge==true */
list<perm_string>*src, char pol,
bool full_flag, list<perm_string>*dst,
PExpr*data_source_expression)
{
PSpecPath*tmp = pform_make_specify_path(li, src, pol, full_flag, dst);
if (edge_flag)
tmp->edge = 1;
else
tmp->edge = -1;
tmp->edge = edge_flag;
tmp->data_source_expression = data_source_expression;
return tmp;
}
@ -1768,6 +1765,9 @@ int pform_parse(const char*path, FILE*file)
/*
* $Log: pform.cc,v $
* Revision 1.143 2007/04/13 02:34:35 steve
* Parse edge sensitive paths without edge specifier.
*
* Revision 1.142 2007/03/07 04:24:59 steve
* Make integer width controllable.
*

View File

@ -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.88 2007/02/12 01:52:21 steve Exp $"
#ident "$Id: pform.h,v 1.89 2007/04/13 02:34:35 steve Exp $"
#endif
# include "netlist.h"
@ -266,7 +266,7 @@ extern PSpecPath*pform_make_specify_path(const struct vlltype&li,
list<perm_string>*src, char pol,
bool full_flag, list<perm_string>*dst);
extern PSpecPath*pform_make_specify_edge_path(const struct vlltype&li,
bool edge_flag, /*posedge==true */
int edge_flag, /*posedge==true */
list<perm_string>*src, char pol,
bool full_flag, list<perm_string>*dst,
PExpr*data_source_expression);
@ -334,6 +334,9 @@ extern void pform_dump(ostream&out, Module*mod);
/*
* $Log: pform.h,v $
* Revision 1.89 2007/04/13 02:34:35 steve
* Parse edge sensitive paths without edge specifier.
*
* Revision 1.88 2007/02/12 01:52:21 steve
* Parse all specify paths to pform.
*