This plugin provides tester models to drive bench debuggers such as the Segger J-Link or PE Micro.
Add the following to your application’s
gem 'origen_debuggers', '0.6.0'
Add the following to your plugin’s gemspec:
spec.add_runtime_dependency 'origen_debuggers', '~> 0', '>= 0.6.0'
and require the gem in your code:
For JTAG based protocols all that should be required is to change the application target to instantiate one of the debuggers that support JTAG, such as J-Link or P&E:
$tester = OrigenDebuggers::JLink.new # or #$tester = OrigenDebuggers::PEmircro.new
Patterns should now generate a debugger command file without any additional application modifications.
For non-JTAG-based protocols, all debuggers support a common API for the protocol to interface with, for example:
# Sleep for 40ms $tester.wait(:time_in_ms => 40) # Sleep for 20 cycles $tester.wait(:cycles => 20) $tester.write_byte(0x55, address: 0x12) $tester.write_word(0xAA55, address: 0x34) $tester.write_longword(0x1122_AA55, address: 0x5678) $tester.read(10, address: 0x0001234, size: 8)
See the API for details on all available methods: Common_API
Finally all debuggers support a direct write method that should be used as a last resort to drive debugger-specific functionality that is not otherwise exposed via an official API:
$tester.dw "hwinfo" $tester.dw "mem 0x1234, 10"
Some patterns can be found in the pattern directory to exercise the debuggers.
Follow the instructions here if you want to make a 3rd party app workspace use your development copy of the OrigenDebuggers plugin: Setting up a Plugin Development Environment
This plugin also contains a test suite, make sure this passes before committing any changes!