origen_arm 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -2
- data/lib/origen_arm/cores/base_core/core.rb +9 -0
- data/lib/origen_arm/cores/base_core/core_controller.rb +19 -0
- data/lib/origen_arm/cores/cortexa/ca35/ca35.rb +42 -0
- data/lib/origen_arm/cores/cortexa/ca35/ca35_controller.rb +57 -0
- data/lib/origen_arm/cores/cortexm/cm33/cm33_controller.rb +28 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e94c021eca23399846f9247e568c125e30ec67bb7c08b710111a34f6cf78eeec
|
4
|
+
data.tar.gz: eebec830498c20852c7a7a8582d89caebfde420d18b599b2300ddf93736eff49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88e77a2be08addf1f9473821c9a937f7a888c048f13a9c1498cf7acb70fb738668aa528efee852ea739536134fbd2065955d4af8f445734afb8901a22c35ff2e
|
7
|
+
data.tar.gz: 0d1b6a98450c087fd9bee342a5bb2899ba1e91e0ebacf1d2ebf4d659982c2210fb4dfbfcb2ebf14ed86a1ec774a3ef243f91bb41e9d8fadc7a116e7e63e48e8e
|
data/config/version.rb
CHANGED
@@ -1,8 +1,27 @@
|
|
1
1
|
module OrigenARM
|
2
2
|
module Cores
|
3
3
|
class BaseController
|
4
|
+
include Origen::Controller
|
5
|
+
|
4
6
|
def initialize(options = {})
|
5
7
|
end
|
8
|
+
# def halt!(options={})
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# def release!(options={})
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# def set_pc!(pc, options={})
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# def set_sp!(sp, options={})
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# def with_debug_mode(options={}, &block)
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# def initialize_core(pc: nil, sp: nil, **options)
|
24
|
+
# end
|
6
25
|
end
|
7
26
|
end
|
8
27
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module OrigenARM
|
2
|
+
module Cores
|
3
|
+
module CortexA
|
4
|
+
class CA35 < OrigenARM::Cores::Base
|
5
|
+
TRACE_DBG_EDPRSR_OFFSET = 0x314
|
6
|
+
TRACE_LAR_OFFSET = 0xFB0
|
7
|
+
TRACE_OSLAR_OFFSET = 0x300
|
8
|
+
TRACE_CTI_CTRL_OFFSET = 0x000
|
9
|
+
TRACE_CTI_OUTEN0_OFFSET = 0x0A0
|
10
|
+
TRACE_CTI_APPPULSE_OFFSET = 0x01C
|
11
|
+
TRACE_CTI_INTACK_OFFSET = 0x010
|
12
|
+
TRACE_DBG_EDITR_OFFSET = 0x84
|
13
|
+
TRACE_DBG_EDSCR_OFFSET = 0x88
|
14
|
+
TRACE_DBG_DTRTX_OFFSET = 0x8C
|
15
|
+
TRACE_DBG_DTRRX_OFFSET = 0x80
|
16
|
+
CTI_BASE = 0x0042_0000
|
17
|
+
DBG_BASE = 0x0041_0000
|
18
|
+
|
19
|
+
def initialize(options = {})
|
20
|
+
super
|
21
|
+
instantiate_registers(options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def instantiate_registers(options)
|
25
|
+
add_reg(:trace_dbg_edprsr, DBG_BASE + TRACE_DBG_EDPRSR_OFFSET, size: 32)
|
26
|
+
add_reg(:trace_dbg_editr, DBG_BASE + TRACE_DBG_EDITR_OFFSET, size: 32)
|
27
|
+
add_reg(:trace_dbg_edscr, DBG_BASE + TRACE_DBG_EDSCR_OFFSET, size: 32)
|
28
|
+
add_reg(:trace_dbg_dtrtx, DBG_BASE + TRACE_DBG_DTRTX_OFFSET, size: 32)
|
29
|
+
add_reg(:trace_dbg_dtrrx, DBG_BASE + TRACE_DBG_DTRRX_OFFSET, size: 32)
|
30
|
+
add_reg(:trace_dbg_lar, DBG_BASE + TRACE_LAR_OFFSET, size: 32)
|
31
|
+
add_reg(:trace_dbg_oslar, DBG_BASE + TRACE_OSLAR_OFFSET, size: 32)
|
32
|
+
add_reg(:trace_cti_ctrl, CTI_BASE + TRACE_CTI_CTRL_OFFSET, size: 32)
|
33
|
+
add_reg(:trace_cti_outen0, CTI_BASE + TRACE_CTI_OUTEN0_OFFSET, size: 32)
|
34
|
+
add_reg(:trace_cti_outen1, CTI_BASE + TRACE_CTI_OUTEN0_OFFSET + 0x4, size: 32)
|
35
|
+
add_reg(:trace_cti_apppulse, CTI_BASE + TRACE_CTI_APPPULSE_OFFSET, size: 32)
|
36
|
+
add_reg(:trace_cti_intack, CTI_BASE + TRACE_CTI_INTACK_OFFSET, size: 32)
|
37
|
+
add_reg(:trace_cti_lar, CTI_BASE + TRACE_LAR_OFFSET, size: 32)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module OrigenARM
|
2
|
+
module Cores
|
3
|
+
module CortexA
|
4
|
+
class CA35Controller < OrigenARM::Cores::BaseController
|
5
|
+
def initialize_core(pc:, release_core: false, **options)
|
6
|
+
halt_core!
|
7
|
+
set_pc!(pc)
|
8
|
+
|
9
|
+
if release_core
|
10
|
+
release_core!
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def halt_core!
|
15
|
+
ss 'Halt core - channel 0'
|
16
|
+
reg(:trace_cti_lar).write!(0xC5AC_CE55)
|
17
|
+
reg(:trace_cti_ctrl).write!(0x1)
|
18
|
+
reg(:trace_cti_outen0).write!(0x1)
|
19
|
+
reg(:trace_cti_apppulse).write!(0x1)
|
20
|
+
tester.cycle(repeat: 10_000)
|
21
|
+
|
22
|
+
ss 'Check that the core is halted'
|
23
|
+
reg(:trace_dbg_edprsr).read!(0x10, mask: 0x0000_0010)
|
24
|
+
|
25
|
+
ss 'Acknowledge'
|
26
|
+
reg(:trace_cti_intack).write!(0x1)
|
27
|
+
tester.cycle(repeat: 100)
|
28
|
+
|
29
|
+
reg(:trace_dbg_lar).write!(0xC5AC_CE55)
|
30
|
+
reg(:trace_dbg_oslar).write!(0xABCD_1234)
|
31
|
+
tester.cycle(repeat: 100)
|
32
|
+
end
|
33
|
+
|
34
|
+
def release_core!
|
35
|
+
ss 'Release core - channel 2'
|
36
|
+
reg(:trace_cti_lar).write!(0xC5AC_CE55)
|
37
|
+
reg(:trace_cti_ctrl).write!(0x1)
|
38
|
+
reg(:trace_cti_outen1).write!(0x4)
|
39
|
+
reg(:trace_cti_apppulse).write!(0x4)
|
40
|
+
tester.cycle(repeat: 100)
|
41
|
+
ss 'Check that the core has been released'
|
42
|
+
reg(:trace_dbg_edprsr).read!(0x0, mask: 0x0000_0010)
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_pc!(pc)
|
46
|
+
ss 'Move the PC'
|
47
|
+
reg(:trace_dbg_dtrtx).write!((pc >> 32) & 0xFFFF_FFFF)
|
48
|
+
reg(:trace_dbg_dtrrx).write!(pc & 0xFFFF_FFFF)
|
49
|
+
reg(:trace_dbg_editr).write!(0xD533_0401)
|
50
|
+
tester.cycle(repeat: 100)
|
51
|
+
reg(:trace_dbg_editr).write!(0xD51B_4521)
|
52
|
+
tester.cycle(repeat: 100)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -16,10 +16,27 @@ module OrigenARM
|
|
16
16
|
# @todo Implement lower and upper stack pointer limit setting.
|
17
17
|
def initialize_core(pc:, sp:, release_core: false, sp_lower_limit: nil, sp_upper_limit: nil)
|
18
18
|
enter_debug_mode
|
19
|
+
|
20
|
+
# clear_state
|
21
|
+
# clear_state
|
22
|
+
|
23
|
+
# ss 'Disable the MPU and the SAU'
|
24
|
+
# mem(0xE000_ED94).write!(0x0, force_arm_debug: true)
|
25
|
+
# mem(0xE000_EDD0).write!(0x0, force_arm_debug: true)
|
26
|
+
|
27
|
+
# ss 'Move the stack pointer limits'
|
28
|
+
# mem(0xE000_EDF8).write!(0x1400_6800, force_arm_debug: true)
|
29
|
+
# mem(0xE000_EDF4).write!(0x0001_0000 + 0x1C, force_arm_debug: true)
|
30
|
+
|
19
31
|
set_sp(sp)
|
20
32
|
set_pc(pc)
|
33
|
+
|
21
34
|
# set_stack_limits(sp_lower_limit, sp_upper_limit) if (sp_lower_limit || sp_upper_limit)
|
22
35
|
exit_debug_mode(release_core: release_core)
|
36
|
+
|
37
|
+
# reg(:aircr).bits(:vectkey).write(CM33::Registers::AIRCR_WRITE_KEY)
|
38
|
+
# reg(:aircr).bits(:sysresetreq).write(1)
|
39
|
+
# reg(:aircr).write!
|
23
40
|
end
|
24
41
|
alias_method :initialize_for_lre, :initialize_core
|
25
42
|
|
@@ -88,6 +105,17 @@ module OrigenARM
|
|
88
105
|
end
|
89
106
|
end
|
90
107
|
|
108
|
+
# def clear_state
|
109
|
+
# pp("Clear the core's current state") do
|
110
|
+
# reg(:aircr).bits(:vectkey).write(CM33::Registers::AIRCR_WRITE_KEY)
|
111
|
+
# reg(:aircr).bits(:sysresetreq).write(1)
|
112
|
+
# #reg(:aircr).bits(:vectclractive).write(1)
|
113
|
+
# reg(:aircr).write!
|
114
|
+
#
|
115
|
+
# tester.cycle(repeat: 1000)
|
116
|
+
# end
|
117
|
+
# end
|
118
|
+
|
91
119
|
# def set_stack_limits(lower_limit, upper_limits, stack: :msp, **options)
|
92
120
|
# end
|
93
121
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_arm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Engelken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|
@@ -53,6 +53,8 @@ files:
|
|
53
53
|
- lib/origen_arm/cores/base_core/core.rb
|
54
54
|
- lib/origen_arm/cores/base_core/core_controller.rb
|
55
55
|
- lib/origen_arm/cores/base_core/core_registers.rb
|
56
|
+
- lib/origen_arm/cores/cortexa/ca35/ca35.rb
|
57
|
+
- lib/origen_arm/cores/cortexa/ca35/ca35_controller.rb
|
56
58
|
- lib/origen_arm/cores/cortexm/base_cortexm/cortexm.rb
|
57
59
|
- lib/origen_arm/cores/cortexm/base_cortexm/cortexm_controller.rb
|
58
60
|
- lib/origen_arm/cores/cortexm/base_cortexm/cortexm_registers.rb
|
@@ -85,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
87
|
version: 1.8.11
|
86
88
|
requirements: []
|
87
89
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.7.
|
90
|
+
rubygems_version: 2.7.6
|
89
91
|
signing_key:
|
90
92
|
specification_version: 4
|
91
93
|
summary: Origen subblocks modeling ARM cores.
|