@@ -52,6 +52,7 @@ int min_mult = 0;
52
52
int *mults = NULL ;
53
53
54
54
void record_mult_distribution (nnode_t *node);
55
+ void terminate_mult_distribution ();
55
56
void init_split_multiplier (nnode_t *node, nnode_t *ptr, int offa, int a, int offb, int b, nnode_t *node_a, nnode_t *node_b);
56
57
void init_multiplier_adder (nnode_t *node, nnode_t *parent, int a, int b);
57
58
void split_multiplier_a (nnode_t *node, int a0, int a1, int b);
@@ -275,14 +276,9 @@ void instantiate_simple_soft_multiplier(nnode_t *node, short mark, netlist_t *ne
275
276
*-------------------------------------------------------------------------*/
276
277
void init_mult_distribution ()
277
278
{
278
- int i, j;
279
-
280
279
oassert (hard_multipliers != NULL );
281
- mults = (int *)vtr::malloc (sizeof (int ) * (hard_multipliers->inputs ->size + 1 ) * (1 + hard_multipliers->inputs ->next ->size ));
282
- for (i = 0 ; i <= hard_multipliers->inputs ->size ; i++)
283
- for (j = 0 ; j <= hard_multipliers->inputs ->next ->size ; j++)
284
- mults[i * hard_multipliers->inputs ->size + j] = 0 ;
285
- return ;
280
+ int len = ( 1 + hard_multipliers->inputs ->size ) * ( 1 + hard_multipliers->inputs ->next ->size );
281
+ mults = (int *)vtr::calloc (len, sizeof (int ));
286
282
}
287
283
288
284
/* ---------------------------------------------------------------------------
@@ -327,7 +323,7 @@ void report_mult_distribution()
327
323
}
328
324
printf (" \n " );
329
325
printf (" \n Total # of multipliers = %ld\n " , num_total);
330
- return ;
326
+ vtr::free (mults) ;
331
327
}
332
328
333
329
/* ---------------------------------------------------------------------------
0 commit comments