4 * Copyright (c) 2008 Stephen Williams (steve@icarus.com)
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)
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23 * The discipline types include the discipline, nature and other
24 * related types for managing declared and used disciplines in a
25 * Verilog-AMS program.
28 # include "StringHeap.h"
31 # include "LineInfo.h"
33 typedef enum { DD_NONE
, DD_DISCRETE
, DD_CONTINUOUS
} ddomain_t
;
34 extern std::ostream
& operator << (std::ostream
&, ddomain_t
);
36 class nature_t
: public LineInfo
{
38 explicit nature_t(perm_string name
, perm_string access
);
41 perm_string
name() const { return name_
; }
42 // Identifier for the access function for this nature
43 perm_string
access() const { return access_
; }
50 class discipline_t
: public LineInfo
{
52 explicit discipline_t (perm_string name
, ddomain_t dom
,
53 nature_t
*pot
, nature_t
*flow
);
56 perm_string
name() const { return name_
; }
57 ddomain_t
domain() const { return domain_
; }
58 const nature_t
*potential() const { return potential_
; }
59 const nature_t
*flow() const { return flow_
; }
67 private: // not implemented
68 discipline_t(const discipline_t
&);
69 discipline_t
& operator = (const discipline_t
&);
72 extern map
<perm_string
,nature_t
*> natures
;
73 extern map
<perm_string
,discipline_t
*> disciplines
;