现在的位置: 首页 > 综合 > 正文

Gate Level Modeling Part-I (of Verilog HDL)

2013年10月06日 ⁄ 综合 ⁄ 共 5610字 ⁄ 字号 评论关闭

  ../images/main/bullet_green_ball.gif Introduction
   

Verilog has built in primitives like gates, transmission gates, and switches. These are rarely used in design (RTL Coding), but are used in post synthesis world for modeling the ASIC/FPGA cells; these cells are then used
for gate level simulation, or what is called as SDF simulation. Also the output netlist format from the synthesis tool, which is imported into the place and route tool, is also in Verilog gate level primitives.

Verilog HDL 已经构建了诸如门(gates)、传输门和开关电路等基本原语。这些原语很少使用在RTL级编码设计中,但是却使用在ASIC/FPGA单元的建模的后期综合中。这些单元使用门级仿真或者称之为SDF simulation. 用于布局、布线工具(P & R tool)的由综合工具产生的网表格式使用的也是Verilog HDL的门级原语。

   

space.gif

   

Note : RTL engineers still may use gate level primitivies or ASIC library cells in RTL when using IO CELLS, Cross domain synch cells.

注意: RTL级的工程师仍然使用门级原语,或者使用IO 单元,跨域的同步单元的的RTL级的ASIC二进制单元

   

space.gif

  ../images/main/bullet_green_ball.gif Gate Primitives //门级原语 N-input( N 输入)
   

space.gif

    ../images/verilog/combo_gates.gif
   

space.gif

   

The gates have one scalar output and multiple scalar inputs. The 1st terminal in the list of gate terminals is an output and the other terminals are inputs.

这些门都是有一个标量输出,多个标量输入。门的端表中的第一个端是输出,其他端都是输入(译者注,这里说的是门级原语的参数表的分布方式,)。

   

space.gif

   

Gate

Description

and

N-input AND gate

nand

N-input NAND gate

or

N-input OR gate

nor

N-input NOR gate

xor

N-input XOR gate

xnor

N-input XNOR gate

   

space.gif

  ../images/main/bulllet_4dots_orange.gif

Examples //举例 

   

   

  1 module gates();
  2 
  3 wire out0;
  4 wire out1;
  5 wire out2;
  6 reg  in1,in2,in3,in4;
  7 
  8 not U1(out0,in1);
  9 and U2(out1,in1,in2,in3,in4);
 10 xor U3(out2,in1,in2,in3);
 11 
 12 initial begin
 13   $monitor(
 14   "in1=%b in2=%b in3=%b in4=%b out0=%b out1=%b out2=%b",
 15    in1,in2,in3,in4,out0,out1,out2); 
 16   in1 = 0;
 17   in2 = 0;
 18   in3 = 0;
 19   in4 = 0;
 20    #1  in1 = 1;
 21    #1  in2 = 1;
 22    #1  in3 = 1;
 23    #1  in4 = 1;
 24    #1  $finish; 
 25 end	
 26 
 27 endmodule

You could download file gates.v here

   

space.gif

   
 in1 = 0 in2 = 0 in3 = 0 in4 = 0 out0 = 1 out1 = 0 out2 = 0
 in1 = 1 in2 = 0 in3 = 0 in4 = 0 out0 = 0 out1 = 0 out2 = 1
 in1 = 1 in2 = 1 in3 = 0 in4 = 0 out0 = 0 out1 = 0 out2 = 0
 in1 = 1 in2 = 1 in3 = 1 in4 = 0 out0 = 0 out1 = 0 out2 = 1
 in1 = 1 in2 = 1 in3 = 1 in4 = 1 out0 = 0 out1 = 1 out2 = 1
   

space.gif

  ../images/main/bullet_green_ball.gif Transmission Gate Primitives  //传输门原语 N-output(N输出)
   

Transmission gates are bi-directional and can be resistive or non-resistive.

传输门是双向的,并且分为阻抗型和非阻抗型。

   

space.gif

   

Syntax: keyword unique_name (inout1, inout2, control);  //语法格式

   

space.gif

    ../images/verilog/bufs.gif
   

space.gif

   

Gate

Description

not

N-output inverter    //n-output (多输出)反相器

buf

N-output buffer. //n-ouput (多输出)buffer

bufif0

Tri-state buffer, Active low en. //三态缓冲区,低电平有效(低电平激活)。

bufif1

Tri-state buffer, Active high en.  //三态缓冲区,高电平有效(高电平激活)

notif0

Tristate inverter, Low en.     // 三态反相器,低电平有效(低电平使能)。

notif1

Tristate inverter, High en. //三态反相器, 高电平使能。

   

space.gif

   

Transmission gates tran and rtran are permanently on and do not have a control line. Tran can be used to interface two wires with seperate drives, and rtran can be used to weaken signals.

传输门中tran 和 rtran 因为没有control line(控制线),所以是永久有效(on)。 Tran主要用来面向有着两个驱动的双线, rtran主要用于削弱信号。

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Examples //举例
   

