forked from mchck/programmer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharmv7-dwt.rb
73 lines (69 loc) · 1.87 KB
/
armv7-dwt.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require 'register'
class ARMv7::DWT
include Peripheral
register :DWT_CTRL, 0xe0001000 do
unsigned :NUMCOMP, 31..28
bool :NOTRCPKT, 27
bool :NOEXTTRIG, 26
bool :NOCYNCCNT, 25
bool :NOPRFCNT, 24
bool :CYCEVTENA, 22
bool :FOLDEVTENA, 21
bool :LSUEVTENA, 20
bool :SLEEPEVTENA, 19
bool :EXCEVTENA, 18
bool :CPIEEVTENA, 17
bool :EXCTRCENA, 16
bool :PCSAMPLENA, 12
unsigned :SYNCTAP, 11..10
enum :CYCTAP, 9, {
:CYCCNT6 => 0,
:CYCCNT10 => 1
}
unsigned :POSTCNT, 8..5
unsigned :POSTPRESET, 4..1
bool :CYCCNTENA, 0
end
unsigned :DWT_CYCCNT, 0xe0001004
unsigned :DWT_CPICNT, 0xe0001008
unsigned :DWT_EXCCNT, 0xe000100c
unsigned :DWT_SLEEPCNT, 0xe0001010
unsigned :DWT_LSUCNT, 0xe0001014
unsigned :DWT_FOLDCNT, 0xe0001018
unsigned :DWT_PCSR, 0xe000101c
unsigned :DWT_COMP, 0xe0001020, :vector => 16, :stride => 16
unsigned :DWT_MASK, 0xe0001024, :vector => 16, :stride => 16
register :DWT_FUNCTION, 0xe0001028, :vector => 16, :stride => 16 do
bool :MATCHED, 24
unsigned :DATAVADDR1, 19..16
unsigned :DATAVADDR0, 15..12
enum :DATAVSIZE, 11..10, {
:byte => 0b00,
:half => 0b01,
:word => 0b10
}
bool :LNK1ENA, 9
bool :DATAVMATCH, 8
bool :CYCMATCH, 7
bool :EMITRANGE, 5
enum :FUNCTION, 3..0, {
:disabled => 0b0000,
:sample_pc => 0b0001,
:sample_daddr => 0b0001,
:sample_data => 0b0010,
:sample_pc_data => 0b0011,
:watch_pc => 0b0100,
:watch_read => 0b0101,
:watch_write => 0b0110,
:watch_access => 0b0111,
:cmpmatch_pc => 0b1000,
:cmpmatch_read => 0b1001,
:cmpmatch_write => 0b1010,
:cmpmatch_access => 0b1011,
:sample_data_read => 0b1100,
:sample_data_write => 0b1101,
:sample_pc_data_read => 0b1110,
:sample_pc_data_write => 0b1111
}
end
end