📄 class.v
字号:
// class zero delay library for functional test only//// all gates have zero delay for maximum simulation speed// registers and latches have a delay of one to avoid simulation ordering problems// Verilog built-in or user defined primitives are used because they// are accelerated by verilog and run much faster than hdl code// Verilog primitive state definition:// 0=0,1=1,x=unknown,?=(0,1 or x),b=(0 or 1)// r=rising edge,f=falling edge,*=rising or falling edge// -=keep last state (for registers and latchs, etc)//// GATESmodule AN2(Z,A,B); input A,B; output Z; and (Z,A,B);endmodulemodule AN2I(Z,A,B); input A,B; output Z; and (Z,A,B);endmodulemodule OR2(Z,A,B); input A,B; output Z; or (Z,A,B);endmodulemodule OR2I(Z,A,B); input A,B; output Z; or (Z,A,B);endmodulemodule IV(Z,A); input A; output Z; not (Z,A);endmodulemodule IVI(Z,A); input A; output Z; not (Z,A);endmodulemodule IVP(Z,A); input A; output Z; not (Z,A);endmodulemodule IVA(Z,A); input A; output Z; not (Z,A);endmodulemodule IVAP(Z,A); input A; output Z; not (Z,A);endmodulemodule IVDA(Z,Y,A); input A; output Z,Y; not (Y,A); buf (Z,A);endmodulemodule IVDAP(Z,Y,A); input A; output Z,Y; not (Y,A); buf (Z,A);endmodulemodule B5I(Z,A); input A; output Z; not (Z,A);endmodulemodule B5IP(Z,A); input A; output Z; not (Z,A);endmodulemodule B4I(Z,A); input A; output Z; not (Z,A);endmodulemodule B4IP(Z,A); input A; output Z; not (Z,A);endmodulemodule ND2(Z,A,B); input A,B; output Z; nand (Z,A,B);endmodulemodule ND2I(Z,A,B); input A,B; output Z; nand (Z,A,B);endmodulemodule ND2P(Z,A,B); input A,B; output Z; nand (Z,A,B);endmodulemodule NR2(Z,A,B); input A,B; output Z; nor (Z,A,B);endmodulemodule NR2I(Z,A,B); input A,B; output Z; nor (Z,A,B);endmodulemodule NR2P(Z,A,B); input A,B; output Z; nor (Z,A,B);endmodulemodule EN(Z,A,B); input A,B; output Z; xnor (Z,A,B);endmodulemodule ENI(Z,A,B); input A,B; output Z; xnor (Z,A,B);endmodulemodule EO(Z,A,B); input A,B; output Z; xor (Z,A,B);endmodulemodule EOI(Z,A,B); input A,B; output Z; xor (Z,A,B);endmodulemodule ND3(Z,A,B,C); input A,B,C; output Z; nand (Z,A,B,C);endmodulemodule ND3P(Z,A,B,C); input A,B,C; output Z; nand (Z,A,B,C);endmodulemodule NR3(Z,A,B,C); input A,B,C; output Z; nor (Z,A,B,C);endmodulemodule NR3P(Z,A,B,C); input A,B,C; output Z; nor (Z,A,B,C);endmodulemodule AN3(Z,A,B,C); input A,B,C; output Z; and (Z,A,B,C);endmodulemodule OR3(Z,A,B,C); input A,B,C; output Z; or (Z,A,B,C);endmodulemodule ND4(Z,A,B,C,D); input A,B,C,D; output Z; nand (Z,A,B,C,D);endmodulemodule ND4P(Z,A,B,C,D); input A,B,C,D; output Z; nand (Z,A,B,C,D);endmodulemodule NR4(Z,A,B,C,D); input A,B,C,D; output Z; nor (Z,A,B,C,D);endmodulemodule ND5(Z,A,B,C,D,E); input A,B,C,D,E; output Z; nand (Z,A,B,C,D,E);endmodulemodule AO6(Z,A,B,C); input A,B,C; output Z; p_ao6(Z,A,B,C);endmodulemodule AO6P(Z,A,B,C); input A,B,C; output Z; p_ao6(Z,A,B,C);endmoduleprimitive p_ao6(Z,A,B,C); input A,B,C; output Z; table// A B C : Z ? ? 1 : 0; 0 ? 0 : 1; ? 0 0 : 1; 1 1 ? : 0; endtableendprimitivemodule AO7(Z,A,B,C); input A,B,C; output Z; p_ao7(Z,A,B,C);endmodulemodule AO7P(Z,A,B,C); input A,B,C; output Z; p_ao7(Z,A,B,C);endmoduleprimitive p_ao7(Z,A,B,C); input A,B,C; output Z; table// A B C : Z ? ? 0 : 1; 1 ? 1 : 0; ? 1 1 : 0; 0 0 ? : 1; // changed EBP 5/7/92 was 0 0 1 which was wrong endtableendprimitivemodule AO2(Z,A,B,C,D); input A,B,C,D; output Z; p_ao2(Z,A,B,C,D);endmodulemodule AO2P(Z,A,B,C,D); input A,B,C,D; output Z; p_ao2(Z,A,B,C,D);endmoduleprimitive p_ao2(Z,A,B,C,D); input A,B,C,D; output Z; table// A B C D : Z 1 1 ? ? : 0; ? ? 1 1 : 0; 0 ? 0 ? : 1; 0 ? ? 0 : 1; ? 0 ? 0 : 1; ? 0 0 ? : 1; endtableendprimitivemodule AO4(Z,A,B,C,D); input A,B,C,D; output Z; p_ao4(Z,A,B,C,D);endmodulemodule AO4P(Z,A,B,C,D); input A,B,C,D; output Z; p_ao4(Z,A,B,C,D);endmoduleprimitive p_ao4(Z,A,B,C,D); input A,B,C,D; output Z; table// A B C D : Z 0 0 ? ? : 1; ? ? 0 0 : 1; 1 ? 1 ? : 0; ? 1 1 ? : 0; 1 ? ? 1 : 0; ? 1 ? 1 : 0; endtableendprimitivemodule AO1(Z,A,B,C,D); input A,B,C,D; output Z; p_ao1(Z,A,B,C,D);endmoduleprimitive p_ao1(Z,A,B,C,D); input A,B,C,D; output Z; table// A B C D : Z 1 1 ? ? : 0; ? ? 1 ? : 0; ? ? ? 1 : 0; ? 0 0 0 : 1; 0 ? 0 0 : 1; endtableendprimitivemodule AO3(Z,A,B,C,D); input A,B,C,D; output Z; p_ao3(Z,A,B,C,D);endmodulemodule AO3P(Z,A,B,C,D); input A,B,C,D; output Z; p_ao3(Z,A,B,C,D);endmoduleprimitive p_ao3(Z,A,B,C,D); input A,B,C,D; output Z; table// A B C D : Z 1 ? 1 1 : 0; ? 1 1 1 : 0; 0 0 ? ? : 1; ? ? 0 ? : 1; ? ? ? 0 : 1; endtableendprimitivemodule AN2P(Z,A,B); input A,B; output Z; and (Z,A,B);endmodulemodule AN3P(Z,A,B,C); input A,B,C; output Z; and (Z,A,B,C);endmodulemodule AN4(Z,A,B,C,D); input A,B,C,D; output Z; and (Z,A,B,C,D);endmodulemodule AN4P(Z,A,B,C,D); input A,B,C,D; output Z; and (Z,A,B,C,D);endmodulemodule OR2P(Z,A,B); input A,B; output Z; or (Z,A,B);endmodulemodule OR3P(Z,A,B,C); input A,B,C; output Z; or (Z,A,B,C);endmodulemodule OR4(Z,A,B,C,D); input A,B,C,D; output Z; or (Z,A,B,C,D);endmodulemodule OR4P(Z,A,B,C,D); input A,B,C,D; output Z; or (Z,A,B,C,D);endmodulemodule MUX21H(Z,S,A,B); input S,A,B; output Z; p_mux21h (Z,S,A,B);endmoduleprimitive p_mux21h(Z,S,A,B); input S,A,B; output Z; table// S A B : Z 0 0 ? : 0; 0 1 ? : 1; 1 ? 0 : 0; 1 ? 1 : 1; x 0 0 : 0; x 1 1 : 1; endtableendprimitivemodule NR5(Z,A,B,C,D,E); input A,B,C,D,E; output Z; nor (Z,A,B,C,D,E);endmodulemodule ND6(Z,A,B,C,D,E,F); input A,B,C,D,E,F; output Z; nand (Z,A,B,C,D,E,F);endmodulemodule NR6(Z,A,B,C,D,E,F); input A,B,C,D,E,F; output Z; nor (Z,A,B,C,D,E,F);endmodulemodule ND8(Z,A,B,C,D,E,F,G,H); input A,B,C,D,E,F,G,H; output Z; nand (Z,A,B,C,D,E,F,G,H);endmodulemodule NR8(Z,A,B,C,D,E,F,G,H); input A,B,C,D,E,F,G,H; output Z; nor (Z,A,B,C,D,E,F,G,H);endmodulemodule EON1(Z,A,B,C,D); input A,B,C,D; output Z; p_eon1 (Z,A,B,C,D);endmoduleprimitive p_eon1(Z,A,B,C,D); input A,B,C,D; output Z; table// A B C D : Z ? ? 1 1 : 1; 1 ? 0 ? : 0; ? 1 0 ? : 0; 1 ? ? 0 : 0; ? 1 ? 0 : 0; 0 0 ? ? : 1; endtableendprimitivemodule EO1(Z,A,B,C,D); input A,B,C,D; output Z; p_eo1 (Z,A,B,C,D);endmoduleprimitive p_eo1(Z,A,B,C,D); input A,B,C,D; output Z; table// A B C D : Z 1 1 ? ? : 0; 0 ? 1 ? : 1; 0 ? ? 1 : 1; ? 0 1 ? : 1; ? 0 ? 1 : 1; ? ? 0 0 : 0; endtableendprimitivemodule ND5P(Z,A,B,C,D,E); input A,B,C,D,E; output Z; nand (Z,A,B,C,D,E);endmodulemodule NR5P(Z,A,B,C,D,E); input A,B,C,D,E; output Z; nor (Z,A,B,C,D,E);endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -