1998-11-04 00:28:49 +01:00
|
|
|
#ifndef __Statement_H
|
|
|
|
|
#define __Statement_H
|
|
|
|
|
/*
|
2012-05-20 02:34:13 +02:00
|
|
|
* Copyright (c) 1998-2008,2012 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
|
2012-08-29 03:41:23 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
1998-11-04 00:28:49 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
# include <string>
|
2011-09-17 21:10:05 +02:00
|
|
|
# include <vector>
|
2010-10-26 04:36:44 +02:00
|
|
|
# include <list>
|
2008-10-22 07:15:49 +02:00
|
|
|
# include "ivl_target.h"
|
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"
|
2008-02-16 06:20:24 +01:00
|
|
|
# include "PScope.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
|
2011-03-30 08:42:26 +02:00
|
|
|
* one of these, which contains its type (initial, always, or final)
|
|
|
|
|
* and a pointer to the single statement that is the process. A module
|
|
|
|
|
* may have several concurrent processes.
|
1998-11-04 00:28:49 +01:00
|
|
|
*/
|
1999-01-25 06:45:56 +01:00
|
|
|
class PProcess : public LineInfo {
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
public:
|
2008-10-22 07:15:49 +02:00
|
|
|
PProcess(ivl_process_type_t t, Statement*st)
|
1998-11-04 00:28:49 +01:00
|
|
|
: type_(t), statement_(st) { }
|
|
|
|
|
|
1999-01-25 06:45:56 +01:00
|
|
|
virtual ~PProcess();
|
|
|
|
|
|
2007-03-05 06:59:10 +01:00
|
|
|
bool elaborate(Design*des, NetScope*scope) const;
|
|
|
|
|
|
2008-10-22 07:15:49 +02:00
|
|
|
ivl_process_type_t type() const { return type_; }
|
1998-11-04 00:28:49 +01:00
|
|
|
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:
|
2008-10-22 07:15:49 +02:00
|
|
|
ivl_process_type_t type_;
|
1998-11-04 00:28:49 +01:00
|
|
|
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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(Design*des, NetScope*scope) const;
|
2008-09-05 06:27:21 +02:00
|
|
|
|
|
|
|
|
map<perm_string,PExpr*> attributes;
|
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:
|
2008-10-04 16:30:34 +02:00
|
|
|
explicit PAssign_(PExpr*lval, PExpr*ex, bool is_constant);
|
1999-07-12 02:59:36 +02:00
|
|
|
explicit PAssign_(PExpr*lval, PExpr*de, PExpr*ex);
|
2008-09-04 01:05:12 +02:00
|
|
|
explicit PAssign_(PExpr*lval, PExpr*cnt, 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_; }
|
2008-10-11 05:42:07 +02:00
|
|
|
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;
|
2008-09-23 06:09:06 +02:00
|
|
|
NetExpr* elaborate_rval_(Design*, NetScope*, unsigned lv_width,
|
|
|
|
|
ivl_variable_type_t type) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2012-07-16 05:44:07 +02:00
|
|
|
NetExpr* elaborate_rval_obj_(Design*, NetScope*,
|
|
|
|
|
ivl_variable_type_t type) const;
|
|
|
|
|
|
2002-04-22 00:31:02 +02:00
|
|
|
PExpr* delay_;
|
1999-09-22 04:00:48 +02:00
|
|
|
PEventStatement*event_;
|
2008-09-04 01:05:12 +02:00
|
|
|
PExpr* count_;
|
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_;
|
2008-10-04 16:30:34 +02:00
|
|
|
bool is_constant_;
|
1999-06-14 01:51:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PAssign : public PAssign_ {
|
|
|
|
|
|
|
|
|
|
public:
|
2011-11-27 20:16:39 +01:00
|
|
|
// lval - assignment l-value
|
|
|
|
|
// ex - assignment r-value
|
|
|
|
|
// op - compressed assignment operator (i.e. '+', '-', ...)
|
|
|
|
|
// de - delayed assignment delay expression
|
1999-06-14 01:51:16 +02:00
|
|
|
explicit PAssign(PExpr*lval, PExpr*ex);
|
2011-11-27 20:16:39 +01:00
|
|
|
explicit PAssign(PExpr*lval, char op, PExpr*ex);
|
1999-07-12 02:59:36 +02:00
|
|
|
explicit PAssign(PExpr*lval, PExpr*de, PExpr*ex);
|
2008-09-04 01:05:12 +02:00
|
|
|
explicit PAssign(PExpr*lval, PExpr*cnt, PEventStatement*de, PExpr*ex);
|
2008-10-04 16:30:34 +02:00
|
|
|
explicit PAssign(PExpr*lval, PExpr*ex, bool is_constant);
|
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:
|
2011-11-27 20:16:39 +01:00
|
|
|
NetProc* elaborate_compressed_(Design*des, NetScope*scope) const;
|
|
|
|
|
char op_;
|
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);
|
2008-09-04 01:05:12 +02:00
|
|
|
explicit PAssignNB(PExpr*lval, PExpr*cnt, PEventStatement*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.
|
|
|
|
|
*/
|
2008-02-16 06:20:24 +01:00
|
|
|
class PBlock : public PScope, public Statement {
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
public:
|
2012-05-20 02:34:13 +02:00
|
|
|
enum BL_TYPE { BL_SEQ, BL_PAR, BL_JOIN_NONE, BL_JOIN_ANY };
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2008-02-16 06:20:24 +01:00
|
|
|
// If the block has a name, it is a scope and also has a parent.
|
2010-01-08 23:49:48 +01:00
|
|
|
explicit PBlock(perm_string n, LexicalScope*parent, BL_TYPE t);
|
2008-02-16 06:20:24 +01:00
|
|
|
// If it doesn't have a name, it's not a scope
|
1999-06-24 06:24:18 +02:00
|
|
|
explicit PBlock(BL_TYPE t);
|
1998-11-04 00:28:49 +01:00
|
|
|
~PBlock();
|
|
|
|
|
|
|
|
|
|
BL_TYPE bl_type() const { return bl_type_; }
|
|
|
|
|
|
2012-05-20 02:34:13 +02:00
|
|
|
// If the bl_type() is BL_PAR, it is possible to replace it
|
|
|
|
|
// with JOIN_NONE or JOIN_ANY. This is to help the parser.
|
|
|
|
|
void set_join_type(BL_TYPE);
|
|
|
|
|
|
2011-09-17 21:10:05 +02:00
|
|
|
void set_statement(const std::vector<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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
|
|
|
|
private:
|
2012-05-20 02:34:13 +02:00
|
|
|
BL_TYPE bl_type_;
|
2011-09-17 21:10:05 +02:00
|
|
|
std::vector<Statement*>list_;
|
1998-11-04 00:28:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PCallTask : public Statement {
|
|
|
|
|
|
|
|
|
|
public:
|
2010-10-26 04:36:44 +02:00
|
|
|
explicit PCallTask(const pform_name_t&n, const list<PExpr*>&parms);
|
|
|
|
|
explicit PCallTask(perm_string n, const list<PExpr*>&parms);
|
2001-11-22 07:20:59 +01:00
|
|
|
~PCallTask();
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2007-05-24 06:07:11 +02:00
|
|
|
const pform_name_t& path() const;
|
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;
|
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
|
|
|
|
2012-07-17 03:15:29 +02:00
|
|
|
NetProc*elaborate_method_(Design*des, NetScope*scope) const;
|
|
|
|
|
|
2007-05-24 06:07:11 +02:00
|
|
|
pform_name_t path_;
|
2010-10-26 04:36:44 +02:00
|
|
|
vector<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 {
|
2010-10-26 04:36:44 +02:00
|
|
|
list<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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(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:
|
2007-05-24 06:07:11 +02:00
|
|
|
explicit PDisable(const pform_name_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:
|
2007-05-24 06:07:11 +02:00
|
|
|
pform_name_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;
|
2008-09-04 01:05:12 +02:00
|
|
|
// Call this with a NULL statement only. It is used to print
|
|
|
|
|
// the event expression for inter-assignment event controls.
|
|
|
|
|
virtual void dump_inline(ostream&out) 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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(Design*des, NetScope*scope) const;
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool has_aa_term(Design*des, NetScope*scope);
|
|
|
|
|
|
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_;
|
|
|
|
|
};
|
|
|
|
|
|
2008-09-04 01:05:12 +02:00
|
|
|
ostream& operator << (ostream&o, const PEventStatement&obj);
|
|
|
|
|
|
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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(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,
|
2012-02-25 18:28:20 +01:00
|
|
|
Statement*step, Statement*body);
|
2001-11-22 07:20:59 +01:00
|
|
|
~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;
|
2008-02-25 04:40:54 +01:00
|
|
|
virtual void elaborate_sig(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_;
|
|
|
|
|
|
2012-02-25 18:28:20 +01:00
|
|
|
Statement*step_;
|
1998-11-09 19:55:33 +01:00
|
|
|
|
|
|
|
|
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;
|
2008-05-15 05:19:51 +02:00
|
|
|
virtual void elaborate_sig(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:
|
2007-05-24 06:07:11 +02:00
|
|
|
explicit PTrigger(const pform_name_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:
|
2007-05-24 06:07:11 +02:00
|
|
|
pform_name_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;
|
2008-05-15 05:19:51 +02:00
|
|
|
virtual void elaborate_sig(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
|
|
|
#endif
|