Exemple #1
0
        public void When_BasicParameters_Expect_NoException()
        {
            // Create the mosfet
            var model      = new Mosfet1Model("M1");
            var parameters = model.GetParameterSet <SpiceSharp.Components.Mosfets.Level1.ModelParameters>();

            // <example_parameters_mos1_creategetter>
            // Create a getter for the nominal temperature of the mosfet1 model
            var tnomGetter  = parameters.CreatePropertyGetter <double>("tnom");
            var temperature = tnomGetter(); // In degrees Celsius
            // </example_parameters_mos1_creategetter>

            // <example_parameters_mos1_createsetter>
            // Create a setter for the gate-drain overlap capacitance of the mosfet1 model
            var cgdoSetter = parameters.CreateParameterSetter <double>("cgdo");

            cgdoSetter(1e-12); // 1pF
            // </example_parameters_mos1_createsetter>

            // <example_parameters_mos1_getparameter>
            // Get the parameter that describes the oxide thickness of the mosfet1 model
            var toxParameter = parameters.GetProperty <double>("tox");

            // </example_parameters_mos1_getparameter>

            // <example_parameters_mos1_setparameter>
            // Flag the model as a PMOS type
            parameters.SetParameter("pmos", true);
            // </example_parameters_mos1_setparameter>
        }