origen_arm_debug 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10a26d1f0559e342aac9aa18777bb2bc3f04b9ff
4
- data.tar.gz: acbe130cdb99f062be4629eed0ab73569b960928
3
+ metadata.gz: e5dd246d4525d4ced61bb06b8bccca56084e3ed9
4
+ data.tar.gz: ef1eaa8501694c28aa03227326a2da6cf2e3c9b2
5
5
  SHA512:
6
- metadata.gz: d400af4575b1daa231314c17391e13aeb937b04bb066e95e229917ea909a113090938f95f8c9194f66642abff9be001da811a535d1b87eecabbf4d24b1d5bbe0
7
- data.tar.gz: 53b6447b770c98bd639ed62f34fe13d39c60e32c9414e06057ecce46995ed3ff80e100b768ffe95077c3bea320eadd15cebdd467d9f440216932a9f0124ed3ac
6
+ metadata.gz: 3d194a9455d7c34f0dfa0bf366f1aaa31e094f0eb470d3c209557faa4651a7edd70d8e1293630984c4a7d9b6eb73588410c80a446bc9532dad04c272d30e54af
7
+ data.tar.gz: cec545de10b7f3bbe7f2c93b7f1c6053b074c583e3b42f24f8ca38c197decfd4e0b71e50fb407359ee6c317d267225138fedce4cb29f5eaaa550ee30cd158285
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenARMDebug
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- BUGFIX = 1
4
+ BUGFIX = 2
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -4,7 +4,7 @@ module OrigenARMDebug
4
4
  include Origen::Model
5
5
 
6
6
  # Wait states for data to be transferred from AP-Reg to RDBUFF (on read)
7
- attr_reader :apreg_access_wait
7
+ attr_accessor :apreg_access_wait
8
8
 
9
9
  def initialize(options = {})
10
10
  @apreg_access_wait = options[:apreg_access_wait] || 0
@@ -95,6 +95,7 @@ module OrigenARMDebug
95
95
  dr[0].write(1)
96
96
  dr[2..1].write(rdbuff.offset >> 2)
97
97
  dr[34..3].copy_all(reg)
98
+ options[:mask] = options[:mask] << 3 unless options[:mask].nil?
98
99
  dut.jtag.read_dr(dr, options)
99
100
 
100
101
  else
@@ -131,6 +132,7 @@ module OrigenARMDebug
131
132
  dr[0].write(1)
132
133
  dr[2..1].write(rdbuff.offset >> 2)
133
134
  dr[34..3].copy_all(reg)
135
+ options[:mask] = options[:mask] << 3 unless options[:mask].nil?
134
136
  ir.write!(0b1010)
135
137
  dut.jtag.read_dr(dr, options)
136
138
  end
@@ -2,12 +2,12 @@ module OrigenARMDebug
2
2
  # Memory Access Port (MEM-AP)
3
3
  class MemAP < AP
4
4
  # Latency to write a memory resource
5
- attr_reader :latency
5
+ attr_accessor :latency
6
6
 
7
7
  # Wait states for data to be transferred from Memory Resource to DRW on
8
8
  # read request. Should be added to apreg_access_wait for complete transaction
9
9
  # time of memory read (read data path: memory->drw->rdbuff)
10
- attr_reader :apmem_access_wait
10
+ attr_accessor :apmem_access_wait
11
11
 
12
12
  def initialize(options = {})
13
13
  super
@@ -32,11 +32,6 @@ Include the <code>OrigenARMDebug</code> module in your DUT class, then hook it u
32
32
  to the Origen register API via
33
33
  <code>read_register</code> and <code>write_register</code> methods.
34
34
 
35
- The <code>OrigenARMDebug</code> module also provides additional methods to use the ARM Debug protocol including:
36
- accessing device memory, accessing core and floating point registers (cortex M cores only),
37
- entering/exiting debug mode (cortex M cores only), setting the PC (cortex M cores only)
38
- and stepping through code (cortex M cores only).
39
-
40
35
  You must also include a compatible physical driver depending on what debug
41
36
  interface your device has, one of the following can be used:
42
37
 
@@ -57,7 +52,10 @@ class DUT
57
52
  reg.bits 7..0, :lower_byte
58
53
  end
59
54
 
60
- sub_block :arm_debug, class_name: "OrigenARMDebug::DAP", mem_aps: { mem_ap: 0x00000000, mem2_ap: 0x01000000 }
55
+ # Simple example using default wait-states and latency:
56
+ # mem_ap: APSEL = 0x00 (base_address[31:24])
57
+ # mem2_ap: APSEL = 0x01 (base_address[31:24])
58
+ sub_block :arm_debug, class_name: 'OrigenARMDebug::DAP', mem_aps: { mem_ap: 0x00000000, mem2_ap: 0x01000000 }
61
59
  end
62
60
 
63
61
  # Hook the ARMDebug module into the register API, any register read
@@ -75,7 +73,7 @@ end
75
73
  DUT.new.myreg.write!(0x55AA) # => Will generate the required vectors using the ARM debug protocol
76
74
  ~~~
77
75
 
78
- You can also access the lower-level API using conventional Origen register transactions:
76
+ You can access the lower-level API using conventional Origen register transactions:
79
77
 
80
78
  ~~~ruby
