origen_debuggers 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fix_my_workspace +100 -0
- data/config/version.rb +2 -2
- data/lib/origen_debuggers/base.rb +18 -0
- data/lib/origen_debuggers/j_link.rb +1 -2
- data/lib/origen_debuggers/p_and_e.rb +1 -2
- data/lib/origen_debuggers/test/dut.rb +1 -2
- metadata +3 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 316e1fff3e0b232218989db707a3abaf54e7b896
|
4
|
+
data.tar.gz: e788a582944ef7adba01076863360b5679007327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f9d2236c2ed8820c478ebaf1477923932c83c994fcd9fdf58eb28aea784edaa110822cae92a8a4f4ed1bb988a1b3caa90fb87511a4262c9bea5822c55cc13d6
|
7
|
+
data.tar.gz: d44485a53359752c8cedb24558838365b49e4991dec063941ba7c9fe9bb843a1b49b6bb3b5d76009fd6c87973dbd3ddcaaa028c92844e9ddf92d64cc76ff3823
|
@@ -0,0 +1,100 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$VERBOSE = nil # Don't care about world writable dir warnings and the like
|
3
|
+
|
4
|
+
if $_fix_my_workspace_version_check
|
5
|
+
$_fix_my_workspace_version = '0.7.0'
|
6
|
+
else
|
7
|
+
if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
|
8
|
+
# If this script is being run from within an origen-core workspace, use that Origen-core,
|
9
|
+
# not the system-installed origen-core version.
|
10
|
+
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
|
11
|
+
require 'origen'
|
12
|
+
else
|
13
|
+
# Use system-installed Origen (the gem in system Ruby)
|
14
|
+
require 'origen'
|
15
|
+
end
|
16
|
+
|
17
|
+
if !Origen.site_config.gem_manage_bundler
|
18
|
+
puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
|
19
|
+
puts 'that I cannot make certain assumptions about how your workspace is configured.'
|
20
|
+
puts 'You will need to either resolve this problem yourself, or else change the value of'
|
21
|
+
puts 'gem_mange_bundler to true.'
|
22
|
+
puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
|
23
|
+
|
24
|
+
else
|
25
|
+
ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
|
26
|
+
ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
|
27
|
+
ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
|
28
|
+
|
29
|
+
# Force copy system gems to local gems
|
30
|
+
if Origen.site_config.gem_use_from_system
|
31
|
+
local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
|
32
|
+
gem_dir = Pathname.new(Gem.dir)
|
33
|
+
|
34
|
+
Origen.site_config.gem_use_from_system.each do |gem, version|
|
35
|
+
begin
|
36
|
+
# This will raise an error if the system doesn't have this gem installed, that
|
37
|
+
# will be rescued below
|
38
|
+
spec = Gem::Specification.find_by_name(gem, version)
|
39
|
+
|
40
|
+
local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
|
41
|
+
FileUtils.mkdir_p local_dir
|
42
|
+
FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
|
43
|
+
|
44
|
+
local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
|
45
|
+
FileUtils.mkdir_p local_file.dirname
|
46
|
+
FileUtils.cp(spec.cache_file, local_file)
|
47
|
+
|
48
|
+
if spec.extension_dir && File.exist?(spec.extension_dir)
|
49
|
+
local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
|
50
|
+
FileUtils.mkdir_p local_dir
|
51
|
+
FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
|
52
|
+
end
|
53
|
+
|
54
|
+
local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
|
55
|
+
FileUtils.mkdir_p local_file.dirname
|
56
|
+
FileUtils.cp(spec.spec_file, local_file)
|
57
|
+
|
58
|
+
rescue Gem::LoadError
|
59
|
+
# This just means that one of the gems that should be copied from the system
|
60
|
+
# was not actually installed in the system, so nothing we can do about that here
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Delete lbin
|
66
|
+
FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
|
67
|
+
|
68
|
+
# Run bundler with correct switches
|
69
|
+
cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
|
70
|
+
`chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
|
71
|
+
`chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
|
72
|
+
`chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
|
73
|
+
|
74
|
+
# Try again, this time updating the bundle
|
75
|
+
if system(cmd)
|
76
|
+
fixed = true
|
77
|
+
elsif system 'bundle update'
|
78
|
+
fixed = true
|
79
|
+
end
|
80
|
+
|
81
|
+
if File.exist?(ENV['BUNDLE_BIN'])
|
82
|
+
`chmod o-w #{ENV['BUNDLE_BIN']}`
|
83
|
+
|
84
|
+
# Make .bat versions of all executables, Bundler should really be doing this when running
|
85
|
+
# on windows
|
86
|
+
if Origen.os.windows?
|
87
|
+
Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
|
88
|
+
unless bin =~ /.bat$/
|
89
|
+
bat = "#{bin}.bat"
|
90
|
+
unless File.exist?(bat)
|
91
|
+
File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
system 'origen -v' if fixed
|
99
|
+
end
|
100
|
+
end
|
data/config/version.rb
CHANGED
@@ -3,6 +3,24 @@ module OrigenDebuggers
|
|
3
3
|
# This is base class of all debuggers, any methods/attributes
|
4
4
|
# defined here will be available to all
|
5
5
|
class Base < OrigenTesters::CommandBasedTester
|
6
|
+
# Testers don't listen for callbacks
|
7
|
+
class OnCreateCaller
|
8
|
+
include Origen::Callbacks
|
9
|
+
|
10
|
+
def initialize(tester)
|
11
|
+
@tester = tester
|
12
|
+
end
|
13
|
+
|
14
|
+
def on_create
|
15
|
+
@tester.on_create if @tester.respond_to?(:on_create)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
OnCreateCaller.new(self)
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
6
24
|
# Returns true if the debugger supports JTAG
|
7
25
|
def jtag?
|
8
26
|
respond_to?(:write_dr)
|
@@ -200,8 +200,7 @@ module OrigenDebuggers
|
|
200
200
|
# NOTE: Specifying a filename in command line
|
201
201
|
# will start J-Link Commander in script mode.
|
202
202
|
class JLink < Base
|
203
|
-
def
|
204
|
-
super
|
203
|
+
def on_create
|
205
204
|
# The minimum time unit is 1ms
|
206
205
|
set_timeset('default', 1_000_000)
|
207
206
|
@pat_extension = 'jlk'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_debuggers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|
@@ -38,34 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.5.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: origen_doc_helpers
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.0
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.2.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: origen_jtag
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.12.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.12.0
|
69
41
|
description:
|
70
42
|
email:
|
71
43
|
- stephen.f.mfcginty@gmail.com
|
@@ -73,6 +45,7 @@ executables: []
|
|
73
45
|
extensions: []
|
74
46
|
extra_rdoc_files: []
|
75
47
|
files:
|
48
|
+
- bin/fix_my_workspace
|
76
49
|
- config/application.rb
|
77
50
|
- config/commands.rb
|
78
51
|
- config/development.rb
|