Esempio n. 1
0
        /// <summary>
        /// Generate a BSIM3 model
        /// </summary>
        /// <param name="name">Name of the parameter</param>
        /// <param name="type">Type of the parameter</param>
        /// <param name="version">Version of the parameter</param>
        /// <returns></returns>
        public static ICircuitObject GenerateBSIM3Model(CircuitIdentifier name, string type, string version)
        {
            double v = 3.3;

            switch (version)
            {
            case null:
            case "3.3.0": v = 3.3; break;

            case "3.2.4": v = 3.24; break;

            default:
                if (!double.TryParse(version, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out v))
                {
                    throw new Exception("Unsupported version \"" + version + "\"");
                }
                break;
            }

            if (Math.Abs(v - 3.3) < 1e-12)
            {
                var b3v30 = new BSIM3v30Model(name);
                switch (type)
                {
                case "nmos": b3v30.SetNMOS(true); break;

                case "pmos": b3v30.SetPMOS(true); break;

                default: throw new Exception("Invalid type \"" + type + "\"");
                }
                return(b3v30);
            }
            else if (Math.Abs(v - 3.24) < 1e-12)
            {
                var b3v24 = new BSIM3v24Model(name);
                switch (type)
                {
                case "nmos": b3v24.SetNMOS(true); break;

                case "pmos": b3v24.SetPMOS(true); break;

                default: throw new Exception("Invalid type \"" + type + "\"");
                }
                return(b3v24);
            }
            else
            {
                throw new Exception("Unrecognized version \"" + v.ToString() + "\"");
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Gets or sets the device model
 /// </summary>
 public void SetModel(BSIM3v24Model model) => Model = model;