Cross Section View - 2D

edited June 2010 in KLayout Development
Hi,

I am looking for a feature where the user draw a virtual horizontal or vertical line (w/ may be some limit in the length) and the tool display in another panel the vertical cross section of that part of the layout.
Of course the user must provide somewhere the thickness of the different layers and the height from the substrate to (in the layer property file ?)
I was wondering if it will be possible to implement a feature like that ?

Of course, the ultimate goal will be to have a 3D view of that portion of the layout :-)))

Thanks,
Jo

Comments

  • edited November -1

    Hi Joachim,

    I had a couple of discussions about the feature already. It looks like you're not the only one looking for that :-)

    Technically the issue is not to provide an interface to the layout but rather to implement a more or less reasonable cross section generation algorithm and to interface to a technology description.

    Any hints about the algorithm/requirements?

    Best regards,

    Matthias

  • edited November -1
    Me too please - as realistic as practical, which means a good few masking operations and polygon re-shaping methods, plus a fairly complex technology description - a huge task unless you can find an ally... ;-)
  • edited November -1
    Hi Matthias,

    I am referring to Joaquim's request above. I think it would be most practical to be compliant with an itf description (already because this is the kind of information that will usually be accessible).

    In reality I might skip many options there and stick with a simple sequence of conformal and non-conformal intermetal dielectrics. (But maybe other users closer to PFA will appreciate the option to specify side-wall and top-thicknesses or tapering...)

    Best regards
    Alex
  • edited June 2010

    Hi all,

    After thinking somewhat about that request, I think I can come up with a very simple solution.

    IMHO it is possible to emulate the process stack more or less using the boolean and sizing functions already built into KLayout. I have performed some experiments. Have a look at the screenshot about one result.

    The underlying concept is to create a vertical cut where polygons represent the materials. A ruler specifies the cut line in the original layout. A ruby script creates the material geometry and provides methods to simulate the process steps in a very simple way. It produces a new "layout" in a new panel. This way, rulers, layer (=material) coloring, screenshot and other features are available as well.

    In that scenario, a ruby script declares the process steps by executing a sequence of operations that define input geometry, apply material modifications and output the results. This script must be provided for a certain technology. It's not as simple as a table description but far more versatile.

    A sample script may look like that:

    m = mask(layer("3/0").sized(-0.5))
    
    si = bulk
    fox = m.grow(0.5, 2).or(m.grow_into(0.5, 0.5, si))
    
    poly = all.grow(0.5, 0.5)
    
    output("1/0", si)
    output("100/0", m)
    output("101/0", fox)
    output("102/0", poly)
    

    For a brief description: "layer" extracts and original layer. Such layers can be sized and boolean operations can be applied. "mask" converts horizontal geometry into intervals along the cut line and produces thin seed lines on the surface of the current material stack. "all" is a special mask which covers all. "grow" will make the given seed line grow atop of the material stack. In this case, two dimensions are specified which means that the material will grow in xy and z direction (xy first, z second). Both grow values can be different. The non-conformal extreme case would be xy=0. "grow_into" means material is consumed. "bulk" is the initial wafer surface. "output" will produce the material geometry on the respective output layer.

    This sample is supposed to mimic field oxide formation and deposition of some poly layer (gate oxide and all the well/implant things are omitted to keep it simple). This script was actually used to produce the screenshot.

    The script is not nearly finished, so I don't have anything to provide yet. I'll follow up on that topic here soon. I am not quite sure whether that is a stupid approach to use, so I'd appreciate feedback.

    Best regards,

    Matthias

  • edited November -1
    Matthias,

    I have contacted you earlier via email on a cross-section program that I already have. Unfortunately, there are copyright issues with sharing the code. Also, the approach that you propose using booleans is in principle much faster than the algorithm that I implemented. So, I think it is an excellent approach, as long as the boolean code handles glitches correctly (which I seem to recall it does).

    I would be interested to contribute (would need to learn Ruby etc). Realistic is important for many applications, and the boolean approach allows that in principle.

    Etching holes is probably a little harder to program than deposition. You will need to deal with different etch rates on different materials in some way, and for true realism you need to give the etched holes a realistic shape (isotropic / anisotropic). A more realistic bird's beak on LOCOS would also be nice. (My program does all that in principle, but does not use the boolean approach, so we would have to find a different way to get the same result.)

    The script approach is very flexible, but has a long learning curve for new users. Several solutions are possible. The simplest is probably to have more advanced functions like "deposit" and "etch". It may be an idea to use an intermediate text file with a simpler non-Ruby syntax, or perhaps even a GUI, and generate the script from there.

    Matthias, let me know how I can help. Another question: is BigBren who I think it is?

    Best regards,

    Hans
  • edited November -1
    Hi Matthias,

    I tried to picture what you describe and as far as I can tell I can do everything I need with your proposed code.

    Two little things where I am not sure though:
    1. What about a burried layer? I would have to do a grow_into for the lower AND the upper edge (in Z) of the layer. Is that supported?
    2. What is the Xsection result when I am cutting right next to a shape that is covered by a conformal layer? Will the increased thickness of the coverlayer be displayed correctly? (This is where I am running out of imagination...)

    Thanks & best regards
    Alex
  • edited November -1

    Hallo Hans & Alex,

    I have performed some more experiments on the boolean approach and adding a "planarize" function already gives some flexibility. I tried to describe a simple CMOS process and a result screenshot can be found here. If anybody is interested in the scripts: the ruby module is xsection.rbm, the technology description is cmos.xs.

    I think it's possible to create buried layers as well, because it should be possible to describe epitaxy process steps as well (as a deposition step).

    But I think Hans is right - the approach has some limitations. To simulation different etch rates would be difficult. Also my LOCOS does not show the beak. And I agree - a simple description would be easier to adopt by the users.

    My basic question is if it's worth to further investigate the approach? What is a promising approach like? I assume that simulation an etch process would require some kind of solver for the rate equation, right?

    Best regards,

    Matthias

  • edited November -1
    Matthias,

    I buried myself in "The Ruby Programming Language" for a week and have not followed the forum. Ik will now study the code and give my comments / additions. Thank you for making this available.

    Best regards,

    Hans
  • edited November -1
    Hello Matthias and Hans,

    This thread is quite exciting, and the idea of a boolean approach, with the intention of also achieving the realism of Hans' famous program, seems very promising. Yes Hans, it is who you think it is, and I would be happy to test out any new code with the latest simple process I'm working on...

    Best regards,

    Brendan.
  • edited November -1

    Hi all,

    thanks for that feedback.

    Please note that this is more like a feasibility study. It's not perfect in every respect. In particular, the sizing approach is very limited and somewhat fragile. I'd like to try to enhance the script by providing a more versatile hull generation algorithm which can provide a more realistic LOCOS beak for example.

    If you find the approach useful, I'd try to start a real project for example on SourceForge for that.

    Best regards,

    Matthias

  • edited November -1
    Hi Matthias,

    I was trying to implement a real stack with a total height > 2um so I was changing the default values for height (and depth).
    Doing so the deposition command deposits material also from a 'top line' 2um above bulk downwards which is not what I want.
    I reckon this can be adapted in xsection.rbm but I didn't dive deep enough to see where.
    Can you help?

    Merci beaucoup.
    Alex
  • edited November -1

    Hi Alex,

    that's probably a bug ...

    I think the script is rather a proof of principle, not a useful implementation. Because there was some interest in that topic I started a project on sourceforge (http://sourceforge.net/projects/xsectionklayout/). Hopefully, some useful solution will emerge.

    I'll have a look if the bug can be fixed easily.

    Best regards,

    Matthias

  • edited July 2010

    Hi Alex,

    I have fixed that problem along with a nasty flaw: now, the cross section is extended internally somewhat further by an adjustable parameter ("extend", default is 2um) to eliminate boundary effects.

    The new version can now be obtained from the sourceforge SVN repository: http://xsectionklayout.svn.sourceforge.net/viewvc/xsectionklayout/trunk/src/xsection.rbm?view=log. Follow "Links to HEAD" to download the latest version.

    Hope that's making it somewhat more useful ...

    Best regards,

    Matthias

  • DanDan
    edited November -1
    Hello Matthias,

    I am using your cross section tool with KLayout 0.20.2 and it is working perfectly. Now I am using KLayout 0.21.14, the Button "X-Section" still exists in the toolbar, but it is not starting the script anymore. Do you know a solution for this problem?

    Thanks and best regards,
    Dan
  • edited November -1
    Hi Dan,

    On my installation it's working, so there does not seem to be a basic problem related to the new released.

    Are you using the latest version from the link above? Could it be that it's simply not finding the .xs-File for the setup?

    One possible cause is that KLayout loads xsection.rbm twice (i.e. when it's present in the installation folder and given on the command line with -rm).

    If you're running on Linux, there may be an error message on the terminal which give some more hints about what is happening.

    Best regards,

    Matthias
  • DanDan
    edited November -1
    Hi Matthias,

    I use a ".bat" file to include a ruby script and I figured out that x-section is working without the inclusion of the script. The problem lies within some lines of code in this script. I'm using some boolean operations:

    "
    ...
    BoolProcessor.new(cv.layout, cv.cell).run do |p|
    ...
    p.output(RBA::LayerInfo.new(1, 0),p.not(p.input(RBA::LayerInfo.new(1,0)),layer_1))
    p.output(RBA::LayerInfo.new(2, 0),p.not(p.input(RBA::LayerInfo.new(2,0)),layer_1))

    end
    "

    When I delete one of the two "p.output"-lines, x-section is working. However if I use the line of code more than once, x-section stops working again. Do you know how I could avoid this problem?

    Best regards,
    Dan
  • edited January 2012

    Hi Dan,

    To me there is no reason why there should be a difference between using the line twice or just once. With the exception that there may be a difference in the input, i.e. that layer 2/0 is empty (which shouldn't be a problem either, but I am not really sure).

    Anyway, I think to track the problem down further it is helpful to enable to error message box. I assume you are using Windows, hence you don't see error messages printed on the shell. Around line 845 of xsection.rbm you find the following code:

    begin
       eval(text)
    # Without this code, stack traces are shown (works better for development ..)
    # rescue
      # RBA::MessageBox::critical("Error", $!, RBA::MessageBox::b_ok)
      # return
    end
    

    If you uncomment the message box code:

    begin
      eval(text)
    rescue
      RBA::MessageBox::critical("Error", $!, RBA::MessageBox::b_ok)
      return
    end
    

    you should see a message box with an error message indicating the cause of the failure more precisely.

    Could you try that and tell me the results?

    Best regards,

    Matthias

  • DanDan
    edited November -1
    Hi Matthias,

    I'm using Windows 7.

    I commented out the code in "xsection.rbm" and tried to run the script again, but unfortunately it makes no difference. After pressing the button "X-Section" nothing happens.

    I tried to break down the code by deleting parts of it until X-Section is working again and I figured out, that the cause of the problem is not a specific line of code but the amount of operations I'm using. Maybe you can reproduce the problem:

    I include a file named "test.rb" with the following code (the code is incomplete but I hope it fits to demonstrate the problem) and X-Section is working out:

    # ----------------------------------------------------------------
    # A boolean processor class
    class BoolProcessor

    private
    @layout
    @cell
    @proc

    end

    class MenuHandler < RBA::Action
    def initialize( t, k, i, &action )
    self.title = t
    self.shortcut = k
    self.icon = i
    @action = action
    end
    def triggered
    @action.call( self )
    end
    private
    @action
    end

    app = RBA::Application.instance
    # ----------------------------------------------------------------
    $menu_handler1 = MenuHandler.new( "Test", "Shift+F7", "icon.png" ) {

    view = RBA::Application.instance.main_window.current_view
    cv = view.cellview(view.active_cellview_index)

    BoolProcessor.new(cv.layout, cv.cell).run do |p|

    layer1= p.input(RBA::LayerInfo.new(999, 0))
    p.output(RBA::LayerInfo.new(1,0),p.not(p.input(RBA::LayerInfo.new(1,0)),layer1))

    end
    view.update_content
    }
    app.exec
    # ----------------------------------------------------------------




    If I use the same script but copy and paste the following line about 100 times, X-Section stops working:

    p.output(RBA::LayerInfo.new(1,0),p.not(p.input(RBA::LayerInfo.new(1,0)),layer1))

    By using a loop, the problem doesn't appear, just when you repeat this line of code multiple times.

    Thanks a lot for your support.

    Best regards,
    Dan
  • edited November -1

    Hi Dan,

    thanks a lot for the analysis. The effect is somewhat strange because I'd either expect an error message or (if there is a memory issue for example) a crash of the program.

    I'll try to reproduce it and come back here.

    Thanks and best regards,

    Matthias

  • edited November -1

    Hi Dan,

    I was trying to reproduce the problem with the information and so far have not been successful.

    Maybe I published the code for BoolProcessor before, but I admit I have forgotten when I did so ... Anyway, neither the current version of xsection.rbm contains the code, nor does any other file I have published recently.

    I have tried to reproduce the problem with the layer processing script which apparently is doing somewhat similar but it works as expected, even when I put in many identical lines of processing instructions.

    Can you send the code for BoolProcessor to the email address listed in the contacts page? That would allow me to create a test case which is as close to your problem as possible.

    Thanks and best regards,

    Matthias

  • DanDan
    edited November -1
    Hi Matthias,

    I have seen the BoolProcessor Class in the following Forum Discussion:

    http://klayout.de/forum/comments.php?DiscussionID=6&page=1#Item_2


    In addition I recognized some more details about the problem:

    1. When I include the script within a batch file:
    "start .\klayout.exe -e -r .\test.rb",
    and I press the button X-Section, nothing happens.

    2. Now I just run Klayout.exe and after pressing "X-Section", the script starts to run and the error message appears as usual: "There is no ruler present for the cross section line". Even if I include test.rb in KLayout now, I can run X-Section again and the same message appears. I just recognized, that I never actually tried to create a X-Section, because I thought the script is working regarding the appearance of the missing-ruler message.
    Now I set a ruler to create a Cross-Section and I get the following error message:

    "
    Ruby error: 'Ruby error: 'uninitialized constant XSectionGenerator::BoolProcessor' (NameError)
    ./xsection.rbm:844:in `eval'
    ./xsection.rbm:844:in `eval'
    ./xsection.rbm:844:in `run'
    ./xsection.rbm:955:in `block in <top (required)>'
    ./xsection.rbm:941:in `call'
    ./xsection.rbm:941:in `triggered'' (RuntimeError)
    ./xsection.rbm:847:in `critical'
    ./xsection.rbm:847:in `rescue in run'
    ./xsection.rbm:843:in `run'
    ./xsection.rbm:955:in `block in <top (required)>'
    ./xsection.rbm:941:in `call'
    ./xsection.rbm:941:in `triggered'
    "

    I could have tried this earlier, sorry for that.
    Hope this helps.


    Best regards,
    Dan
  • edited January 2012

    Hi Dan,

    if I understand it correctly, the code from test.rb and xsection.rb gets mixed. In particular it seems that there is a problem with the MenuAction class which is defined in both files. It is possible that on version 0.21 the order of initialisation is different so one class overwrites the other.

    It is possible to rewrite the code for 0.21 somewhat so it does not require tha MenuAction helper class. To to so, replace lines 933 to the end (that is the definition of class MenuAction and the registration of the menu items) with this code:

    # register the function in the toolbar
    # TODO: add shortcut, correct title etc.
    app = RBA::Application.instance
    mw = app.main_window
    
    menu = mw.menu
    if !menu.is_valid("@toolbar.xsection")
      # create the menu action with event binding (requires KLayout 0.21)
      # use a global variable to keep a reference to the RBA::Action object
      $xsection_action = RBA::Action.new
      $xsection_action.title = "X-Section"
      $xsection_action.on_triggered { XSectionGenerator.new.run }
      menu.insert_separator("@toolbar.end", "tb_separator")
      menu.insert_item("@toolbar.end", "xsection", $xsection_action)
    end
    

    That also fixes a potential interaction with the GC which may clean up the MenuAction object the in the previous implementation

    Hopefully that solves that issue.

    Best regards,

    Matthias

  • DanDan
    edited November -1
    Hi Matthias,

    you are right, I have split the code in several files and because of this, some problems appeared in the new Version of KLayout. With your code and help, everything is working again!

    I'm grateful for your extraordinary support. Thank you very much!

    Best regards,
    Dan
  • edited November -1

    Hi Dan,

    that's great. You're welcome :-)

    Best regards,

    Matthias

  • edited November -1
    I have been using Klayout as a viewer in the past years and only recently came up with the idea of making cross-sections. I went through the forum and came up with this thread about 2D cross-sections. But for me there is a big BUT....I'm not at all familiar with these scripts (Ruby?) so I have no idea how to use it. Is there a way to explain it to me in easy steps how I can make a cross-section view?
  • edited February 2014

    Hi,

    I think you refer to the thread http://klayout.de/forum/comments.php?DiscussionID=208.

    There is a Ruby script which allows to define cross section recipes by describing process steps (deposition, etch, planarization ...). The implementation is kind of handwaving - it's based on very simply assumptions about the nature of a process step and has a couple of limitations. It is capable of delivering nice pictures though. You just cannot expect a detailed process simulation.

    You'll find the script and some documentation here: http://xsectionklayout.sourceforge.net/.

    Regards,

    Matthias

Sign In or Register to comment.