Page MenuHomePhorge

run_exhaustive_search.sh
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

run_exhaustive_search.sh

#!/bin/bash
D2B_1=({0..1}{0..1})
D2B_2=({0..1}{0..1}{0..1}{0..1})
D2B_3=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1})
D2B_4=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1})
file="../bruteforce_muxig.c"
temp_file="./bruteforce_muxig_temp.c"
for inputs in $(seq 3 4); do
# Dynamically access the D2B arrays
eval "current_array=(\"\${D2B_${inputs}[@]}\")"
# Iterate through the array elements
for i in "${!current_array[@]}"; do
binary="${current_array[$i]}"
echo "Processing: Input $inputs, Index $i, Binary $binary"
# Update the file with the current binary
if[inputs -le 2]; then
sed -e "s|#define target_truth_table \"00000000\"|#define target_truth_table \"$binary\"|" \
-e "s|#define NUM_INPUTS 3|#define NUM_INPUTS $inputs|" \
"$file" > "$temp_file"
else
sed -e "s|#define target_truth_table \"00000000\"|#define target_truth_table \"$binary\"|" \
-e "s|#define NUM_INPUTS 3|#define NUM_INPUTS $inputs|" \
-e "s|#define MAX_GATES 2|#define MAX_GATES 3|" \
"$file" > "$temp_file"
fi
# Compile and run the generated C file
gcc -pthreads -o bruteforce_muxig_temp "$temp_file"
./bruteforce_muxig_temp
# Save the output in a structured directory
mkdir -p "result_${inputs}/${i}_${binary}"
mv ./output/* "result_${inputs}/${i}_${binary}/"
done
done

File Metadata

Mime Type
text/x-shellscript
Expires
Sun, Jul 12, 7:08 PM (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
351918
Default Alt Text
run_exhaustive_search.sh (1 KB)

Event Timeline