GDS-Render v1.2.1
|
Data Structures | |
struct | gds_cell_array_instance |
Struct representing an array instantiation. More... | |
struct | gds_point |
A point in the 2D plane. Sometimes referred to as vertex. More... | |
struct | gds_cell_checks |
Stores the result of the cell checks. More... | |
struct | gds_time_field |
Date information for cells and libraries. More... | |
struct | gds_graphics |
A GDS graphics object. More... | |
struct | gds_cell_instance |
This represents an instanc of a cell inside another cell. More... | |
struct | gds_cell |
A Cell inside a gds_library. More... | |
struct | gds_library |
GDS Toplevel library. More... | |
Macros | |
#define | GDS_DEFAULT_UNITS (10E-9) |
Default units assumed for library. More... | |
#define | GDS_ERROR(fmt, ...) printf("[PARSE_ERROR] " fmt "\n", ##__VA_ARGS__) |
Print GDS error. More... | |
#define | GDS_WARN(fmt, ...) printf("[PARSE_WARNING] " fmt "\n", ##__VA_ARGS__) |
Print GDS warning. More... | |
#define | GDS_INF(fmt, ...) |
#define | GDS_PRINT_DEBUG_INFOS (0) |
1: Print infos, 0: Don't print More... | |
#define | CELL_NAME_MAX (100) |
Maximum length of a gds_cell::name or a gds_library::name. More... | |
#define | MIN(a, b) (((a) < (b)) ? (a) : (b)) |
Return smaller number. More... | |
#define | MAX(a, b) (((a) > (b)) ? (a) : (b)) |
Return bigger number. More... | |
Enumerations | |
enum | gds_record { INVALID = 0x0000 , HEADER = 0x0002 , BGNLIB = 0x0102 , LIBNAME = 0x0206 , UNITS = 0x0305 , ENDLIB = 0x0400 , BGNSTR = 0x0502 , STRNAME = 0x0606 , ENDSTR = 0x0700 , BOUNDARY = 0x0800 , PATH = 0x0900 , SREF = 0x0A00 , ENDEL = 0x1100 , XY = 0x1003 , MAG = 0x1B05 , ANGLE = 0x1C05 , SNAME = 0x1206 , STRANS = 0x1A01 , BOX = 0x2D00 , LAYER = 0x0D02 , DATATYPE = 0x0E02 , WIDTH = 0x0F03 , PATHTYPE = 0x2102 , COLROW = 0x1302 , AREF = 0x0B00 } |
enum | { GDS_CELL_CHECK_NOT_RUN = -1 } |
Defintion of check counter default value that indicates that the corresponding check has not yet been executed. More... | |
enum | graphics_type { GRAPHIC_PATH = 0 , GRAPHIC_POLYGON = 1 , GRAPHIC_BOX = 2 } |
Types of graphic objects. More... | |
enum | path_type { PATH_FLUSH = 0 , PATH_ROUNDED = 1 , PATH_SQUARED = 2 } |
Defines the line caps of a path. More... | |
Functions | |
static int | name_cell_ref (struct gds_cell_instance *cell_inst, unsigned int bytes, char *data) |
Name cell reference. More... | |
static int | name_array_cell_ref (struct gds_cell_array_instance *cell_inst, unsigned int bytes, char *data) |
Name cell reference. More... | |
static double | gds_convert_double (const char *data) |
Convert GDS 8-byte real to double. More... | |
static signed int | gds_convert_signed_int (const char *data) |
Convert GDS INT32 to int. More... | |
static int16_t | gds_convert_signed_int16 (const char *data) |
Convert GDS INT16 to int16. More... | |
static uint16_t | gds_convert_unsigned_int16 (const char *data) |
Convert GDS UINT16 String to uint16. More... | |
static GList * | append_library (GList *curr_list, struct gds_library **library_ptr) |
Append library to list. More... | |
static GList * | prepend_graphics (GList *curr_list, enum graphics_type type, struct gds_graphics **graphics_ptr) |
Prepend graphics to list. More... | |
static GList * | append_vertex (GList *curr_list, int x, int y) |
Appends vertext List. More... | |
static GList * | append_cell (GList *curr_list, struct gds_cell **cell_ptr) |
append_cell Append a gds_cell to a list More... | |
static GList * | append_cell_ref (GList *curr_list, struct gds_cell_instance **instance_ptr) |
Append a cell reference to the reference GList. More... | |
static int | name_library (struct gds_library *current_library, unsigned int bytes, char *data) |
Name a gds_library. More... | |
static int | name_cell (struct gds_cell *cell, unsigned int bytes, char *data, struct gds_library *lib) |
Names a gds_cell. More... | |
static void | parse_reference_list (gpointer gcell_ref, gpointer glibrary) |
Search for cell reference gcell_ref in glibrary . More... | |
static void | scan_cell_reference_dependencies (gpointer gcell, gpointer library) |
Scans cell references inside cell This function searches all the references in gcell and updates the gds_cell_instance::cell_ref field in each instance. More... | |
static void | scan_library_references (gpointer library_list_item, gpointer user) |
Scans library's cell references. More... | |
static void | gds_parse_date (const char *buffer, int length, struct gds_time_field *mod_date, struct gds_time_field *access_date) |
gds_parse_date More... | |
static void | convert_aref_to_sref (struct gds_cell_array_instance *aref, struct gds_cell *container_cell) |
Convert AREF to a bunch of SREFs and append them to container_cell . More... | |
int | parse_gds_from_file (const char *filename, GList **library_array) |
Parse a GDS file. More... | |
static void | delete_cell_inst_element (struct gds_cell_instance *cell_inst) |
delete_cell_inst_element More... | |
static void | delete_vertex (struct gds_point *vertex) |
delete_vertex More... | |
static void | delete_graphics_obj (struct gds_graphics *gfx) |
delete_graphics_obj More... | |
static void | delete_cell_element (struct gds_cell *cell) |
delete_cell_element More... | |
static void | delete_library_element (struct gds_library *lib) |
delete_library_element More... | |
int | clear_lib_list (GList **library_list) |
Deletes all libraries including cells, references etc. More... | |
int | gds_tree_check_cell_references (struct gds_library *lib) |
gds_tree_check_cell_references checks if all child cell references can be resolved in the given library More... | |
static int | gds_tree_check_list_contains_cell (GList *list, struct gds_cell *cell) |
Check if list contains a cell. More... | |
static int | gds_tree_check_iterate_ref_and_check (struct gds_cell *cell_to_check, GList **visited_cells) |
This function follows down the reference list of a cell and marks each visited subcell and detects loops. More... | |
int | gds_tree_check_reference_loops (struct gds_library *lib) |
gds_tree_check_reference_loops checks if the given library contains reference loops More... | |
#define CELL_NAME_MAX (100) |
Maximum length of a gds_cell::name or a gds_library::name.
Definition at line 37 of file gds-types.h.
#define GDS_DEFAULT_UNITS (10E-9) |
Default units assumed for library.
Definition at line 51 of file gds-parser.c.
#define GDS_ERROR | ( | fmt, | |
... | |||
) | printf("[PARSE_ERROR] " fmt "\n", ##__VA_ARGS__) |
Print GDS error.
Definition at line 53 of file gds-parser.c.
#define GDS_INF | ( | fmt, | |
... | |||
) |
Definition at line 60 of file gds-parser.c.
#define GDS_PRINT_DEBUG_INFOS (0) |
1: Print infos, 0: Don't print
Definition at line 38 of file gds-parser.h.
#define GDS_WARN | ( | fmt, | |
... | |||
) | printf("[PARSE_WARNING] " fmt "\n", ##__VA_ARGS__) |
Print GDS warning.
Definition at line 54 of file gds-parser.c.
#define MAX | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Return bigger number.
Definition at line 41 of file gds-types.h.
#define MIN | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Return smaller number.
Definition at line 40 of file gds-types.h.
anonymous enum |
Defintion of check counter default value that indicates that the corresponding check has not yet been executed.
Enumerator | |
---|---|
GDS_CELL_CHECK_NOT_RUN |
Definition at line 45 of file gds-types.h.
enum gds_record |
Enumerator | |
---|---|
INVALID | |
HEADER | |
BGNLIB | |
LIBNAME | |
UNITS | |
ENDLIB | |
BGNSTR | |
STRNAME | |
ENDSTR | |
BOUNDARY | |
PATH | |
SREF | |
ENDEL | |
XY | |
MAG | |
ANGLE | |
SNAME | |
STRANS | |
BOX | |
LAYER | |
DATATYPE | |
WIDTH | |
PATHTYPE | |
COLROW | |
AREF |
Definition at line 62 of file gds-parser.c.
enum graphics_type |
Types of graphic objects.
Enumerator | |
---|---|
GRAPHIC_PATH | Path. Esentially a line. |
GRAPHIC_POLYGON | An arbitrary polygon. |
GRAPHIC_BOX | A rectangle.
|
Definition at line 48 of file gds-types.h.
enum path_type |
Defines the line caps of a path.
Enumerator | |
---|---|
PATH_FLUSH | |
PATH_ROUNDED | |
PATH_SQUARED |
Definition at line 58 of file gds-types.h.
|
static |
append_cell Append a gds_cell to a list
Usage similar to append_cell_ref().
curr_list | List containing gds_cell elements. May be NULL |
cell_ptr | newly created cell |
Definition at line 344 of file gds-parser.c.
|
static |
Append a cell reference to the reference GList.
Appends a new gds_cell_instance to curr_list
and returns the new element via instance_ptr
curr_list | List of gds_cell_instance elements. May be NULL |
instance_ptr | newly created element |
Definition at line 373 of file gds-parser.c.
|
static |
Append library to list.
curr_list | List containing gds_library elements. May be NULL. |
library_ptr | Return of newly created library. |
Definition at line 269 of file gds-parser.c.
|
static |
Appends vertext List.
curr_list | List containing gds_point elements. May be NULL. |
x | x-coordinate of new point |
y | y-coordinate of new point |
Definition at line 323 of file gds-parser.c.
int clear_lib_list | ( | GList ** | library_list | ) |
Deletes all libraries including cells, references etc.
library_list | Pointer to a list of gds_library. Is set to NULL after completion. |
Definition at line 1146 of file gds-parser.c.
|
static |
Convert AREF to a bunch of SREFs and append them to container_cell
.
This function converts a single array reference (aref
) to gds_cell_array_instance::rows * gds_cell_array_instance::columns single references (SREFs). See gds_cell_instance.
Both gds_cell_array_instance::rows and gds_cell_array_instance::columns must be larger than zero.
[in] | aref | Array reference to parse |
[in] | container_cell | cell to add the converted single references to. |
Definition at line 575 of file gds-parser.c.
|
static |
delete_cell_element
cell |
Definition at line 1122 of file gds-parser.c.
|
static |
delete_cell_inst_element
cell_inst |
Definition at line 1089 of file gds-parser.c.
|
static |
delete_graphics_obj
gfx |
Definition at line 1109 of file gds-parser.c.
|
static |
delete_library_element
lib |
Definition at line 1136 of file gds-parser.c.
|
static |
delete_vertex
vertex |
Definition at line 1099 of file gds-parser.c.
|
static |
Convert GDS 8-byte real to double.
data | 8 Byte GDS real |
Definition at line 172 of file gds-parser.c.
|
static |
Convert GDS INT32 to int.
data | Buffer containing the int |
Definition at line 217 of file gds-parser.c.
|
static |
Convert GDS INT16 to int16.
data | Buffer containing the INT16 |
Definition at line 238 of file gds-parser.c.
|
static |
Convert GDS UINT16 String to uint16.
data | Buffer containing the uint16 |
Definition at line 253 of file gds-parser.c.
|
static |
gds_parse_date
buffer | Buffer that contains the GDS Date field |
length | Length of buffer |
mod_date | Modification Date |
access_date | Last Access Date |
Definition at line 530 of file gds-parser.c.
int gds_tree_check_cell_references | ( | struct gds_library * | lib | ) |
gds_tree_check_cell_references checks if all child cell references can be resolved in the given library
This function will only mark cells that directly contain unresolved references.
If a cell contains a reference to a cell with unresolved references, it is not flagged.
lib | The GDS library to check |
Definition at line 40 of file gds-tree-checker.c.
|
static |
This function follows down the reference list of a cell and marks each visited subcell and detects loops.
cell_to_check | The cell to check for reference loops |
visited_cells | Pointer to list head. May be zero. |
Definition at line 111 of file gds-tree-checker.c.
|
static |
Check if list contains a cell.
list | GList to check. May be a null pointer |
cell | Cell to check for |
Definition at line 93 of file gds-tree-checker.c.
int gds_tree_check_reference_loops | ( | struct gds_library * | lib | ) |
gds_tree_check_reference_loops checks if the given library contains reference loops
lib | GDS library |
Definition at line 158 of file gds-tree-checker.c.
|
static |
Name cell reference.
cell_inst | Cell reference |
bytes | Length of name |
data | Name |
Definition at line 144 of file gds-parser.c.
|
static |
Names a gds_cell.
cell | Cell to name |
bytes | Length of name |
data | Name |
lib | Library in which cell is located |
Definition at line 432 of file gds-parser.c.
|
static |
Name cell reference.
cell_inst | Cell reference |
bytes | Length of name |
data | Name |
Definition at line 114 of file gds-parser.c.
|
static |
Name a gds_library.
current_library | Library to name |
bytes | Lenght of name |
data | Name |
Definition at line 401 of file gds-parser.c.
int parse_gds_from_file | ( | const char * | filename, |
GList ** | library_array | ||
) |
Parse a GDS file.
This function parses a GDS File and creates a list of libraries, which then contain the different cells.
The function appends The detected libraries to the library_array
list. The library array may be empty, meaning *library_list may be NULL.
[in] | filename | Path to the GDS file |
[in,out] | library_array | GList Pointer. |
Definition at line 620 of file gds-parser.c.
|
static |
Search for cell reference gcell_ref
in glibrary
.
Search cell referenced by gcell_ref
inside glibrary
and update gds_cell_instance::cell_ref with found gds_cell
gcell_ref | gpointer cast of struct gds_cell_instance * |
glibrary | gpointer cast of struct gds_library * |
Definition at line 464 of file gds-parser.c.
|
static |
Prepend graphics to list.
curr_list | List containing gds_graphics elements. May be NULL |
type | Type of graphics |
graphics_ptr | newly created graphic is written here |
Definition at line 294 of file gds-parser.c.
|
static |
Scans cell references inside cell This function searches all the references in gcell
and updates the gds_cell_instance::cell_ref field in each instance.
gcell | pointer cast of gds_cell * |
library | Library where the cell references are searched in |
Definition at line 496 of file gds-parser.c.
|
static |
Scans library's cell references.
This function searches all the references between cells and updates the gds_cell_instance::cell_ref field in each instance
library_list_item | List containing gds_library elements |
user | not used |
Definition at line 514 of file gds-parser.c.