Home Forums Nazca Trying to get nazca.trace() to work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6771
    Raj Patel
    Participant

    Hi,

    I’m using a LioniX PDK for a design, and would like to use nazca.trace() to determine the geometrical lengths of the interconnects:

    import nazca as nd
    import lionix as lx
    import nazca.trace as trc
    
    ...
    
    trc.trace_start()
    wg=lx.ads.sinebend(distance=1000, offset=1000).put(5000, 10000)
    trc.trace_stop()
    mylength=trc.trace_length()
    
    print(mylength)

    However, it just returns 0 each time. Is this something that the LioniX PDK doesn’t support?

    Thanks

     

    #6779
    Xaveer
    Moderator

    Dear Raj Patel,

    The path length was not implemented for sine bends. This is fixed and will be in a future release of nazca.

    For now you can use this workaround to calculate the arc length of the center line of the sinebend yourself:

    from scipy.integrate import quad
    from math import sin, pi, sqrt
    
    def length_sinebend(distance, offset):
        def arc_len_sinebend(t, d=distance, s=offset):
            return s / (2 * pi) * sqrt((d / s) ** 2 + (1 - sin(t)) ** 2)
        return quad(arc_len_sinebend, 0, 2 * pi)[0]
    
    # wg=lx.ads.sinebend(distance=1000, offset=1000).put(5000, 10000)
    mylength = length_sinebend(1000, 1000)
    print(mylength)

    Xaveer

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