diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index d1355419..5ca6f8ba 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,12 @@ +2009-05-09 Arnim Laeuger + + * src/bsdl/Makefile.am, src/svf/Makefile.am: avoid -Werror to bail out because + of unused input() functions in flex-generated files + + * include/urjtag/svf.h, src/cmd/cmd_svf.c, src/svf/svf.c, + src/svf/svf_bison.y, src/svf/svf.h, src/svf/svf_flex.l: + replace print_progress with DETAIL log level + 2009-05-05 Rutger Hofman * src/flash/, src/svf/, src/tap/*.c, src/tap/parallel/, src/tap/usbconn: diff --git a/urjtag/include/urjtag/svf.h b/urjtag/include/urjtag/svf.h index 4632830b..3c44de9e 100644 --- a/urjtag/include/urjtag/svf.h +++ b/urjtag/include/urjtag/svf.h @@ -46,8 +46,6 @@ * @param SVF_FILE file handle of SVF file * @param stop_on_mismatch 1 = stop upon tdo mismatch * 0 = continue upon mismatch - * @param print_progress 1 = continually print progress status - * 0 = don't print * @param ref_freq reference frequency for RUNTEST * * @return @@ -56,6 +54,6 @@ * ***************************************************************************/ int urj_svf_run (urj_chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch, - int print_progress, uint32_t ref_freq); + uint32_t ref_freq); #endif /* URJ_SVF_H */ diff --git a/urjtag/src/bsdl/Makefile.am b/urjtag/src/bsdl/Makefile.am index 44f4840b..75a2dd82 100644 --- a/urjtag/src/bsdl/Makefile.am +++ b/urjtag/src/bsdl/Makefile.am @@ -42,6 +42,10 @@ noinst_HEADERS = \ vhdl_bison.h \ vhdl_parser.h +# avoid -Werror to bail out because of unused input() function +# in vhdl_flex.c and bsdl_flex.c +libbsdl_la_CFLAGS = -Wno-error=unused-function + # additional dependencies # - all files depend on bsdl_config.h which dynamically generated # - *_flex files must be processed after their *_bison counterparts diff --git a/urjtag/src/cmd/cmd_svf.c b/urjtag/src/cmd/cmd_svf.c index 1104ad50..1d16730e 100644 --- a/urjtag/src/cmd/cmd_svf.c +++ b/urjtag/src/cmd/cmd_svf.c @@ -30,6 +30,8 @@ #include #include +#include + #include #include @@ -43,6 +45,7 @@ cmd_svf_run (urj_chain_t *chain, char *params[]) int stop = 0; int print_progress = 0; uint32_t ref_freq = 0; + urj_log_level_t old_log_level = urj_log_state.level; num_params = urj_cmd_params (params); if (num_params > 1) @@ -59,9 +62,12 @@ cmd_svf_run (urj_chain_t *chain, char *params[]) return -1; } + if (print_progress) + urj_log_state.level = URJ_LOG_LEVEL_DETAIL; + if ((SVF_FILE = fopen (params[1], "r")) != NULL) { - urj_svf_run (chain, SVF_FILE, stop, print_progress, ref_freq); + urj_svf_run (chain, SVF_FILE, stop, ref_freq); result = 1; fclose (SVF_FILE); @@ -74,6 +80,8 @@ cmd_svf_run (urj_chain_t *chain, char *params[]) } + urj_log_state.level = old_log_level; + return result; } @@ -95,11 +103,3 @@ const urj_cmd_t urj_cmd_svf = { cmd_svf_help, cmd_svf_run }; - - -/* Emacs specific variables -;;; Local Variables: *** -;;; indent-tabs-mode:t *** -;;; tab-width:2 *** -;;; End: *** -*/ diff --git a/urjtag/src/svf/Makefile.am b/urjtag/src/svf/Makefile.am index f78dc6f7..0732f3b4 100644 --- a/urjtag/src/svf/Makefile.am +++ b/urjtag/src/svf/Makefile.am @@ -32,6 +32,9 @@ libsvf_la_SOURCES = \ svf.h \ svf.c +# avoid -Werror to bail out because of unused input() function in svf_flex.c +libsvf_la_CFLAGS = -Wno-error=unused-function + svf_flex.$(OBJEXT) svf.$(OBJEXT): svf_bison.$(OBJEXT) svf_bison.h: svf_bison.c diff --git a/urjtag/src/svf/svf.c b/urjtag/src/svf/svf.c index d25e5841..aec8ccb2 100644 --- a/urjtag/src/svf/svf.c +++ b/urjtag/src/svf/svf.c @@ -1111,8 +1111,6 @@ urj_svf_txr (enum generic_irdr_coding ir_dr, struct ths_params *params) * SVF_FILE : file handle of SVF file * stop_on_mismatch : 1 = stop upon tdo mismatch * 0 = continue upon mismatch - * print_progress : 1 = continually print progress status - * 0 = don't print * ref_freq : reference frequency for RUNTEST * * Return value: @@ -1121,7 +1119,7 @@ urj_svf_txr (enum generic_irdr_coding ir_dr, struct ths_params *params) * ***************************************************************************/ int urj_svf_run (urj_chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch, - int print_progress, uint32_t ref_freq) + uint32_t ref_freq) { const urj_svf_sxr_t sxr_default = { {0.0, NULL, NULL, NULL, NULL}, 1, 1 @@ -1242,21 +1240,18 @@ urj_svf_run (urj_chain_t *chain, FILE *SVF_FILE, int stop_on_mismatch, /* select SIR instruction */ urj_part_set_instruction (priv.part, "SIR"); - if (urj_svf_bison_init (&priv, SVF_FILE, num_lines, print_progress)) + if (urj_svf_bison_init (&priv, SVF_FILE, num_lines)) { urj_svf_parse (&priv, chain); urj_svf_bison_deinit (&priv); } - if (print_progress) - { - if (priv.mismatch_occurred > 0) - urj_log (URJ_LOG_LEVEL_NORMAL, - _("Mismatches occurred between scanned device output and expected TDO values.\n")); - else - urj_log (URJ_LOG_LEVEL_NORMAL, - _("Scanned device output matched expected TDO values.\n")); - } + if (priv.mismatch_occurred > 0) + urj_log (URJ_LOG_LEVEL_DETAIL, + _("Mismatches occurred between scanned device output and expected TDO values.\n")); + else + urj_log (URJ_LOG_LEVEL_DETAIL, + _("Scanned device output matched expected TDO values.\n")); /* clean up */ /* SIR */ diff --git a/urjtag/src/svf/svf.h b/urjtag/src/svf/svf.h index 5035c68e..e7a921b2 100644 --- a/urjtag/src/svf/svf.h +++ b/urjtag/src/svf/svf.h @@ -119,7 +119,6 @@ typedef struct parser_priv urj_svf_parser_priv_t; struct scanner_extra { int num_lines; - int print_progress; int planb; char decimal_point; }; @@ -127,10 +126,10 @@ typedef struct scanner_extra urj_svf_scanner_extra_t; struct YYLTYPE; -void *urj_svf_flex_init (FILE *, int, int); +void *urj_svf_flex_init (FILE *, int); void urj_svf_flex_deinit (void *); -int urj_svf_bison_init (urj_svf_parser_priv_t *, FILE *, int, int); +int urj_svf_bison_init (urj_svf_parser_priv_t *, FILE *, int); void urj_svf_bison_deinit (urj_svf_parser_priv_t *); void urj_svf_endxr (urj_svf_parser_priv_t *, enum generic_irdr_coding, diff --git a/urjtag/src/svf/svf_bison.y b/urjtag/src/svf/svf_bison.y index dbb7f3e0..c04725da 100644 --- a/urjtag/src/svf/svf_bison.y +++ b/urjtag/src/svf/svf_bison.y @@ -447,8 +447,7 @@ urj_svf_free_ths_params (struct ths_params *params) int -urj_svf_bison_init (urj_svf_parser_priv_t *priv_data, FILE *f, int num_lines, - int print_progress) +urj_svf_bison_init (urj_svf_parser_priv_t *priv_data, FILE *f, int num_lines) { const struct svf_parser_params params = { {0.0, NULL, NULL, NULL, NULL}, @@ -459,7 +458,7 @@ urj_svf_bison_init (urj_svf_parser_priv_t *priv_data, FILE *f, int num_lines, priv_data->parser_params = params; if ((priv_data->scanner = - urj_svf_flex_init (f, num_lines, print_progress)) == NULL) + urj_svf_flex_init (f, num_lines)) == NULL) return 0; else return 1; diff --git a/urjtag/src/svf/svf_flex.l b/urjtag/src/svf/svf_flex.l index dac8db03..9a98f853 100644 --- a/urjtag/src/svf/svf_flex.l +++ b/urjtag/src/svf/svf_flex.l @@ -372,20 +372,20 @@ progress_nl (YYLTYPE *mylloc, YY_EXTRA_TYPE extra) { int percent; - if ((extra->print_progress) && (mylloc->last_line % 10 == 0)) + if (mylloc->last_line % 10 == 0) { percent = ((mylloc->last_line * 100) + 1) / extra->num_lines; if (percent <= 1) return; // dont bother printing < 1 % - urj_log (URJ_LOG_LEVEL_NORMAL, "\r"); - urj_log (URJ_LOG_LEVEL_NORMAL, _("Parsing %6d/%d (%3.0d%%)"), + urj_log (URJ_LOG_LEVEL_DETAIL, "\r"); + urj_log (URJ_LOG_LEVEL_DETAIL, _("Parsing %6d/%d (%3.0d%%)"), mylloc->last_line, extra->num_lines, percent); } } void * -urj_svf_flex_init (FILE *f, int num_lines, int print_progress) +urj_svf_flex_init (FILE *f, int num_lines) { YY_EXTRA_TYPE extra; yyscan_t scanner; @@ -405,7 +405,6 @@ urj_svf_flex_init (FILE *f, int num_lines, int print_progress) } extra->num_lines = num_lines; - extra->print_progress = print_progress; #ifdef ENABLE_NLS { @@ -426,8 +425,7 @@ void urj_svf_flex_deinit (void *scanner) { YY_EXTRA_TYPE extra = yyget_extra (scanner); - if (extra->print_progress) - urj_log (URJ_LOG_LEVEL_NORMAL, "\n"); + urj_log (URJ_LOG_LEVEL_DETAIL, "\n"); free (extra); yylex_destroy (scanner); }