Origen Debuggers (0.6.0)


This plugin provides tester models to drive bench debuggers such as the Segger J-Link or PE Micro.

How To Import

To use in an application:

Add the following to your application’s Gemfile:

gem 'origen_debuggers', '0.6.0'
To use in a plugin:

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:

require 'origen_debuggers'

How To Use

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"

How To Setup a Development Environment

Clone the repository from Github.

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!

origen examples