Re: [ng-spice] BSIM3 Transient analysis ignoring TEMP
Hi,
To follow this up I asked Mike Smith (Winspice) if he'd fixed anything
specific to this and he replied as follows;
___________________________________________________________
I found a temperature problem recently which was fixed by making a
modification to spiceif.c.
Find the routine if_run() and compare with the following. The bits
commented /* -- *** !BUG *** */ are bits that have been added (although
there are other changes that tou won't see in stock Spice3f4 - just
ignore
them):-
int if_run(char * t, char * what, wordlist * args, char * tab)
{
GENERIC * ckt = (GENERIC *) t;
int err;
struct line deck;
char buf[BSIZE_SP];
int j;
int which = -1;
IFuid specUid;
IFuid optUid;
char * pTmpStr;
/* -- First parse the line... */
if (cieq(what, "tran")
|| cieq(what, "ac")
|| cieq(what, "dc")
|| cieq(what, "op")
|| cieq(what, "pz")
|| cieq(what, "disto")
|| cieq(what, "adjsen")
|| cieq(what, "sens")
|| cieq(what, "tf")
|| cieq(what, "noise"))
{
pTmpStr = wl_flatten(args);
(void) sprintf(buf, ".%s", pTmpStr);
tfree(pTmpStr);
memset(&deck, 0, sizeof(deck));
deck.li_next = NULL;
deck.li_actual = NULL;
deck.li_error = NULL;
deck.li_warning = NULL;
deck.li_linenum = 0;
deck.li_line = buf;
deck.li_file = NULL;
if (ft_curckt->ci_specTask)
{
err = ft_sim->deleteTask(ft_curckt->ci_ckt,
ft_curckt->ci_specTask);
if (err)
{
ft_sperror(err, "deleteTask");
return (2);
}
}
err = IFnewUid(ft_curckt->ci_ckt,
&specUid,
(IFuid) NULL,
"special",
UID_TASK,
(GENERIC **) NULL);
if (err)
{
tfree(specUid);
ft_sperror(err, "newUid");
return (2);
}
err = ft_sim->newTask(ft_curckt->ci_ckt,
(GENERIC **) &ft_curckt->ci_specTask,
specUid);
tfree(specUid);
if (err)
{
ft_sperror(err, "newTask");
return (2);
}
for (j = 0; j < ft_sim->numAnalyses; j++)
{
if (cieq(ft_sim->analyses[j]->name, "options"))
{
which = j;
break;
}
}
if (which != -1)
{
err = IFnewUid(ft_curckt->ci_ckt,
&optUid,
(IFuid) NULL,
"options",
UID_ANALYSIS,
(GENERIC **) NULL);
if (err)
{
tfree(optUid);
ft_sperror(err, "newUid");
return (2);
}
err = ft_sim->newAnalysis(ft_curckt->ci_ckt,
which,
optUid,
(GENERIC **)
&ft_curckt->ci_specOpt,
(GENERIC *)
ft_curckt->ci_specTask);
tfree(optUid);
if (err)
{
ft_sperror(err, "createOptions");
return (2);
}
/* -- *** BUG! ***
*/
/* -- Inherit the default simulation settings taken from the
*/
/* -- .option line.
*/
memcpy(&ft_curckt->ci_specOpt->TSKtemp,
&ft_curckt->ci_defOpt->TSKtemp,
sizeof(TSKtask) - offsetof(TSKtask, TSKtemp));
ft_curckt->ci_curOpt = ft_curckt->ci_specOpt;
}
ft_curckt->ci_curTask = ft_curckt->ci_specTask;
INPpas2(ckt, (card *) &deck, (INPtables *) tab,
ft_curckt->ci_specTask);
if (deck.li_error)
{
(void) fprintf(cp_err, "Error: %s\n", deck.li_error);
return 2;
}
if (deck.li_warning)
{
(void) fprintf(cp_err, "Warning: %s\n", deck.li_warning);
}
}
/* -- *** BUG! ***
*/
/* -- A bug fix suggested by Cecil Aswell (aswell@netcom.com) to let
*/
/* -- the interactive analysis commands get the current temperature
*/
/* -- and other options.
*/
if (cieq(what, "run"))
{
ft_curckt->ci_curTask = ft_curckt->ci_defTask;
ft_curckt->ci_curOpt = ft_curckt->ci_defOpt;
}
/* -- Find out what we are supposed to do. */
if (cieq(what, "tran")
|| cieq(what, "ac")
|| cieq(what, "dc")
|| cieq(what, "op")
|| cieq(what, "pz")
|| cieq(what, "disto")
|| cieq(what, "noise")
|| cieq(what, "adjsen")
|| cieq(what, "sens")
|| cieq(what, "tf")
|| cieq(what, "run"))
{
err = ft_sim->doAnalyses(ckt, 1, ft_curckt->ci_curTask);
if (err != OK)
{
ft_sperror(err, "doAnalyses");
/* wrd_end(); */
if (err == E_PAUSE)
{
return (1);
}
else
{
return (2);
}
}
}
else if (cieq(what, "resume"))
{
err = ft_sim->doAnalyses(ckt, 0, ft_curckt->ci_curTask);
if (err != OK)
{
ft_sperror(err, "doAnalyses");
/* wrd_end(); */
if (err == E_PAUSE)
{
return (1);
}
else
{
return (2);
}
}
}
else
{
(void) fprintf(cp_err, "if_run: Internal Error: bad run type
%s\n",
what);
return (2);
}
return (0);
}
___________________________________________________________
ng-spice@ieee.ing.uniroma1.it wrote:
>
> Hi,
>
> I've tried using ng-spice to simulate the delay through an ASIC IO
> buffer based on BSIM3 MOSFET models.
> I would expect that the characteristics of the buffer (delay,
> rise-time
> etc) would change with temperature, but when I change the simulation
> temerature via the TEMP option the characteristics remain
> unchanged....
> to the limit of Spices' precision.
>
> As a sanity check I tried the same decks on vanilla spice3f5 (no
> change)
> and on WinSpice1.02 (worked OK, device was faster at lower TEMP).
>
> The version of ng-spice I'm using is 0.5 (the last version I could
> successfully build on Solaris 2.6)
>
> Has anyone else tried this or have any explanation for it?
>
> Regards,
>
> Robert
>
> --
> Robert Lindsell, Senior Hardware Engineer |
> robertl@research.canon.com.au
> Canon Information Systems Research Australia| Phone: +61-2-9805-2876
> PO Box 313 NORTH RYDE NSW 2113 | Fax: +61-2-9805-2929
>
> eGroups Sponsor
>
> Banking in California? View your Bank of America accounts
> on Yahoo!
--
Robert Lindsell, Senior Hardware Engineer |
robertl@research.canon.com.au
Canon Information Systems Research Australia| Phone: +61-2-9805-2876
PO Box 313 NORTH RYDE NSW 2113 | Fax: +61-2-9805-2929
Partial thread listing: