Parse disable statements to pform.

This commit is contained in:
steve 2000-07-26 05:08:07 +00:00
parent 880b712140
commit 739365abe5
5 changed files with 68 additions and 9 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: Statement.cc,v 1.21 2000/05/11 23:37:26 steve Exp $"
#ident "$Id: Statement.cc,v 1.22 2000/07/26 05:08:07 steve Exp $"
#endif
# include "Statement.h"
@ -165,6 +165,14 @@ PDelayStatement::~PDelayStatement()
{
}
PDisable::PDisable(const string&sc)
: scope_(sc)
{
}
PDisable::~PDisable()
{
}
PEventStatement::PEventStatement(const svector<PEEvent*>&ee)
: expr_(ee), statement_(0)
@ -252,6 +260,9 @@ PWhile::~PWhile()
/*
* $Log: Statement.cc,v $
* Revision 1.22 2000/07/26 05:08:07 steve
* Parse disable statements to pform.
*
* Revision 1.21 2000/05/11 23:37:26 steve
* Add support for procedural continuous assignment.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: Statement.h,v 1.26 2000/05/11 23:37:26 steve Exp $"
#ident "$Id: Statement.h,v 1.27 2000/07/26 05:08:07 steve Exp $"
#endif
# include <string>
@ -286,6 +286,23 @@ class PDelayStatement : public Statement {
Statement*statement_;
};
/*
* This represends the parsing of a disable <scope> statement.
*/
class PDisable : public Statement {
public:
explicit PDisable(const string&sc);
~PDisable();
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
private:
string scope_;
};
/*
* The event statement represents the event delay in behavioral
* code. It comes from such things as:
@ -437,6 +454,9 @@ class PWhile : public Statement {
/*
* $Log: Statement.h,v $
* Revision 1.27 2000/07/26 05:08:07 steve
* Parse disable statements to pform.
*
* Revision 1.26 2000/05/11 23:37:26 steve
* Add support for procedural continuous assignment.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elaborate.cc,v 1.179 2000/07/22 22:09:03 steve Exp $"
#ident "$Id: elaborate.cc,v 1.180 2000/07/26 05:08:07 steve Exp $"
#endif
/*
@ -698,9 +698,10 @@ NetNet* PEConcat::elaborate_lnet(Design*des, const string&path) const
NetProc* Statement::elaborate(Design*des, const string&path) const
{
cerr << "internal error: elaborate: What kind of statement? " <<
cerr << get_line() << ": internal error: elaborate: What kind of statement? " <<
typeid(*this).name() << endl;
NetProc*cur = new NetProc;
des->errors += 1;
return cur;
}
@ -1629,6 +1630,17 @@ NetProc* PDelayStatement::elaborate(Design*des, const string&path) const
}
}
/*
* The disable statement is not yet supported.
*/
NetProc* PDisable::elaborate(Design*des, const string&path) const
{
cerr << get_line() << ": sorry: disable not supported " << endl;
NetProc*cur = new NetProc;
des->errors += 1;
return cur;
}
/*
* An event statement is an event delay of some sort, attached to a
* statement. Some Verilog examples are:
@ -2477,6 +2489,9 @@ Design* elaborate(const map<string,Module*>&modules,
/*
* $Log: elaborate.cc,v $
* Revision 1.180 2000/07/26 05:08:07 steve
* Parse disable statements to pform.
*
* Revision 1.179 2000/07/22 22:09:03 steve
* Parse and elaborate timescale to scopes.
*

12
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: parse.y,v 1.102 2000/07/07 04:53:54 steve Exp $"
#ident "$Id: parse.y,v 1.103 2000/07/26 05:08:07 steve Exp $"
#endif
# include "parse_misc.h"
@ -1901,18 +1901,22 @@ statement
{ PBlock*tmp = new PBlock(PBlock::BL_PAR);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
delete $3;
$$ = tmp;
}
| K_disable IDENTIFIER ';'
{ yyerror(@1, "sorry: disable statements not supported.");
| K_disable identifier ';'
{ PDisable*tmp = new PDisable($2);
tmp->set_file(@1.text);
tmp->set_lineno(@1.first_line);
delete $2;
$$ = 0;
$$ = tmp;
}
| K_TRIGGER IDENTIFIER ';'
{ PTrigger*tmp = new PTrigger($2);
tmp->set_file(@2.text);
tmp->set_lineno(@2.first_line);
delete $2;
$$ = tmp;
}
| K_forever statement

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: pform_dump.cc,v 1.60 2000/05/23 16:03:13 steve Exp $"
#ident "$Id: pform_dump.cc,v 1.61 2000/07/26 05:08:07 steve Exp $"
#endif
/*
@ -509,6 +509,12 @@ void PDelayStatement::dump(ostream&out, unsigned ind) const
}
}
void PDisable::dump(ostream&out, unsigned ind) const
{
out << setw(ind) << "" << "disable " << scope_ << "; /* "
<< get_line() << " */" << endl;
}
void PEventStatement::dump(ostream&out, unsigned ind) const
{
out << setw(ind) << "" << "@(" << *(expr_[0]);
@ -774,6 +780,9 @@ void PUdp::dump(ostream&out) const
/*
* $Log: pform_dump.cc,v $
* Revision 1.61 2000/07/26 05:08:07 steve
* Parse disable statements to pform.
*
* Revision 1.60 2000/05/23 16:03:13 steve
* Better parsing of expressions lists will empty expressoins.
*