Arnim Läuger <[email protected]> writes:
> So do you know of any examples or further information on how to approach
> this performance issue with flex?

Here's a copy of the SVF:

  http://www.megacz.com/tmp/out.svf

Try the following: after svf_flex.c is generated, open it in an editor
and find this line:

  for ( i = 0; i < number_to_move; ++i )

Right above it, insert this text:

  fprintf(stderr, "number_to_move: %d\n", number_to_move);

Then recompile and run.  You'll see the number of characters copied
keeps increasing; every time flex expands the buffer it re-scans
what's already in there.  It can't proceed until the entire
31-megabyte "token" is entirely inside the buffer.

However, if you also modify the file to redefine YY_READ_BUF_SIZE and
YY_BUF_SIZE like this:

  #define YY_READ_BUF_SIZE 30000000
  #define YY_BUF_SIZE 32000000

The SVF will parse quite quickly -- although urjtag will always
require 32MB of memory in order to run.

Here are the commands I issue:

  cable Signalyzer
  bsdl path urjtag/bsdl/active/
  detect
  part 1
  instruction BYPASS
  part 2
  instruction BYPASS
  part 3
  instruction BYPASS
  part 4
  instruction BYPASS
  part 0
  svf out.svf stop progress

  - a


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to