From 55a87fe076e4c07d78a53f3fb02f1584831bed90 Mon Sep 17 00:00:00 2001 From: markhummel Date: Fri, 30 Sep 2005 04:02:45 +0000 Subject: [PATCH] added 'speed' and 'space' options to lxt systask to control compression of wave files. --- ChangeLog | 4 ++++ doc/veriwell.1 | 10 ++++++++-- lxt/lxt.c | 31 +++++++++++++++++++++++++------ lxt/test.v | 4 +++- src/veriwell.cc | 2 ++ 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9934d4b..4c58708 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,3 +50,7 @@ * fixed parsers so they work with older versions of bision * fixed vfscanf configuration check * changed revision number to 2.8.4 + +2005-09-29 Mark Hummel + * added space and speed option keywords to lxt systasks + diff --git a/doc/veriwell.1 b/doc/veriwell.1 index 0eae6d1..19c83a0 100644 --- a/doc/veriwell.1 +++ b/doc/veriwell.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35. -.TH VERIWELL "1" "September 2005" "Veriwell 2.8.2," "User Commands" +.TH VERIWELL "1" "September 2005" "Veriwell 2.8.4," "User Commands" .SH NAME -Veriwell \- manual page for Veriwell 2.8.2, +Veriwell \- manual page for Veriwell 2.8.4, .SH SYNOPSIS .B veriwell [\fIoptions\fR] \fI \fR[\fI\fR...] @@ -115,6 +115,12 @@ Start waveform dump incsize= Specify incremental file size in bytes .TP +space +optimize for space +.TP +speed +optimize for speed +.TP sequence Record 0 time signal changes .TP diff --git a/lxt/lxt.c b/lxt/lxt.c index ca424c2..6f4d148 100644 --- a/lxt/lxt.c +++ b/lxt/lxt.c @@ -50,6 +50,8 @@ * nosequence * design=name * depth=# + * speed + * space */ @@ -75,6 +77,7 @@ struct lxt_s { int enabled; int sequence; char* design; + int compress; unsigned incSize; struct lt_trace* t; int inited; @@ -85,7 +88,7 @@ struct lxt_s { int hunk; }; typedef struct lxt_s lxt_t, *lxt_p; -lxt_t lxt = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +lxt_t lxt = { 0, 0, 0, 0, 1, 100*1024*1024, 0, 0, 0, 0, 0, 0, 0 }; static void lxt_close(); static void lxt_enable( int on ); @@ -152,6 +155,20 @@ int lxt_recordvars( int data, int reason ) } ginstance = tf_getinstance(); + /* + * parse options first + */ + for( i = 1; i <= tf_nump(); ++i ) { + handle object; + if( tf_typep(i) == tf_nullparam ) { + continue; + } + if( tf_typep(i) == tf_string ) { + char* str = acc_fetch_tfarg_str(i); + lxt_option( str ); + continue; + } + } /* * on first call, initialize structure */ @@ -164,8 +181,6 @@ int lxt_recordvars( int data, int reason ) continue; } if( tf_typep(i) == tf_string ) { - char* str = acc_fetch_tfarg_str(i); - lxt_option( str ); continue; } object = acc_handle_tfarg(i); @@ -416,6 +431,10 @@ static void lxt_option( char* str ) len -= strlen( eq ); } else if( !strncmp( str, "incsize", len ) ) { lxt.incSize = atoi( eq+1 ); + } else if( !strncmp( str, "speed", len ) ) { + lxt.compress = 0; + } else if( !strncmp( str, "space", len ) ) { + lxt.compress = 1; } else if( !strncmp( str, "sequence", len ) ) { lxt.sequence = 1; } else if( !strncmp( str, "nosequence", len ) ) { @@ -661,13 +680,13 @@ static void lxt_init() return; } lt_set_clock_compress( lxt.t ); - lt_set_chg_compress( lxt.t ); + if( lxt.compress ) { + lt_set_chg_compress( lxt.t ); + } lxt.inited = 1; - lxt.sequence = 0; lxt.enabled = 1; lxt.updateList = 0; lxt.eventList = 0; - lxt.incSize = 100*1024*1024; lxt.hunk = 0; lt_set_initial_value( lxt.t, 'x' ); diff --git a/lxt/test.v b/lxt/test.v index 80cd390..e8afd82 100644 --- a/lxt/test.v +++ b/lxt/test.v @@ -37,11 +37,13 @@ event xevent; real xyz; initial begin - $lxt_recordvars(); + $lxt_recordvars("speed"); xyz = 0.0001; #1 clk = 0; count = 0; + #500000 $lxt_recordoff(); + #500000 $lxt_recordon(); #10000000 $finish; end diff --git a/src/veriwell.cc b/src/veriwell.cc index 014a727..782af31 100644 --- a/src/veriwell.cc +++ b/src/veriwell.cc @@ -815,6 +815,8 @@ void CmdlineHelp() printf(" $lxt_recordvar options Start waveform dump\n\n"); printf("Lxt Options:\n"); printf(" incsize= Specify incremental file size in bytes\n"); + printf(" space optimize for space\n"); + printf(" speed optimize for speed\n"); printf(" sequence Record 0 time signal changes\n"); printf(" nosequence Do not record 0 time signal changes\n"); printf(" design= Specify design name\n");