Exemple #1
0
        private Mosfet3Model CreateMOS3Model(string name, bool nmos, string parameters)
        {
            var model = new Mosfet3Model(name, nmos);

            ApplyParameters(model, parameters);
            return(model);
        }
Exemple #2
0
        /// <summary>
        /// Create a MOS3 transistor
        /// </summary>
        /// <param name="name">Name</param>
        /// <param name="d">Drain</param>
        /// <param name="g">Gate</param>
        /// <param name="s">Source</param>
        /// <param name="b">Bulk</param>
        /// <param name="modelname">Model name</param>
        /// <param name="nmos">True for NMOS, false for PMOS</param>
        /// <param name="modelparams">Model parameters</param>
        /// <returns></returns>
        protected Mosfet3 CreateMOS3(Identifier name, Identifier d, Identifier g, Identifier s, Identifier b,
                                     Identifier modelname, bool nmos, string modelparams)
        {
            // Create model
            Mosfet3Model model = new Mosfet3Model(modelname, nmos);

            ApplyParameters(model, modelparams);

            // Create transistor
            Mosfet3 mos = new Mosfet3(name);

            mos.Connect(d, g, s, b);
            mos.SetModel(model);
            return(mos);
        }
        /// <summary>
        /// Create a MOS3 transistor
        /// </summary>
        /// <param name="name">Name</param>
        /// <param name="d">Drain</param>
        /// <param name="g">Gate</param>
        /// <param name="s">Source</param>
        /// <param name="b">Bulk</param>
        /// <param name="modelname">Model name</param>
        /// <param name="nmos">True for NMOS, false for PMOS</param>
        /// <param name="modelparams">Model parameters</param>
        /// <returns></returns>
        protected Mosfet3 CreateMOS3(string name, string d, string g, string s, string b,
                                     string modelname, bool nmos, string modelparams)
        {
            // Create model
            var model = new Mosfet3Model(modelname, nmos);

            ApplyParameters(model, modelparams);

            // Create transistor
            var mos = new Mosfet3(name);

            mos.Connect(d, g, s, b);
            mos.SetModel(model);
            return(mos);
        }
Exemple #4
0
        public MosfetModelGenerator()
        {
            // Default MOS levels
            Levels.Add(1, (string name, string type, string version) =>
            {
                var m = new Mosfet1Model(name);
                switch (type.ToLower())
                {
                case "nmos": m.SetParameter("nmos", true); break;

                case "pmos": m.SetParameter("pmos", true); break;
                }

                return(m);
            });

            Levels.Add(2, (string name, string type, string version) =>
            {
                var m = new Mosfet2Model(name);
                switch (type.ToLower())
                {
                case "nmos": m.SetParameter("nmos", true); break;

                case "pmos": m.SetParameter("pmos", true); break;
                }

                return(m);
            });

            Levels.Add(3, (string name, string type, string version) =>
            {
                var m = new Mosfet3Model(name);
                switch (type.ToLower())
                {
                case "nmos": m.SetParameter("nmos", true); break;

                case "pmos": m.SetParameter("pmos", true); break;
                }

                return(m);
            });
        }