aboutsummaryrefslogtreecommitdiff
path: root/src/svf
AgeCommit message (Collapse)Author
2015-11-20svf: fix progress reporting switch behaviourPaul Fertser
The svf_progress_enabled variable is global, hence its lifetime is not limited and it retains the value from the previous run. Fix this by explicit assignment. Change-Id: Id6f4fa88f39521606342a37f6876a0948ac5406e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/3111 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-11-20svf: fix off-by-one error in line numbers as output to userPaul Fertser
This makes SVF error output match actual line numbers in the file processed. Change-Id: I1fa4b9d0891e4358b7beada516945d5331ebe182 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2945 Tested-by: jenkins
2015-09-30svf: fix segfaults exposed by some SVFPaul Fertser
The problem was reported by jstefanop on IRC, the SVF was generated with Xilinx ISE 14.7. Found and investigated with Valgrind's vgdb service. Change-Id: I32b0e77e0380ce4a391661f97449f9c2a5f83625 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2933 Tested-by: jenkins
2015-08-06svf: flush the queue before reallocing memoryPaul Fertser
During reallocation a new memory region might be allocated and the old one freed. If jtag queue is holding a pointer to the old memory, it will segfault during the execution. Avoid this by flushing the queue before a reallocation attempt is made. This should fix ticket #102. Change-Id: I737fc3f1ebf6d76413a475beb8bf20184fe0233f Reported-by: Alex Forencich <aforencich@users.sf.net> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2899 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-07-03Openocd: svf: Add ability to ignore svf_check_tdo errorsKamal Dasu
Added Openocd commandline argument to ignore_error when the read back TDO does not match to expected value specified with TDO after masking with what is specified in MASK. This allows to continue to play entire SVF file ignoring errors. Error logs clearly show the failure reason and prints read back TDO value. Change-Id: I324f476fc16a003b35e6f2c5b63976431f49d54a Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Reviewed-on: http://openocd.zylin.com/2129 Tested-by: jenkins Reviewed-by: Franck Jullien <franck.jullien@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-06-22svf: Only read TDO back from the device if we actually need to look at the bits.Joshua Wise
This results in a 90% speedup on USB-Blaster, which serializes repeated TDI input against TDO readback; program time on an 5CGXFC5C6F27 part was dropped from 2m30s to 9s. Signed-off-by: Joshua Wise <joshua@joshuawise.com> Change-Id: I92d5a8b800492283d619328549235b610528c338 Reviewed-on: http://openocd.zylin.com/2145 Reviewed-by: Paul Fertser <fercerpav@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-05-05svf: Fix debug and error messages that print hex bufferKamal Dasu
Added SVF_BUF_LOG macro to properly print the hex buffer of parsed string for SIR, SDR, TDI, TDO and MASK. The original debug and error logs with respect to printing real values were misleading and also had endianess issues. All the bits are printed now instead of just u32 values. Change-Id: Ie89902403bdb61ff458418446c2ca1253ea2a63f Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Reviewed-on: http://openocd.zylin.com/1964 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2014-04-14svf: try to reallocate buffers if they're not enoughPaul Fertser
On larger FPGAs the default buffer size is not nearly enough; automatically reallocate it as needed. Change-Id: Ic8071e8cceddeef897ce76996c029250fd22662b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2099 Tested-by: jenkins Reviewed-by: Kenneth Lorthioir <ibelimb@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-03-30Don't cast return value of [cm]allocAndreas Fritiofson
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2069 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-13svf: off-by-one error; do not access after the allocated memoryPaul Fertser
Keep the promise and ensure there're at least 3 bytes available after the current position. This eliminates the errors reported by Valgrind. Change-Id: I1d0640e904c750eed808b2b4caf419b4d7619845 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1615 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-06-05update files to correct FSF addressSpencer Oliver
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-02-06build: cleanup src/svf directorySpencer Oliver
Change-Id: If9186964e2597f8ca1f01885fc28418df7d92964 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/409 Tested-by: jenkins
2011-11-10svf: fix warningsØyvind Harboe
Change-Id: Ib7f67612db3a865f9acc5ae349455da7ddcd3348 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/177 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-06-04Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - trivial fixesFreddie Chopin
2011-04-01types: write memory now uses constØyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-03-17Fix a bunch of typos.Uwe Hermann
Fix a bunch of typos. Most are in code comments, so nothing should break. UNKOWN_COMMAND and CMD_UNKOWN are not used elsewhere, so correcting the spelling should also not break anything.
2011-02-28svf: add nil option that just runs through the svf fileØyvind Harboe
useful for debugging without access to hardware to e.g. regression test, reproduce memory corruption problems, etc. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-01-02svf: implement sleep for RUNTEST min_timeJon Povey
Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> min_time was effectively ignored, I needed it to program a Lattice MachXO which uses a RUNTEST to wait for an erase operation, amongst other things. With this patch pauses happen and I can program the device with an SVF generated in LSC ispVM (with "Rev D Standard" checked to suppress nonstandard LOOP statements)
2011-01-02svf: fix USAGE and related error reportingJon Povey
Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
2010-12-07svf: various improvementsAndrew Leech
* added support for targeting particular tap * improved file reading * improved command line parsing * added progress meter * more readable time measurement output
2010-11-18build: add common.mkSpencer Oliver
Rather than specifying common makefile variables move them all to a common.mk. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-06-16svf: -Wshadow warning fixesØyvind Harboe
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-15rename jtag_khz as adapter_khzDavid Brownell
Globally rename "jtag_khz" as "adapter_khz", and move it out of the "jtag" command group ... it needs to be used with non-JTAG transports Includes a migration aid (in jtag/startup.tcl) so that old user scripts won't break. That aid should Sunset in about a year. (We may want to update it to include a nag message too.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-08jtag: simplify jtag_add_plain_ir/dr_scanØyvind Harboe
These fn's now clearly just clock out/in bits. No mystical fields are involved. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: retire tap fieldØyvind Harboe
jtag_add_dr/ir_scan() now takes the tap as the first argument, rather than for each of the fields passed in. The code never exercised the path where there was more than one tap being scanned, who knows if it even worked. This simplifies the implementation and reduces clutter in the calling code. use jtag_add_ir/dr_plain_scan() for more fancy situations. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-01-26cygwin buildfixDavid Brownell
isspace() parameter must be an integer, else a 'char' gets used as an array index (sigh). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-25SVF: all content between parentheses is one parametersimon qian
More SVF fixes: * Treat all content between parentheses as part of the same parameter; don't (wrongly) treat whitespace as a delimiter. * Use isspace() to catch that whitespace; it's not all single spaces, newlines etc are also valid. * When parsing bitstrings, strip leading whitespace too. So for example, these are equivalent and should (now) be OK: "TDI( 1234 )" "TDI( 1 2 3 4 )" "TDI(00 12 34 )" "TDI( 00 12 34)" [dbrownell@users.sourceforge.net: comment updates; trivial cleanup] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-23SVF: insert space before '(' and after ')'simon qian
See http://forum.sparkfun.com/viewtopic.php?p=90983#90983 for discussion; basically, the SVF parser wrongly expects "TDI (123)" but the space is optional and it should accept "TDI(123)" too. In the same way, "TDI(123)TDO(456)" should work too. Rather than update the command parsing, this just makes sure the expected spaces are present. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-08*SVF: help/usage updatesDavid Brownell
Usage messages should use the same EBNF as the User's Guide; no angle brackets. Be more complete too ... some params were missing. Don't use "&function"; its name is its address. Unrelated: fix typo in one "target.c" usage message. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-26cygwin 1.7 build fixesDavid Brownell
It's less accepting of signed char ... insisting that e.g. tolower() not receive one as a parameter. It's probably good to phase out such usage, given the number of bugs that lurk in the vicinity (assumptions that char is unsigned), so fix these even though such usage is actually legal. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-08build: add build/src to include pathØyvind Harboe
This allows including generated include files. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-05misc code review updatesDavid Brownell
More updates from the code review by Steve Grubb <sgrubb@redhat.com>. The Jim float-comparision bug just gets a comment not a fix, though. Cc: Steve Grubb <sgrubb@redhat.com>. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03remove tertiary include pathsZachary T Welch
With all #include directives converted, we only need to have the top-level src/ directory in the search path.
2009-12-03change #include "jtag.h" to <jtag/jtag.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "jtag.h" the following form should be used. #include <jtag/jtag.h> The exception is from .c files in the same directory.
2009-12-03change #include "time_support.h" to <helper/time_support.h>Zachary T Welch
Changes from the flat namespace to heirarchical one. Instead of writing: #include "time_support.h" the following form should be used. #include <helper/time_support.h> The exception is from .c files in the same directory.
2009-12-03normalize headers to make changing easierZachary T Welch
These headers need minor tweaks to paves the way for wholesale scripted coversion of the header files.
2009-12-03allow #include directives to use module nameZachary T Welch
Includes the src directory in the search path, so header files may be migrated from: #include "foo.h" to #include <module/foo.h> which is more conducive for installation.
2009-11-24{,x}svf: use register_commands()Zachary T Welch
Use register_commands() for registering {,x}svf commands.
2009-11-24use COMMAND_REGISTER macroZachary T Welch
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-16move ARRAY_SIZE macro to types.hZachary T Welch
The ARRAY_SIZE macro was defined in several target files, so move it to types.h. This patch also removes two other identical macros: DIM (from jtag.h) and asizeof (from arm11.h).
2009-11-13command_context_t -> struct command_contextZachary T Welch
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13remove typedef keyword from svf structuresZachary T Welch
Removes all misleading typedef keywords from structures in svf.c.
2009-11-13scan_field_t -> struct scan_fieldZachary T Welch
Remove useless structure typedef.
2009-11-13jtag_tap_t -> struct jtag_tapZachary T Welch
Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
2009-11-13command_handler_t: make argc unsignedZachary T Welch
The number of command arguments will always be 0 or more, so use the right type in handlers. This has a cascading effect up through the layers, but the new COMMAND_HANDLER macros prevented total chaos.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch
2009-11-09svf,xsvf,arm7_9_common: trim forard declarationsZachary T Welch
Remove forward declarations by reordering command registration.