summaryrefslogtreecommitdiff
path: root/src/svf/svf.c
Commit message (Collapse)AuthorAgeFilesLines
* move ARRAY_SIZE macro to types.hZachary T Welch2009-11-161-3/+3
| | | | | | | | 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).
* command_context_t -> struct command_contextZachary T Welch2009-11-131-3/+3
| | | | Remove misleading typedef and redundant suffix from struct command_context.
* remove typedef keyword from svf structuresZachary T Welch2009-11-131-21/+21
| | | | Removes all misleading typedef keywords from structures in svf.c.
* scan_field_t -> struct scan_fieldZachary T Welch2009-11-131-1/+1
| | | | Remove useless structure typedef.
* jtag_tap_t -> struct jtag_tapZachary T Welch2009-11-131-1/+1
| | | | | Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
* command_handler_t: make argc unsignedZachary T Welch2009-11-131-2/+2
| | | | | | 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.
* use COMMAND_HANDLER macro to define all commandsZachary T Welch2009-11-131-1/+1
|
* svf,xsvf,arm7_9_common: trim forard declarationsZachary T Welch2009-11-091-9/+9
| | | | Remove forward declarations by reordering command registration.
* SVF: fix checking bit pattern against lengthMichael Roth2009-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* SVF: fix parsing hex strings containing leading '0' charactersMichael Roth2009-10-261-0/+4
| | | | | | | | | 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>
* SVF: clean up, mostly for TAP state name handlingDavid Brownell2009-10-231-75/+60
| | | | | | | | | | | | | | | | | | | | | - 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>
* XSVF: use svf_add_statemove()David Brownell2009-10-201-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* SVF: better spec conformance for STATE switchDavid Brownell2009-10-191-15/+13
| | | | | | | | | | | | | | | 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>
* SVF/XSVF: comment and whitespace fixesDavid Brownell2009-10-191-20/+34
| | | | | | | | 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>
* Audrius Urmanavičius <didele.deze@gmail.com> Latest source (R2606) does not ↵oharboe2009-08-251-1/+1
| | | | | | 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
* Steve Grubb <sgrubb@redhat.com> fix various and sundry leaksoharboe2009-08-241-0/+2
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2606 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Piotr Ziecik <kosmo@semihalf.com> This patch adds handling blank characters ↵oharboe2009-08-201-59/+38
| | | | | | | | | between hex digits in SVF file, making OpenOCD compatible with files generated by Altera Quatrus II 9.0. git-svn-id: svn://svn.berlios.de/openocd/trunk@2600 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove whitespace at end of lines, step 2.zwelch2009-06-231-10/+10
| | | | | | | - Replace '\s*$' with ''. git-svn-id: svn://svn.berlios.de/openocd/trunk@2380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove whitespace that occurs before ')'.zwelch2009-06-231-3/+3
| | | | | | | - Replace '[ \t]*[)]' with ')'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove whitespace that occurs after '('.zwelch2009-06-231-2/+2
| | | | | | | - Replace '([ \t]*' with '('. git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Replace 'switch(' with 'switch ('.zwelch2009-06-231-4/+4
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Finish transforming 'u32' to 'uint32_t'.zwelch2009-06-181-2/+2
| | | | | | | | - Replace '\([^_]\)u32' with '\1uint32_t'. - Replace '^u32' with 'uint32_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2281 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Transform 'u8' to 'uint8_t'zwelch2009-06-181-24/+24
| | | | | | | | - Replace '\([^_]\)u8' with '\1uint8_t'. - Replace '^u8' with 'uint8_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* simon qian <simonqian.openocd@gmail.com> stop incestious communication with ↵oharboe2009-06-011-51/+72
| | | | | | lower jtag.c layers git-svn-id: svn://svn.berlios.de/openocd/trunk@1978 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* SimonQian <simonqian@SimonQian.com>, reported by R.Doss:zwelch2009-05-261-0/+21
| | | | | | | | | This patch fixes a segfault when TDO was not received in XXR command: - allocate space for the value and mask anyway - clear the mask to zero to effectively skip the output comparison step git-svn-id: svn://svn.berlios.de/openocd/trunk@1915 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* SimonQian <simonqian@SimonQian.com>:zwelch2009-05-261-10/+24
| | | | | | | | Add svf_get_mask_u32 to generate a mask according to bitlen. Fix this bug in other functions except for svf_check_tdo. git-svn-id: svn://svn.berlios.de/openocd/trunk@1914 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Author: Simon Qian <simonqian@SimonQian.com>kc8apf2009-05-251-1/+29
| | | | | | | - add tap_state_svf_name since tap_state_name doesn't use SVF standard names git-svn-id: svn://svn.berlios.de/openocd/trunk@1912 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* SimonQian <simonqian@SimonQian.com>:zwelch2009-05-241-20/+23
| | | | | | | | | Changes svf_check_tdo function (checks tdo output matches desired values): - call buf_cmp_mask function to do comparison instead of using a loop. - fixes a bug when data length is equal to sizeof(int). git-svn-id: svn://svn.berlios.de/openocd/trunk@1900 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>: This patch adds annotations tozwelch2009-05-211-1/+1
| | | | | | | | | | the key command_*() helper functions, fixng the bugs that turned up. Several of these bugs were from misuse of PRIi64; that's for 64-bit integers, NOT for "long long" or "u64" (which work best with %lld). git-svn-id: svn://svn.berlios.de/openocd/trunk@1873 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add jtag_queue_command() by Michael Bruck <mbruck@digenius.de> [8/8]kc8apf2009-05-181-32/+27
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1822 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Audit and eliminate redundant #include directives in src/{pld,svf,xsvf}.zwelch2009-05-111-12/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1710 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Remove redundant sys/types.h #include directives (now in types.h).zwelch2009-05-111-1/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* in_handler in_check_mask and in_check_value now removed from field. Last big ↵oharboe2009-05-081-2/+2
| | | | | | patch in the series of JTAG API cleanup. git-svn-id: svn://svn.berlios.de/openocd/trunk@1672 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Fix pointer cast alignment issues in svf.czwelch2009-05-061-5/+14
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1622 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* remove unecessary setting of deprecated fields to NULLoharboe2009-05-061-6/+6
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1611 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* retire out_mask - not used anywhereoharboe2009-05-061-2/+2
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1608 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Zach Welch <zw@superlucidity.net> fix -Werror warningsoharboe2009-04-191-3/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1472 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* - Cable driver helper API courtesy of Dick Hollenbeck <dick@softplc.com>kc8apf2009-02-031-8/+8
| | | | | | | - Formatting changes from uncrustify git-svn-id: svn://svn.berlios.de/openocd/trunk@1366 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Fixes for svf player by Simon Qian <simonqian@SimonQian.com>kc8apf2009-01-231-42/+139
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@1359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* SVF player courtesy of Simon Qian <simonqian@SimonQian.com>kc8apf2009-01-191-0/+1305
git-svn-id: svn://svn.berlios.de/openocd/trunk@1339 b42882b7-edfa-0310-969c-e2dbd0fdcd60