I took a look at our calback functions in klayout ...
# qucs-s
k
I took a look at our calback functions in klayout (see the picture above). It turns out that the function use some technology parameters which are sourced from a
JSON
file. Do you think it would be a good idea to implement it as well in Qucs-S, i mean to source the technology data uingg this file.
Copy code
def CbResCalc(calc, r, l, w, b, ps, cell):

    global techparams
    global SG13_TECHNOLOGY

    suffix = 'G2'
    
    rspec  = Numeric(techparams[cell+suffix+'_rspec']) # specific body res. per sq. (float)
    rkspec = Numeric(techparams[cell+'_rkspec']) # res. per single contact (float)
    rzspec = Numeric(techparams[cell+'_rzspec']) * 1e6 # transition res. per um width between contact area and body (float)
    lwd    = Numeric(techparams[cell+suffix+'_lwd']) * 1e6  # line width delta [um] (both edges, positiv value adds to w)
    kappa  = Numeric(techparams[cell+'_kappa'])
    poly_over_cont = techparams['Cnt_d'] # strcat(cell '_poly_over_cont'))
    cont_size = techparams['Cnt_a'] # techGetSpacingRule(tfId 'minWidth' 'Cont')     # size of contact array [um]
    cont_space = techparams['Cnt_b'] # techGetSpacingRule(tfId 'minSpacing' 'Cont')
    cont_dist = cont_space+cont_size
    minW = Numeric(techparams[cell+'_minW'])

    # must check for string arguments and convert to float
    if type(r) == str :
        r=Numeric(r)
    if type(l) == str :
        l=Numeric(l)
    if type(w) == str :
        w=Numeric(w)
    if type(b) == str :
        b=Numeric(b)
    if type(ps) == str :
        ps=Numeric(ps)

    if LeQp3(w, minW, '1u', techparams['epsilon1']) :  # 6.8.03 GG: wmin -> minW,HS: Function'LeQp' 28.9.2004
        w = minW    # avoid divide by zero errors in case of problems ; 21.7.03 GG: eps -> minW
    
    w = w * 1e6 # um (needed for contact calculation);HS 4.10.2004
    l = l * 1e6
    ps = ps * 1e6

    # here: all dimensions given in [um]!
    result = 0

    if calc == 'R' :
        weff = w+lwd
        #result = l/weff*(b+1)*rspec+(2.0/kappa*weff+ps)*b/weff*rspec+2.0/weff*rzspec+2.0*(rkspec/ncont)
        result = l/weff*(b+1)*rspec+(2.0/kappa*weff+ps)*b/weff*rspec+2.0/w*rzspec
    elif calc == 'l' :
        weff = w+lwd
        #result = (weff*(r-2.0*rkspec/ncont)-b*(2.0/kappa*weff+ps)*rspec-2.0*rzspec)/(rspec*(b+1))*1.0e-6 ; in [m]
        result = (weff*r-b*(2.0/kappa*weff+ps)*rspec-2.0*weff/w*rzspec)/(rspec*(b+1))*1.0e-6 # in [m]
    elif calc == 'w' :
        tmp = r-2*b*rspec/kappa
        p = (r*lwd-l*(b+1)*rspec-(2*lwd/kappa+ps)*b*rspec-2*rzspec)/tmp
        q = -2*lwd*rzspec/tmp
        w = -p/2+sqrt(p*p/4-q)
        result = Snap(w)*1e-6 #  -> [m]

    return result