81
79
  arm_debug.sw_dp.idcode.read!(0x2BA01477)
@@ -88,6 +86,91 @@ arm_debug.sw_dp.select.write!(0) # Select AHB-AP, bank 0
88
86
  arm_debug.ahb_ap.csw.write!(0x23000052)
89
87
  ~~~
90
88
 
89
+ You can also adjust the intermediate wait-states and latency parameters:
90
+
91
+ * [AP.apreg_access_wait](http://origen-sdk.org/arm_debug/api/OrigenARMDebug/AP.html#apreg_access_wait-instance_method)
92
+ * [MemAP.apmem_access_wait](http://origen-sdk.org/arm_debug/api/OrigenARMDebug/MemAP.html#apmem_access_wait-instance_method)
93
+ * [MemAP.latency](http://origen-sdk.org/arm_debug/api/OrigenARMDebug/MemAP.html#latency-instance_method)
94
+
95
+ ~~~ruby
96
+ # Assuming ahb_ap has been previously defined
97
+ dut.arm_debug.ahb_ap.apmem_access_wait = 16
98
+ dut.arm_debug.ahb_ap.apreg_access_wait = 12
99
+ dut.arm_debug.ahb_ap.latency = 8
100
+ ~~~
101
+
102
+ ### Company Customization
103
+
104
+ It may be the case that your application needs additional, customized Access Ports (AP) which are allowed but
105
+ not defined by the standard ARM Debug Interface. The following example shows how you can use the generic AP
106
+ class as a starting point and add extra registers as defined by your specific implementation.
107
+
108
+ ~~~ruby
109
+ require 'origen_arm_debug'
110
+ module ARMDebugCOMPANY
111
+ # New AP class inherited from generic AP class provided by origen_arm_debug
112
+ class CustomAP < OrigenARMDebug::AP
113
+ # Initialize AP parameters and registers
114
+ def initialize(options = {})
115
+ super
116
+
117
+ instantiate_registers(options)
118
+
119
+ # Standard AP-register latency for most devices. Can be overriden by
120
+ # top-level if necessary
121
+ @apreg_access_wait = 8
122
+ end
123
+
124
+ # Add example registers associated with CustomAP.
125
+ #
126
+ # Custom registers can also be added by ARMDebug owner with add_reg or
127
+ # overloading entire instantiate_registers methd
128
+ #
129
+ # Ex: arm_debug.company_ap.add_reg(:custom_reg_3, 0x08)
130
+ def instantiate_registers(options = {})
131
+ add_reg :custom_reg_1, 0x00
132
+ add_reg :custom_reg_2, 0x04
133
+ end
134
+ end
135
+ end
136
+
137
+
138
+ class DUT
139
+ include Origen::TopLevel
140
+ include ARMDebugCOMPANY
141
+
142
+ # Also include the required physical driver, JTAG in this example
143
+ include OrigenJTAG
144
+
145
+ def initialize
146
+ reg :myreg, 0x0012, size: 16 do |reg|
147
+ reg.bits 15..8, :upper_byte
148
+ reg.bits 7..0, :lower_byte
149
+ end
150
+
151
+ # Some standard AP parameters values
152
+ std_memap_config = { latency: 16, apreg_access_wait: 8, apmem_access_wait: 8, csw_reset: 0x23000040 }
153
+
154
+ # 2 MemAPs using standard parameters (above)
155
+ mem_aps = {
156
+ mem_ap_0: { base_address: 0x00000000 }.merge(std_memap_config), # AP Select = 0x00
157
+ mem_ap_1: { base_address: 0x01000000 }.merge(std_memap_config), # AP Select = 0x01
158
+ }
159
+
160
+ # Add Company-Customized AP class @ APSEL = 0x04
161
+ custom_ap = {
162
+ company_ap: { class_name: 'ARMDebugCOMPANY::CustomAP', base_address: 0x04000000, apreg_access_wait: 8 }
163
+ }
164
+
165
+ sub_block :arm_debug, class_name: 'OrigenARMDebug::DAP',
166
+ base_address: 0,
167
+ mem_aps: mem_aps,
168
+ aps: custom_ap
169
+ end
170
+ end
171
+ DUT.new.arm_debug.company_ap.custom_reg_1.write!(0x55AA)
172
+ ~~~
173
+
91
174
  ### How To Setup a Development Environment
92
175
 
93
176
  [Clone the repository from Github](https://github.com/Origen-SDK/origen_arm_debug).
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_arm_debug
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronnie Lajaunie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-08 00:00:00.000000000 Z
11
+ date: 2017-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -34,16 +34,22 @@ dependencies:
34
34
  name: origen_jtag
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.17'
37
40
  - - ">="
38
41
  - !ruby/object:Gem::Version
39
- version: 0.15.0
42
+ version: 0.17.0
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.17'
44
50
  - - ">="
45
51
  - !ruby/object:Gem::Version
46
- version: 0.15.0
52
+ version: 0.17.0
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: origen_swd
49
55
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +106,7 @@ files:
100
106
  - templates/web/release_notes.md.erb
101
107
  homepage: http://origen-sdk.org/origen_arm_debug
102
108
  licenses:
103
- - LGPL-3
109
+ - MIT
104
110
  metadata: {}
105
111
  post_install_message:
106
112
  rdoc_options: []