space.gif

   

  1 module transmission_gates();  
  2 
  3 reg data_enable_low, in;
  4 wire data_bus, out1, out2;
  5 
  6 bufif0 U1(data_bus,in, data_enable_low);
  7 buf  U2(out1,in);
  8 not U3(out2,in);
  9 
 10 initial begin
 11   $monitor(
 12     "@%g in=%b data_enable_low=%b out1=%b out2= b data_bus=%b", 
 13     $time, in, data_enable_low, out1, out2, data_bus);
 14   data_enable_low = 0;
 15   in = 0;
 16    #4  data_enable_low = 1;
 17    #8  $finish;
 18 end
 19 
 20 always  #2  in = ~in;
 21 
 22 endmodule

You could download file transmission_gates.v here

   

space.gif

   
 @0 in = 0 data_enable_low = 0 out1 = 0 out2 = 1 data_bus = 0
 @2 in = 1 data_enable_low = 0 out1 = 1 out2 = 0 data_bus = 1
 @4 in = 0 data_enable_low = 1 out1 = 0 out2 = 1 data_bus = z
 @6 in = 1 data_enable_low = 1 out1 = 1 out2 = 0 data_bus = z
 @8 in = 0 data_enable_low = 1 out1 = 0 out2 = 1 data_bus = z
 @10 in = 1 data_enable_low = 1 out1 = 1 out2 = 0 data_bus = z
   

space.gif

   
   

space.gif

  ../images/main/bullet_green_ball.gif Switch Primitives //开关电路语言
   

There are six different switch primitives (transistor models) used in Verilog, nmos, pmos and cmos and the corresponding three resistive versions rnmos, rpmos and rcmos. The cmos type of switches have two gates and so
have two control signals.

在Verilog中有6个不同的开关原语 (晶体管模型): nmos, pmos, cmos,和对应的三种有阻抗的 (resistive)rnmos, rpmos, rcmos. 

cmos类型的开关电路有两个门组成,因此也有两个控制信号。

   

space.gif

   

Syntax: keyword unique_name (drain. source, gate)  //开关原语的语法 (漏极、源极、栅极)

   

space.gif

    ../images/verilog/switch_prms.gif
   

space.gif

   

Gate

Description

1. pmos

Uni-directional PMOS switch //单向PMOS开关

1. rpmos

Resistive PMOS switch 带阻抗的PMOS

2. nmos

Uni-directional NMOS switch  //单向传输的NMOS开关

2. rnmos

Resistive NMOS switch //带阻抗的NMOS开关

3. cmos

Uni-directional CMOS switch //单向的CMOS开关

3. rcmos

Resistive CMOS switch      //但阻抗的CMOS开关

4. tranif1

Bi-directional transistor (High) //双向传输三极管(高电平有效)

4. tranif0

Bi-directional transistor (Low) //双向传输三极管(低电平有效)

5. rtranif1

Resistive Transistor (High)  //带阻抗的双向传输三极管(高电平有效)

5. rtranif0

Resistive Transistor (Low)  //带阻抗双向传输三极管(低电平有效)

6. tran

Bi-directional pass transistor  //双向传输三极管

6. rtran

Resistive pass transistor //带阻抗的双向传输三极管

7. pullup

Pull up resistor //上拉电阻

8. pulldown

Pull down resistor //下拉电阻

   

space.gif

   

Transmission gates are bi-directional and can be resistive or non-resistive. Resistive devices reduce the signal strength which appears on the output by one level. All the switches only pass signals from source to drain,
incorrect wiring of the devices will result in high impedance outputs.

传输门是双向的可以有阻抗也可以无阻抗。带阻抗的设备在下一级输出时,降低信号强度。所有的开关电路都只能将信号从source 传向 drain,(即从源极到漏极)。不正确的设备布线,将导致高阻输出(Z)。

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Examples //举例   switch name(drain,source ,gate)
   

space.gif

   

 1 module switch_primitives();
 2 
 3 wire  net1, net2, net3;
 4 wire  net4, net5, net6;
 5 
 6 tranif0 my_gate1 (net1, net2, net3);
 7 rtranif1 my_gate2 (net4, net5, net6);
 8 
 9 endmodule

You could download file switch_primitives.v here

   

space.gif

   

Transmission gates tran and rtran are permanently on and do not have a control line. Tran can be used to interface two wires with separate drives, and rtran can be used to weaken signals. Resistive devices reduce the
signal strength which appears on the output by one level. All the switches only pass signals from source to drain, incorrect wiring of the devices will result in high impedance outputs.

传输门tran和tran由于没有控制线,可以永久有效。Tran能够驱动具有分别驱动的双线。rtran能够用来削弱信号。阻抗设备的下一级输出将削弱信号。

所有的开关只将信号从source传送到drain,设备间不正确的连线,将导致高阻输出。

   

space.gif

  ../images/main/bullet_green_ball.gif Logic Values and signal Strengths // 逻辑值和信号强度
   

The Verilog HDL has got four logic values

// Verilog HDL有4个逻辑值: 0, 1, X(未知), Z(高阻)。

   

space.gif

   

Logic Value

Description

0

zero, low, false //0,低电平、false

1

one, high, true // 1, 高电平、true

z or Z

high impedance, floating //高阻的,悬浮的

x or X

unknown, uninitialized, contention //未知,未初始化,竞争

   

space.gif

  ../images/main/bullet_green_ball.gif Verilog Strength Levels //Verilog中 强度级别
   

space.gif

   

Strength Level

Specification Keyword

7 Supply Drive // 电源驱动

supply0 supply1

抱歉!评论已关闭.