//////////////////////////////////////////////////////////////////////////////// // File Name: resistor.v //////////////////////////////////////////////////////////////////////////////// // Copyright (C) 1997 Free Model Foundation // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // MODIFICATION HISTORY: // // version: | author: | mod date: | changes made: // V1.0 C. Cummings 97 MAR 14 Initial Release // ///////////////////////////////////////////////////////////////////////////// // PART DESCRIPTION : // // Library: DISCRETE // Technology: // Part: RESISTOR // // Desciption: Resistor // ///////////////////////////////////////////////////////////////////////////// module r(p1,p2); inout p1,p2; parameter DRIVE_STRENGTH = "PULL"; `ifdef setrpull rtran r1(p1,p2); `else reg en1, en2, en3; tranif1 t1(p1,n1,en1), t2(n1,n2,en2), t3(n2,p2,en3); rtran r1(n1,n2), r2(n2,p2); initial case(DRIVE_STRENGTH) "WIRE" : begin en1 = 1; en2 = 1; en3 = 1; end "PULL" : begin en1 = 1; en2 = 1; en3 = 0; end "WEAK" : begin en1 = 1; en2 = 0; en3 = 0; end "OPEN" : begin en1 = 0; en2 = 0; en3 = 0; end default: begin en1 = 1; en2 = 1; en3 = 0; end endcase `endif endmodule