Limbo 3.5.4
Loading...
Searching...
No Matches
GdsParser::GdsWriter Class Reference

#include <GdsWriter.h>

Public Member Functions

 GdsWriter (const char *filename)
 constructor
 ~GdsWriter ()
 destructor
char * gds_adjust_string (const char *input, int *output_length)
high level interfaces
void write_boundary (int layer, int datatype, std::vector< int > const &vx, std::vector< int > const &vy, bool has_last=true)
 write a boundary object
void write_box (int layer, int datatype, int xl, int yl, int xh, int yh)
 write a box object
void create_lib (const char *libname, double dbu_uu, double dbu_m)
 create GDSII library
low level interfaces
void gds_make_next_item (struct gds_itemtype **ci)
void gds_bindump (BYTE x)
void gds_write_float (double x)
void gds_swap4bytes (BYTE *four)
 swap bytes
void gds_swap2bytes (BYTE *two)
 swap bytes
void gds_write_header ()
 write HEADER
void gds_write_bgnlib ()
 write BGNLIB
void gds_write_bgnstr ()
 write BGNSTR
void gds_write_endlib ()
 write ENDLIB
void gds_write_endstr ()
 write ENDSTR
void gds_write_libname (const char *name)
 write LIBNAME
void gds_write_strname (const char *name)
 write STRNAME
void gds_write_string (const char *s)
 write STRING
void gds_write_sname (const char *s)
 write SNAME
void gds_write_boundary ()
 write BOUNDARY
void gds_write_box ()
 write BOX
void gds_write_boxtype (short int dt)
 write BOXTYPE
void gds_write_path ()
 write PATH
void gds_write_sref ()
 write SREF
void gds_write_aref ()
 write AREF
void gds_write_text ()
 write TEXT
void gds_write_endel ()
 write ENDEL
void gds_write_layer (short int layer)
 write LAYER
void gds_write_width (int width)
 write WIDTH
void gds_write_datatype (short int dt)
 write DATATYPE
void gds_write_texttype (short int dt)
 write TEXTTYPE
void gds_write_generations (short int gens)
 write GENERATIONS
void gds_write_pathtype (short int pt)
 write PATHTYPE
void gds_write_presentation (int font, int vp, int hp)
 write PRESENTATION
void gds_write_strans (BOOL reflect, BOOL abs_angle, BOOL abs_mag)
 write STRANS
void gds_write_xy (const int *x, const int *y, int n, bool has_last=true)
 write XY
void gds_write_colrow (int ncols, int nrows)
 write COLROW
void gds_write_bgnextn (int bgnextn)
 write BGNEXTN
void gds_write_endextn (int endextn)
 write ENDEXTN
void gds_write_units (double dbu_uu, double dbu_m)
 write UNITS
void gds_write_mag (double mag)
 write MAG
void gds_write_angle (double angle)
 write ANGLE
void gds_create_lib (const char *libname, double dbu_um)
 create library with name and unit
void gds_create_text (const char *str, int x, int y, int layer, int size)
 wrapper to create text

Protected Member Functions

int gds_write (const char *b, std::size_t n)
void gds_flush ()
 flush all contents in the buffer

Protected Attributes

GdsStream * m_os
 output stream
BYTE gdsswap
 moved from global variables
short gdsword
 move from global variables
std::size_t m_capacity
 output buffer capacity
std::size_t m_size
 output buffer size
char * m_buffer
 output buffer

Detailed Description

write GDSII

Definition at line 90 of file GdsWriter.h.

Constructor & Destructor Documentation

◆ GdsWriter()

GdsParser::GdsWriter::GdsWriter ( const char * filename)

constructor

Parameters
filenameoutput file name

Member Function Documentation

◆ create_lib()

void GdsParser::GdsWriter::create_lib ( const char * libname,
double dbu_uu,
double dbu_m )

create GDSII library

Parameters
libnamename of the library
dbu_uuis user unit, 1nm per bit
dbu_mis database unit in meter, usually 1e-9 this wrapper is different from gds_create_lib in terms of units

◆ gds_adjust_string()

char * GdsParser::GdsWriter::gds_adjust_string ( const char * input,
int * output_length )

handle string with odd length; generate new string output and return its length

Parameters
inputa string
output_lengthresult length
Returns
a new string

◆ gds_create_lib()

void GdsParser::GdsWriter::gds_create_lib ( const char * libname,
double dbu_um )

create library with name and unit

Parameters
libnamename of library
dbu_umdatabase unit in microns, usually 1e-6

◆ gds_create_text()

void GdsParser::GdsWriter::gds_create_text ( const char * str,
int x,
int y,
int layer,
int size )

wrapper to create text

Parameters
strtext
xx position
yy position
layerlayer
sizetext size

◆ gds_swap2bytes()

void GdsParser::GdsWriter::gds_swap2bytes ( BYTE * two)

swap bytes

Parameters
two2-byte of data

◆ gds_swap4bytes()

void GdsParser::GdsWriter::gds_swap4bytes ( BYTE * four)

swap bytes

Parameters
four4-byte of data

◆ gds_write()

int GdsParser::GdsWriter::gds_write ( const char * b,
std::size_t n )
protected

a buffered putting scheme to speedup writing

Returns
negative value if error by Yibo Lin

◆ gds_write_angle()

void GdsParser::GdsWriter::gds_write_angle ( double angle)

