From f548e8400a22832d13a52d2bdf83dd72666f7549 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 30 Jul 2023 14:44:07 +0200 Subject: [PATCH] eprvcd [-a] [-t timescale] node node ... timescale is now given by minimum 1fs, maximum 1s. --- src/xspice/evt/evtprint.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/xspice/evt/evtprint.c b/src/xspice/evt/evtprint.c index ac97fcde3..534cad422 100644 --- a/src/xspice/evt/evtprint.c +++ b/src/xspice/evt/evtprint.c @@ -610,16 +610,22 @@ EVTprintvcd(wordlist *wl) char *value; /* Check for the "-a" option (output analog values at timesteps) - * and "-t nn": specifies the VCD timestep as a power of ten. - */ + * and "-t nn": specifies the VCD timestep with range 1fs to 1s */ while (wl && wl->wl_word[0] == '-') { if (wl->wl_word[1] == 'a' && !wl->wl_word[2]) { timesteps = 1; } else if (wl->wl_word[1] == 't' && !wl->wl_word[2]) { wl = wl->wl_next; - if (wl) - tspower = atoi(wl->wl_word); + if (wl) { + double input; + int error = 0; + char* inword = wl->wl_word; + input = INPevaluate(&inword, &error, 0); + tspower = (int)ceil(- 1. * log10(input)); + if (tspower < 0) + tspower = 0; + } else break; } else {