Sentaurus Workbench Introduction Once you’ve got a simulation working successfully, you will probably want to repeat it several times under different conditions – for example, with small changes to the device structure, or with different bias voltages. Workbench gives you a convenient way of doing this. In this tutorial, we’ll set up a project to simulate charge sharing when a particle passes through a strip detector at different positions. Using Workbench, we will vary the xposition where the particle hits the detector, to see how the collected charge varies. The simulation is very similar to the example given in Introduction to Sentaurus TCAD. The project will use a Mesh stage to create the device structure, Sentaurus Device to do the simulation, and Inspect to view the output. In order to vary the position where the particle track passes through the detector, we need to make 2 changes to the simulations. Firstly, the mesh must have fine spacing in the region where the particle passes, to ensure the charge generation is accurate. Secondly, in the Sentaurus Device stage, we must alter the position where the particle hit occurs. Files Firstly, all the command files used in this simulation can be found in the folder SENTAURUS/Seminar/Workbench. Also, the folder SENTAURUS/Seminar/Tutorial contains a completed example of this project. Start – setting up Workbench Workbench can just be run with swb & When you begin, Workbench wants to know the location of the folder where your projects are kept (STDB). For now, just choose the SENTAURUS folder. If you have your own account, you can put a command to set STDB in a file like .bashrc, which will run automatically when you start a shell window. For example, the command I use to set STDB for my account at Glasgow is: STDB=/data/detdev01/dpennica/genesis_lib/DBtest export STDB Workbench environment Environment has a few main sections – Project browser – allows you to navigate through all the projects available Toolbar Current project window – this gives the tool flow, and all the nodes. Project browser Each project has its own folder. Projects can be created, deleted, moved, copied, and so on. A project can be activated by double-clicking, and other commands are available either by right-clicking the icon of the project, or using the Project menu at the top of the screen. For now, if you browse through the folders, you should find a project in the Tutorial folder called “StripDetectorShare”. This is an example of a finished project. If you want to take a look at the project, double-click on it to load it. For now, though, we want to create a new project from the beginning, so select Project->New from the top menu. Building a project The top section of the project window is where you build up a project, out of tools and paramters. Click the “no tools” box in the family tree, and then use the menu “Tool>Add” to insert a mesh stage. Then, we can add a parameter to control the position where the MIP arrives. Click on the empty box in the row immediately below the Mesh icon, then use “Parameter>Add” from the top menu. Using the dialog box, call this new parameter Xpos. Once Xpos is created, we can set its values by selecting it and using the Parameter->Add Values menu. In this simulation, we are using a strip detector with 40um spacing. Xpos=0 represents the centre of an electrode named “nplus2”. As Xpos increases, the hit position moves away from nplus2 and towards nplus3. At Xpos=20, the hit position is halfway between the two electrodes. So, we want a decent range of values ranging from 0 to 20, preferably with more points near 20um where the behaviour is more interesting. After doing this, add Sentaurus Device and Inspect stages, to give the tool flow Mesh {add Xpos parameter) -> Sentaurus Device -> Inspect. This can be done by clicking on the Mesh stage, using Tool->Add, then choosing to add a Sentaurus Device stage after the current stage, etc. Below the tool flow, we have a spreadsheet which lists all the nodes in the project. A node corresponds to a single simulation run. So, if we set the Xpos parameter to have 6 different values, we will have 6 Mesh nodes, 6 SDevice nodes and 6 Inspect nodes. If you use View->Tree options->Show node numbers you can see how the stages are numbered. Setting up each stage of the simulation Each stage in the simulation requires its own command files. These command files are similar to what would be used when running the simulations normally. The main difference is that we insert special text in place of file names, parameter values and so on. Then, when the Workbench project is “preprocessed”, it creates the command files needed for each simulation stage by replacing these commands appropriately. By right-clicking on each simulation stage (or left click then Tool menu) we can use the commands “Import file” to load a command file, or “Edit file” to look at the file in a text editor. The command files for each stage of this project have already been created – they just need to be imported to the project. They are in the folder SENTAURUS/Seminar/Workbench Mesh stage Import boundary file StripDetectorParam.bnd, and command file StripDetectorParam.cmd. Along the path of the particle, we want the mesh to have narrower spacing, so that the total no of electron hole pairs produced by the particle is correct. We have a set of refinements called “MIP1” etc. to do this. So, we want to vary the positions of these refinements, depending on Xpos. Scroll down to the end of the file. In the sections giving the placement of MIP1 etc., expressions like @<Xpos-1>@ are used to set these values. When the simulations are run, Workbench will replace these sections with the appropriate values. As well as normal mathematical expressions, you can also use logical operators like ==, >, &&. The “Reference guide” section in the Workbench manual describes other expressions that can be used. In particular, the #if, #elif, #else and #endif statements are extremely useful for making more complicated changes to the simulation. For example, we could use a variable called “Structure”: #if @< Structure==1 >@ …Some profiles and refinements… #else …A different set of profiles and refinements… #endif Sentaurus Device Use command file StripDetectorParam_Share_des.cmd In this file, we want to alter the position where the particle passes through the detector, using Xpos. Look at the HeavyIon statement. The “Position” section, which specifies where the particle arrives, uses @Xpos@ Also, the file names are replaced by @grid@, @doping@ and so on. These refer to the grid and doping files produced by the previous Mesh stage. When Workbench “preprocesses” the project, it inserts appropriate file names. By going to Edit > Tool DB > Global and looking at “file types” you can see a full list of these. Inspect stage Import StripDetectorParam_ins.cmd After doing the previous 2 stages, it would be possible to just look through the results by hand using Inspect. However, Inspect has a scripting language, which can be used to produce graphs automatically. This is described in the Inspect manual. The script here will load the current signals produced in the simulation and integrate them to find the total charge collected on each readout electrode. There is a particular command in the script, ft_scalar, which will export the calculated values of total charge into Workbench, forming a spreadsheet of results. Once this is done, View->Export allows you to write the variables to a file so you can use then in another program. In Inspect, the command Script->Record->Start will allow you to carry out a series of operations by hand, and automatically write the correct script commands to a file. This can be useful for designing new scripts. In the “Tool” menu for the Inspect stage, Edit Input->Preferences lets you choose between running in Batch or Interactive mode. In Interactive, Inspect will open and display the graphs. In Batch, it will extract the results with ft_scalar but won’t open Inspect. Preprocessing and running the project Look at the “Project” menu. First, the project must be saved, using the command Project->Save. When you do this, you need to navigate to the folder where you want to save the project, then at the end of the file path you must type a name for the project. So, try saving it under an appropriate name in the Tutorial folder, say as “StripExample” Once you’ve saved the project, there should now be a new subfolder within the “Tutorial” folder. Using Linux, look inside this folder. There should be some files inside. If you look at the text files mesh_msh.cmd, mesh_msh.bnd, sdevice_des.cmd and inspect_ins.cmd, you should see that these match the files you imported earlier. Then, try Project->Project Operations->Preprocess. When this is used, Workbench will create the command files needed to run each stage of the simulation. Now, the project folder will contain a lot of new files, starting with “pp” then a number. In Workbench, if you use View->Tree options->Show node numbers, then you can find out which files correspond to which simulation. For example, if one of the boxes under the Mesh stage is numbered n4, then there should be files named pp4_msh.bnd and pp4_msh.cmd. Take a look at some of these files, and compare them to the files you imported into the project. Statements like @<Xpos-1>@ will have been replaced by proper values. Next, try Project->Clean up. This gives you various options to delete these preprocessed files, output files and so on. One of the boxes allows you to renumber the tree. Often, when the project is first created, the numbering of the simulation phases is a bit strange, and renumbering can improve this. After doing this, you’ll need to preprocess again. It’s possible to use Project->Project Operations->Run to run the entire project. However, if you only want to run (or preprocess) some of the simulation stages, you can highlight them, right-click to get a menu, then choose run. It is also possible to preprocess or run only specific nodes, by selecting then in the spreadsheet and then right-clicking on them. In this tutorial, the Mesh and Inspect stages should run very quickly, whereas Sentaurus Device runs will probably take 10-15 minutes. So, it’s sensible to run just one Mesh stage, then the Sentaurus Device stage that follows it. Once this is done, you can run the Inspect stage. After a simulation phase is run, if you use Linux to look at the project folder, you will find output files starting with pp. You can look at these output files using Inspect, Tecplot and so on. When you run the Inspect stage, Inspect will open automatically, and the script you imported will make inspect draw some graphs automatically. Firstly, it will make graphs called signal2 and signal3, giving the readout currents on electrodes nplus2 and nplus3. Then, it integrates these signals, to give graphs called charge2 and charge3, showing the total charge collected on each readout electrode over time. After closing Inspect, the total charge collected at each electrode during each simulation will be added to the spreadsheet automatically. (This is done by a command called ft_scalar in the script.) This can be exported as a text file so that you can work with it in another package. Suggested tutorial examples Note that the Sentaurus Device stages take about 15 minutes to run each – it’s sensible just to try running one Device stage to make sure the simulations work. Using the files provided, set up a project to simulate how charge sharing in a strip detector varies with the position of the particle track and the bias voltage applied to the detector. This is similar to the project above, but with an extra parameter. Set up a strip detector simulation project to see how either the substrate thickness or the spacing between the electrodes affects charge sharing. You can use the “Save Clean as..” command to create a copy of your previous project, rather than starting from the beginning. So far, we’ve looked at using Inspect to analyse the results from sdevice. It’s also possible to add in a Tecplot stage, to produce images from the simulation using the .dat file automatically created at the end. For example, if you’ve tried to vary the spacing between the electrodes, you might want to make an image showing the electric field or potential pattern around the electrodes for each simulation. Like Inspect, Tecplot has a scripting language. This is described in a separate reference guide. Once again, the “record macro” function is very useful – start the macro recorder, go through a series of steps by hand, and the corresponding script commands will be written to a file. So, add a Tecplot stage to the end, and make a command file to produce an interesting plot. The file StripDetectorParam_tec.cmd gives some useful commands, but you should also try using the record macro function (and the Tecplot reference guide) to find out how to alter the axes, add a legend etc.