Synchronize lxt_write.c and lxt2_write.c with Tony Bybell
cvs -z3 -d:pserver:anonymous@gtkwave.cvs.sourceforge.net:/cvsroot/gtkwave co -P gtkwave3 delete CVS logs embedded in files had to add #define wave_alloca alloca to lxt2_write.h differences remain relative to upstream .h files: whitespace value chosen for LXT*_WR_SYMPRIME Regarding the latter, Tony writes "Don't worry about the .h file. The only difference is a considerably larger initial hash size. If this isn't a problem with Icarus now, it certainly doesn't need to be bumped up."
This commit is contained in:
parent
25ad1c174a
commit
6c5773c0e3
162
vpi/lxt2_write.c
162
vpi/lxt2_write.c
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-2004 Tony Bybell.
|
* Copyright (c) 2003-2007 Tony Bybell.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _AIX
|
||||||
|
#pragma alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
#include "lxt2_write.h"
|
#include "lxt2_write.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -50,6 +55,55 @@ for(;;s++)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* in-place sort to keep chained facs from migrating...
|
||||||
|
*/
|
||||||
|
static void wave_mergesort(struct lxt2_wr_symbol **a, struct lxt2_wr_symbol **b, int lo, int hi)
|
||||||
|
{
|
||||||
|
int i, j, k;
|
||||||
|
|
||||||
|
if (lo<hi)
|
||||||
|
{
|
||||||
|
int mid=(lo+hi)/2;
|
||||||
|
|
||||||
|
wave_mergesort(a, b, lo, mid);
|
||||||
|
wave_mergesort(a, b, mid+1, hi);
|
||||||
|
|
||||||
|
i=0; j=lo;
|
||||||
|
while (j<=mid)
|
||||||
|
{
|
||||||
|
b[i++]=a[j++];
|
||||||
|
}
|
||||||
|
|
||||||
|
i=0; k=lo;
|
||||||
|
while ((k<j)&&(j<=hi))
|
||||||
|
{
|
||||||
|
if (strcmp(b[i]->name, a[j]->name) <= 0)
|
||||||
|
{
|
||||||
|
a[k++]=b[i++];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
a[k++]=a[j++];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (k<j)
|
||||||
|
{
|
||||||
|
a[k++]=b[i++];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void wave_msort(struct lxt2_wr_symbol **a, int num)
|
||||||
|
{
|
||||||
|
struct lxt2_wr_symbol **b = malloc(((num/2)+1) * sizeof(struct lxt2_wr_symbol *));
|
||||||
|
|
||||||
|
wave_mergesort(a, b, 0, num-1);
|
||||||
|
|
||||||
|
free(b);
|
||||||
|
}
|
||||||
|
|
||||||
/************************ splay ************************/
|
/************************ splay ************************/
|
||||||
|
|
||||||
static lxt2_wr_ds_Tree * lxt2_wr_ds_splay (granmsk_t i, lxt2_wr_ds_Tree * t) {
|
static lxt2_wr_ds_Tree * lxt2_wr_ds_splay (granmsk_t i, lxt2_wr_ds_Tree * t) {
|
||||||
|
|
@ -497,21 +551,6 @@ strcpy(lt->compress_fac_str, str);
|
||||||
* emit facs in sorted order along with geometry
|
* emit facs in sorted order along with geometry
|
||||||
* and sync table info
|
* and sync table info
|
||||||
*/
|
*/
|
||||||
static int lxt2_wr_compare(const void *v1, const void *v2)
|
|
||||||
{
|
|
||||||
struct lxt2_wr_symbol *s1 = *(struct lxt2_wr_symbol **)v1;
|
|
||||||
struct lxt2_wr_symbol *s2 = *(struct lxt2_wr_symbol **)v2;
|
|
||||||
int rc = strcmp(s1->name, s2->name);
|
|
||||||
if(rc)
|
|
||||||
{
|
|
||||||
return(rc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return(s1->msb - s2->msb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void strip_brack(struct lxt2_wr_symbol *s)
|
static void strip_brack(struct lxt2_wr_symbol *s)
|
||||||
{
|
{
|
||||||
|
|
@ -521,6 +560,11 @@ if(s->namlen<3) return;
|
||||||
lastch--;
|
lastch--;
|
||||||
while(lastch!=s->name)
|
while(lastch!=s->name)
|
||||||
{
|
{
|
||||||
|
if(*lastch=='.')
|
||||||
|
{
|
||||||
|
return; /* MTI SV [0.3] notation for implicit vars */
|
||||||
|
}
|
||||||
|
|
||||||
if(*lastch=='[')
|
if(*lastch=='[')
|
||||||
{
|
{
|
||||||
*lastch=0x00;
|
*lastch=0x00;
|
||||||
|
|
@ -539,7 +583,7 @@ int i;
|
||||||
if((lt)&&(lt->numfacs))
|
if((lt)&&(lt->numfacs))
|
||||||
{
|
{
|
||||||
struct lxt2_wr_symbol *s = lt->symchain;
|
struct lxt2_wr_symbol *s = lt->symchain;
|
||||||
struct lxt2_wr_symbol **aliascache = calloc(lt->numalias, sizeof(struct lxt2_wr_symbol *));
|
struct lxt2_wr_symbol **aliascache = calloc(lt->numalias ? lt->numalias : 1, sizeof(struct lxt2_wr_symbol *));
|
||||||
int aliases_encountered, facs_encountered;
|
int aliases_encountered, facs_encountered;
|
||||||
|
|
||||||
lt->sorted_facs = (struct lxt2_wr_symbol **)calloc(lt->numfacs, sizeof(struct lxt2_wr_symbol *));
|
lt->sorted_facs = (struct lxt2_wr_symbol **)calloc(lt->numfacs, sizeof(struct lxt2_wr_symbol *));
|
||||||
|
|
@ -549,17 +593,17 @@ if((lt)&&(lt->numfacs))
|
||||||
if(lt->do_strip_brackets)
|
if(lt->do_strip_brackets)
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
lt->sorted_facs[i] = s;
|
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
|
||||||
strip_brack(s);
|
strip_brack(s);
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
lt->sorted_facs[i] = s;
|
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
}
|
}
|
||||||
qsort((void *)lt->sorted_facs, lt->numfacs, sizeof(struct lxt2_wr_symbol *), lxt2_wr_compare);
|
wave_msort(lt->sorted_facs, lt->numfacs);
|
||||||
|
|
||||||
if(lt->partial_preference)
|
if(lt->partial_preference)
|
||||||
{
|
{
|
||||||
|
|
@ -690,7 +734,7 @@ if((lt)&&(lt->numfacs))
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize the trace and get back and lt context
|
* initialize the trace and get back an lt context
|
||||||
*/
|
*/
|
||||||
struct lxt2_wr_trace *lxt2_wr_init(const char *name)
|
struct lxt2_wr_trace *lxt2_wr_init(const char *name)
|
||||||
{
|
{
|
||||||
|
|
@ -1005,8 +1049,10 @@ for(cnt = 0; cnt < lt->break_header_size; cnt += sizeof(buf))
|
||||||
seg = sizeof(buf);
|
seg = sizeof(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(buf, seg, 1, clone);
|
if(fread(buf, seg, 1, clone))
|
||||||
fwrite(buf, seg, 1, f2);
|
{
|
||||||
|
if(!fwrite(buf, seg, 1, f2)) break; /* write error! */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(clone);
|
fclose(clone);
|
||||||
|
|
@ -1380,7 +1426,7 @@ if((lt->timegranule>=lt->maxgranule)||(do_finalize)||(early_flush))
|
||||||
lxt2_wr_emit_u64(lt, (lt->firsttime>>32)&0xffffffff, lt->firsttime&0xffffffff);
|
lxt2_wr_emit_u64(lt, (lt->firsttime>>32)&0xffffffff, lt->firsttime&0xffffffff);
|
||||||
lxt2_wr_emit_u64(lt, (lt->lasttime>>32)&0xffffffff, lt->lasttime&0xffffffff);
|
lxt2_wr_emit_u64(lt, (lt->lasttime>>32)&0xffffffff, lt->lasttime&0xffffffff);
|
||||||
|
|
||||||
/* fprintf(stderr, "start: %Ld, end %Ld\n", lt->firsttime, lt->lasttime); */
|
/* fprintf(stderr, "start: %lld, end %lld\n", lt->firsttime, lt->lasttime); */
|
||||||
|
|
||||||
lt->timegranule=0;
|
lt->timegranule=0;
|
||||||
lt->numblock++;
|
lt->numblock++;
|
||||||
|
|
@ -1466,9 +1512,10 @@ if(lt)
|
||||||
}
|
}
|
||||||
else if (s->flags&LXT2_WR_SYM_F_DOUBLE)
|
else if (s->flags&LXT2_WR_SYM_F_DOUBLE)
|
||||||
{
|
{
|
||||||
double value;
|
double value = 0;
|
||||||
|
|
||||||
sscanf(s->value, "%lg", &value);
|
sscanf(s->value, "%lg", &value);
|
||||||
|
errno = 0;
|
||||||
lxt2_wr_emit_value_double(lt, s, 0, value);
|
lxt2_wr_emit_value_double(lt, s, 0, value);
|
||||||
}
|
}
|
||||||
else if (s->flags&LXT2_WR_SYM_F_STRING)
|
else if (s->flags&LXT2_WR_SYM_F_STRING)
|
||||||
|
|
@ -1752,13 +1799,13 @@ while(s->aliased_to) /* find root alias if exists */
|
||||||
valuelen = strlen(value); /* ensure string is proper length */
|
valuelen = strlen(value); /* ensure string is proper length */
|
||||||
if(valuelen == s->len)
|
if(valuelen == s->len)
|
||||||
{
|
{
|
||||||
vfix = alloca(s->len+1);
|
vfix = wave_alloca(s->len+1);
|
||||||
strcpy(vfix, value);
|
strcpy(vfix, value);
|
||||||
value = vfix;
|
value = vfix;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vfix = alloca(s->len+1);
|
vfix = wave_alloca(s->len+1);
|
||||||
|
|
||||||
if(valuelen < s->len)
|
if(valuelen < s->len)
|
||||||
{
|
{
|
||||||
|
|
@ -1972,16 +2019,19 @@ if((lt)&&(!lt->blackout))
|
||||||
s = lt->symchain;
|
s = lt->symchain;
|
||||||
while(s)
|
while(s)
|
||||||
{
|
{
|
||||||
if((s->msk & (LXT2_WR_GRAN_1VAL<<lt->timepos)) == LXT2_WR_GRAN_0VAL)
|
if(!(s->flags&LXT2_WR_SYM_F_ALIAS))
|
||||||
{
|
{
|
||||||
s->msk |= (LXT2_WR_GRAN_1VAL<<lt->timepos);
|
if((s->msk & (LXT2_WR_GRAN_1VAL<<lt->timepos)) == LXT2_WR_GRAN_0VAL)
|
||||||
s->chg[s->chgpos] = LXT2_WR_ENC_BLACKOUT;
|
{
|
||||||
|
s->msk |= (LXT2_WR_GRAN_1VAL<<lt->timepos);
|
||||||
|
s->chg[s->chgpos] = LXT2_WR_ENC_BLACKOUT;
|
||||||
|
|
||||||
s->chgpos++;
|
s->chgpos++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s->chg[s->chgpos-1] = LXT2_WR_ENC_BLACKOUT;
|
s->chg[s->chgpos-1] = LXT2_WR_ENC_BLACKOUT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
|
|
@ -2006,26 +2056,29 @@ if((lt)&&(lt->blackout))
|
||||||
s = lt->symchain;
|
s = lt->symchain;
|
||||||
while(s)
|
while(s)
|
||||||
{
|
{
|
||||||
if(s->flags&LXT2_WR_SYM_F_DOUBLE)
|
if(!(s->flags&LXT2_WR_SYM_F_ALIAS))
|
||||||
{
|
{
|
||||||
free(s->value);
|
if(s->flags&LXT2_WR_SYM_F_DOUBLE)
|
||||||
s->value = strdup("0"); /* will cause mismatch then flush */
|
{
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(!(s->flags&LXT2_WR_SYM_F_STRING))
|
|
||||||
{
|
|
||||||
s->value[0] = '-'; /* will cause mismatch then flush */
|
|
||||||
for(i=1;i<s->len;i++)
|
|
||||||
{
|
|
||||||
s->value[i] = 'x'; /* initial value */
|
|
||||||
}
|
|
||||||
s->value[i]=0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
free(s->value);
|
free(s->value);
|
||||||
s->value = calloc(1, 1*sizeof(char));
|
s->value = strdup("0"); /* will cause mismatch then flush */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!(s->flags&LXT2_WR_SYM_F_STRING))
|
||||||
|
{
|
||||||
|
s->value[0] = '-'; /* will cause mismatch then flush */
|
||||||
|
for(i=1;i<s->len;i++)
|
||||||
|
{
|
||||||
|
s->value[i] = 'x'; /* initial value */
|
||||||
|
}
|
||||||
|
s->value[i]=0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
free(s->value);
|
||||||
|
s->value = calloc(1, 1*sizeof(char));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2107,6 +2160,7 @@ if(lt)
|
||||||
lt->symchain=NULL;
|
lt->symchain=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(lt->lxtname);
|
||||||
free(lt->sorted_facs);
|
free(lt->sorted_facs);
|
||||||
fclose(lt->handle);
|
fclose(lt->handle);
|
||||||
free(lt);
|
free(lt);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#define ftello ftell
|
#define ftello ftell
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define wave_alloca alloca
|
||||||
|
|
||||||
#define LXT2_WR_HDRID (0x1380)
|
#define LXT2_WR_HDRID (0x1380)
|
||||||
#define LXT2_WR_VERSION (0x0001)
|
#define LXT2_WR_VERSION (0x0001)
|
||||||
|
|
|
||||||
105
vpi/lxt_write.c
105
vpi/lxt_write.c
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-3 Tony Bybell.
|
* Copyright (c) 2001-7 Tony Bybell.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
@ -20,8 +20,58 @@
|
||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
#include "lxt_write.h"
|
#include "lxt_write.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* in-place sort to keep chained facs from migrating...
|
||||||
|
*/
|
||||||
|
static void wave_mergesort(struct lt_symbol **a, struct lt_symbol **b, int lo, int hi)
|
||||||
|
{
|
||||||
|
int i, j, k;
|
||||||
|
|
||||||
|
if (lo<hi)
|
||||||
|
{
|
||||||
|
int mid=(lo+hi)/2;
|
||||||
|
|
||||||
|
wave_mergesort(a, b, lo, mid);
|
||||||
|
wave_mergesort(a, b, mid+1, hi);
|
||||||
|
|
||||||
|
i=0; j=lo;
|
||||||
|
while (j<=mid)
|
||||||
|
{
|
||||||
|
b[i++]=a[j++];
|
||||||
|
}
|
||||||
|
|
||||||
|
i=0; k=lo;
|
||||||
|
while ((k<j)&&(j<=hi))
|
||||||
|
{
|
||||||
|
if (strcmp(b[i]->name, a[j]->name) <= 0)
|
||||||
|
{
|
||||||
|
a[k++]=b[i++];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
a[k++]=a[j++];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (k<j)
|
||||||
|
{
|
||||||
|
a[k++]=b[i++];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void wave_msort(struct lt_symbol **a, int num)
|
||||||
|
{
|
||||||
|
struct lt_symbol **b = malloc(((num/2)+1) * sizeof(struct lt_symbol *));
|
||||||
|
|
||||||
|
wave_mergesort(a, b, 0, num-1);
|
||||||
|
|
||||||
|
free(b);
|
||||||
|
}
|
||||||
|
|
||||||
/************************ splay ************************/
|
/************************ splay ************************/
|
||||||
|
|
||||||
static int dslxt_success;
|
static int dslxt_success;
|
||||||
|
|
@ -561,26 +611,6 @@ strcpy(lt->compress_fac_str, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* emit facs in sorted order along with geometry
|
|
||||||
* and sync table info
|
|
||||||
*/
|
|
||||||
static int lt_compare(const void *v1, const void *v2)
|
|
||||||
{
|
|
||||||
struct lt_symbol *s1 = *(struct lt_symbol **)v1;
|
|
||||||
struct lt_symbol *s2 = *(struct lt_symbol **)v2;
|
|
||||||
int rc = strcmp(s1->name, s2->name);
|
|
||||||
if(rc)
|
|
||||||
{
|
|
||||||
return(rc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return(s1->msb - s2->msb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void strip_brack(struct lt_symbol *s)
|
static void strip_brack(struct lt_symbol *s)
|
||||||
{
|
{
|
||||||
char *lastch = s->name+s->namlen - 1;
|
char *lastch = s->name+s->namlen - 1;
|
||||||
|
|
@ -589,6 +619,11 @@ if(s->namlen<3) return;
|
||||||
lastch--;
|
lastch--;
|
||||||
while(lastch!=s->name)
|
while(lastch!=s->name)
|
||||||
{
|
{
|
||||||
|
if(*lastch=='.')
|
||||||
|
{
|
||||||
|
return; /* MTI SV [0.3] notation for implicit vars */
|
||||||
|
}
|
||||||
|
|
||||||
if(*lastch=='[')
|
if(*lastch=='[')
|
||||||
{
|
{
|
||||||
*lastch=0x00;
|
*lastch=0x00;
|
||||||
|
|
@ -616,17 +651,17 @@ if((lt)&&(lt->numfacs))
|
||||||
if(lt->do_strip_brackets)
|
if(lt->do_strip_brackets)
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
lt->sorted_facs[i] = s;
|
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
|
||||||
strip_brack(s);
|
strip_brack(s);
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
lt->sorted_facs[i] = s;
|
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing*/
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
}
|
}
|
||||||
qsort((void *)lt->sorted_facs, lt->numfacs, sizeof(struct lt_symbol *), lt_compare);
|
wave_msort(lt->sorted_facs, lt->numfacs);
|
||||||
|
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
|
|
@ -831,7 +866,7 @@ switch(numbytes_trans&3)
|
||||||
case 3: lt->lt_emit_u32(lt, numtrans); break;
|
case 3: lt->lt_emit_u32(lt, numtrans); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf("Clock finish for '%s' at %Ld ending with '%c' for %d repeats over a switch delta of %d\n",
|
/* printf("Clock finish for '%s' at %lld ending with '%c' for %d repeats over a switch delta of %d\n",
|
||||||
s->name, lt->timeval, s->clk_prevval, s->clk_numtrans - LT_CLKPACK, s->clk_delta); */
|
s->name, lt->timeval, s->clk_prevval, s->clk_numtrans - LT_CLKPACK, s->clk_delta); */
|
||||||
s->clk_prevtrans = ULLDescriptor(~0);
|
s->clk_prevtrans = ULLDescriptor(~0);
|
||||||
s->clk_numtrans = 0;
|
s->clk_numtrans = 0;
|
||||||
|
|
@ -932,7 +967,7 @@ switch(numbytes_trans&3)
|
||||||
case 3: lt->lt_emit_u32(lt, numtrans); break;
|
case 3: lt->lt_emit_u32(lt, numtrans); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printf("Clock finish for '%s' at %Ld ending with '%08x' for %d repeats over a switch delta of %Ld\n",
|
/* printf("Clock finish for '%s' at %lld ending with '%08x' for %d repeats over a switch delta of %lld\n",
|
||||||
s->name, lt->timeval, s->clk_prevval, s->clk_numtrans - LT_CLKPACK_M, s->clk_delta); */
|
s->name, lt->timeval, s->clk_prevval, s->clk_numtrans - LT_CLKPACK_M, s->clk_delta); */
|
||||||
s->clk_prevtrans = ULLDescriptor(~0);
|
s->clk_prevtrans = ULLDescriptor(~0);
|
||||||
s->clk_numtrans = 0;
|
s->clk_numtrans = 0;
|
||||||
|
|
@ -1467,17 +1502,17 @@ if((lt)&&(!lt->emitted)&&(!lt->sorted_facs))
|
||||||
if(lt->do_strip_brackets)
|
if(lt->do_strip_brackets)
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
lt->sorted_facs[i] = s;
|
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
|
||||||
strip_brack(s);
|
strip_brack(s);
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
lt->sorted_facs[i] = s;
|
lt->sorted_facs[lt->numfacs - i - 1] = s; /* facs were chained backwards so reverse to restore bitslicing */
|
||||||
s=s->symchain;
|
s=s->symchain;
|
||||||
}
|
}
|
||||||
qsort((void *)lt->sorted_facs, lt->numfacs, sizeof(struct lt_symbol *), lt_compare);
|
wave_msort(lt->sorted_facs, lt->numfacs);
|
||||||
|
|
||||||
for(i=0;i<lt->numfacs;i++)
|
for(i=0;i<lt->numfacs;i++)
|
||||||
{
|
{
|
||||||
|
|
@ -1639,6 +1674,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
unsigned int last_change_delta;
|
unsigned int last_change_delta;
|
||||||
|
|
||||||
if((lt->clock_compress)&&(s->rows==0))
|
if((lt->clock_compress)&&(s->rows==0))
|
||||||
|
{
|
||||||
if((len>1)&&(len<=32))
|
if((len>1)&&(len<=32))
|
||||||
{
|
{
|
||||||
int ivalue = value;
|
int ivalue = value;
|
||||||
|
|
@ -1678,7 +1714,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
s->clk_prevval1 = s->clk_prevval;
|
s->clk_prevval1 = s->clk_prevval;
|
||||||
s->clk_prevval = ivalue;
|
s->clk_prevval = ivalue;
|
||||||
|
|
||||||
/* printf("Clock value '%08x' for '%s' at %Ld (#%d)\n", ivalue, s->name, lt->timeval, s->clk_numtrans); */
|
/* printf("Clock value '%08x' for '%s' at %lld (#%d)\n", ivalue, s->name, lt->timeval, s->clk_numtrans); */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1779,6 +1815,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
|
|
||||||
s->clk_prevval = ivalue + '0';
|
s->clk_prevval = ivalue + '0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* normal trace handling */
|
/* normal trace handling */
|
||||||
|
|
||||||
|
|
@ -2120,7 +2157,7 @@ if((s->flags)<_SYM_F_STRING)
|
||||||
int numbytes; /* number of bytes to store value minus one */
|
int numbytes; /* number of bytes to store value minus one */
|
||||||
unsigned int last_change_delta = lt->position - s->last_change - 2;
|
unsigned int last_change_delta = lt->position - s->last_change - 2;
|
||||||
|
|
||||||
if(lt->numfacs_bytes)
|
if(!lt->numfacs_bytes)
|
||||||
{
|
{
|
||||||
if(last_change_delta >= 256*65536)
|
if(last_change_delta >= 256*65536)
|
||||||
{
|
{
|
||||||
|
|
@ -2245,6 +2282,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
int len = ((s->flags)<_SYM_F_INTEGER) ? 32 : s->len;
|
int len = ((s->flags)<_SYM_F_INTEGER) ? 32 : s->len;
|
||||||
|
|
||||||
if((lt->clock_compress)&&(s->rows==0))
|
if((lt->clock_compress)&&(s->rows==0))
|
||||||
|
{
|
||||||
if((len>1)&&(len<=32))
|
if((len>1)&&(len<=32))
|
||||||
{
|
{
|
||||||
int legal = 0;
|
int legal = 0;
|
||||||
|
|
@ -2308,7 +2346,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
s->clk_prevval1 = s->clk_prevval;
|
s->clk_prevval1 = s->clk_prevval;
|
||||||
s->clk_prevval = ivalue;
|
s->clk_prevval = ivalue;
|
||||||
|
|
||||||
/* printf("Clock value '%08x' for '%s' [len=%d] at %Ld (#%d)\n",
|
/* printf("Clock value '%08x' for '%s' [len=%d] at %lld (#%d)\n",
|
||||||
ivalue, s->name, len, lt->timeval, s->clk_numtrans); */
|
ivalue, s->name, len, lt->timeval, s->clk_numtrans); */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
@ -2374,7 +2412,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
{
|
{
|
||||||
s->clk_prevval = value[0];
|
s->clk_prevval = value[0];
|
||||||
|
|
||||||
/* printf("Clock value '%c' for '%s' at %Ld (#%d)\n", value[0], s->name, lt->timeval, s->clk_numtrans); */
|
/* printf("Clock value '%c' for '%s' at %lld (#%d)\n", value[0], s->name, lt->timeval, s->clk_numtrans); */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2408,6 +2446,7 @@ if(!(s->flags&(LT_SYM_F_DOUBLE|LT_SYM_F_STRING)))
|
||||||
|
|
||||||
s->clk_prevval = value[0];
|
s->clk_prevval = value[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* normal trace handling */
|
/* normal trace handling */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue