Optional variables, Error

edx
pdk
library

#1

Hello,

In our SiEPIC EBeam PDK https://github.com/lukasc-ubc/SiEPIC_EBeam_PDK, we have an option to run Monte Carlo simulations. These require a wafer map and other MC parameters. We define these as global variables, and each component can read these variables using the %% notation, e.g., %MC_grid%. This works fine when doing Monte Carlo simulations.

However, if we start a new project with normal simulations, these variables aren’t defined. And then the components all pop up errors that the variables are undefined.

See below.

Is there another way of passing optional variables? There is a command called “exist”, but it doesn’t seem to work on these global variables. We don’t actually need the in the dialog box, but rather within the script, so perhaps there is an “exist” approach?

I tried to create a variable in the Script Prompt, e.g., a=1. I see it in the Script Workplace. But I can’t seem to access it in the components’ Setup Script.

‘ebeam_wg_integral_1550_1::MC_grid’: Error evaluating expression, MC_grid is not a valid function or variable name
’ebeam_wg_integral_1550_1::MC_resolution_x’: Error evaluating expression, MC_resolution_x is not a valid function or variable name
’ebeam_wg_integral_1550_1::MC_resolution_y’: Error evaluating expression, MC_resolution_y is not a valid function or variable name
’ebeam_wg_integral_1550_1::MC_uniformity_width’: Error evaluating expression, MC_uniformity_width is not a valid function or variable name
’ebeam_wg_integral_1550_1::MC_non_uniform’: Error evaluating expression, MC_non_uniform is not a valid function or variable name
’ebeam_wg_integral_1550_1::MC_uniformity_thickness’: Error evaluating expression, MC_uniformity_thickness is not a valid function or variable name

Thank you
Lukas


#2

Hi Lukas,

There is no easy way to optionally set the Expressions for elements. And the setup script of the compound cannot access the global variables that are defined in the scripts. The good news is that, these errors won’t affect the running of the normal simulations without MC analysis. But indeed they are annoying. I will elevate this problem up to see whether we can define a flag that controls the Expression settings. For this time being, you can manually set the variables if you want to do MC analysis in normal simulations. Please let me know if you have further problems.