Download (as "aref.txt") aref
#!/usr/bin/perl -w
# GDSII generation
# Most simple example, have box-500 structure and it is placed
# at the center of TOP structure
use GDS2; # --- enable GDSII (GDS2) library
# strict checks variable declaration and subroutine argument consistency
use strict;
my $VERSION = "2018-10-24 01:47" ; # written by emacs time-stamp
## --------------------------------------------
## M A I N R O U T I N E
## --------------------------------------------
my ($gds2File); # --- file handle
# 出力名を 「自分の名前.gds」 に設定します。ただし、もし、 .txt が付いていたら、それは先に削除します。
my $filename = $0; # --- set filename with the same as this script
$filename =~ s/.txt$//; # --- Strip '.txt' part
# $ は行末を意味します
$filename .= '.gds'; # . connects string
$gds2File = new GDS2(-fileName=> '>'. $filename); # --- open new GDS2 (object) to write
$gds2File -> printInitLib(-name=>'LibraryName'); # --- always necessary for start
$gds2File -> printBgnstr( -name=> 'box-500'); # --- Start new structure
$gds2File -> printBoundary(
-xy=> [-250, -250,
250, -250,
250, 250,
-250, 250]);
# --- Boundary with four coordinate
$gds2File -> printEndstr(); # --- End of this new structure
# ----------------------------------
# |<----------------------------------------->| 5 um
# -- +---+ +---+ +---+ +---+ +---+
# | | | | | | | | | |
# +---+ +---+ +---+ +---+ +---+
# x
# +---+ +---+ +---+ +---+ +---+
# | + | | | | | | | | |
# +---+ +---+ +---+ +---+ +---+ +---+
# ^ ^
# ---
# ----------------------------------
$gds2File -> printBgnstr( -name=> 'TOP'); # --- Start another structure
$gds2File -> printAref( # --- Place structure reference
-name => 'box-500', # --- of name 'box-500
-columns => 5,
-rows => 2,
-xy => [-2000, -500,
3000, -500,
-2000, 1500,]
);
# 何も考えないと 1000 x 5, 1000 x 2 で 5000 x 2000 の大きさになる
# -2500, -1000
# 2500, -1000
# -2500, 1000
# ところ、が、それは空きの(間の)空白も含んだ数え方なので、 最後の 500 x 500 には
# 何も置かれない
# これを パターン + 空白部分 = (1um) の半分ずつ上、右にうごかすと、上の値になる
$gds2File -> printEndstr; # --- End 'TOP' structure
$gds2File -> printEndlib(); # --- close library
__END__
|