@@ -26,9 +26,8 @@ using fio::Fio;
26
26
27
27
int PinPlacer::map_clocks () {
28
28
uint16_t tr = ltrace ();
29
- auto & ls = lout ();
30
29
if (tr >= 4 ) {
31
- lputs ( );
30
+ flush_out ( true );
32
31
lputs (" PinPlacer::map_clocks().." );
33
32
}
34
33
@@ -40,6 +39,7 @@ int PinPlacer::map_clocks() {
40
39
if (not constraint_xml_requested) {
41
40
if (tr >= 4 )
42
41
lputs (" PinPlacer::map_clocks() returns NOP" );
42
+ flush_out (false );
43
43
return 0 ;
44
44
}
45
45
@@ -49,11 +49,13 @@ int PinPlacer::map_clocks() {
49
49
}
50
50
51
51
if (tr >= 3 )
52
- ls << " PinPlacer::map_clocks() returns OK" << endl;
52
+ lputs (" PinPlacer::map_clocks() returns OK" );
53
+ flush_out (false );
53
54
return 1 ;
54
55
}
55
56
56
57
int PinPlacer::write_clocks_logical_to_physical () {
58
+ flush_out (false );
57
59
uint16_t tr = ltrace ();
58
60
auto & ls = lout ();
59
61
string cur_dir = get_CWD ();
@@ -66,8 +68,11 @@ int PinPlacer::write_clocks_logical_to_physical() {
66
68
string clkmap_fn = cl_.get_param (" --clk_map" );
67
69
68
70
if (not Fio::regularFileExists (clkmap_fn)) {
69
- CERROR << " no such file (--clk_map): " << clkmap_fn << endl;
70
- ls << " [Error] no such file (--clk_map): " << clkmap_fn << endl;
71
+ flush_out (true );
72
+ err_puts ();
73
+ lprintf2 (" [Error] no such file (--clk_map): %s\n " , clkmap_fn.c_str ());
74
+ err_puts ();
75
+ flush_out (true );
71
76
return -1 ;
72
77
}
73
78
@@ -86,7 +91,7 @@ int PinPlacer::write_clocks_logical_to_physical() {
86
91
} else {
87
92
ls << " \n pin_c WARNING: --clk_map file is not readable: " << clkmap_fn << endl;
88
93
}
89
- ls << endl ;
94
+ flush_out ( true ) ;
90
95
}
91
96
92
97
// read clkmap file
@@ -178,7 +183,7 @@ int PinPlacer::write_clocks_logical_to_physical() {
178
183
for (const auto & tcmd : tokenized_cmds) {
179
184
assert (tcmd.size () < USHRT_MAX);
180
185
uint sz = tcmd.size ();
181
- if (tr >= 5 ) {
186
+ if (tr >= 6 ) {
182
187
logVec (tcmd, " tcmd: " );
183
188
lprintf (" \t tcmd.size()= %u\n " , sz);
184
189
}
@@ -198,16 +203,36 @@ int PinPlacer::write_clocks_logical_to_physical() {
198
203
}
199
204
}
200
205
}
206
+
207
+ if (tr >= 3 ) {
208
+ flush_out (true );
209
+ lprintf (" clock mapping: # user-design clocks = %zu # device clocks = %zu" ,
210
+ udes_clocks.size (), pdev_clocks.size ());
211
+ }
201
212
if (tr >= 4 ) {
202
- lprintf (" \n udes_clocks.size()= %zu pdev_clocks.size()= %zu\n " ,
213
+ flush_out (true );
214
+ lprintf (" udes_clocks.size()= %zu pdev_clocks.size()= %zu\n " ,
203
215
udes_clocks.size (), pdev_clocks.size ());
216
+ flush_out (true );
204
217
logVec (udes_clocks, " udes_clocks: " );
218
+ flush_out (true );
205
219
logVec (pdev_clocks, " pdev_clocks: " );
220
+ flush_out (true );
206
221
}
207
- assert (udes_clocks. size () == pdev_clocks. size ());
222
+
208
223
if (udes_clocks.empty ()) {
209
- CERROR << " no clocks in file (--clk_map): " << clkmap_fn << endl;
210
- ls << " [Error] no clocks in file (--clk_map): " << clkmap_fn << endl;
224
+ flush_out (true ); err_puts ();
225
+ lprintf2 (" [Error] no clocks in file (--clk_map): %s\n " , clkmap_fn.c_str ());
226
+ err_puts (); flush_out (true );
227
+ return -1 ;
228
+ }
229
+ if (udes_clocks.size () != pdev_clocks.size ()) {
230
+ flush_out (true ); err_puts ();
231
+ lprintf2 (" [Error] reading --clk_map file: %s\n " , clkmap_fn.c_str ());
232
+ flush_out (true ); err_puts ();
233
+ lprintf2 (" [Error] number of user-design clocks (%zu) does not match number of device clocks (%zu)\n " ,
234
+ udes_clocks.size (), pdev_clocks.size ());
235
+ err_puts (); flush_out (true );
211
236
return -1 ;
212
237
}
213
238
@@ -293,6 +318,7 @@ int PinPlacer::write_clocks_logical_to_physical() {
293
318
if (tr >= 4 )
294
319
lprintf (" pin_c: current directory= %s\n " , cur_dir.c_str ());
295
320
321
+ flush_out (false );
296
322
return 1 ;
297
323
}
298
324
0 commit comments