在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1865|回复: 5

[求助] 如何从一个.va文件中生成两个symbol(一个n型一个p型)?

[复制链接]
发表于 2018-11-21 17:39:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 937166474 于 2018-11-22 09:54 编辑

各位大佬好,刚入门的幼儿园小学生一枚Ubuntu18.04LST + IC617
我从这里下载了TFET的相关的文件(用到的就只有ndtfet.va和ndtfet.lib两个文件),然后在Hspice中跑了一个简单的反相器,出来的波形是对的,
然后我准备用ndtfet.va这个文件,在cadence中生成两个symbol,导入步骤是看YouTube上的视频,第一次导入的时候(导入n型),我在cell name中写的是ntfet,Type是VerilogA,内容是下面的第一个代码,第二次导入的时候(导入p型),

我在cell name中写的是ptfet,

Type是VerilogA,内容是下面的

第一个

代码,其中第76行





  1. parameter integer type = `n_type;


复制代码
我给改成了





  1. parameter integer type = `p_type;


复制代码
目测这条语句是来控制管子类型的吧希望我没有理解错,,然后单独看n型(或p型)的D端电流随D端电压变化,n型是对的(

也可能是错,只是凑巧看着是对的,毕竟只做了一个电路简单看了一下,原谅我不知道怎么看是对是错

),单独看p型是不对的,做成反向器也是不对的。






