-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
pulp/sim/tcl_files/fault_injection/inject_fault.tcl
Lines 357 to 366 in 1a0ee6a
| set old_value_numeric [examine -radix binary,enumnumeric $signal_name] | |
| set new_value_numeric [expr int(rand()*([expr 2 ** [string length $old_value_numeric]]))] | |
| while {$old_value_numeric == $new_value_numeric && [string length $old_value_numeric] != 1} { | |
| set new_value_numeric [expr int(rand()*([expr 2 ** [string length $old_value_numeric]]))] | |
| } | |
| if {$is_register} { | |
| force -freeze $signal_name $new_value_numeric -cancel $::register_fault_duration | |
| } else { | |
| force -freeze $signal_name $new_value_numeric, $old_value_numeric $::signal_fault_duration -cancel $::signal_fault_duration | |
| } |
old_value_numeric is extracted as a binary value while new_value_numeric is stored as a decimal number. As a result, the condition in the while statement $old_value_numeric == $new_value_numeric && [string length $old_value_numeric] != 1 is stuck to false and the command force -freeze interprets old_value_numeric as a decimal value since no base is specified.
Metadata
Metadata
Assignees
Labels
No labels