It looks like you're new here. If you want to get involved, click one of these buttons!
I'm wondering how can I use the layer mapping function in ruby script.
I have a GDS database (source: foundry A) want to map the layer to other GDS database (target: foundry
1. grep all layer from source
2. map for related layer to target
3. loop #1 & #2 until got all layer
Now I just finish #1. I got the correct info while "puts" the related source layer info.
The problem I met is I can't use create_full to map
def joFileWpath(filePath,file)
fileWpath = File.join(File.dirname(filePath+"/ruby.rb"),file)
return fileWpath
end
module MyMacro
include RBA
lo = LoadLayoutOptions::new
layout = Layout::new # read the layout
if $gds_in
gds_in = $gds_in # user define of GDSII input file
else
puts "You can input your gds file, (default: TOP_POLT.gds)"
gds_in = "test.gds" # default of GDSII input file
end
workDir = File.expand_path(File.dirname(__FILE__))
layout.read(joFileWpath(workDir+"/gdsii",gds_in),lo)
lm = LayerMapping::new
layer_indexes = layout.layer_indexes
lenOfLindex = layer_indexes.length
layer_indexes.sort{|a,b| a<=>b}.each do |indx|
layer_info = layout.get_info(indx)
puts "Layer:"+layer_info.to_s+";"+layer_info.layer.to_s+"\n"
lm.create_full(70,0 , layer_info) # this is a test case only, layer:70; datatype:0, finally would change to variable
end
end
Got the error if set 70,0 (layer & datatype)
Got the error if set 70 (layer only)
How can I map the layer from source to target??
Comments
I'd try another method to map layer & datatype, but I still can't find the correct command.
The plot file like this:
diff,1,0,10,0
m1,7,0,11,0
....
....
The new code as below:
Hi,
You code is basically just missing the "set_info" statement which sets the modified layer information after you have modified it:
But there is an easier way to achieve this: by setting a layer mapping on the reader options:
The "map" method maps an input layer to an output layer. The arguments are:
LayerInfo
object representing the source layer from your layoutLayerInfo
object representing the layer under which the layer is stored in the layoutJust use the "lo" object in "read" and your layers will be translated upon reading. No need to modify them later.
Matthias