请知道的大佬提醒一下需要注意的点,如果能有点教程(怎么导入n型和p型)就最好了,,,谢谢大佬们。





  1. //#######################################################################
  2. //#
  3. //#  File :  ndtfet.va
  4. //#  Authors : Trond Ytterdal, Hao Lu and Alan Seabaugh
  5. //#  Date : Nov. 25, 2014
  6. //#  Description : University of Notre Dame TFET Model
  7. //#  References : Based on Lu et al., "Universal analytic model for
  8. //#  tunnel FET circuit simulation", Solid-State Electronics, 2014
  9. //#  Restrictions :
  10. //#
  11. //#######################################################################
  12. //#
  13. //#  Version history:
  14. //#
  15. //#   v1.6.8 Nov. 25, 2014  Hao Lu: Initial version for NEEDS
  16. //#   v1.6.9 Jan. 19, 2014  Hao Lu: Add parameter cmin and cmax
  17. //#
  18. //#######################################################################


  19. //`define DEBUG_CV
  20. `ifdef insideADMS
  21. `define P(p) (*p*)
  22. `define PGIVEN(p)                $given(p)
  23. `define INITIAL_MODEL                @(initial_model)
  24. `define INITIAL_INSTANCE        @(initial_instance)
  25. `else
  26. `define P(p)
  27. `define PGIVEN(p)                p
  28. `define INITIAL_MODEL                @(initial_step or initial_step("static"))
  29. `define INITIAL_INSTANCE
  30. `endif
  31. `include "discipline.h"
  32. `define n_type 1
  33. `define p_type -1
  34. `define CHARGE 1.6021918e-19
  35. `define HBAR 1.05458e-34
  36. `define PI 3.141592653
  37. `define EPS0 8.85418782e-12
  38. `define VDSMIN 1e-12
  39. `define DELTA 5
  40. `define VMIN 0.0001
  41. `define AMIN 0.0001
  42. module ndtfet(drain, gate, source);
  43.   inout drain, gate, source;
  44.   electrical drain, gate, source;
  45. electrical drainprime, gateprime, sourceprime;
  46. parameter real l = 20n from (0:inf) `P(spice:name="w" type="instance");
  47. parameter real w = 1u from (0:inf) `P(spice:name="w" type="instance");
  48. parameter real alpha = 1.14;
  49.   parameter real beta = 0.02;
  50.   parameter real cgs0 = 6.9e-11;
  51. parameter real e0 = 0.527e8;
  52.   parameter real eg = 0.35;
  53.   parameter real eot = 0.2n;
  54.   parameter real eta = 0.1;
  55.   parameter real epsi = 1.0;
  56.   parameter real gamma = 0.06;
  57.   parameter real gammac = 0.18;
  58.   parameter real j0 = 1e7;
  59.   parameter real jp = 2e8;
  60.   parameter real k = 2;
  61.   parameter real lambda = 0.19;
  62.   parameter real mc = 2;
  63.   parameter real mr = 0.012;
  64. parameter real n1 = 1.8;
  65.   parameter real n2 = 1.1;
  66. parameter real r0 = 0.5;
  67. parameter real r1 = 0.01;
  68. parameter real r2 = 1.3;
  69.   parameter real rdw = 0;
  70.   parameter real rgwl = 0;
  71.   parameter real rsw = 0;
  72.   parameter real s = 1;
  73. parameter real tch = 5e-9;
  74. parameter integer type = `n_type;
  75.   parameter real vp = 0.05;
  76. parameter real vth = 0.17;
  77. real vds, vsd, vdse, vsde, vgs, vgd, mrvalue, egvalue, u0, a, b, ru, gi, q, r0p, deltas;
  78.   real ci, cgs, cgd, cgdmax, cgdmin, ac, ace;
  79.   real vgt, vgo, vgoe, vgoen, f, u, e, id;
  80.   real vgta, vgoa, vgoea, vgoena, fa, ua, ea, ida, ide;
  81.   real rd, rg, rs, gd, gg, gs;
  82. analog
  83.     begin
  84.       `INITIAL_MODEL
  85. begin
  86. q = `CHARGE;
  87. u0 = n1*$vt;
  88. mrvalue = mr*9.1095e-31;
  89. egvalue = eg*q;
  90. ru = r0*u0;
  91. gi = 1/gamma;
  92. r0p = 1-r0;
  93.           deltas = `DELTA*`DELTA;
  94.         end
  95. `INITIAL_INSTANCE
  96. begin
  97. a = w*tch*q*q*q/(8*`PI*`PI*`HBAR*`HBAR)*sqrt(2*mrvalue/egvalue);
  98. b = 4*egvalue*sqrt(2*mrvalue*egvalue)/(3*q*`HBAR);
  99.           ci = `EPS0*epsi*w*l/eot;
  100. //          cgdmax = cmin*ci;
  101. //          cgdmin = cmax*ci;
  102.           rd = rdw/(w*1e6);
  103.           rg = rgwl*w/l;
  104.           rs = rsw/(w*1e6);
  105.           if(rd > 0)
  106.             gd = 1/rd;
  107.           else
  108.             gd = 0;
  109.           if(rg > 0)
  110.             gg = 1/rg;
  111.           else
  112.             gg = 0;
  113.           if(rs > 0)
  114.             gs = 1/rs;
  115.           else
  116.             gs = 0;
  117.         end
  118.       vds = type*V(drainprime,sourceprime);
  119.       vgd = type*V(gateprime,drainprime);
  120.       vgs = type*V(gateprime,sourceprime);
  121.       vgt  = vgs-vth;
  122.       vdse = `VDSMIN*(0.5*vds/`VDSMIN+sqrt(deltas+(0.5*vds/`VDSMIN-1)*(0.5*vds/`VDSMIN-1))-sqrt(deltas+1));
  123.       // main drain-source tunneling current
  124.       vgo  = vgs;
  125.       vgoe = `VMIN*(1+0.5*vgo/`VMIN+sqrt(deltas+(0.5*vgo/`VMIN-1)*(0.5*vgo/`VMIN-1)));
  126.       vgoen = vgoe/(vth);
  127.       f = (1-limexp(-vdse*gi))/(1+limexp((lambda*tanh(vgo)-vdse)*gi));
  128.       u = ru+r0p*u0*vgoen;
  129.       e = e0*(1+r1*vdse+r2*vgoe);
  130.       id = a*f*u*ln(1+limexp((vgt)/u))*e*limexp(-b/e);
  131.       // ambipolar drain-source current   
  132.       vgta = -vgs-vth;
  133.       vgoa  = -vgo;
  134.       vgoea = `VMIN*(1+0.5*vgoa/`VMIN+sqrt(deltas+(0.5*vgoa/`VMIN-1)*(0.5*vgoa/`VMIN-1)));
  135.       vgoena = vgoea/vth;
  136.       fa = (1-limexp(-vdse*gi))/(1+limexp((lambda*tanh(vgoa)-vdse)*gi));
  137.       ua = ru+r0p*u0*vgoena;
  138.       ea = e0*(1+r1*vdse+r2*vgoea);
  139.       ida = s*a*fa*ua*ln(1+limexp((vgta)/ua))*ea*limexp(-b/ea);
  140.       // RTD drain-source current
  141.       vsd = -vds;
  142.       vsde = `VDSMIN*(0.5*vsd/`VDSMIN+sqrt(deltas+(0.5*vsd/`VDSMIN-1)*(0.5*vsd/`VDSMIN-1))-sqrt(deltas+1));
  143.       ide = -w*tch*(jp*vsde/vp*k*vgoe*limexp(1+(-vsde+eta*vgs)/vp)+j0*(limexp(vsde/n2/$vt)-1));
  144.       // capacitance calculations
  145.       ac = ((1+beta*pow(vgs,mc))-limexp(-vgo/gammac))/(1+limexp((vth+alpha*vdse-vgo)/gammac));
  146.       ace = `AMIN*(1+0.5*ac/`AMIN+sqrt(deltas+(0.5*ac/`AMIN-1)*(0.5*ac/`AMIN-1)));
  147.       cgs = cgs0*w;
  148.       cgd = cgdmin + (cgdmax - cgdmin)*ace;
  149.       // Augment the matrix
  150.       I(gateprime,sourceprime) <+ type*cgs*ddt(vgs);
  151.       I(gateprime,drainprime) <+ type*cgd*ddt(vgd);
  152.       I(drainprime,sourceprime) <+ type*(id+ida+ide);
  153.       if(rd > 0)
  154.         I(drain,drainprime) <+ gd*V(drain,drainprime);
  155.       else
  156.         V(drain,drainprime) <+ 0.0;
  157.       if(rs > 0)
  158.         I(source,sourceprime) <+ gs*V(source,sourceprime);
  159.       else
  160.         V(source,sourceprime) <+ 0.0;
  161.       if(rg > 0)
  162.         I(gate,gateprime) <+ gg*V(gate,gateprime);
  163.       else
  164.         V(gate,gateprime) <+ 0.0;
  165.     end
  166. endmodule




