Home › Forums › Nazca › Questions and Answers › Where can I set straight-to-bend waveguide offset
- This topic has 6 replies, 3 voices, and was last updated 6 years, 9 months ago by
Ronald.
-
AuthorPosts
-
28 June 2018 at 16:46 #4447
alvin
MemberWhen 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.
28 June 2018 at 19:04 #4453Xaveer
ModeratorDear 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
28 June 2018 at 19:57 #4454Ronald
KeymasterIn 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
29 June 2018 at 11:12 #4455alvin
MemberMany 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 demond.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.
29 June 2018 at 23:29 #4456Ronald
KeymasterDear 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
4 July 2018 at 22:33 #4536alvin
MemberThanks 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?
5 July 2018 at 01:52 #4538Ronald
KeymasterDear 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.
-
AuthorPosts
- You must be logged in to reply to this topic.