1 #ifndef IVL_ivl_target_priv_H
2 #define IVL_ivl_target_priv_H
3 /*
4  * Copyright (c) 2008-2019 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  "ivl_target.h"
23 # include  <inttypes.h>
24 # include  <map>
25 # include  <vector>
26 # include  <ostream>
27 # include  <valarray>
28 
29 class NetScope;
30 
31 /*
32 * This header has declarations related to the ivl_target.h API that
33 * are not to be exported outside of the core via the ivl_target.h
34 * interface.
35 *
36 * (NOTE: A lot of similar definitions exist in the t-dll.h header
37 * file. That is a legacy from an earlier time before the
38 * ivl_target_priv.h header file was started, and those definitions
39 * should gradually be moved over to this header file.)
40 */
41 
42 /*
43  * This is the root of a design, from the ivl_target point of few. The
44  * ivl_target API uses this as the root for getting at everything else
45  * in the design.
46  */
47 struct ivl_design_s {
48 
49       int time_precision;
50 
51       ivl_process_t threads_;
52 
53 	// Keep arrays of root scopes.
54       std::vector<ivl_scope_t> packages;
55       std::vector<ivl_scope_t> roots;
56 
57 	// This is used to implement the ivl_design_roots function.
58       std::vector<ivl_scope_t> root_scope_list;
59 
60 	// Keep an array of constants objects.
61       std::vector<ivl_net_const_t> consts;
62 
63 	// Keep a handy array of all of the disciplines in the design.
64       std::valarray<ivl_discipline_t> disciplines;
65 
66       const class Design*self;
67 };
68 
69 /*
70  * A branch is a pair of terminals. The elaborator assures that the
71  * terminals have compatible disciplines.
72  */
73 struct ivl_branch_s {
74       ivl_nexus_t pins[2];
75       ivl_island_t island;
76 };
77 
78 /*
79 * Information about islands. Connected branches within a net are
80 * collected into islands. Branches that are purely ddiscrete do not
81 * have disciplines and do not belong to islands.
82 */
83 
84 struct ivl_island_s {
85       ivl_discipline_t discipline;
86 	// user accessible flags. They are initially false, always.
87       std::vector<bool> flags;
88 };
89 
90 extern std::ostream& operator << (std::ostream&o, ivl_drive_t str);
91 
92 #endif /* IVL_ivl_target_priv_H */
93