write ANGLE

Parameters
angleangle in degree

◆ gds_write_bgnextn()

void GdsParser::GdsWriter::gds_write_bgnextn ( int bgnextn)

write BGNEXTN

Parameters
bgnextnbegin point extension

◆ gds_write_boxtype()

void GdsParser::GdsWriter::gds_write_boxtype ( short int dt)

write BOXTYPE

Parameters
dtdata type

◆ gds_write_colrow()

void GdsParser::GdsWriter::gds_write_colrow ( int ncols,
int nrows )

write COLROW

Parameters
ncolsnumber of columns
nrowsnumber of rows

◆ gds_write_datatype()

void GdsParser::GdsWriter::gds_write_datatype ( short int dt)

write DATATYPE

Parameters
dtdata type

◆ gds_write_endextn()

void GdsParser::GdsWriter::gds_write_endextn ( int endextn)

write ENDEXTN

Parameters
endextnend point extension

◆ gds_write_generations()

void GdsParser::GdsWriter::gds_write_generations ( short int gens)

write GENERATIONS

Parameters
gensgenerations

◆ gds_write_layer()

void GdsParser::GdsWriter::gds_write_layer ( short int layer)

write LAYER

Parameters
layerlayer

◆ gds_write_libname()

void GdsParser::GdsWriter::gds_write_libname ( const char * name)

write LIBNAME

Parameters
namename of library

◆ gds_write_mag()

void GdsParser::GdsWriter::gds_write_mag ( double mag)

write MAG

Parameters
magmagnification

◆ gds_write_pathtype()

void GdsParser::GdsWriter::gds_write_pathtype ( short int pt)

write PATHTYPE

Parameters
ptpath type

◆ gds_write_presentation()

void GdsParser::GdsWriter::gds_write_presentation ( int font,
int vp,
int hp )

write PRESENTATION

Parameters
fontfont number 0, 1, 2, 3
vpvertical presentation 0 = top 1 = middle 2 = bottom
hphorizontal presentation 0 = left 1 = center 2 = right

◆ gds_write_sname()

void GdsParser::GdsWriter::gds_write_sname ( const char * s)

write SNAME

Parameters
sstring

◆ gds_write_strans()

void GdsParser::GdsWriter::gds_write_strans ( BOOL reflect,
BOOL abs_angle,
BOOL abs_mag )

write STRANS

Parameters
reflectreflect about X axis before rotation (normally false)
abs_angleangles are absolute (normally false)
abs_magmagnification (scale) is absolute (normally false)

◆ gds_write_string()

void GdsParser::GdsWriter::gds_write_string ( const char * s)

write STRING

Parameters
sstring

◆ gds_write_strname()

void GdsParser::GdsWriter::gds_write_strname ( const char * name)

write STRNAME

Parameters
namename

◆ gds_write_texttype()

void GdsParser::GdsWriter::gds_write_texttype ( short int dt)

write TEXTTYPE

Parameters
dttext type

◆ gds_write_units()

void GdsParser::GdsWriter::gds_write_units ( double dbu_uu,
double dbu_m )

write UNITS

Parameters
dbu_uudatabase unit in user units, usually 0.001
dbu_mdatabase unit in meters, usually 1e-9

◆ gds_write_width()

void GdsParser::GdsWriter::gds_write_width ( int width)

write WIDTH

Parameters
widthwidth

◆ gds_write_xy()

void GdsParser::GdsWriter::gds_write_xy ( const int * x,
const int * y,
int n,
bool has_last = true )

write XY

Parameters
xarray of x coordinates
yarray of y coordinates
nlength of array
has_lastif true, it means the last point is the same as the first point; otherwise, we need to add one point to the end.
Default value is true.

◆ write_boundary()

void GdsParser::GdsWriter::write_boundary ( int layer,
int datatype,
std::vector< int > const & vx,
std::vector< int > const & vy,
bool has_last = true )

write a boundary object

Parameters
layerlayer
datatypedata type
vxarray of x coordinates
vyarray of y coordinates
has_lastif true, it means the last point is the same as the first point; otherwise, we need to add one point to the end.
Default value is true

◆ write_box()

void GdsParser::GdsWriter::write_box ( int layer,
int datatype,
int xl,
int yl,
int xh,
int yh )

write a box object

Parameters
layerlayer
datatypedata type
xl,yl,xh,yhcoordinates of the box

Member Data Documentation

◆ gdsswap

BYTE GdsParser::GdsWriter::gdsswap
protected

moved from global variables

Definition at line 269 of file GdsWriter.h.

◆ gdsword

short GdsParser::GdsWriter::gdsword
protected

move from global variables

Definition at line 270 of file GdsWriter.h.

◆ m_buffer

char* GdsParser::GdsWriter::m_buffer
protected

output buffer

Definition at line 274 of file GdsWriter.h.

◆ m_capacity

std::size_t GdsParser::GdsWriter::m_capacity
protected

output buffer capacity

Definition at line 272 of file GdsWriter.h.

◆ m_os

GdsStream* GdsParser::GdsWriter::m_os
protected

output stream

Definition at line 267 of file GdsWriter.h.

◆ m_size

std::size_t GdsParser::GdsWriter::m_size
protected

output buffer size

Definition at line 273 of file GdsWriter.h.


The documentation for this class was generated from the following file: