aboutsummaryrefslogtreecommitdiff
path: root/src/svf
AgeCommit message (Collapse)Author
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.
2009-11-09src/{server,pld,svf,xsvf}: remove 'extern' keywordZachary T Welch
Removes 'extern' keyword from function declarations in header filess.
2009-10-29SVF: fix checking bit pattern against lengthMichael Roth
The code works like follow (N = bit_len): N -1 %4 2<< -1 ~ (binary) -------------------------------------------------- 1 0 0 2 1 1111 1110 2 1 1 4 3 1111 1100 3 2 2 8 7 1111 1000 4 3 3 16 15 1111 0000 5 4 0 2 1 1111 1110 6 5 1 4 3 1111 1100 7 6 2 8 7 1111 1000 8 7 3 16 15 1111 0000 ... ... ... ... ... ... Addresses a bug reported by FangfangLi <ffli@syntest.com.cn>. [dbrownell@users.sourceforge.net: fix spelling bug too] Signed-off-by: Michael Roth <mroth@nessie.de> Cc: FangfangLi <ffli@syntest.com.cn> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-26SVF: fix parsing hex strings containing leading '0' charactersMichael Roth
Ignore leading '0' characters on hex strings. For example a bit pattern consisting of 6 bits could be written as 3f, 03f or 003f and so on. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-23SVF: clean up, mostly for TAP state name handlingDavid Brownell
- Use the name mappings all the other code uses: + name-to-state ... needed to add one special case + state-to-name - Improve various diagnostics: + don't complain about a "valid" state when the issue is actually that it must be "stable" + say which command was affected - Misc: + make more private data and code be static + use public DIM() not private dimof() + shorten the affected lines Re the mappings, this means we're more generous in inputs we accept, since case won't matter. Also our output diagnostics will be a smidgeon more informative, saying "RUN/IDLE" not just "IDLE" (emphasizing that there can be side effects). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-20XSVF: use svf_add_statemove()David Brownell
XSVF improvements: - Layer parts of XSVF directly over SVF, calling svf_add_statemove() instead of expecting jtag_add_statemove() to conform to the SVF/XSVF requirements (which it doesn't). This should improve XSTATE handling a lot; it removes most users of jtag_add_statemove(), and the comments about how it should really do what svf_add_statemove() does. - Update XSTATE logic to be a closer match to the XSVF spec. The main open issue here is (still) that this implementation doesn't know how to build and submit paths from single-state transitions ... but now it will report that error case. - Update the User's Guide to mention the two utility scripts for working with XSVF, and to mention the five extension opcodes. Handling of state transition paths is, overall, still a mess. I think they should all be specified as paths not unlike SVF uses, and compiled to the bitstrings later ... so that we can actually make sense of the paths. (And see the extra clocks, detours through RUN, etc.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-19SVF: better spec conformance for STATE switchDavid Brownell
Don't add extra TCK in current state; exit from RESET had four extras. Only IDLE --> IDLE needs such an extra clock. (At least one TCK must be issued.) Allow entry to RESET; SVF allows it, so must we (despite those entries being commented out of the statemove table). When entering RESET, always use TLR ... we might end up with extra clocks in reset that way, which is harmless, but we'll never end up in any other state than RESET, which is useful paranoia. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-19SVF/XSVF: comment and whitespace fixesDavid Brownell
SVF: comment the predefined/default paths; make them static const SVF, XSVF: whitespace fixes, mostly so copyrights display sanely Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-08-25Audrius Urmanavičius <didele.deze@gmail.com> Latest source (R2606) does not ↵oharboe
compile under Windows+Cygwin - fails with error about possibly uninitialized use of variable 'ch'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2612 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-24Steve Grubb <sgrubb@redhat.com> fix various and sundry leaksoharboe
git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60