复制代码




  1. *#######################################################################
  2. *#
  3. *#  File : ndtfet.lib
  4. *#  Author : Trond Ytterdal
  5. *#  Date : July 15, 2014
  6. *#  Description : Library of TFET devices
  7. *#  References :
  8. *#  Restrictions :
  9. *#
  10. *#######################################################################
  11. *#
  12. *#  Version history:
  13. *#
  14. *#   v1.0.2 Dec. 15, 2014  Hao Lu: Initial version for NEEDS
  15. *#   v1.0.3 Jan. 19, 2015  Hao Lu: Add GaN TFET model
  16. *#           and Add parameter cmin and cmax
  17. *#
  18. *#######################################################################
  19. *#
  20. *#  Content:
  21. *#
  22. *#   InAs DG TFET:
  23. *#     usage: .lib inas_tfet
  24. *#
  25. *#   AlGaSb/InAs TFET:
  26. *#     usage: .lib algasb_inas_tfet
  27. *#
  28. *#   GaN/InN TFET:
  29. *#     usage: .lib gan_tfet
  30. *#
  31. *#######################################################################.lib inas_tfet.lib ndtfet.lib ndtfet_va.model ntfet ndtfet
  32. + alpha = 1.14
  33. + beta = 0.02
  34. + cgs0 = 6.9e-11
  35. + cmin = 0.13
  36. + cmax = 0.9+ e0 = 0.507e8
  37. + eg = 0.354
  38. + eot = 0.2n
  39. + eta = 0.1
  40. + epsi = 1.0
  41. + gamma = 0.056
  42. + gammac = 0.18
  43. + j0 = 1e4
  44. + jp = 2e5
  45. + k = 2
  46. + lambda = 0.19
  47. + mc = 2
  48. + mr = 0.0218+ n1 = 1.49
  49. + n2 = 1.49+ r0 = 0.64
  50. + r1 = 0.01
  51. + r2 = 1.89
  52. + rdw = 0
  53. + rgwl = 0
  54. + rsw = 0
  55. + s = 1e-3+ tch = 5e-9
  56. + type = 1+ vp = 0.05+ vth = 0.145.model ptfet ndtfet
  57. + alpha = 1.14
  58. + beta = 0.02
  59. + cgs0 = 6.9e-11
  60. + cmin = 0.13
  61. + cmax = 0.9+ e0 = 0.507e8
  62. + eg = 0.354
  63. + eot = 0.2n
  64. + eta = 0.1
  65. + epsi = 1.0
  66. + gamma = 0.056
  67. + gammac = 0.18
  68. + j0 = 1e4
  69. + jp = 2e5
  70. + k = 2
  71. + lambda = 0.19
  72. + mc = 2
  73. + mr = 0.0218+ n1 = 1.49
  74. + n2 = 1.49+ r0 = 0.64
  75. + r1 = 0.01
  76. + r2 = 1.89
  77. + rdw = 0
  78. + rgwl = 0
  79. + rsw = 0
  80. + s = 1e-3+ tch = 5e-9
  81. + type = -1+ vp = 0.05+ vth = 0.145.endl
  82. .lib algasb_inas_tfet.lib ndtfet.lib ndtfet_va.model ntfet ndtfet
  83. + alpha = 1.14
  84. + beta = 0.02
  85. + cgs0 = 6.9e-11
  86. + cmin = 0.13
  87. + cmax = 0.9+ e0 = 1e8
  88. + eg = 0.35
  89. + eot = 0.2n
  90. + eta = 0.1
  91. + epsi = 1.0
  92. + gamma = 0.046
  93. + gammac = 0.18
  94. + j0 = 1e4
  95. + jp = 2e5
  96. + k = 2
  97. + lambda = 0.32
  98. + mc = 2
  99. + mr = 0.012+ n1 = 1.2
  100. + n2 = 1.49+ r0 = 0.2
  101. + r1 = 0.1
  102. + r2 = 0.9
  103. + rdw = 0
  104. + rgwl = 0
  105. + rsw = 0
  106. + s = 1e-3+ tch = 5e-9
  107. + type = 1+ vp = 0.05+ vth = 0.08.model ptfet ndtfet
  108. + alpha = 1.14
  109. + beta = 0.02
  110. + cgs0 = 6.9e-11
  111. + cmin = 0.13
  112. + cmax = 0.9+ e0 = 1e8
  113. + eg = 0.35
  114. + eot = 0.2n
  115. + eta = 0.1
  116. + epsi = 1.0
  117. + gamma = 0.046
  118. + gammac = 0.18
  119. + j0 = 1e4
  120. + jp = 2e5
  121. + k = 2
  122. + lambda = 0.32
  123. + mc = 2
  124. + mr = 0.012+ n1 = 1.2
  125. + n2 = 1.49+ r0 = 0.2
  126. + r1 = 0.1
  127. + r2 = 0.9
  128. + rdw = 0
  129. + rgwl = 0
  130. + rsw = 0
  131. + s = 1e-3+ tch = 5e-9
  132. + type = -1+ vp = 0.05+ vth = 0.08.endl.lib gan_tfet.lib ndtfet.lib ndtfet_va.model ntfet ndtfet
  133. + alpha = 12.22
  134. + beta = 1.504
  135. + cgs0 = 2.3e-10
  136. + cmin = 0.0836
  137. + cmax = 2.4+ e0 = 2.265e8
  138. + eg = 0.64
  139. + eot = 0.43n
  140. + eta = 0.1
  141. + epsi = 1.0
  142. + gamma = 0.0596
  143. + gammac = 4.825
  144. + j0 = 1e4
  145. + jp = 2e5
  146. + k = 2
  147. + lambda = 0.435
  148. + mc = 0.3176
  149. + mr = 0.1+ n1 = 4
  150. + n2 = 1.49+ r0 = 0.151
  151. + r1 = 0
  152. + r2 = 0.15
  153. + rdw = 0
  154. + rgwl = 0
  155. + rsw = 0
  156. + s = 1e-6+ tch = 2e-8
  157. + type = 1+ vp = 0.05+ vth = 0.096.model ptfet ndtfet
  158. + alpha = 12.22
  159. + beta = 1.504
  160. + cgs0 = 2.3e-10
  161. + cmin = 0.0836
  162. + cmax = 2.4+ e0 = 2.265e8
  163. + eg = 0.64
  164. + eot = 0.43n
  165. + eta = 0.1
  166. + epsi = 1.0
  167. + gamma = 0.0596
  168. + gammac = 4.825
  169. + j0 = 1e4
  170. + jp = 2e5
  171. + k = 2
  172. + lambda = 0.435
  173. + mc = 0.3176
  174. + mr = 0.1+ n1 = 4
  175. + n2 = 1.49+ r0 = 0.151
  176. + r1 = 0
  177. + r2 = 0.15
  178. + rdw = 0
  179. + rgwl = 0
  180. + rsw = 0
  181. + s = 1e-6+ tch = 2e-8
  182. + type = -1+ vp = 0.05+ vth = 0.096.endl
  183. .lib ndtfet_va.hdl ndtfet.va.endl


复制代码
 楼主| 发表于 2018-11-22 09:53:26 | 显示全部楼层
自顶
发表于 2018-11-22 15:24:08 | 显示全部楼层
通过宏定义可以实现吧
 楼主| 发表于 2018-11-22 18:30:56 | 显示全部楼层
回复 3# STSnow

宏定义具体指的是什么?在symbol的过程中哪地方选用用到?


34,35两行定义了n型和p型,然后改76行的代码不可以嘛??还请大佬赐教,谢谢
发表于 2018-11-22 18:45:39 | 显示全部楼层
就类似于选择编译吧
 楼主| 发表于 2018-11-23 16:00:40 | 显示全部楼层
回复 5# STSnow


    谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条


小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-11-13 03:54 , Processed in 0.020836 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表