Rev 9 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9 | Rev 11 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | * $Header: C:/cvsroot/Vert03/vertlib/database.h,v 1.2 2004/06/22 21:44:14 mjames Exp $ |
2 | * $Header: C:/cvsroot/Vert03/vertlib/database.h,v 1.2 2004/06/22 21:44:14 mjames Exp $ |
3 | * |
3 | * |
4 | * $Log: database.h,v $ |
4 | * $Log: database.h,v $ |
5 | * Revision 1.2 2004/06/22 21:44:14 mjames |
5 | * Revision 1.2 2004/06/22 21:44:14 mjames |
6 | * Firrst build most files |
6 | * Firrst build most files |
7 | * |
7 | * |
Line 64... | Line 64... | ||
64 | * |
64 | * |
65 | * Revision 1.1.1.1 2000/10/19 21:58:35 mjames |
65 | * Revision 1.1.1.1 2000/10/19 21:58:35 mjames |
66 | * Mike put it here |
66 | * Mike put it here |
67 | * |
67 | * |
68 | * |
68 | * |
69 | * |
69 | * |
70 | */ |
70 | */ |
- | 71 | ||
- | 72 | ||
71 | #pragma once |
73 | |
72 | #include "expression.h" |
- | |
73 | #include "generic.h" |
- | |
74 | 74 | ||
- | 75 | ||
75 | #if !defined _DATABASE |
76 | #if !defined _DATABASE |
76 | #define _DATABASE |
77 | #define _DATABASE |
77 | 78 | ||
78 | 79 | ||
- | 80 | #if !defined _EXPRESSION |
|
- | 81 | #error "Need to include 'expression.h' before database.h" |
|
- | 82 | #endif |
|
- | 83 | ||
- | 84 | #if ! defined _GENERIC |
|
- | 85 | #error "generic.h" must be included first |
|
- | 86 | #endif |
|
- | 87 | ||
79 | #define MAXIDLEN 1024 |
88 | #define MAXIDLEN 1024 |
80 | 89 | ||
81 | #define BUFPREFIX "XX_" |
90 | #define BUFPREFIX "XX_" |
82 | 91 | ||
83 | #if defined PC |
92 | #if defined PC |
84 | #define VERTICAL_INI_PATH "vertical.ini" |
93 | #define VERTICAL_INI_PATH "vertical.ini" |
85 | #define VERTICAL_PATH ".;c:/cygwin/usr/local/vert_files" |
94 | #define VERTICAL_PATH ".;c:/cygwin/usr/local/vert_files" |
86 | #else |
95 | #else |
87 | #define VERTICAL_INI_PATH "vertical.ini" |
96 | #define VERTICAL_INI_PATH "vertical.ini" |
88 | #define VERTICAL_PATH ".;$(HOME)/.caddata/vert_files" |
97 | #define VERTICAL_PATH ".;$(HOME)/.caddata/vert_files" |
89 | /* DLL creation declaration mode. not used on HP */ |
98 | /* DLL creation declaration mode. not used on HP */ |
90 | #if !defined __declspec |
99 | #if ! defined __declspec |
91 | #define __declspec(x) |
100 | #define __declspec(x) |
92 | #define DLLIMPORT |
- | |
93 | #define DLLEXPORT |
- | |
94 | - | ||
95 | #endif |
101 | #endif |
96 | #endif |
102 | #endif |
97 | 103 | ||
- | 104 | ||
98 | /* incomplete declarations to placate 'c' */ |
105 | /* incomplete declarations to placate 'c' */ |
99 | 106 | ||
100 | struct connector; |
107 | struct connector; |
101 | struct net; |
108 | struct net; |
102 | struct netref; |
109 | struct netref; |
103 | struct equivalent_node_set; |
110 | struct equivalent_node_set; |
104 | 111 | ||
- | 112 | ||
105 | /* the direction list */ |
113 | /* the direction list */ |
106 | typedef enum |
114 | typedef enum { NONE,INPUT,OUTPUT,BUFFER,BIDIR,CONFIG,POWER } pindir_t; |
107 | { |
115 | |
108 | NONE, |
- | |
109 | INPUT, |
- | |
110 | OUTPUT, |
- | |
111 | BUFFER, |
- | |
112 | BIDIR, |
- | |
113 | CONFIG, |
- | |
114 | POWER |
- | |
115 | } pindir_t; |
- | |
116 | 116 | ||
117 | #define Create 0 |
117 | #define Create 0 |
118 | #define Search 1 |
118 | #define Search 1 |
119 | 119 | ||
- | 120 | ||
- | 121 | ||
120 | #define ISNULLSTR(x) ((x == NULL) || (x && (x[0] == 0))) |
122 | #define ISNULLSTR(x) ((x == NULL) || (x && (x[0]==0))) |
- | 123 | ||
121 | 124 | ||
122 | /* operations to manipulate the data structure */ |
125 | /* operations to manipulate the data structure */ |
123 | /* from the ACF reader */ |
126 | /* from the ACF reader */ |
124 | 127 | ||
125 | /* typedef enum { Ident,Type,Name,Value,Datatype,How_Routed } property_t; */ |
128 | /* typedef enum { Ident,Type,Name,Value,Datatype,How_Routed } property_t; */ |
126 | typedef enum |
- | |
127 | { |
- | |
128 | Ident, |
- | |
129 | Type, |
- | |
130 | Name, |
- | |
131 | Value, |
- | |
132 | How_Routed |
129 | typedef enum { Ident,Type,Name,Value,How_Routed } property_t; |
133 | } property_t; |
- | |
134 | 130 | ||
135 | /* used in seting the routing_status attribute of a net */ |
131 | /* used in seting the routing_status attribute of a net */ |
136 | 132 | ||
137 | typedef enum |
133 | typedef enum |
138 | { |
134 | { |
139 | Free, /* name given may be reassigned */ |
135 | Free, /* name given may be reassigned */ |
140 | By_Name, /* Routed by Name */ |
136 | By_Name, /* Routed by Name */ |
141 | By_Net, /* Routed by already existing net */ |
137 | By_Net, /* Routed by already existing net */ |
142 | By_Fixed_Net, /* Routed through fixed existing net */ |
138 | By_Fixed_Net,/* Routed through fixed existing net */ |
143 | By_Exact_Net, /* Routed using identical already existing net */ |
139 | By_Exact_Net,/* Routed using identical already existing net */ |
144 | By_Creating, /* Routed by creating a new net */ |
140 | By_Creating, /* Routed by creating a new net */ |
145 | By_Jumpering, /* Routed by connecting an existing net */ |
141 | By_Jumpering,/* Routed by connecting an existing net */ |
146 | By_FixPins, /* can only go here as pins are fixed */ |
142 | By_FixPins, /* can only go here as pins are fixed */ |
147 | Not_Routable, /* not allowed to participate in any routing */ |
143 | Not_Routable, /* not allowed to participate in any routing */ |
148 | Not_Routable_H, /* pullup/VCC */ |
144 | Not_Routable_H, /* pullup/VCC */ |
149 | Not_Routable_L /* pulldown/GND */ |
145 | Not_Routable_L /* pulldown/GND */ |
150 | } HowRouted_t; |
146 | } HowRouted_t; |
151 | /* these macros are reliant on sorted ordinal values */ |
147 | /* these macros are reliant on sorted ordinal values */ |
152 | #define IS_NOT_ROUTABLE(x) ((x) >= Not_Routable) |
148 | #define IS_NOT_ROUTABLE(x) ((x)>=Not_Routable) |
153 | #define IS_ROUTABLE(x) ((x) < Not_Routable) |
149 | #define IS_ROUTABLE(x) ((x)<Not_Routable) |
- | 150 | ||
154 | 151 | ||
155 | /* a type to hold a VHDL data type */ |
152 | /* a type to hold a VHDL data type */ |
156 | typedef struct vhdl |
153 | typedef struct vhdl { |
- | 154 | char * basetype; |
|
- | 155 | expression_t * decl_expr; /* the range given in its declaration */ |
|
157 | { |
156 | |
158 | char *basetype; |
157 | expression_t * expr; /* the expression that is used to */ |
- | 158 | /* define the values of high/low etc */ |
|
159 | expression_t *decl_expr; /* the range given in its declaration */ |
159 | expression_t * default_expr; /* default value assigned in declaration */ |
- | 160 | /* char * text; */ /* this is the original declaration */ |
|
- | 161 | /* int low; |
|
- | 162 | int high; */ |
|
- | 163 | unsigned int valid:1; /* is the expression valid ? */ |
|
- | 164 | unsigned int is_vector:1; /* is this port a vector */ |
|
- | 165 | unsigned int is_downto:1; /* is the vector X TO Y or X DOWNTO Y */ |
|
- | 166 | } vhdl_t; |
|
160 | 167 | ||
161 | expression_t *expr; /* the expression that is used to */ |
- | |
162 | /* define the values of high/low etc */ |
- | |
163 | expression_t *default_expr; /* default value assigned in declaration */ |
- | |
164 | /* char * text; */ /* this is the original declaration */ |
- | |
165 | /* int low; |
- | |
166 | int high; */ |
- | |
167 | unsigned int valid : 1; /* is the expression valid ? */ |
- | |
168 | unsigned int is_vector : 1; /* is this port a vector */ |
- | |
169 | unsigned int is_downto : 1; /* is the vector X TO Y or X DOWNTO Y */ |
- | |
170 | } vhdl_t; |
- | |
171 | 168 | ||
172 | /* object node : point in a circuit connected a socket and a net */ |
169 | /* object node : point in a circuit connected a socket and a net */ |
173 | typedef struct node |
170 | typedef struct node |
174 | { |
171 | { |
175 | struct node *sktnext; /* linked to a socket */ |
172 | struct node * sktnext; /* linked to a socket */ |
176 | char *identifier; /* e.g 102, A22 */ |
173 | char * identifier; /* e.g 102, A22 */ |
177 | char *name; /* internal signal name (actually same as netname ) */ |
174 | char * name; /* internal signal name (actually same as netname ) */ |
178 | 175 | ||
179 | vhdl_t *vhdltype; /* the subset of the net that the node is connected to */ |
176 | vhdl_t * vhdltype; /* the subset of the net that the node is connected to */ |
180 | vhdl_t *orig_vhdltype; /* how this node was originally declared */ |
177 | vhdl_t * orig_vhdltype; /* how this node was originally declared */ |
181 | expression_t *lhs_expr; /* if the net is sliced on socket pin assignment LHS */ |
178 | expression_t * lhs_expr;/* if the net is sliced on socket pin assignment LHS */ |
182 | pindir_t pindir; /* final pin type input? output? bidir? unknown? */ |
179 | pindir_t pindir; /* final pin type input? output? bidir? unknown? */ |
183 | int pin_group; /* can say 'any pin in group(n) only is interchangeable' */ |
180 | int pin_group; /* can say 'any pin in group(n) only is interchangeable' */ |
184 | struct net *net; /* refer to net this node is on (if known) */ |
181 | struct net * net; /* refer to net this node is on (if known) */ |
185 | 182 | ||
186 | struct net *routed_net; /* which routed net connects to this node */ |
183 | struct net * routed_net; /* which routed net connects to this node */ |
187 | 184 | ||
188 | int refcount; /* how many nets refer to this node */ |
185 | int refcount; /* how many nets refer to this node */ |
189 | struct socket *socket; /* refer to socket this node is part of */ |
186 | struct socket * socket; /* refer to socket this node is part of */ |
190 | struct equivalent_node_set *equivalent_nodes; /* member of set of equivalent nodes */ |
187 | struct equivalent_node_set * equivalent_nodes; /* member of set of equivalent nodes */ |
191 | 188 | ||
192 | /* sorting data structure */ |
189 | /* sorting data structure */ |
193 | char *id_numeric_chars; /* the numeric part of the identifier */ |
190 | char * id_numeric_chars; /* the numeric part of the identifier */ |
194 | int id_numeric_cnt; /* the number of numeric chars in this part of the identifier */ |
191 | int id_numeric_cnt; /* the number of numeric chars in this part of the identifier */ |
195 | 192 | ||
196 | char *id_alpha_chars; /* the alphabetic part of the identifier */ |
193 | char * id_alpha_chars; /* the alphabetic part of the identifier */ |
197 | int id_alpha_cnt; /* the number of alpha chars in this part of the ident */ |
194 | int id_alpha_cnt; /* the number of alpha chars in this part of the ident */ |
198 | 195 | ||
199 | int pin_row; |
196 | int pin_row; |
200 | int pin_col; |
197 | int pin_col; |
201 | int pin_index; /* the ordinal pin number : which would be used in a bundle */ |
198 | int pin_index; /* the ordinal pin number : which would be used in a bundle */ |
202 | int bundle_index; /* if >=0 then this pin is in a bundle */ |
199 | int bundle_index; /* if >=0 then this pin is in a bundle */ |
203 | 200 | ||
204 | unsigned int fixed_pin : 1; /* if fixed_pin = 1 then this pin can only be used |
201 | unsigned int fixed_pin:1;/* if fixed_pin = 1 then this pin can only be used |
205 | to connect to the net in a particular |
202 | to connect to the net in a particular |
206 | direction */ |
203 | direction */ |
207 | unsigned int in_use : 1; /* if '1' the node is used by a pin |
204 | unsigned int in_use:1; /* if '1' the node is used by a pin |
208 | if '0' the node has had a dummy name assigned*/ |
205 | if '0' the node has had a dummy name assigned*/ |
209 | unsigned int template_flag : 1; /* used in template processing */ |
206 | unsigned int template_flag:1; /* used in template processing */ |
210 | unsigned int net_assigned : 1; /* if '1' the node (name) has a net assigned |
207 | unsigned int net_assigned:1; /* if '1' the node (name) has a net assigned |
211 | to it by routing */ |
208 | to it by routing */ |
212 | unsigned int fix_location : 1; /* if set then nets referring to this pin |
209 | unsigned int fix_location:1; /* if set then nets referring to this pin |
213 | have to be connected to it and nowhere else */ |
210 | have to be connected to it and nowhere else */ |
214 | unsigned int reservation : 1; /* mark this as a reserved pin when it is given rsvXXXX |
211 | unsigned int reservation:1; /* mark this as a reserved pin when it is given rsvXXXX ident */ |
215 | ident */ |
- | |
- | 212 | ||
216 | 213 | ||
217 | } node_t; |
214 | } node_t; |
218 | 215 | ||
- | 216 | ||
219 | /* different nets may refer to the same nodes |
217 | /* different nets may refer to the same nodes |
220 | but dependent on whether net is desired or already routed, different rules |
218 | but dependent on whether net is desired or already routed, different rules |
221 | apply */ |
219 | apply */ |
222 | 220 | ||
223 | typedef struct noderef |
221 | typedef struct noderef |
224 | { |
222 | { |
225 | struct noderef *next; |
223 | struct noderef * next; |
226 | pindir_t pindir; /* proposed pin type input ? output ? bidir ? unknown ? */ |
224 | pindir_t pindir; /* proposed pin type input ? output ? bidir ? unknown ? */ |
227 | node_t *node; |
225 | node_t * node; |
228 | struct net *join_parent; /* Which net this node reference is joined to (used in |
226 | struct net * join_parent; /* Which net this node reference is joined to (used in |
229 | alias/jumpering */ |
227 | alias/jumpering */ |
230 | struct net *net; |
228 | struct net * net; |
231 | /* the net that owns this node reference */ |
229 | /* the net that owns this node reference */ |
232 | unsigned int r_flag : 1; /* a routing flag to indicate this node has been |
230 | unsigned int r_flag:1; /* a routing flag to indicate this node has been |
233 | found already at this phase of routing */ |
231 | found already at this phase of routing */ |
234 | /* char * datatype; */ /* pointer to the data type of this node */ |
232 | /* char * datatype; */ /* pointer to the data type of this node */ |
235 | 233 | ||
236 | vhdl_t *vhdltype; /* what this now has been aliased to in VHDL */ |
234 | vhdl_t * vhdltype; /* what this now has been aliased to in VHDL */ |
237 | vhdl_t *orig_vhdltype; /* what this now has been aliased to in VHDL */ |
235 | vhdl_t * orig_vhdltype; /* what this now has been aliased to in VHDL */ |
238 | expression_t *lhs_expr; /* the expression will be copied over when routing . Bus slice |
236 | expression_t * lhs_expr; /* the expression will be copied over when routing . Bus slice on LHS of pin assignment */ |
239 | on LHS of pin assignment */ |
- | |
240 | char *orig_name; /* if this pointer is not null then the name of this reference will be |
237 | char * orig_name; /* if this pointer is not null then the name of this reference will be used |
241 | used in place of the net name when listing the nets */ |
238 | in place of the net name when listing the nets */ |
242 | 239 | ||
243 | struct noderef *base_noderef; /* used in jumpering to define original node reference |
240 | struct noderef * base_noderef; /* used in jumpering to define original node reference that will be renamed: |
244 | that will be renamed: in the original node reference |
- | |
245 | this pointer is to itself */ |
241 | in the original node reference this pointer is to itself */ |
246 | } noderef_t; |
242 | } noderef_t; |
247 | 243 | ||
- | 244 | ||
248 | /* the aliased net join means that each sub_net keeps its own |
245 | /* the aliased net join means that each sub_net keeps its own |
249 | signal name while its identiier is common. The Jumpered |
246 | signal name while its identiier is common. The Jumpered |
250 | net join means that the new signal is to be treated |
247 | net join means that the new signal is to be treated |
251 | as a new net entity */ |
248 | as a new net entity */ |
252 | 249 | ||
253 | typedef enum |
250 | typedef enum { |
254 | { |
- | |
255 | NotJoined = 0, |
251 | NotJoined=0, |
256 | Aliased, /* names are aliased onto same physical piece of wire */ |
252 | Aliased, /* names are aliased onto same physical piece of wire */ |
257 | Jumpered, /* separate wires can be joined together */ |
253 | Jumpered, /* separate wires can be joined together */ |
258 | } JoinMode_t; |
254 | } JoinMode_t; |
259 | 255 | ||
- | 256 | ||
260 | /* object net : a piece of wire connected to a set of nodes */ |
257 | /* object net : a piece of wire connected to a set of nodes */ |
261 | 258 | ||
- | 259 | ||
- | 260 | ||
262 | typedef struct net |
261 | typedef struct net |
263 | { |
262 | { |
264 | struct net *next; |
263 | struct net * next; |
265 | struct net *prev; /* demand that previous net be referred to */ |
264 | struct net * prev; /* demand that previous net be referred to */ |
266 | struct net **list_ref; /* the membership of which list: |
265 | struct net ** list_ref; /* the membership of which list: |
267 | routed_list unrouted_list named_list*/ |
266 | routed_list unrouted_list named_list*/ |
268 | char *identifier; /* e.g N1, N2 */ |
267 | char * identifier; /* e.g N1, N2 */ |
269 | char *name; /* signal names */ |
268 | char * name; /* signal names */ |
270 | HowRouted_t how_routed; /* in fact this indicates how it was routed */ |
269 | HowRouted_t how_routed; /* in fact this indicates how it was routed */ |
271 | int nodecount; /* how many nodes does this net have ? */ |
270 | int nodecount; /* how many nodes does this net have ? */ |
272 | noderef_t *nodes; /* and all the other nodes on this net */ |
271 | noderef_t * nodes; /* and all the other nodes on this net */ |
273 | struct net *join_parent; /* Which net this net is joined to (used in |
272 | struct net * join_parent; /* Which net this net is joined to (used in |
274 | alias/jumpering */ |
273 | alias/jumpering */ |
275 | struct net *subnets; /* if this net has subnets , refer to them */ |
274 | struct net * subnets; /* if this net has subnets , refer to them */ |
276 | struct net *joined_nets; /* other nets at this level of join */ |
275 | struct net * joined_nets; /* other nets at this level of join */ |
277 | struct net *unrouted_fix_net; /* is there an unrouted net fixed to this one ? */ |
276 | struct net * unrouted_fix_net; /* is there an unrouted net fixed to this one ? */ |
278 | struct net *vhdl_connect_net; /* pointer to a net connected by VHDL connection */ |
277 | struct net * vhdl_connect_net; /* pointer to a net connected by VHDL connection */ |
279 | JoinMode_t how_joined; /* if subnets, is this an alias join or a |
278 | JoinMode_t how_joined; /* if subnets, is this an alias join or a |
280 | jumpered join */ |
279 | jumpered join */ |
281 | struct net *unrouted_reference; /* points at the net that is the unrouted |
280 | struct net * unrouted_reference; /* points at the net that is the unrouted |
282 | original , if this is a routed net. */ |
281 | original , if this is a routed net. */ |
283 | node_t *external_node; /* if not null and there is a jumper then print |
282 | node_t * external_node ; /* if not null and there is a jumper then print |
284 | the external node name rather than the net name*/ |
283 | the external node name rather than the net name*/ |
285 | unsigned int nodes_reserved : 1; /* This net has been processed by the |
284 | unsigned int nodes_reserved : 1; /* This net has been processed by the ensure_reservation function in routing.c */ |
286 | ensure_reservation function in routing.c */ |
- | |
287 | unsigned int has_external : 1; /* one of the net nodes (at least) |
285 | unsigned int has_external : 1 ; /* one of the net nodes (at least) |
288 | is an external connection */ |
286 | is an external connection */ |
289 | unsigned int has_fix_location : 1; /* one of the net nodes (at least) |
287 | unsigned int has_fix_location : 1 ; /* one of the net nodes (at least) |
290 | is a FIX_LOCATION pin */ |
288 | is a FIX_LOCATION pin */ |
291 | /* expanded information for partitioning */ |
289 | /* expanded information for partitioning */ |
292 | unsigned int leaves_partition : 1; /* '1' : crosses boundary of partition*/ |
290 | unsigned int leaves_partition : 1; /* '1' : crosses boundary of partition*/ |
293 | unsigned int inside_partition : 1; /* '1' : in use as internal signal |
291 | unsigned int inside_partition : 1; /* '1' : in use as internal signal |
294 | in partition */ |
292 | in partition */ |
295 | unsigned int needs_buff_sig : 1; /* if '1' then the external connection needs a local |
293 | unsigned int needs_buff_sig: 1; /* if '1' then the external connection needs a local signal */ |
296 | signal */ |
- | |
297 | unsigned int force_port : 1; /* if '1' then the net will be forced to be a port on |
294 | unsigned int force_port: 1; /* if '1' then the net will be forced to be a port on partition */ |
298 | partition */ |
- | |
299 | unsigned int type_defined : 1; /* the signal type has been defined so does not need to |
295 | unsigned int type_defined: 1; /* the signal type has been defined so does not need to be |
300 | be patched up by guesswork in the partition |
296 | patched up by guesswork in the partition calculation Oct 2000*/ |
301 | calculation Oct 2000*/ |
- | |
302 | /* bundle structures : cause signal renaming when sockets |
297 | /* bundle structures : cause signal renaming when sockets |
303 | are converted to a wire bundle leaving the |
298 | are converted to a wire bundle leaving the |
304 | partition */ |
299 | partition */ |
305 | unsigned int bundle_member; /* set if the net is a bundle member */ |
300 | unsigned int bundle_member; /* set if the net is a bundle member */ |
306 | int bundle_index; /* the ordinal number of the pin of the bundle */ |
301 | int bundle_index; /* the ordinal number of the pin of the bundle */ |
307 | 302 | ||
308 | pindir_t ext_dir; /* basic boundary crossing direction*/ |
303 | pindir_t ext_dir; /* basic boundary crossing direction*/ |
309 | /* char * datatype; */ /* the string description of the data type */ |
304 | /* char * datatype; */ /* the string description of the data type */ |
310 | vhdl_t *vhdltype; /* what this looks like in VHDL */ |
305 | vhdl_t * vhdltype; /* what this looks like in VHDL */ |
311 | } net_t; |
306 | } net_t; |
312 | 307 | ||
313 | /* net reference list, attched to a node */ |
308 | /* net reference list, attched to a node */ |
314 | typedef struct netref |
309 | typedef struct netref |
315 | { |
310 | { |
316 | struct netref *next; |
311 | struct netref * next; |
317 | net_t *net; |
312 | net_t * net; |
318 | } netref_t; |
313 | } netref_t; |
319 | 314 | ||
- | 315 | ||
320 | /* unrouted node reference, which permits node by node pin renaming */ |
316 | /* unrouted node reference, which permits node by node pin renaming */ |
321 | 317 | ||
322 | typedef struct unrouted_ref |
318 | typedef struct unrouted_ref |
323 | { |
319 | { |
324 | struct unrouted_ref *next; |
320 | struct unrouted_ref * next; |
325 | net_t **listref; /* the root pointer of which list this unrouted reference has been |
321 | net_t ** listref; /* the root pointer of which list this unrouted reference has been added to */ |
326 | added to */ |
- | |
327 | char *identifier; /* used to point to the pin identifier before creating unrouted net |
322 | char * identifier; /* used to point to the pin identifier before creating unrouted net */ |
328 | */ |
- | |
329 | char *name; /* this is the name by which this pin shall be known */ |
323 | char * name; /* this is the name by which this pin shall be known */ |
330 | char *orig_name; /* if this pointer is not null then the name of this reference will be |
324 | char * orig_name; /* if this pointer is not null then the name of this reference will be used |
331 | used in place of the net name when creating the nets !! */ |
325 | in place of the net name when creating the nets !! */ |
332 | pindir_t pindir; /* proposed pin type input ? output ? bidir ? unknown ? */ |
326 | pindir_t pindir; /* proposed pin type input ? output ? bidir ? unknown ? */ |
333 | int pin_group; |
327 | int pin_group; |
334 | vhdl_t *vhdltype; /* what this looks like in VHDL */ |
328 | vhdl_t * vhdltype; /* what this looks like in VHDL */ |
335 | vhdl_t *orig_vhdltype; /* place holder for the signal type as originally declared */ |
329 | vhdl_t * orig_vhdltype; /* place holder for the signal type as originally declared */ |
336 | expression_t *lhs_expr; /* expression is sliced on the LHS */ |
330 | expression_t * lhs_expr; /* expression is sliced on the LHS */ |
337 | } unrouted_ref_t; |
331 | } unrouted_ref_t; |
338 | 332 | ||
- | 333 | ||
339 | /* member of list of pins that carry the same signal on a device */ |
334 | /* member of list of pins that carry the same signal on a device */ |
340 | typedef struct equivalent_node |
335 | typedef struct equivalent_node { |
341 | { |
- | |
342 | struct equivalent_node *next; |
336 | struct equivalent_node * next; |
343 | node_t *node; |
337 | node_t * node; |
344 | } equivalent_node_t; |
338 | } equivalent_node_t; |
345 | 339 | ||
346 | /* pointer to list of lists of pins that carry the same signal on a device */ |
340 | /* pointer to list of lists of pins that carry the same signal on a device */ |
347 | typedef struct equivalent_node_set |
341 | typedef struct equivalent_node_set { |
348 | { |
- | |
349 | struct equivalent_node_set *next; |
342 | struct equivalent_node_set * next; |
350 | equivalent_node_t *nodes; |
343 | equivalent_node_t * nodes; |
351 | } equivalent_node_set_t; |
344 | } equivalent_node_set_t; |
352 | 345 | ||
353 | /* a chip socket is a socket, as are all the board connectors */ |
346 | /* a chip socket is a socket, as are all the board connectors */ |
354 | /* A lastnode pointer is provided so that new nodes can be added to the */ |
347 | /* A lastnode pointer is provided so that new nodes can be added to the */ |
355 | /* end rather than the beginning of the list */ |
348 | /* end rather than the beginning of the list */ |
356 | /* reason: so that priority of assigning nodes is kept */ |
349 | /* reason: so that priority of assigning nodes is kept */ |
357 | /* this will be altered by the sorting of the nodes by identifier */ |
350 | /* this will be altered by the sorting of the nodes by identifier */ |
358 | typedef struct socket |
351 | typedef struct socket |
359 | { |
352 | { |
360 | struct socket *next; |
353 | struct socket * next; |
361 | struct socket *template_socket; /* the VHDL component for this entity if present */ |
354 | struct socket * template_socket; /* the VHDL component for this entity if present */ |
362 | char *identifier; /* e.g U1, U2 */ |
355 | char * identifier; /* e.g U1, U2 */ |
363 | char *type; |
356 | char * type; |
364 | char *name; |
357 | char * name; |
365 | char *value; |
358 | char * value; |
366 | node_t *nodes; /* the nodes attached to this chip */ |
359 | node_t * nodes; /* the nodes attached to this chip */ |
367 | node_t *lastnode; |
360 | node_t * lastnode; |
368 | unrouted_ref_t *unrouted_refs; /* when an unrouted node is read in the node is added |
361 | unrouted_ref_t * unrouted_refs; /* when an unrouted node is read in the node is added here */ |
369 | here */ |
- | |
370 | generic_info_t *generics; /* look in generic.c for more info */ |
362 | generic_info_t * generics; /* look in generic.c for more info */ |
371 | generic_info_t *unrouted_generics; /* before elaboration */ |
363 | generic_info_t * unrouted_generics;/* before elaboration */ |
372 | equivalent_node_set_t *equivalent_node_set; /* these pins carry equivalent signals |
364 | equivalent_node_set_t * equivalent_node_set; /* these pins carry equivalent signals |
373 | FPGA context : represent inner through signals |
365 | FPGA context : represent inner through signals |
374 | component context : represent external jumpers |
366 | component context : represent external jumpers |
375 | around pins of component. */ |
367 | around pins of component. */ |
376 | 368 | ||
377 | int max_pin_col; /* determine pin identifier limits for later (see sorting.c, */ |
369 | int max_pin_col; /* determine pin identifier limits for later (see sorting.c, */ |
378 | int min_pin_col; /* sorting device pin IDs for more info.) */ |
370 | int min_pin_col; /* sorting device pin IDs for more info.) */ |
379 | int max_pin_row; |
371 | int max_pin_row; |
380 | int min_pin_row; |
372 | int min_pin_row; |
381 | 373 | ||
382 | unsigned int is_FPGA : 1; /* alters interpretation of equivalent nodes */ |
374 | unsigned int is_FPGA:1; /* alters interpretation of equivalent nodes */ |
383 | 375 | ||
384 | unsigned int selected : 1; /* a '1' here is used in the VHDL printout */ |
376 | unsigned int selected:1; /* a '1' here is used in the VHDL printout */ |
385 | unsigned int is_external : 1; /* a '1' here changes the rules about external ports*/ |
377 | unsigned int is_external:1; /* a '1' here changes the rules about external ports*/ |
386 | /* If it is external then all nets attached give their |
378 | /* If it is external then all nets attached give their |
387 | names to the pins of the socket rather than calling |
379 | names to the pins of the socket rather than calling |
388 | them 'rsvXXXXXz' */ |
380 | them 'rsvXXXXXz' */ |
389 | unsigned int is_template : 1; /* this chip is a template if it is '1' */ |
381 | unsigned int is_template:1; /* this chip is a template if it is '1' */ |
390 | unsigned int socket_type_seen : 1; /* used in verilog printout to force |
382 | unsigned int socket_type_seen:1; /* used in verilog printout to force |
391 | * printout of only one instance |
383 | * printout of only one instance |
392 | * of a particular type */ |
384 | * of a particular type */ |
393 | struct socket *parent_template_ref; /* this chip is an alias template if this pointer |
385 | struct socket * parent_template_ref; /* this chip is an alias template if this pointer is non-null */ |
394 | is non-null */ |
- | |
395 | int route_flags; /* any device can have its fasttrack flags set independently */ |
386 | int route_flags; /* any device can have its fasttrack flags set independently */ |
396 | int named_in_use_cnt; /* counters used by the statistics module */ |
387 | int named_in_use_cnt; /* counters used by the statistics module */ |
397 | int named_cnt; |
388 | int named_cnt; |
398 | int routed_cnt; |
389 | int routed_cnt; |
399 | int unrouted_cnt; |
390 | int unrouted_cnt; |
400 | int lowest_bundle; /* base for bundle indices */ |
391 | int lowest_bundle; /* base for bundle indices */ |
401 | 392 | ||
402 | int highest_bundle; /* non-zero will create an external net declaration using a bus |
393 | int highest_bundle ; /* non-zero will create an external net declaration using a bus with highest_bundle -1 pins on it in the top |
403 | with highest_bundle -1 pins on it in the top level of a |
- | |
404 | partition */ |
394 | level of a partition */ |
405 | int bundle_width; /* number of valid pins in the bundle */ |
395 | int bundle_width ; /* number of valid pins in the bundle */ |
406 | } socket_t; |
396 | } socket_t; |
407 | 397 | ||
408 | /* case insensitive strcmp */ |
398 | /* case insensitive strcmp */ |
409 | extern int strcmp2 (char *s, char *t); |
399 | extern int strcmp2(char * s, char * t); |
- | 400 | ||
- | 401 | ||
410 | 402 | ||
411 | /* this is equvalent to 'strdup' but checks null pointer */ |
403 | /* this is equvalent to 'strdup' but checks null pointer */ |
412 | /* extern char * allocstr(char * s); */ |
404 | /* extern char * allocstr(char * s); */ |
413 | #define allocstr(s) ((s) == NULL ? NULL : strdup (s)) |
405 | #define allocstr(s) ((s)==NULL ? NULL : strdup(s)) |
- | 406 | ||
414 | 407 | ||
415 | extern vhdl_t *get_vhdl_buswidth (noderef_t *ref); |
- | |
416 | 408 | ||
- | 409 | ||
417 | extern void define_pin ( |
410 | extern vhdl_t * get_vhdl_buswidth( noderef_t * ref ); |
- | 411 | ||
418 | net_t **listref, |
412 | extern void define_pin(net_t ** listref, |
419 | socket_t *chip, |
413 | socket_t * chip, |
420 | char *name, |
414 | char * name, |
421 | int pin_type, |
415 | int pin_type, |
422 | int pin_group, |
416 | int pin_group, |
423 | char *identifier, |
417 | char * identifier, |
424 | vhdl_t *vhdl, |
418 | vhdl_t * vhdl, |
425 | expression_t *lhs_expr); |
419 | expression_t * lhs_expr); |
426 | 420 | ||
427 | /* this is a check on a socket ident : if it doesnt have one */ |
421 | /* this is a check on a socket ident : if it doesnt have one */ |
428 | 422 | ||
429 | extern void ensure_socket_ident (socket_t *chip); |
423 | extern void ensure_socket_ident(socket_t * chip); |
430 | 424 | ||
431 | /* a string that is suffixed to names and identifiers |
425 | /* a string that is suffixed to names and identifiers |
432 | when read in from the database */ |
426 | when read in from the database */ |
433 | 427 | ||
434 | extern void set_board_suffix (char *s); |
428 | extern void set_board_suffix(char * s); |
- | 429 | ||
435 | 430 | ||
436 | /* set the socket type for further information */ |
431 | /* set the socket type for further information */ |
437 | extern void set_socket (socket_t *socket, property_t prop, char *str); |
432 | extern void set_socket(socket_t * socket, |
- | 433 | property_t prop, |
|
- | 434 | char * str); |
|
438 | 435 | ||
439 | /* Tell the system about a new socket */ |
436 | /* Tell the system about a new socket */ |
440 | /* locate a socket by a property */ |
437 | /* locate a socket by a property */ |
441 | extern socket_t *find_socket (property_t prop, char *str, int srchonly, socket_t **head_ref); |
438 | extern socket_t * find_socket(property_t prop, |
- | 439 | char * str, |
|
- | 440 | int srchonly, |
|
- | 441 | socket_t ** head_ref); |
|
442 | 442 | ||
443 | extern void set_net (net_t *net, property_t prop, char *str); |
- | |
444 | 443 | ||
445 | extern net_t *find_net (net_t **listref, property_t prop, char *str, int srchonly); |
444 | extern void set_net(net_t * net,property_t prop,char * str); |
- | 445 | ||
- | 446 | extern net_t * find_net(net_t ** listref, |
|
- | 447 | property_t prop, |
|
- | 448 | char * str, |
|
- | 449 | int srchonly); |
|
446 | 450 | ||
447 | /* set a node property */ |
451 | /* set a node property */ |
448 | extern void set_node (node_t *node, property_t prop, char *str); |
452 | extern void set_node(node_t * node, |
- | 453 | property_t prop, |
|
- | 454 | char * str); |
|
449 | 455 | ||
450 | /* locate a node on a chip by a property */ |
456 | /* locate a node on a chip by a property */ |
451 | extern node_t *find_node (socket_t *socket, property_t prop, char *str, int srchonly); |
457 | extern node_t * find_node(socket_t * socket, |
- | 458 | property_t prop, |
|
- | 459 | char * str, |
|
- | 460 | int srchonly); |
|
452 | 461 | ||
453 | /* joins a node to a net */ |
462 | /* joins a node to a net */ |
454 | extern void connect_node_net ( |
- | |
455 | char *orig_name, /* added to allow name aliasing (this will be the OLD name ) */ |
463 | extern void connect_node_net(char * orig_name, /* added to allow name aliasing (this will be the OLD name ) */ |
456 | node_t *cnode, |
464 | node_t * cnode, |
457 | net_t *cnet, |
465 | net_t * cnet, |
458 | pindir_t pindir, |
466 | pindir_t pindir, |
459 | vhdl_t *vhdl, |
467 | vhdl_t * vhdl, |
460 | vhdl_t *orig_vhdl, |
468 | vhdl_t * orig_vhdl, |
461 | expression_t *lhs_expr); |
469 | expression_t * lhs_expr); |
- | 470 | ||
462 | 471 | ||
463 | /* remove net name attributes from the routed list */ |
472 | /* remove net name attributes from the routed list */ |
464 | extern void del_net_names (char *template); |
473 | extern void del_net_names(char * template); |
- | 474 | ||
465 | 475 | ||
466 | /* disconnect a node from the netlist */ |
476 | /* disconnect a node from the netlist */ |
467 | extern void disconnect_node (socket_t *chip, node_t *node); |
477 | extern void disconnect_node(socket_t * chip, node_t * node); |
- | 478 | ||
468 | 479 | ||
469 | /* global variables */ |
480 | /* global variables */ |
470 | /* used in setting the routing status attribute of a net */ |
481 | /* used in setting the routing status attribute of a net */ |
471 | /* these are constant strings */ |
482 | /* these are constant strings */ |
472 | /*extern char Routed[] ; */ /* "Routed" */ |
483 | /*extern char Routed[] ; */ /* "Routed" */ |
473 | /*extern char AssignedName[] ;*/ /* "Named" */ |
484 | /*extern char AssignedName[] ;*/ /* "Named" */ |
474 | /*extern char Unrouted[] ; */ /* "Unrouted" */ |
485 | /*extern char Unrouted[] ; */ /* "Unrouted" */ |
475 | 486 | ||
476 | extern socket_t *socket_head; |
- | |
477 | extern socket_t *template_head; |
- | |
478 | extern net_t *routed_list; |
- | |
479 | extern net_t *named_list; |
- | |
480 | extern net_t *named_tail; |
- | |
481 | extern net_t *unrouted_list; |
- | |
482 | 487 | ||
- | 488 | extern socket_t * socket_head; |
|
- | 489 | extern socket_t * template_head; |
|
- | 490 | extern net_t * routed_list; |
|
- | 491 | extern net_t * named_list; |
|
483 | extern char nullstr[]; |
492 | extern net_t * named_tail; |
- | 493 | extern net_t * unrouted_list; |
|
484 | 494 | ||
485 | extern char *decode_how_routed[]; |
- | |
486 | 495 | ||
- | 496 | extern char nullstr[]; |
|
- | 497 | ||
- | 498 | extern char * decode_how_routed[]; |
|
- | 499 | ||
- | 500 | ||
487 | extern char *decode_which_list (net_t **list_head); |
501 | extern char * decode_which_list(net_t ** list_head); |
- | 502 | ||
488 | 503 | ||
489 | /* this points at std_logic, std_ulogic etc */ |
504 | /* this points at std_logic, std_ulogic etc */ |
490 | extern vhdl_t *default_vhdl_datatype; |
505 | extern vhdl_t * default_vhdl_datatype; |
491 | extern vhdl_t *default_vhdl_bustype; |
506 | extern vhdl_t * default_vhdl_bustype; |
- | 507 | ||
- | 508 | extern void InitialiseData(void); |
|
- | 509 | ||
492 | 510 | ||
493 | extern void InitialiseData (void); |
- | |
494 | 511 | ||
495 | #endif |
512 | #endif |