@@ -1380,7 +1380,7 @@ hard_block_model *read_hard_block_model(char *name_subckt, hard_block_ports *por
1380
1380
while (vtr::fgets (buffer, READ_BLIF_BUFFER, file))
1381
1381
{
1382
1382
char *token = vtr::strtok (buffer,TOKENS, file, buffer);
1383
- // match .model followed buy the subcircuit name.
1383
+ // match .model followed by the subcircuit name.
1384
1384
if (token && !strcmp (token," .model" ) && !strcmp (vtr::strtok (NULL ,TOKENS, file, buffer), name_subckt))
1385
1385
{
1386
1386
model = (hard_block_model *)vtr::calloc (1 , sizeof (hard_block_model));
@@ -1397,28 +1397,31 @@ hard_block_model *read_hard_block_model(char *name_subckt, hard_block_ports *por
1397
1397
while (vtr::fgets (buffer, READ_BLIF_BUFFER, file))
1398
1398
{
1399
1399
char *first_word = vtr::strtok (buffer, TOKENS, file, buffer);
1400
- if (! strcmp ( first_word, " .inputs " ) )
1400
+ if (first_word)
1401
1401
{
1402
- char *name;
1403
- while ((name = vtr::strtok (NULL , TOKENS, file, buffer)))
1402
+ if (!strcmp (first_word, " .inputs" ))
1404
1403
{
1405
- model->inputs ->names = (char **)vtr::realloc (model->inputs ->names , sizeof (char *) * (model->inputs ->count + 1 ));
1406
- model->inputs ->names [model->inputs ->count ++] = vtr::strdup (name);
1404
+ char *name;
1405
+ while ((name = vtr::strtok (NULL , TOKENS, file, buffer)))
1406
+ {
1407
+ model->inputs ->names = (char **)vtr::realloc (model->inputs ->names , sizeof (char *) * (model->inputs ->count + 1 ));
1408
+ model->inputs ->names [model->inputs ->count ++] = vtr::strdup (name);
1409
+ }
1407
1410
}
1408
- }
1409
- else if (!strcmp (first_word, " .outputs" ))
1410
- {
1411
- char *name;
1412
- while ((name = vtr::strtok (NULL , TOKENS, file, buffer)))
1411
+ else if (!strcmp (first_word, " .outputs" ))
1412
+ {
1413
+ char *name;
1414
+ while ((name = vtr::strtok (NULL , TOKENS, file, buffer)))
1415
+ {
1416
+ model->outputs ->names = (char **)vtr::realloc (model->outputs ->names , sizeof (char *) * (model->outputs ->count + 1 ));
1417
+ model->outputs ->names [model->outputs ->count ++] = vtr::strdup (name);
1418
+ }
1419
+ }
1420
+ else if (!strcmp (first_word, " .end" ))
1413
1421
{
1414
- model->outputs ->names = (char **)vtr::realloc (model->outputs ->names , sizeof (char *) * (model->outputs ->count + 1 ));
1415
- model->outputs ->names [model->outputs ->count ++] = vtr::strdup (name);
1422
+ break ;
1416
1423
}
1417
1424
}
1418
- else if (!strcmp (first_word, " .end" ))
1419
- {
1420
- break ;
1421
- }
1422
1425
}
1423
1426
break ;
1424
1427
}
0 commit comments