1 #ifndef IVL_AStatement_H
2 #define IVL_AStatement_H
3 /*
4  * Copyright (c) 2008-2014 Stephen Williams (steve@icarus.com)
5  *
6  *    This source code is free software; you can redistribute it
7  *    and/or modify it in source code form under the terms of the GNU
8  *    General Public License as published by the Free Software
9  *    Foundation; either version 2 of the License, or (at your option)
10  *    any later version.
11  *
12  *    This program is distributed in the hope that it will be useful,
13  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *    GNU General Public License for more details.
16  *
17  *    You should have received a copy of the GNU General Public License
18  *    along with this program; if not, write to the Free Software
19  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 # include  <map>
23 # include  "ivl_target.h"
24 # include  "StringHeap.h"
25 # include  "LineInfo.h"
26 # include  "Statement.h"
27 # include  "PExpr.h"
28 
29 class PExpr;
30 class NetAnalog;
31 class NetScope;
32 class Design;
33 
34 /*
35  * A contribution statement is like an assignment: there is an l-value
36  * expression and an r-value expression. The l-value is a branch probe
37  * expression.
38  */
39 class AContrib : public Statement {
40 
41     public:
42       AContrib(PExpr*lval, PExpr*rval);
43       ~AContrib();
44 
45       virtual void dump(ostream&out, unsigned ind) const;
46       virtual NetProc* elaborate(Design*des, NetScope*scope) const;
47 
48     private:
49       PExpr*lval_;
50       PExpr*rval_;
51 };
52 
53 /*
54  * An analog process is not a statement, but contains an analog
55  * statement. The process is where we attach process characteristics
56  * such as initial vs. always, attributes....
57  */
58 class AProcess : public LineInfo {
59 
60     public:
AProcess(ivl_process_type_t t,Statement * st)61       AProcess(ivl_process_type_t t, Statement*st)
62       : type_(t), statement_(st) { }
63 
64       ~AProcess();
65 
66       bool elaborate(Design*des, NetScope*scope) const;
67 
type()68       ivl_process_type_t type() const { return type_; }
statement()69       Statement*statement() { return statement_; }
70 
71       map<perm_string,PExpr*> attributes;
72 
73 	// Dump the analog process
74       void dump(ostream&out, unsigned ind) const;
75 
76     private:
77       ivl_process_type_t type_;
78       Statement*statement_;
79 
80     private: // not implemented
81       AProcess(const AProcess&);
82       AProcess& operator= (const AProcess&);
83 };
84 
85 #endif /* IVL_AStatement_H */
86