-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
5,389 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# This must follow the format "<port_number>,<bitstream_name_without_extension>" | ||
BOARDS="$1" | ||
|
||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
OLDIFS=$IFS; IFS=','; | ||
# Separate "tuple" arguments with positional notation | ||
set -- ${BOARDS}; | ||
for board in ${BOARDS[*]}; do | ||
printf "Configuring BPM board: %s\n" "${board}" | ||
(cd build/ && ./examples/fofb_ctrl --brokerendp ipc:///tmp/malamute --boardslot ${board} --halcsnumber 0 --bpm_id ${board} --time_frame_len 10000 --cc_enable 0) | ||
(cd build/ && ./examples/fofb_ctrl --brokerendp ipc:///tmp/malamute --boardslot ${board} --halcsnumber 1 --bpm_id ${board} --time_frame_len 10000 --cc_enable 0) | ||
(cd build/ && ./examples/fofb_ctrl --brokerendp ipc:///tmp/malamute --boardslot ${board} --halcsnumber 0 --cc_enable 1) | ||
(cd build/ && ./examples/fofb_ctrl --brokerendp ipc:///tmp/malamute --boardslot ${board} --halcsnumber 1 --cc_enable 1) | ||
(cd build/ && ./examples/trigger --brokerendp ipc:///tmp/malamute --boardslot ${board} --halcsnumber 0 --channumber 1 --rcvsrc 0 --rcvsel 3) | ||
(cd build/ && ./examples/trigger --brokerendp ipc:///tmp/malamute --boardslot ${board} --halcsnumber 1 --channumber 1 --rcvsrc 0 --rcvsel 3) | ||
done; | ||
|
||
IFS=$OLDIFS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import re | ||
|
||
def conv_int32_to_uint32(x): | ||
INT32_TO_UINT32 = (1 << 32) | ||
INT32_SIGN_BIT = (1 << 31) | ||
return x + INT32_TO_UINT32 if (x & INT32_SIGN_BIT) else x | ||
|
||
LINE_PATTERN = "[\t ]*(-?\d+)[\t ]*(-?\d+)[\t ]*(-?\d+)[\t ]*(-?\d+)" | ||
p = re.compile(LINE_PATTERN) | ||
|
||
i = 0 | ||
print("| {:8} | {:10} | {:8} | {:6} | {:^17} | {:^17} | {:10} |". | ||
format("packet #", "tf_cntr_16", "tf_start", "bpm_id", "bpm_x", "bpm_y", "tf_cntr_32")) | ||
for line in sys.stdin: | ||
m = re.match(p, line) | ||
atoms = [conv_int32_to_uint32(int(g)) for g in m.groups()] | ||
tf_cntr_16_lsb = (atoms[3] & 0xFFFF0000) >> 16 | ||
tf_start = (atoms[3] & 0x8000) >> 15 | ||
bpm_id = (atoms[3] & 0x7FFF) | ||
bpm_pos_x_16_msb = (atoms[2] & 0xFFFF0000) >> 16 | ||
bpm_pos_x_16_lsb = (atoms[2] & 0xFFFF) | ||
bpm_pos_y_16_msb = (atoms[1] & 0xFFFF0000) >> 16 | ||
bpm_pos_y_16_lsb = (atoms[1] & 0xFFFF) | ||
tf_cnrt_32 = atoms[0] | ||
print("| {:<8} | {:<10} | {:<8} | {:<6} | {:<8} | {:<8} | {:<8} | {:<8} | {:10} |". | ||
format(i, tf_cntr_16_lsb, tf_start, bpm_id, | ||
bpm_pos_x_16_msb, bpm_pos_x_16_lsb, | ||
bpm_pos_y_16_msb, bpm_pos_y_16_lsb, | ||
tf_cnrt_32)) | ||
i = i + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.