Compare commits
2 Commits
0ef6d2f40f
...
73e4806e65
Author | SHA1 | Date | |
---|---|---|---|
73e4806e65 | |||
0b17c25ecc |
@ -299,6 +299,8 @@ static GList *append_cell(GList *curr_list, struct gds_cell **cell_ptr)
|
||||
cell->graphic_objs = NULL;
|
||||
cell->name[0] = 0;
|
||||
cell->parent_library = NULL;
|
||||
cell->checks.unresolved_child_count = GDS_CELL_CHECK_NOT_RUN;
|
||||
cell->checks.affected_by_reference_loop = GDS_CELL_CHECK_NOT_RUN;
|
||||
} else
|
||||
return NULL;
|
||||
/* return cell */
|
||||
|
@ -34,10 +34,53 @@
|
||||
*/
|
||||
|
||||
#include "gds-tree-checker.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int gds_tree_check_cell_references(struct gds_library *lib)
|
||||
{
|
||||
return 0;
|
||||
GList *cell_iter;
|
||||
struct gds_cell *cell;
|
||||
GList *instance_iter;
|
||||
struct gds_cell_instance *cell_inst;
|
||||
int total_unresolved_count = 0;
|
||||
|
||||
if (!lib)
|
||||
return -1;
|
||||
|
||||
/* Iterate over all cells in library */
|
||||
for (cell_iter = lib->cells; cell_iter != NULL; cell_iter = g_list_next(cell_iter)) {
|
||||
cell = (struct gds_cell *)cell_iter->data;
|
||||
|
||||
/* Check if this list element is broken. This should never happen */
|
||||
if (!cell) {
|
||||
fprintf(stderr, "Broken cell list item found. Will continue.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Reset the unresolved cell reference counter to 0 */
|
||||
cell->checks.unresolved_child_count = 0;
|
||||
|
||||
/* Iterate through all child cell references and check if the references are set */
|
||||
for (instance_iter = cell->child_cells; instance_iter != NULL;
|
||||
instance_iter = g_list_next(instance_iter)) {
|
||||
cell_inst = (struct gds_cell_instance *)instance_iter->data;
|
||||
|
||||
/* Check if broken. This should also not happen */
|
||||
if (!cell_inst) {
|
||||
fprintf(stderr, "Broken cell list item found in cell %s. Will continue.\n",
|
||||
cell->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check if instance is valid; else increment "error" counter of cell */
|
||||
if (!cell_inst->cell_ref) {
|
||||
total_unresolved_count++;
|
||||
cell->checks.unresolved_child_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return total_unresolved_count;
|
||||
}
|
||||
|
||||
int gds_tree_check_reference_loops(struct gds_library *lib)
|
||||
|
@ -40,6 +40,10 @@
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) /**< @brief Return smaller number */
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b)) /**< @brief Return bigger number */
|
||||
|
||||
/** @brief Defintion of check counter default value
|
||||
* that indicates that the corresponding check has not yet been executed */
|
||||
enum {GDS_CELL_CHECK_NOT_RUN = -1};
|
||||
|
||||
/** @brief Types of graphic objects */
|
||||
enum graphics_type
|
||||
{
|
||||
@ -65,8 +69,8 @@ struct gds_point {
|
||||
* @brief Stores the result of the cell checks.
|
||||
*/
|
||||
struct gds_cell_checks {
|
||||
int unresolved_child_count; /**< @brief Number of unresolved cell instances inside this cell */
|
||||
int affected_by_reference_loop; /**< @brief 1 if the cell is affected by a reference loop and therefore not renderable */
|
||||
int unresolved_child_count; /**< @brief Number of unresolved cell instances inside this cell. Default: GDS_CELL_CHECK_NOT_RUN */
|
||||
int affected_by_reference_loop; /**< @brief 1 if the cell is affected by a reference loop and therefore not renderable. Default: GDS_CELL_CHECK_NOT_RUN*/
|
||||
/**
|
||||
* @brief For the internal use of the checker.
|
||||
* @warning Do not use this structure and its contents!
|
||||
|
Loading…
Reference in New Issue
Block a user