Routine bas-niveau
fr - eng


chargepump_c - routine de calcul bas-niveau d'une pompe de charge

Module

Paramètres

Contenu du fichier


/* chargepump_c subroutine
 * ideal and noisy charge pump computation
 *
 * Copyright (C) 2007-2011 Alan Layec
 *
 * This file is part of modnumlib.
 *
 * modnumlib is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * modnumlib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with modnumlib; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
 
/* REVISION HISTORY :
 * $Log$
 */
 
#include "modnum_lib.h"

/* chargepump_c routine de calcul d'une pompe de charge
 *
 * Entrées :
 * n    : taille des vecteurs 
 * up   : adresse de départ des vecteurs up
 * down : adresse de départ des vecteurs down
 * Io   : adresse de départ des vecteurs Io
 * typ_leak : type de courant fuite 
 *               0: pas de fuite
 *               1: fuite constante
 *               2: fuite bruit normal
 * Ileak_m : adresse de départ des vecteurs du courants de fuite moyen
 * Ileak_d : adresse de départ des vecteurs de la déviation du courant de fuite
 *
 * Sorties :
 * Icp : adresse de départ du vecteur de sortie
 */

void chargepump_c(int *n,double *up,double *down,double *Io, int *typ_leak,double *Ileak_m,double *Ileak_d,double *Icp)
{
 /*déclaration*/
 int i;
 
 /*test sur type de courant de fuite*/
 switch (*typ_leak)
 {
  case 0 : /*cas pas de fuite*/
  {
   for(i=0;i<(*n);i++) Icp[i]=Io[i]*(up[i]-down[i]);
   break;
  }
  case 1 : /*cas fuite constante*/
  {
   for(i=0;i<(*n);i++) Icp[i]=Io[i]*(up[i]-down[i])+Ileak_m[i];
   break;
  }
  case 2 :
  {
   /*Appel noiseblk_c*/
   noiseblk_c(n,(i=1,&i),&Ileak_d[0],&Ileak_m[0],&Icp[0]);
   for(i=0;i<(*n);i++) Icp[i]=Io[i]*(up[i]-down[i])+Icp[i];
   break;
  }
  /*cas other*/
  for(i=0;i<(*n);i++) Icp[i]=Io[i]*(up[i]-down[i]);
  break;
 }
 return;
}

Auteurs

A. Layec