-
Notifications
You must be signed in to change notification settings - Fork 0
/
Irt8iAdcCrcDiagnosticFaultInjectionTest2.py
43 lines (40 loc) · 1.63 KB
/
Irt8iAdcCrcDiagnosticFaultInjectionTest2.py
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
#/////////////////////////////////////////////////////////////////////////////
#/// @file Irt8iAdcCrcDiagnosticFaultInjectionTest2.py
#///
#/// This Python script verifies that a bad CRC read from the ADC will cause
#/// that channel to fault.
#/// Verify that the "Fault" status bit is set in the appropriate input tag.
#///
#/// @if REVISION_HISTORY_INCLUDED
#/// @par Edit History
#/// kolat 18-Jan-2016 Created.
#/// @endif
#///
#/// @par Copyright (c) 2016 Rockwell Automation Technologies, Inc. All rights reserved.
#///
#/////////////////////////////////////////////////////////////////////////////
import faultInjectionUtils
#------------------------------------------------------------------------------
# Here is the list of files to be modified by this script, along with
# blocks of new code (first two lines of block are start and end text to
# search for and replace between) for each of the modified files.
fileModificationsDictionary = { \
'IRT8I.c': [ \
# # # # # # # # # # # # # # # # # # # # # # # # #
'''
/* Start Fault Injection Point 3 */
/* End Fault Injection Point 3 */
/* Fault Injection Code Start */
/* For each odd channel number, corrupt it's read CRC value by incrementing it */
/* Verify that these channels have their "Fault" status bit set. */
if ( (ADC_bit & 1) == 1 )
{
read_crc[ ADC_bit ]++;
}
/* Fault Injection Code End */
'''
]
}
# Call the procedure to modify and build the test firmware code with the
# above modifications.
faultInjectionUtils.FaultInjectionUtils().ModifyAndBuildFaultInjectionFile(fileModificationsDictionary, __file__)