Home Forums Nazca Questions and Answers Where can I set straight-to-bend waveguide offset

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4447
    alvin
    Member

    When using nazca.demofab.shallow, where can I set the straight-to-bend waveguide offset.

    I am working with narrow waveguide, i.e. width=0.45um, the default offset is too much.

    #4453
    Xaveer
    Moderator

    Dear Alvin,

    If you want to use Nazca to implement your own PDK for a specific “fab” (could be your own process), then you need to implement that yourself. Demofab provides a demonstration of how the technology of such a fab could be implemented in Nazca. So you should probably use demofab as a template for implementing your own technology.

    However, to answer your question, you can specify your own offset function to calculate and apply the proper offset in your technology, as a function of bend radius and waveguide width, for a specific waveguide cross section. Here is an example of a custom offset function for the “shallow” waveguide cross section implemented in demofab:

    import nazca as nd
    import nazca.demofab as demo
    from math import copysign
    
    # Function needs to implement proper offset for *your* technology.
    def my_os_shallow(width, radius):
        '''Straight to bend offset as function of waveguide width and radius.'''
    
        offset = 0.5 # just a fixed value here as an example
    
        return copysign(offset, radius)
    
    # Example with demofab default:
    demo.shallow.strt(100).put()
    demo.shallow.bend(radius=500, angle=45).put()
    demo.shallow.strt(100).put()
    
    # Use the new offset function
    demo.xsShallow.os = my_os_shallow
    
    # Example with new offset value:
    demo.shallow.strt(100).put(0, 20)
    demo.shallow.bend(radius=500, angle=45).put()
    demo.shallow.strt(100).put()
    
    nd.export_gds()

    If all you need is a single-value offset, you can also specify just that value, e.g.:
    demo.xsShallow.os = 0.03

    Xaveer

    #4454
    Ronald
    Keymaster

    In addition to Xaveer’s answer, the below examples show how to define a xsection and offset from scratch, i.e. without importing demofab. The first example uses the generic ‘strt’ and ‘bend’ functions to draw the waveguides.

    import nazca as nd
    
    xs1 = nd.add_xsection(name='new_xs')
    xs1.os = 0.5
    
    nd.strt(length=10, xs='new_xs').put()
    nd.bend(angle=10, xs='new_xs').put()
    
    nd.export_gds()

    It can be convenient to work with ‘interconnects’ that remember their xs, width, radius, etc.
    See the example below and the interconnect tutorial on how to use them.

    import nazca as nd
    
    xs1 = nd.add_xsection(name='new_xs')
    xs1.os = 0.5
    waveguide = nd.interconnects.Interconnect(width=2, radius=20, xs='new_xs')
    
    waveguide.strt(length=10).put()
    waveguide.bend(angle=10).put()
    
    nd.export_gds()

    Ronald

    #4455
    alvin
    Member

    Many thanks to Xaveer and Ronald. In fact, where can I see all the attributes (e.g. width, radius, os, cladding width, etc) corresponding to an existing PDK?

    I know I can do the followings to see all the PDK in demofab:

    import nazca as nd
    import nazca.demofab as demo

    nd.show_xsections()

    As what Xaveer said, it would be convenient to use an existing PDK as template and implement my own technology. But, how to actually do that? Can I “import” demofab.shallow to a new xsection and start to do modification from that?

    Maybe there is specific section for this in the manual. Please refer me to that.

    #4456
    Ronald
    Keymaster

    Dear Alvin,

    A good way forward is to look into the demofab implementation, which you can find in the installer .zip file:
    Open the zip and navigate to the nazca/demofab/ directory. Copy the files as a start for your own implementation.

    To find/see attributes of an object in a typical Python development environment you can use tab completion:

    xs1.<press tab>

    You can print attribute values that may or may not be defined like:

    try:
       print(xs1.os)
    except:
       print("no os attribute defined")

    Alternatively, Python lets you query the available attributes and methods like

    import nazca.demofab as demo
    dir(demo.xsShallow)

    Also, an official Nazca PDK comes with a dedicated manual. The website will be extended for this soon.
    Hope this helps.

    Ronald

    #4536
    alvin
    Member

    Thanks Ronald. This has been very helpful. I have been building my own PDK like the follows.

    sifab = nd.add_xsection(name='sifab')
    sifab.os = 0.0
    nd.add_layer2xsection(xsection='sifab', layer=1, accuracy=0.0001)
    nd.add_layer2xsection(xsection='sifab', layer=2, accuracy=0.0010, growx=10)
    wg = nd.interconnects.Interconnect(width=0.5, radius=20, xs='sifab')
    

    If later on, I want to recall the value of ‘growx’ in layer 2 of ‘sifab’, how can I do that?

    #4538
    Ronald
    Keymaster

    Dear Alvin,

    There is a pandas DataFrame with the xsection(s) definition(s):

    import nazca as nd
    
    # your code ...
    
    # print the xsection definitions:
    nd.show_xsection_layer_map()
    
    # work with the underlying DataFrame:
    df = nd.cfg.xsection_layer_map
    print(df[df['xsection']=='sifab'][['layer', 'growx']])

    Maybe a DataFrame is a little laborious to obtain the grow number. Alternatively, store the growx in a variable first and use it later where needed.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.