summaryrefslogtreecommitdiffstats
path: root/spec/dev/grlib/val/io.yml
blob: 3e06d266c89c0885d5aa7eda933147c74c2ae528 (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
links: []
test-actions:
- action-brief: |
    Call ${../if/load-08:/name} to load a prepared value.
  action-code: |
    uint8_t reg_8;
    uint8_t val_8;

    reg_8 = 0x81;
    val_8 = grlib_load_8( &reg_8 );
  checks:
  - brief: |
      Check that the returned value is equal to the prepared value.
    code: |
      T_step_eq_u8( ${.:/step}, val_8, 0x81 );
    links:
    - role: validation
      uid: ../req/load-08
  links: []
- action-brief: |
    Call ${../if/load-16:/name} to load a prepared value.
  action-code: |
    uint16_t reg_16;
    uint16_t val_16;

    reg_16 = 0x8001;
    val_16 = grlib_load_16( &reg_16 );
  checks:
  - brief: |
      Check that the returned value is equal to the prepared value.
    code: |
      T_step_eq_u16( ${.:/step}, val_16, 0x8001 );
    links:
    - role: validation
      uid: ../req/load-16
  links: []
- action-brief: |
    Call ${../if/load-32:/name} to load a prepared value.
  action-code: |
    uint32_t reg_32;
    uint32_t val_32;

    reg_32 = 0x80000001;
    val_32 = grlib_load_32( &reg_32 );
  checks:
  - brief: |
      Check that the returned value is equal to the prepared value.
    code: |
      T_step_eq_u32( ${.:/step}, val_32, 0x80000001 );
    links:
    - role: validation
      uid: ../req/load-32
  links: []
- action-brief: |
    Call ${../if/load-64:/name} to load a prepared value.
  action-code: |
    uint64_t reg_64;
    uint64_t val_64;

    reg_64 = 0x8000000000000001;
    val_64 = grlib_load_64( &reg_64 );
  checks:
  - brief: |
      Check that the returned value is equal to the prepared value.
    code: |
      T_step_eq_u64( ${.:/step}, val_64, 0x8000000000000001 );
    links:
    - role: validation
      uid: ../req/load-64
  links: []
- action-brief: |
    Call ${../if/store-08:/name} to store a value to an object.
  action-code: |
    uint8_t reg_8;

    grlib_store_8( &reg_8, 0x81 );
  checks:
  - brief: |
      Check that the value of the object is equal to the stored value.
    code: |
      T_step_eq_u8( ${.:/step}, reg_8, 0x81 );
    links:
    - role: validation
      uid: ../req/store-08
  links: []
- action-brief: |
    Call ${../if/store-16:/name} to store a value to an object.
  action-code: |
    uint16_t reg_16;

    grlib_store_16( &reg_16, 0x8001 );
  checks:
  - brief: |
      Check that the value of the object is equal to the stored value.
    code: |
      T_step_eq_u16( ${.:/step}, reg_16, 0x8001 );
    links:
    - role: validation
      uid: ../req/store-16
  links: []
- action-brief: |
    Call ${../if/store-32:/name} to store a value to an object.
  action-code: |
    uint32_t reg_32;

    grlib_store_32( &reg_32, 0x80000001 );
  checks:
  - brief: |
      Check that the value of the object is equal to the stored value.
    code: |
      T_step_eq_u32( ${.:/step}, reg_32, 0x80000001 );
    links:
    - role: validation
      uid: ../req/store-32
  links: []
- action-brief: |
    Call ${../if/store-64:/name} to store a value to an object.
  action-code: |
    uint64_t reg_64;

    grlib_store_64( &reg_64, 0x8000000000000001 );
  checks:
  - brief: |
      Check that the value of the object is equal to the stored value.
    code: |
      T_step_eq_u64( ${.:/step}, reg_64, 0x8000000000000001 );
    links:
    - role: validation
      uid: ../req/store-64
  links: []
- action-brief: |
    Call ${../if/apbuart-outbyte-polled:/name} to store a character to the data
    register.  The transmitter FIFO shall be initially non-empty.  The status
    is checked by ${../if/apbuart-outbyte-wait:/name}.
  action-code: |
    apbuart regs;

    memset( &regs, 0, sizeof( regs ) );
    SetIORelaxHandler( ApbuartIORelax, &regs );
    apbuart_outbyte_polled( &regs, (char) 0xff );
    SetIORelaxHandler( NULL, NULL );
  checks:
  - brief: |
      Check that the transmitter FIFO empty flag was set by ApbuartIORelax().
    code: |
      T_step_eq_u32( ${.:/step}, regs.status, APBUART_STATUS_TE );
    links:
    - role: validation
      uid: ../req/apbuart-outbyte-wait
    - role: validation
      uid: ../req/apbuart-outbyte-polled
  - brief: |
      Check that the data register was written by
      ${../if/apbuart-outbyte-polled:/name}.
    code: |
      T_step_eq_u32( ${.:/step}, regs.data, 0xff );
    links:
    - role: validation
      uid: ../req/apbuart-outbyte-polled
  links: []
test-brief: |
  Tests some ${../if/group:/name} directives.
test-context: []
test-context-support: null
test-description: null
test-header: null
test-includes:
- grlib/apbuart.h
- grlib/io.h
- string.h
test-local-includes:
- tx-support.h
test-setup: null
test-stop: null
test-support: |
  static void ApbuartIORelax( void *arg )
  {
    apbuart *regs;

    regs = arg;
    regs->status = 0x4;
    T_quiet_eq_u32( regs->data, 0 );
  }
test-target: testsuites/validation/tc-dev-grlib-io.c
test-teardown: null
type: test-case