1998-11-04 00:28:49 +01:00
|
|
|
#ifndef __Statement_H
|
|
|
|
|
#define __Statement_H
|
|
|
|
|
/*
|
2000-02-23 03:56:53 +01:00
|
|
|
* Copyright (c) 1998-2000 Stephen Williams (steve@icarus.com)
|
1998-11-04 00:28:49 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
|
*/
|
2002-08-12 03:34:58 +02:00
|
|
|
#ifdef HAVE_CVS_IDENT
|
2005-12-05 22:21:18 +01:00
|
|
|
#ident "$Id: Statement.h,v 1.42 2005/12/05 21:21:18 steve Exp $"
|
1998-11-04 00:28:49 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
# include <string>
|
1999-04-29 04:16:26 +02:00
|
|
|
# include "svector.h"
|
2004-02-20 19:53:33 +01:00
|
|
|
# include "StringHeap.h"
|
1999-09-04 21:11:45 +02:00
|
|
|
# include "PDelays.h"
|
1999-04-29 04:16:26 +02:00
|
|
|
# include "PExpr.h"
|
2001-12-03 05:47:14 +01:00
|
|
|
# include "HName.h"
|
1999-01-25 06:45:56 +01:00
|
|
|
# include "LineInfo.h"
|
1998-11-04 00:28:49 +01:00
|
|
|
class PExpr;
|
|
|
|
|
class Statement;
|
1999-09-22 04:00:48 +02:00
|
|
|
class PEventStatement;
|
2000-03-11 04:25:51 +01:00
|
|
|
class Design;
|
2000-09-03 19:58:35 +02:00
|
|
|
class NetAssign_;
|
2000-05-12 01:37:26 +02:00
|
|
|
class NetCAssign;
|
|
|
|
|
class NetDeassign;
|
2004-12-11 03:31:25 +01:00
|
|
|
class NetForce;
|
2000-03-11 04:25:51 +01:00
|
|
|
class NetScope;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The PProcess is the root of a behavioral process. Each process gets
|
|
|
|
|
* one of these, which contains its type (initial or always) and a
|
|
|
|
|
* pointer to the single statement that is the process. A module may
|
|
|
|
|
* have several concurrent processes.
|
|
|
|
|
*/
|
1999-01-25 06:45:56 +01:00
|
|
|
class PProcess : public LineInfo {
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum Type { PR_INITIAL, PR_ALWAYS };
|
|
|
|
|
|
|
|
|
|
PProcess(Type t, Statement*st)
|
|
|
|
|
: type_(t), statement_(st) { }
|
|
|
|
|
|
1999-01-25 06:45:56 +01:00
|
|
|
virtual ~PProcess();
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
Type type() const { return type_; }
|
|
|
|
|
Statement*statement() { return statement_; }
|
|
|
|
|
|
2004-02-20 19:53:33 +01:00
|
|
|
map<perm_string,PExpr*> attributes;
|
2002-05-26 03:39:02 +02:00
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Type type_;
|
|
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The PProcess is a process, the Statement is the actual action. In
|
|
|
|
|
* fact, the Statement class is abstract and represents all the
|
|
|
|
|
* possible kinds of statements that exist in Verilog.
|
|
|
|
|
*/
|
1999-01-25 06:45:56 +01:00
|
|
|
class Statement : public LineInfo {
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Statement() { }
|
|
|
|
|
virtual ~Statement() =0;
|
|
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Assignment statements of the various forms are handled by this
|
|
|
|
|
* type. The rvalue is an expression. The lvalue needs to be figured
|
|
|
|
|
* out by the parser as much as possible.
|
|
|
|
|
*/
|
1999-06-14 01:51:16 +02:00
|
|
|
class PAssign_ : public Statement {
|
1998-11-04 00:28:49 +01:00
|
|
|
public:
|
1999-09-22 04:00:48 +02:00
|
|
|
explicit PAssign_(PExpr*lval, PExpr*ex);
|
1999-07-12 02:59:36 +02:00
|
|
|
explicit PAssign_(PExpr*lval, PExpr*de, PExpr*ex);
|
1999-09-22 04:00:48 +02:00
|
|
|
explicit PAssign_(PExpr*lval, PEventStatement*de, PExpr*ex);
|
1999-06-14 01:51:16 +02:00
|
|
|
virtual ~PAssign_() =0;
|
1999-06-06 22:45:38 +02:00
|
|
|
|
1999-07-12 02:59:36 +02:00
|
|
|
const PExpr* lval() const { return lval_; }
|
|
|
|
|
const PExpr* rval() const { return rval_; }
|
1998-11-04 00:28:49 +01:00
|
|
|
|
1999-06-14 01:51:16 +02:00
|
|
|
protected:
|
2000-09-03 19:58:35 +02:00
|
|
|
NetAssign_* elaborate_lval(Design*, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2002-04-22 00:31:02 +02:00
|
|
|
PExpr* delay_;
|
1999-09-22 04:00:48 +02:00
|
|
|
PEventStatement*event_;
|
1999-09-04 21:11:45 +02:00
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
private:
|
1999-05-10 02:16:57 +02:00
|
|
|
PExpr* lval_;
|
1999-06-14 01:51:16 +02:00
|
|
|
PExpr* rval_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PAssign : public PAssign_ {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PAssign(PExpr*lval, PExpr*ex);
|
1999-07-12 02:59:36 +02:00
|
|
|
explicit PAssign(PExpr*lval, PExpr*de, PExpr*ex);
|
1999-09-22 04:00:48 +02:00
|
|
|
explicit PAssign(PExpr*lval, PEventStatement*de, PExpr*ex);
|
1999-06-14 01:51:16 +02:00
|
|
|
~PAssign();
|
|
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
1999-05-10 02:16:57 +02:00
|
|
|
|
1999-06-14 01:51:16 +02:00
|
|
|
private:
|
1998-11-04 00:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
1999-06-14 01:51:16 +02:00
|
|
|
class PAssignNB : public PAssign_ {
|
1999-06-06 22:45:38 +02:00
|
|
|
|
|
|
|
|
public:
|
1999-06-14 01:51:16 +02:00
|
|
|
explicit PAssignNB(PExpr*lval, PExpr*ex);
|
1999-09-02 03:59:27 +02:00
|
|
|
explicit PAssignNB(PExpr*lval, PExpr*de, PExpr*ex);
|
1999-06-06 22:45:38 +02:00
|
|
|
~PAssignNB();
|
|
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
1999-09-15 03:55:06 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
NetProc*assign_to_memory_(class NetMemory*, PExpr*,
|
2001-11-22 07:20:59 +01:00
|
|
|
Design*des, NetScope*scope) const;
|
1999-06-06 22:45:38 +02:00
|
|
|
};
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/*
|
|
|
|
|
* A block statement is an ordered list of statements that make up the
|
|
|
|
|
* block. The block can be sequential or parallel, which only affects
|
|
|
|
|
* how the block is interpreted. The parser collects the list of
|
|
|
|
|
* statements before constructing this object, so it knows a priori
|
|
|
|
|
* what is contained.
|
|
|
|
|
*/
|
|
|
|
|
class PBlock : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum BL_TYPE { BL_SEQ, BL_PAR };
|
|
|
|
|
|
2004-02-18 18:11:54 +01:00
|
|
|
explicit PBlock(perm_string n, BL_TYPE t, const svector<Statement*>&st);
|
1999-06-24 06:24:18 +02:00
|
|
|
explicit PBlock(BL_TYPE t, const svector<Statement*>&st);
|
|
|
|
|
explicit PBlock(BL_TYPE t);
|
1998-11-04 00:28:49 +01:00
|
|
|
~PBlock();
|
|
|
|
|
|
|
|
|
|
BL_TYPE bl_type() const { return bl_type_; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
private:
|
2004-02-18 18:11:54 +01:00
|
|
|
perm_string name_;
|
1998-11-04 00:28:49 +01:00
|
|
|
const BL_TYPE bl_type_;
|
1999-06-24 06:24:18 +02:00
|
|
|
svector<Statement*>list_;
|
1998-11-04 00:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PCallTask : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2001-12-03 05:47:14 +01:00
|
|
|
explicit PCallTask(const hname_t&n, const svector<PExpr*>&parms);
|
2001-11-22 07:20:59 +01:00
|
|
|
~PCallTask();
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2001-12-03 05:47:14 +01:00
|
|
|
const hname_t& path() const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
1999-05-10 02:16:57 +02:00
|
|
|
unsigned nparms() const { return parms_.count(); }
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
PExpr*&parm(unsigned idx)
|
1999-05-10 02:16:57 +02:00
|
|
|
{ assert(idx < parms_.count());
|
1998-11-04 00:28:49 +01:00
|
|
|
return parms_[idx];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PExpr* parm(unsigned idx) const
|
1999-05-10 02:16:57 +02:00
|
|
|
{ assert(idx < parms_.count());
|
1998-11-04 00:28:49 +01:00
|
|
|
return parms_[idx];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
private:
|
2001-11-22 07:20:59 +01:00
|
|
|
NetProc* elaborate_sys(Design*des, NetScope*scope) const;
|
|
|
|
|
NetProc* elaborate_usr(Design*des, NetScope*scope) const;
|
1999-07-03 04:12:51 +02:00
|
|
|
|
2001-12-03 05:47:14 +01:00
|
|
|
hname_t path_;
|
1999-05-10 02:16:57 +02:00
|
|
|
svector<PExpr*> parms_;
|
1998-11-04 00:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
1999-02-03 05:20:11 +01:00
|
|
|
class PCase : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
struct Item {
|
1999-06-15 07:38:39 +02:00
|
|
|
svector<PExpr*>expr;
|
1999-02-03 05:20:11 +01:00
|
|
|
Statement*stat;
|
|
|
|
|
};
|
|
|
|
|
|
1999-09-29 20:36:02 +02:00
|
|
|
PCase(NetCase::TYPE, PExpr*ex, svector<Item*>*);
|
1999-02-03 05:20:11 +01:00
|
|
|
~PCase();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1999-02-03 05:20:11 +01:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
1999-09-29 20:36:02 +02:00
|
|
|
NetCase::TYPE type_;
|
1999-02-03 05:20:11 +01:00
|
|
|
PExpr*expr_;
|
|
|
|
|
|
1999-06-06 22:45:38 +02:00
|
|
|
svector<Item*>*items_;
|
1999-02-03 05:20:11 +01:00
|
|
|
|
|
|
|
|
private: // not implemented
|
|
|
|
|
PCase(const PCase&);
|
|
|
|
|
PCase& operator= (const PCase&);
|
|
|
|
|
};
|
|
|
|
|
|
2000-05-12 01:37:26 +02:00
|
|
|
class PCAssign : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PCAssign(PExpr*l, PExpr*r);
|
|
|
|
|
~PCAssign();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetCAssign* elaborate(Design*des, NetScope*scope) const;
|
2000-05-12 01:37:26 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*lval_;
|
|
|
|
|
PExpr*expr_;
|
|
|
|
|
};
|
|
|
|
|
|
1998-11-07 18:05:05 +01:00
|
|
|
class PCondit : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2000-04-12 06:23:57 +02:00
|
|
|
PCondit(PExpr*ex, Statement*i, Statement*e);
|
1998-11-07 18:05:05 +01:00
|
|
|
~PCondit();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-07 18:05:05 +01:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*expr_;
|
|
|
|
|
Statement*if_;
|
|
|
|
|
Statement*else_;
|
|
|
|
|
|
|
|
|
|
private: // not implemented
|
|
|
|
|
PCondit(const PCondit&);
|
|
|
|
|
PCondit& operator= (const PCondit&);
|
|
|
|
|
};
|
|
|
|
|
|
2000-05-12 01:37:26 +02:00
|
|
|
class PDeassign : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PDeassign(PExpr*l);
|
|
|
|
|
~PDeassign();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetDeassign* elaborate(Design*des, NetScope*scope) const;
|
2000-05-12 01:37:26 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*lval_;
|
|
|
|
|
};
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
class PDelayStatement : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2000-04-12 06:23:57 +02:00
|
|
|
PDelayStatement(PExpr*d, Statement*st);
|
|
|
|
|
~PDelayStatement();
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*delay_;
|
|
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
2000-07-26 07:08:07 +02:00
|
|
|
|
|
|
|
|
/*
|
2003-01-30 17:23:07 +01:00
|
|
|
* This represents the parsing of a disable <scope> statement.
|
2000-07-26 07:08:07 +02:00
|
|
|
*/
|
|
|
|
|
class PDisable : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2001-12-03 05:47:14 +01:00
|
|
|
explicit PDisable(const hname_t&sc);
|
2000-07-26 07:08:07 +02:00
|
|
|
~PDisable();
|
|
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-07-26 07:08:07 +02:00
|
|
|
|
|
|
|
|
private:
|
2001-12-03 05:47:14 +01:00
|
|
|
hname_t scope_;
|
2000-07-26 07:08:07 +02:00
|
|
|
};
|
|
|
|
|
|
2000-04-01 21:31:57 +02:00
|
|
|
/*
|
|
|
|
|
* The event statement represents the event delay in behavioral
|
|
|
|
|
* code. It comes from such things as:
|
|
|
|
|
*
|
|
|
|
|
* @name <statement>;
|
|
|
|
|
* @(expr) <statement>;
|
2002-04-21 06:59:07 +02:00
|
|
|
* @* <statement>;
|
2000-04-01 21:31:57 +02:00
|
|
|
*/
|
1998-11-04 00:28:49 +01:00
|
|
|
class PEventStatement : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2000-04-01 21:31:57 +02:00
|
|
|
explicit PEventStatement(const svector<PEEvent*>&ee);
|
|
|
|
|
explicit PEventStatement(PEEvent*ee);
|
2002-04-21 06:59:07 +02:00
|
|
|
// Make an @* statement.
|
|
|
|
|
explicit PEventStatement(void);
|
1999-04-29 04:16:26 +02:00
|
|
|
|
2000-04-01 21:31:57 +02:00
|
|
|
~PEventStatement();
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2000-04-12 06:23:57 +02:00
|
|
|
void set_statement(Statement*st);
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
1999-09-22 04:00:48 +02:00
|
|
|
// This method is used to elaborate, but attach a previously
|
|
|
|
|
// elaborated statement to the event.
|
2001-11-22 07:20:59 +01:00
|
|
|
NetProc* elaborate_st(Design*des, NetScope*scope, NetProc*st) const;
|
1999-09-22 04:00:48 +02:00
|
|
|
|
2003-05-19 04:50:58 +02:00
|
|
|
NetProc* elaborate_wait(Design*des, NetScope*scope, NetProc*st) const;
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
private:
|
1999-04-29 04:16:26 +02:00
|
|
|
svector<PEEvent*>expr_;
|
1998-11-04 00:28:49 +01:00
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
2000-04-22 06:20:19 +02:00
|
|
|
class PForce : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PForce(PExpr*l, PExpr*r);
|
|
|
|
|
~PForce();
|
|
|
|
|
|
2004-12-11 03:31:25 +01:00
|
|
|
virtual NetForce* elaborate(Design*des, NetScope*scope) const;
|
2000-04-22 06:20:19 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*lval_;
|
|
|
|
|
PExpr*expr_;
|
|
|
|
|
};
|
|
|
|
|
|
1999-06-19 23:06:16 +02:00
|
|
|
class PForever : public Statement {
|
|
|
|
|
public:
|
|
|
|
|
explicit PForever(Statement*s);
|
|
|
|
|
~PForever();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1999-06-19 23:06:16 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
1998-11-09 19:55:33 +01:00
|
|
|
class PForStatement : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
1999-05-10 02:16:57 +02:00
|
|
|
PForStatement(PExpr*n1, PExpr*e1, PExpr*cond,
|
2001-11-22 07:20:59 +01:00
|
|
|
PExpr*n2, PExpr*e2, Statement*st);
|
|
|
|
|
~PForStatement();
|
1998-11-09 19:55:33 +01:00
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-09 19:55:33 +01:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
1999-05-10 02:16:57 +02:00
|
|
|
PExpr* name1_;
|
1998-11-09 19:55:33 +01:00
|
|
|
PExpr* expr1_;
|
|
|
|
|
|
|
|
|
|
PExpr*cond_;
|
|
|
|
|
|
1999-05-10 02:16:57 +02:00
|
|
|
PExpr* name2_;
|
1998-11-09 19:55:33 +01:00
|
|
|
PExpr* expr2_;
|
|
|
|
|
|
|
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
class PNoop : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
PNoop() { }
|
2005-12-05 22:21:18 +01:00
|
|
|
~PNoop() { }
|
1998-11-04 00:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
1999-06-19 23:06:16 +02:00
|
|
|
class PRepeat : public Statement {
|
|
|
|
|
public:
|
|
|
|
|
explicit PRepeat(PExpr*expr, Statement*s);
|
|
|
|
|
~PRepeat();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1999-06-19 23:06:16 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*expr_;
|
|
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
2000-04-22 06:20:19 +02:00
|
|
|
class PRelease : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PRelease(PExpr*l);
|
|
|
|
|
~PRelease();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-04-22 06:20:19 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*lval_;
|
|
|
|
|
};
|
|
|
|
|
|
2000-04-01 21:31:57 +02:00
|
|
|
/*
|
|
|
|
|
* The PTrigger statement sends a trigger to a named event. Take the
|
|
|
|
|
* name here.
|
|
|
|
|
*/
|
|
|
|
|
class PTrigger : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2001-12-03 05:47:14 +01:00
|
|
|
explicit PTrigger(const hname_t&ev);
|
2000-04-01 21:31:57 +02:00
|
|
|
~PTrigger();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-04-01 21:31:57 +02:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
2001-12-03 05:47:14 +01:00
|
|
|
hname_t event_;
|
2000-04-01 21:31:57 +02:00
|
|
|
};
|
|
|
|
|
|
1998-11-11 04:13:04 +01:00
|
|
|
class PWhile : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2001-11-22 07:20:59 +01:00
|
|
|
PWhile(PExpr*e1, Statement*st);
|
1998-11-11 04:13:04 +01:00
|
|
|
~PWhile();
|
|
|
|
|
|
2001-11-22 07:20:59 +01:00
|
|
|
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
|
2000-03-11 04:25:51 +01:00
|
|
|
virtual void elaborate_scope(Design*des, NetScope*scope) const;
|
1998-11-11 04:13:04 +01:00
|
|
|
virtual void dump(ostream&out, unsigned ind) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
PExpr*cond_;
|
|
|
|
|
Statement*statement_;
|
|
|
|
|
};
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/*
|
|
|
|
|
* $Log: Statement.h,v $
|
2005-12-05 22:21:18 +01:00
|
|
|
* Revision 1.42 2005/12/05 21:21:18 steve
|
|
|
|
|
* Fixes for stubborn compilers.
|
|
|
|
|
*
|
2004-12-11 03:31:25 +01:00
|
|
|
* Revision 1.41 2004/12/11 02:31:25 steve
|
|
|
|
|
* Rework of internals to carry vectors through nexus instead
|
|
|
|
|
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
|
|
|
|
|
* down this path.
|
|
|
|
|
*
|
2004-02-20 19:53:33 +01:00
|
|
|
* Revision 1.40 2004/02/20 18:53:33 steve
|
|
|
|
|
* Addtrbute keys are perm_strings.
|
|
|
|
|
*
|
2004-02-18 18:11:54 +01:00
|
|
|
* Revision 1.39 2004/02/18 17:11:54 steve
|
|
|
|
|
* Use perm_strings for named langiage items.
|
|
|
|
|
*
|
2003-05-19 04:50:58 +02:00
|
|
|
* Revision 1.38 2003/05/19 02:50:58 steve
|
|
|
|
|
* Implement the wait statement behaviorally instead of as nets.
|
|
|
|
|
*
|
2003-01-30 17:23:07 +01:00
|
|
|
* Revision 1.37 2003/01/30 16:23:07 steve
|
|
|
|
|
* Spelling fixes.
|
|
|
|
|
*
|
2002-08-12 03:34:58 +02:00
|
|
|
* Revision 1.36 2002/08/12 01:34:58 steve
|
|
|
|
|
* conditional ident string using autoconfig.
|
|
|
|
|
*
|
2002-06-04 07:38:43 +02:00
|
|
|
* Revision 1.35 2002/06/04 05:38:44 steve
|
|
|
|
|
* Add support for memory words in l-value of
|
|
|
|
|
* blocking assignments, and remove the special
|
|
|
|
|
* NetAssignMem class.
|
|
|
|
|
*
|
2002-05-26 03:39:02 +02:00
|
|
|
* Revision 1.34 2002/05/26 01:39:02 steve
|
|
|
|
|
* Carry Verilog 2001 attributes with processes,
|
|
|
|
|
* all the way through to the ivl_target API.
|
|
|
|
|
*
|
|
|
|
|
* Divide signal reference counts between rval
|
|
|
|
|
* and lval references.
|
|
|
|
|
*
|
2002-04-22 00:31:02 +02:00
|
|
|
* Revision 1.33 2002/04/21 22:31:02 steve
|
|
|
|
|
* Redo handling of assignment internal delays.
|
|
|
|
|
* Leave it possible for them to be calculated
|
|
|
|
|
* at run time.
|
|
|
|
|
*
|
2002-04-21 06:59:07 +02:00
|
|
|
* Revision 1.32 2002/04/21 04:59:07 steve
|
|
|
|
|
* Add support for conbinational events by finding
|
|
|
|
|
* the inputs to expressions and some statements.
|
|
|
|
|
* Get case and assignment statements working.
|
|
|
|
|
*
|
2001-12-03 05:47:14 +01:00
|
|
|
* Revision 1.31 2001/12/03 04:47:14 steve
|
|
|
|
|
* Parser and pform use hierarchical names as hname_t
|
|
|
|
|
* objects instead of encoded strings.
|
|
|
|
|
*
|
2001-11-22 07:20:59 +01:00
|
|
|
* Revision 1.30 2001/11/22 06:20:59 steve
|
|
|
|
|
* Use NetScope instead of string for scope path.
|
|
|
|
|
*
|
2000-09-09 17:21:26 +02:00
|
|
|
* Revision 1.29 2000/09/09 15:21:26 steve
|
|
|
|
|
* move lval elaboration to PExpr virtual methods.
|
|
|
|
|
*
|
2000-09-03 19:58:35 +02:00
|
|
|
* Revision 1.28 2000/09/03 17:58:35 steve
|
|
|
|
|
* Change elaborate_lval to return NetAssign_ objects.
|
|
|
|
|
*
|
2000-07-26 07:08:07 +02:00
|
|
|
* Revision 1.27 2000/07/26 05:08:07 steve
|
|
|
|
|
* Parse disable statements to pform.
|
|
|
|
|
*
|
2000-05-12 01:37:26 +02:00
|
|
|
* Revision 1.26 2000/05/11 23:37:26 steve
|
|
|
|
|
* Add support for procedural continuous assignment.
|
|
|
|
|
*
|
2000-04-22 06:20:19 +02:00
|
|
|
* Revision 1.25 2000/04/22 04:20:19 steve
|
|
|
|
|
* Add support for force assignment.
|
|
|
|
|
*
|
2000-04-12 06:23:57 +02:00
|
|
|
* Revision 1.24 2000/04/12 04:23:57 steve
|
|
|
|
|
* Named events really should be expressed with PEIdent
|
|
|
|
|
* objects in the pform,
|
|
|
|
|
*
|
|
|
|
|
* Handle named events within the mix of net events
|
|
|
|
|
* and edges. As a unified lot they get caught together.
|
|
|
|
|
* wait statements are broken into more complex statements
|
|
|
|
|
* that include a conditional.
|
|
|
|
|
*
|
|
|
|
|
* Do not generate NetPEvent or NetNEvent objects in
|
|
|
|
|
* elaboration. NetEvent, NetEvWait and NetEvProbe
|
|
|
|
|
* take over those functions in the netlist.
|
1998-11-04 00:28:49 +01:00
|
|
|
*/
|
|
|
|
|
#endif
|