Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
German Leon
Carol-fi
Commits
2b26a42d
Commit
2b26a42d
authored
Dec 18, 2020
by
leon@uji.es
Browse files
Crossbar total
parent
460770cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
classes/BitFlip.py
View file @
2b26a42d
...
@@ -22,6 +22,7 @@ class BitFlip:
...
@@ -22,6 +22,7 @@ class BitFlip:
self
.
__fault_model
=
kwargs
.
get
(
'fault_model'
)
self
.
__fault_model
=
kwargs
.
get
(
'fault_model'
)
self
.
__logging
=
kwargs
.
get
(
'logging'
)
self
.
__logging
=
kwargs
.
get
(
'logging'
)
self
.
__injection_site
=
kwargs
.
get
(
'injection_site'
)
self
.
__injection_site
=
kwargs
.
get
(
'injection_site'
)
self
.
__maxregs
=
kwargs
.
get
(
'max_regs'
)
self
.
fault_injected
=
False
self
.
fault_injected
=
False
"""
"""
...
@@ -200,17 +201,17 @@ class BitFlip:
...
@@ -200,17 +201,17 @@ class BitFlip:
def
__select_register
(
self
):
def
__select_register
(
self
):
# Start on 1 to consider R0
# Start on 1 to consider R0
max_num_register
=
0
#
max_num_register =
# registers_list.popleft()
# registers_list.popleft()
registers_list
=
cf
.
execute_command
(
gdb
=
gdb
,
to_execute
=
"info registers"
)
#
registers_list = cf.execute_command(gdb=gdb, to_execute="info registers")
for
line
in
registers_list
:
#
for line in registers_list:
m
=
re
.
match
(
r
".*R.*0x([0-9a-fA-F]+).*"
,
line
)
#
m = re.match(r".*R.*0x([0-9a-fA-F]+).*", line)
if
m
and
m
.
group
(
1
)
!=
'0'
:
#
if m and m.group(1) != '0':
#self.__logging.info ("LIne salida:{}".format(m.group(1))
#self.__logging.info ("LIne salida:{}".format(m.group(1))
max_num_register
+=
1
#
max_num_register += 1
#self.__logging.info("LIne entrada {}--max{}".format(line,max_num_register))
#self.__logging.info("LIne entrada {}--max{}".format(line,max_num_register))
self
.
__register
=
"R{}"
.
format
(
random
.
randint
(
0
,
max_num_register
-
1
))
self
.
__register
=
"R{}"
.
format
(
random
.
randint
(
0
,
self
.
__maxregs
-
1
))
self
.
__logging
.
info
(
"MAX_NUM_REGISTER:{}"
.
format
(
max_num_register
))
self
.
__logging
.
info
(
"MAX_NUM_REGISTER:{}"
.
format
(
self
.
__maxregs
))
"""
"""
Instruction injector
Instruction injector
"""
"""
...
...
fault_injector.py
View file @
2b26a42d
...
@@ -332,6 +332,7 @@ def gdb_inject_fault(**kwargs):
...
@@ -332,6 +332,7 @@ def gdb_inject_fault(**kwargs):
seq_signals
=
kwargs
.
get
(
'seq_signals'
)
seq_signals
=
kwargs
.
get
(
'seq_signals'
)
init_sleep
=
kwargs
.
get
(
'init_sleep'
)
init_sleep
=
kwargs
.
get
(
'init_sleep'
)
sdc_check_script
=
kwargs
.
get
(
'gold_check_script'
)
sdc_check_script
=
kwargs
.
get
(
'gold_check_script'
)
maxregs
=
kwargs
.
get
(
'max_regs'
).
# signalCmd
# signalCmd
signal_cmd
=
kwargs
.
get
(
"signal_cmd"
)
signal_cmd
=
kwargs
.
get
(
"signal_cmd"
)
...
@@ -355,7 +356,7 @@ def gdb_inject_fault(**kwargs):
...
@@ -355,7 +356,7 @@ def gdb_inject_fault(**kwargs):
logging
.
info
(
"Starting GDB script"
)
logging
.
info
(
"Starting GDB script"
)
# Generate configuration file for specific test
# Generate configuration file for specific test
gdb_env_string
=
"{}|{}|{}|{}|{}|file {}; set args {}|{}"
.
format
(
gdb_kernel
,
os
.
getpid
(),
","
.
join
(
str
(
i
)
for
i
in
bits_to_flip
),
fault_model
,
gdb_env_string
=
"{}|{}|{}|{}|{}|
{}|
file {}; set args {}|{}"
.
format
(
gdb_kernel
,
os
.
getpid
(),
max_regs
,
","
.
join
(
str
(
i
)
for
i
in
bits_to_flip
),
fault_model
,
flip_log_file
,
benchmark_binary
,
benchmark_args
,
flip_log_file
,
benchmark_binary
,
benchmark_args
,
injection_site
)
injection_site
)
...
...
flip_value.py
View file @
2b26a42d
...
@@ -74,7 +74,7 @@ def main():
...
@@ -74,7 +74,7 @@ def main():
# Get variables values from environment
# Get variables values from environment
# Firsn parse line
# Firsn parse line
[
kernel
,
pid
,
bits_to_flip
,
fault_model
,
flip_log_file
,
[
kernel
,
pid
,
max_regs
,
bits_to_flip
,
fault_model
,
flip_log_file
,
gdb_init_strings
,
injection_site
]
=
arg0
.
split
(
'|'
)
gdb_init_strings
,
injection_site
]
=
arg0
.
split
(
'|'
)
# Logging
# Logging
...
@@ -91,7 +91,7 @@ def main():
...
@@ -91,7 +91,7 @@ def main():
# Set Breakpoint attributes to be use
# Set Breakpoint attributes to be use
bits_to_flip
=
[
i
for
i
in
bits_to_flip
.
split
(
","
)]
bits_to_flip
=
[
i
for
i
in
bits_to_flip
.
split
(
","
)]
fault_model
=
int
(
fault_model
)
fault_model
=
int
(
fault_model
)
bit_flip
=
BitFlip
(
bits_to_flip
=
bits_to_flip
,
fault_model
=
fault_model
,
bit_flip
=
BitFlip
(
bits_to_flip
=
bits_to_flip
,
fault_model
=
fault_model
,
max_regs
=
max_regs
,
logging
=
global_logging
,
injection_site
=
cp
.
INJECTION_SITES
[
injection_site
])
logging
=
global_logging
,
injection_site
=
cp
.
INJECTION_SITES
[
injection_site
])
# Start app execution
# Start app execution
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment