18
18
#include " read_xml_arch_file.h"
19
19
20
20
#include " path_delay.h"
21
- /* ************ Variables (globals) shared by all path_delay modules **********/
22
-
23
- int num_tnode_levels; /* Number of levels in the timing graph. */
24
-
25
- vtr::t_ivec *tnodes_at_level;
26
- /* [0..num__tnode_levels - 1]. Count and list of tnodes at each level of
27
- * the timing graph, to make topological searches easier. Level-0 nodes are
28
- * sources to the timing graph (types TN_FF_SOURCE, TN_INPAD_SOURCE
29
- * and TN_CONSTANT_GEN_SOURCE). Level-N nodes are in the immediate fanout of
30
- * nodes with level at most N-1. */
31
-
32
21
/* ****************** Subroutines local to this module ************************/
33
22
34
23
static int *alloc_and_load_tnode_fanin_and_check_edges (int *num_sinks_ptr);
@@ -122,7 +111,7 @@ int alloc_and_load_timing_graph_levels(void) {
122
111
i;
123
112
t_tedge *tedge;
124
113
125
- auto & timing_ctx = g_vpr_ctx.timing ();
114
+ auto & timing_ctx = g_vpr_ctx.mutable_timing ();
126
115
127
116
/* [0..timing_ctx.num_tnodes-1]. # of in-edges to each tnode that have not yet been *
128
117
* seen in this traversal. */
@@ -137,7 +126,7 @@ int alloc_and_load_timing_graph_levels(void) {
137
126
* Temporarily need one extra level on the end because I look at the first *
138
127
* empty level. */
139
128
140
- tnodes_at_level = (vtr::t_ivec *) vtr::malloc (
129
+ timing_ctx. tnodes_at_level = (vtr::t_ivec *) vtr::malloc (
141
130
(timing_ctx.num_tnodes + 1 ) * sizeof (vtr::t_ivec));
142
131
143
132
/* Scan through the timing graph, putting all the primary input nodes (no *
@@ -154,16 +143,16 @@ int alloc_and_load_timing_graph_levels(void) {
154
143
}
155
144
156
145
alloc_ivector_and_copy_int_list (&nodes_at_level_head, num_at_level,
157
- &tnodes_at_level[0 ], &free_list_head);
146
+ &timing_ctx. tnodes_at_level [0 ], &free_list_head);
158
147
159
148
num_levels = 0 ;
160
149
161
150
while (num_at_level != 0 ) { /* Until there's nothing in the queue. */
162
151
num_levels++;
163
152
num_at_level = 0 ;
164
153
165
- for (i = 0 ; i < tnodes_at_level[num_levels - 1 ].nelem ; i++) {
166
- inode = tnodes_at_level[num_levels - 1 ].list [i];
154
+ for (i = 0 ; i < timing_ctx. tnodes_at_level [num_levels - 1 ].nelem ; i++) {
155
+ inode = timing_ctx. tnodes_at_level [num_levels - 1 ].list [i];
167
156
tedge = timing_ctx.tnodes [inode].out_edges ;
168
157
num_edges = timing_ctx.tnodes [inode].num_edges ;
169
158
@@ -182,12 +171,11 @@ int alloc_and_load_timing_graph_levels(void) {
182
171
}
183
172
184
173
alloc_ivector_and_copy_int_list (&nodes_at_level_head, num_at_level,
185
- &tnodes_at_level[num_levels], &free_list_head);
174
+ &timing_ctx. tnodes_at_level [num_levels], &free_list_head);
186
175
}
187
176
188
- tnodes_at_level = (vtr::t_ivec *) vtr::realloc (tnodes_at_level,
189
- num_levels * sizeof (vtr::t_ivec));
190
- num_tnode_levels = num_levels;
177
+ timing_ctx.tnodes_at_level = (vtr::t_ivec *) vtr::realloc (timing_ctx.tnodes_at_level , num_levels * sizeof (vtr::t_ivec));
178
+ timing_ctx.num_tnode_levels = num_levels;
191
179
192
180
free (tnode_fanin_left);
193
181
free_int_list (&free_list_head);
@@ -213,8 +201,8 @@ void check_timing_graph() {
213
201
214
202
/* TODO: Rework error checks for I/Os*/
215
203
216
- for (ilevel = 0 ; ilevel < num_tnode_levels; ilevel++)
217
- num_tnodes_check += tnodes_at_level[ilevel].nelem ;
204
+ for (ilevel = 0 ; ilevel < timing_ctx. num_tnode_levels ; ilevel++)
205
+ num_tnodes_check += timing_ctx. tnodes_at_level [ilevel].nelem ;
218
206
219
207
if (num_tnodes_check != timing_ctx.num_tnodes ) {
220
208
vtr::printf_error (__FILE__, __LINE__,
0 commit comments