mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-12-16 09:31:19 +01:00
Compare commits
435 Commits
10.0.0
...
dev/add_si
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f12bc1efd | |||
| 50bf72b40b | |||
| 0adb8156d0 | |||
| e24fb9fc43 | |||
| ac128a1fb3 | |||
| 74f4f6d364 | |||
| 3e8fb809e0 | |||
| ffc9464826 | |||
| 497b3ed00e | |||
| 300a296c20 | |||
| 8a194ddaa0 | |||
| c968c1f3f7 | |||
| c8170b8496 | |||
| c4b5b89534 | |||
| 01e392b112 | |||
| 5409cec73e | |||
|
|
1c31a85a43 | ||
| 577813e8bc | |||
| aa0fa31383 | |||
| 6c8510e542 | |||
| 219e61f85e | |||
| d4d258d92b | |||
| 134137ead0 | |||
| 6d3922f487 | |||
| f14cfb0b31 | |||
| 0ececf502b | |||
| 523224a8d5 | |||
| cf4e6b65c1 | |||
| 0da80cd898 | |||
| d21942d22d | |||
| bbeb336030 | |||
| 3c0a3881d6 | |||
| 13abeca017 | |||
| f7dcece2e7 | |||
| b6dc1101bf | |||
| 96855592f0 | |||
| 8e7921ae45 | |||
| 56e527f047 | |||
| b90851a855 | |||
| 683accd914 | |||
| 30e82e4740 | |||
| 08486b9812 | |||
| a5c661ce22 | |||
| 50448cefb4 | |||
| c1e5cfa101 | |||
| ae8c9175bf | |||
| e7f5a2aa11 | |||
| cad44943c3 | |||
| d4f8049623 | |||
| 925cd55b1c | |||
| ec11ba5a54 | |||
| 336d218c4a | |||
| 52450b41e1 | |||
| eea4dca449 | |||
| 3285221e8a | |||
| 41fb0e08a2 | |||
| f728a8b7cf | |||
| 575b2314fe | |||
|
|
f32fcf1e88 | ||
| 57320a7227 | |||
| 3b0ad0ed16 | |||
| 3ff199822d | |||
| b7e02d5c1a | |||
| 0ba9a269a1 | |||
| afc51c9771 | |||
| 408160c5f1 | |||
| af3149cc76 | |||
| baa9f3c9b5 | |||
| e1b0aef62b | |||
| cdef349561 | |||
| daf1763832 | |||
| 5bcfd05f99 | |||
| 86045c3a1b | |||
| 6c0105536e | |||
| 099965630e | |||
| 955f75848f | |||
| 906b52d5be | |||
| 420bb46cf3 | |||
| 1cf9dc21ab | |||
| 3b92ffb902 | |||
|
|
0490c0ef23 | ||
| af2c6eca0c | |||
|
|
d3dc92b18b | ||
|
|
e243af045d | ||
|
|
1d66f1d26d | ||
|
|
9d40220274 | ||
|
|
41989836e7 | ||
|
|
db91f06c02 | ||
| 5041fd7fef | |||
|
|
d2560aa7f1 | ||
| 13e648ce42 | |||
| f9fdcca028 | |||
| 3684f29e1a | |||
| 9b411ffa25 | |||
| 965f8ab9f2 | |||
|
|
2d8f93a426 | ||
|
|
e7a91d38f2 | ||
| 6e006665ef | |||
| 26846f7c33 | |||
| 5eb8fa07db | |||
| 3387e22796 | |||
| be3749f493 | |||
| c39bd98f2d | |||
| 028bae82e9 | |||
| ddc44e1065 | |||
| 284472b48f | |||
| 6e3acbdf79 | |||
| 5b069d85a8 | |||
| 9af571ea0e | |||
| fff5fa73be | |||
| 15cbaa509e | |||
| 72056ff813 | |||
| 776338a3d4 | |||
| 89fe2a6329 | |||
| 6b763797df | |||
| 92991de5a8 | |||
| efe6124675 | |||
| 292e057004 | |||
| f468c20c57 | |||
| 975caaf813 | |||
| db4a8b9db7 | |||
| 595bf38605 | |||
| d83e9385ed | |||
| 8ca251bbb7 | |||
| f594826e95 | |||
| 071b142b10 | |||
| 956103bbd4 | |||
| f714aa22c5 | |||
| dff2be6cdc | |||
| 35a7458657 | |||
| 6e92acceb2 | |||
| 69dc463b56 | |||
| 953e29a383 | |||
| 3faa7097d3 | |||
| 1eb401d65f | |||
| 6389692c16 | |||
| d64ae91453 | |||
| c8fc7fd6c1 | |||
| 21da221417 | |||
| aa20ceaac1 | |||
| 6bebafa25a | |||
| ebabd37622 | |||
| 55b62f4654 | |||
| 912cf0e671 | |||
| ea01457e1d | |||
| fc5d870583 | |||
| f74bc36984 | |||
| 92648bf5bb | |||
| ee27f0bc1b | |||
| 047793766a | |||
| d91585a39f | |||
| 09709f0f96 | |||
| 2698087efa | |||
| 1bf3d5e67a | |||
| fa508e0376 | |||
| af51776eef | |||
| ef8d8a5fd2 | |||
| d8ee0c2279 | |||
| e1f8c4012f | |||
| d210b0956e | |||
| 3426ca9d32 | |||
| 6b79fcc552 | |||
| e0aadbcc0f | |||
| 767555c5cc | |||
| 45f2dce3fc | |||
| f0c6575a60 | |||
| 2926904cf7 | |||
| fb4a25ecee | |||
| 318b19ad79 | |||
| 9a37cee4e9 | |||
| d18ea00b85 | |||
| 4ff29161d4 | |||
| e0810d973d | |||
| 1caf88858b | |||
| 396ef0a298 | |||
| c3012ec06c | |||
| 34002f5be0 | |||
| b1c6b4b078 | |||
| f9d41f1d66 | |||
| 94a9476550 | |||
| 313fc75950 | |||
| 66ee7954db | |||
| 67042e8315 | |||
| 3bc594862c | |||
| 6c4c60ca71 | |||
| 92fd3f0609 | |||
| 929e441dc6 | |||
| a28c78c47f | |||
| f8a06d78f3 | |||
| 274a338520 | |||
| 36ed20117d | |||
| cd06ea1e31 | |||
| 98d0612314 | |||
| e274524c55 | |||
| f42609b66f | |||
| 5def4bdfc4 | |||
| da3037a8ea | |||
| ba02094c4e | |||
| 5d31d86b83 | |||
| cbd0aed8e5 | |||
| b775dd0efa | |||
| 72bf1fa257 | |||
| 8e20d08af2 | |||
| 856ca1e558 | |||
| 25e4070168 | |||
| ca3311da4c | |||
| 3d4eaec178 | |||
| 91f33edcf8 | |||
| 707bf023c6 | |||
| 23f8981346 | |||
| 8f0c946393 | |||
| 24fcfb3f9d | |||
| 7258adfe15 | |||
| 28792ea7e7 | |||
| 686eebd69b | |||
| 83482c8285 | |||
| 953c3f1587 | |||
| 230d43d1fe | |||
| 24f878a17b | |||
| aac3f8904b | |||
| 8dd9165078 | |||
| 982383980f | |||
| 56aa96e9b5 | |||
| 06f06cfbf4 | |||
| e97eae88bc | |||
| 925176b661 | |||
| e4f329466c | |||
| d19fe8b66a | |||
|
|
f4345a91a1 | ||
| ec67617e5c | |||
|
|
bab6a5e9e1 | ||
|
|
f84454fbc1 | ||
| c92830f854 | |||
| e77fd8d85d | |||
| cd0fb1b7bb | |||
| 50ab20317d | |||
| d0a946a919 | |||
|
|
ed142aa34e | ||
| 1227574590 | |||
|
|
3ac7b579a0 | ||
|
|
feb1b0868e | ||
|
|
6d2f34ef1d | ||
| b36a5b9933 | |||
|
|
d8ce5eabb8 | ||
|
|
ceecb0ca27 | ||
| ac3670dcd2 | |||
| 1c7bc61531 | |||
| 58245a62a4 | |||
| a464262558 | |||
| 995d3e0034 | |||
| 90d57cb6a9 | |||
|
|
30eab42294 | ||
| 1d0eeea7ee | |||
| d7c012d306 | |||
| 1665937540 | |||
|
|
9343e3c667 | ||
|
|
b4c8fc1765 | ||
|
|
3ad4e01a5d | ||
| 015b4add65 | |||
| 9051dae787 | |||
| 68bdd75c9c | |||
| a53873b695 | |||
| 77a39b4ef2 | |||
| 64be8b1e89 | |||
| 68bd9fb4f7 | |||
| 0d5d851585 | |||
| eb3d51d20c | |||
| 9f4298ac15 | |||
| fb79ba768c | |||
| 7bc48e3111 | |||
| 53b90d92d7 | |||
| fb6ef8b818 | |||
| 8bb9de0de1 | |||
| 451b50dfed | |||
| 22f2662e3b | |||
| ce3f555c08 | |||
|
|
dedab6010d | ||
| 62a5fda33f | |||
| 5073769403 | |||
| aabec193ff | |||
| d4a1044fce | |||
| dca0edcfcc | |||
| 5a24a79bf7 | |||
| 91f9c4fa83 | |||
| 3940d6f56e | |||
| f09879a46c | |||
| 1b0e891912 | |||
| 292d65491a | |||
| 36faec6ad3 | |||
|
|
062002243e | ||
|
|
98b1e287a4 | ||
| adf0124ea3 | |||
| e1f46d4747 | |||
|
|
d8c3fa0df3 | ||
|
|
27530fca31 | ||
|
|
cc7f13a10e | ||
|
|
625f4353fb | ||
|
|
2815913d10 | ||
| 5fa2402ec5 | |||
| 4d7d3c9138 | |||
|
|
c3f1d05033 | ||
|
|
0e4cb7cbcd | ||
|
|
bace9edf89 | ||
|
|
99735c3ee5 | ||
|
|
2571397c70 | ||
|
|
497c3abfc2 | ||
|
|
fca31cc432 | ||
|
|
8fe4a78feb | ||
|
|
ee170fa2e0 | ||
|
|
da760b2b93 | ||
| 2c8c2a46ea | |||
| 9625a8058c | |||
|
|
4d8bdae836 | ||
|
|
3297707ab7 | ||
|
|
598154645c | ||
|
|
9d8f9a9ba9 | ||
| 68f163b757 | |||
| b8c5bb2045 | |||
| b45df191e5 | |||
| 01cc745787 | |||
|
|
f9bc2eb126 | ||
|
|
4c86ad3198 | ||
|
|
5be0724f82 | ||
|
|
7c652498e4 | ||
| ae19c1b102 | |||
| 6e6b1b64e4 | |||
|
|
721d536350 | ||
| 361437428d | |||
|
|
aadbfeaf2d | ||
|
|
f119d14e7c | ||
| f8b12201f8 | |||
| 585c92be66 | |||
| 7c8639b8ae | |||
| a138b5b365 | |||
|
|
9fde62ae30 | ||
|
|
29fe988583 | ||
|
|
6740d9b363 | ||
|
|
1d1b55b864 | ||
| c32732b22e | |||
| 1e6b6fef0a | |||
|
|
5ab2c1693e | ||
| 0b3cd499a8 | |||
| 884e17f0c4 | |||
|
|
d0ccf236c0 | ||
|
|
396b955db7 | ||
|
|
5f14eb32aa | ||
|
|
cfec7c18ec | ||
|
|
04583acb21 | ||
|
|
95e11d668a | ||
| 772e58c743 | |||
| 470e2633c3 | |||
|
|
3312adddd1 | ||
| 46152d2419 | |||
|
|
b5c82783d6 | ||
| dc85a48864 | |||
| dc8a34592a | |||
| 9d0ae22981 | |||
| ec3cfc1138 | |||
| 8ec0d37cc6 | |||
| c1406efec6 | |||
| 7844216812 | |||
| 96ae1a1cca | |||
| 3793e7b7d4 | |||
| 713e4f6822 | |||
|
|
fada23365e | ||
| 89726ab3ff | |||
| f313f602ba | |||
|
|
6dd0a5b0dd | ||
|
|
c3b197f209 | ||
|
|
9f49ac6457 | ||
|
|
0b3ead6353 | ||
| 8b3625fc01 | |||
|
|
0da508a8b7 | ||
|
|
608eb1a436 | ||
|
|
c0bc6fe25a | ||
|
|
a0d540fd72 | ||
|
|
46a46b65e5 | ||
|
|
4f62b1a05c | ||
| 45dadf8b90 | |||
| e8e84a4e72 | |||
|
|
2f390971e6 | ||
| b7e17d1320 | |||
| c54b1cb6af | |||
| ddb89bce34 | |||
| f056f9d31b | |||
|
|
d9a50ad9f4 | ||
| ce0450d498 | |||
| 7b531059a0 | |||
|
|
bc187bb198 | ||
|
|
eb8c34f53b | ||
| d9a50705e4 | |||
| f4626c2c81 | |||
| e0a48e1e75 | |||
| ec4eb1978e | |||
| 842b376801 | |||
| 13b2cada66 | |||
|
|
3c2f149c22 | ||
| 0a5b5aac4b | |||
| 6e5b058fc1 | |||
| ace2b3a938 | |||
| 5a8213024e | |||
| bd66228b30 | |||
| e1c9754cd2 | |||
| ff101e19cd | |||
| e8ac048114 | |||
| 3c79e8d7b2 | |||
| a74fb2bcd1 | |||
| 63bb79d727 | |||
| 8d87a6ee4e | |||
| ab01940769 | |||
| 23aa9c2814 | |||
| 010f736e80 | |||
| 4dcbcad435 | |||
| 8f8a92b9c5 | |||
| 684eee984d | |||
| 297c3752e3 | |||
| fa504e6675 | |||
| b9b4f1ae35 | |||
| 3c2062f23e | |||
| e7247f1fee | |||
|
|
905a509a17 | ||
| b4dc1dde6c | |||
| 964ab19b42 | |||
| ce8911de10 | |||
| d1e5b0bc42 | |||
| 4b3ed22f76 | |||
| aad1ab0cf4 | |||
| 117637863d | |||
| e933a25453 | |||
| f1f369b48c | |||
| 6b149244d3 | |||
| 436d180e93 | |||
| c43a4030a5 | |||
| 6e826d2840 | |||
| 315d49f8df |
33
.gitea/workflows/rh8-local.yml
Normal file
33
.gitea/workflows/rh8-local.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Build on local RHEL8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- developer
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "detectors-software-RH8"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build library
|
||||
run: |
|
||||
source /home/gitea_runner/.bashrc
|
||||
conda activate det
|
||||
mkdir build && cd build
|
||||
conda activate det
|
||||
cmake .. -DSLS_USE_PYTHON=ON
|
||||
make -j 2
|
||||
cd ../pyctbgui
|
||||
make
|
||||
|
||||
- name: Deploy to NFS update server
|
||||
if: gitea.ref == 'refs/heads/developer'
|
||||
run: |
|
||||
sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin'
|
||||
sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put pyctbgui'
|
||||
@@ -21,9 +21,9 @@ jobs:
|
||||
- name: Build library
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON
|
||||
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON
|
||||
make -j 2
|
||||
|
||||
- name: C++ unit tests
|
||||
working-directory: ${{gitea.workspace}}/build
|
||||
run: ctest
|
||||
run: ctest -j1 --rerun-failed --output-on-failure
|
||||
30
.gitea/workflows/rh9-local.yml
Normal file
30
.gitea/workflows/rh9-local.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Build on local RHEL9
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- developer
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "detectors-software-RH9"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build library
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -DSLS_USE_PYTHON=ON -DPython_EXECUTABLE=/usr/bin/python3.13 -DPython_INCLUDE_DIR=/usr/include/python3.13 -DPython_LIBRARY=/usr/lib64/libpython3.13.so ..
|
||||
make -j 2
|
||||
cd ../pyctbgui
|
||||
make
|
||||
|
||||
- name: Deploy to NFS update server
|
||||
if: gitea.ref == 'refs/heads/developer'
|
||||
run: |
|
||||
sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put build/bin'
|
||||
sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put pyctbgui'
|
||||
@@ -19,9 +19,9 @@ jobs:
|
||||
- name: Build library
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON
|
||||
cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON
|
||||
make -j 2
|
||||
|
||||
- name: C++ unit tests
|
||||
working-directory: ${{gitea.workspace}}/build
|
||||
run: ctest
|
||||
run: ctest -j1 --rerun-failed --output-on-failure
|
||||
2
.github/workflows/build_wheel.yml
vendored
2
.github/workflows/build_wheel.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build wheels
|
||||
run: pipx run cibuildwheel==2.23.0
|
||||
run: pipx run cibuildwheel==3.2.1
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
4
.github/workflows/cmake.yaml
vendored
4
.github/workflows/cmake.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
with:
|
||||
python-version: 3.12
|
||||
cache: 'pip'
|
||||
- run: pip install pytest numpy
|
||||
- run: pip install pytest numpy colorama
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
with:
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
|
||||
- name: C++ unit tests
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: ctest -C ${{env.BUILD_TYPE}} -j1
|
||||
run: ctest -C ${{env.BUILD_TYPE}} -j1 --rerun-failed --output-on-failure
|
||||
|
||||
- name: Python unit tests
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
|
||||
47
.github/workflows/conda_deploy_library.yaml
vendored
Normal file
47
.github/workflows/conda_deploy_library.yaml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Build and deploy slsdetlib
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, ] # macos-12, windows-2019]
|
||||
python-version: ["3.12",]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
# The setup-miniconda action needs this to activate miniconda
|
||||
defaults:
|
||||
run:
|
||||
shell: "bash -l {0}"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get conda
|
||||
uses: conda-incubator/setup-miniconda@v3.0.4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
channels: conda-forge
|
||||
|
||||
- name: Prepare
|
||||
run: conda install conda-build conda-verify pytest anaconda-client
|
||||
|
||||
- name: Enable upload
|
||||
run: conda config --set anaconda_upload yes
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }}
|
||||
run: conda build conda-recipes/main-library --user slsdetectorgroup --token ${CONDA_TOKEN} --output-folder build_output
|
||||
|
||||
- name: Upload all Conda to github as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: conda-packages
|
||||
path: build_output/** # Uploads all packages
|
||||
47
.github/workflows/conda_deploy_slsdet.yaml
vendored
Normal file
47
.github/workflows/conda_deploy_slsdet.yaml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: deploy slsdet
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, ] # macos-12, windows-2019]
|
||||
python-version: ["3.12",]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
# The setup-miniconda action needs this to activate miniconda
|
||||
defaults:
|
||||
run:
|
||||
shell: "bash -l {0}"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get conda
|
||||
uses: conda-incubator/setup-miniconda@v3.0.4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
channels: conda-forge
|
||||
|
||||
- name: Prepare
|
||||
run: conda install conda-build conda-verify pytest anaconda-client
|
||||
|
||||
- name: Enable upload
|
||||
run: conda config --set anaconda_upload yes
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }}
|
||||
run: conda build conda-recipes/python-client --user slsdetectorgroup --token ${CONDA_TOKEN} --output-folder build_output
|
||||
|
||||
- name: Upload all Conda packages
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: conda-packages
|
||||
path: build_output/** # Uploads all packages
|
||||
59
.github/workflows/run_tests.yaml
vendored
Normal file
59
.github/workflows/run_tests.yaml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Run Simulator Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- developer
|
||||
- main
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Debug
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||
runs-on: ubuntu-latest
|
||||
name: Run all Simulator Tests
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12
|
||||
cache: 'pip'
|
||||
- run: pip install pytest numpy colorama
|
||||
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
with:
|
||||
packages: libhdf5-dev
|
||||
version: 1.0
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON -DSLS_USE_PYTHON=On #-DSLS_USE_HDF5=ON #are there hdf5 tests?
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build -j4 --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Python unit tests with simulators
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
run: python -m pytest -m detectorintegration ${{github.workspace}}/python/tests --detector-integration
|
||||
|
||||
- name: Simulator unit tests
|
||||
working-directory: ${{github.workspace}}/build/bin
|
||||
run: |
|
||||
python test_simulators.py -nlf --disable_jungfrau --disable_xilinx_ctb
|
||||
python test_frame_synchronizer.py -nlf
|
||||
|
||||
#- name: Upload detector logs
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: detector-logs
|
||||
# path: |
|
||||
# /tmp/*.txt
|
||||
|
||||
166
CMakeLists.txt
166
CMakeLists.txt
@@ -24,14 +24,22 @@ include(cmake/SlsAddFlag.cmake)
|
||||
include(cmake/helpers.cmake)
|
||||
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# POSIX threads are required for the moment but we use CMake to find them
|
||||
# Once migrated to std::thread this can be removed
|
||||
if(NOT CMAKE_USE_PTHREADS_INIT)
|
||||
message(FATAL_ERROR "A POSIX threads (pthread) implementation is required, but was not found.")
|
||||
endif()
|
||||
|
||||
|
||||
option(SLS_USE_SYSTEM_ZMQ "Use system installed libzmq" OFF)
|
||||
|
||||
# Using FetchContent to get libzmq
|
||||
include(FetchContent)
|
||||
option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF)
|
||||
option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF)
|
||||
|
||||
|
||||
|
||||
# Allow FetchContent_Populate to be called with a single argument
|
||||
# otherwise deprecated warning is issued
|
||||
# Note: From cmake 3.28 we can pass EXCLUDE_FROM_ALL to FetchContent_Declare
|
||||
@@ -50,51 +58,111 @@ if(NOT PATCH_EXECUTABLE)
|
||||
message(FATAL_ERROR "The 'patch' tool is required for patching lib zeromq. Please install it.")
|
||||
endif()
|
||||
|
||||
if(SLS_FETCH_ZMQ_FROM_GITHUB)
|
||||
# Opt in to pull down a zmq version from github instead of
|
||||
# using the bundled version
|
||||
FetchContent_Declare(
|
||||
libzmq
|
||||
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
|
||||
GIT_TAG v${SLS_LIBZMQ_VERSION}
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
|
||||
UPDATE_DISCONNECTED 1
|
||||
)
|
||||
if(SLS_USE_SYSTEM_ZMQ)
|
||||
# find_package(ZeroMQ REQUIRED)
|
||||
# 1) Try a CMake package config if available (vcpkg, Homebrew, source builds)
|
||||
# Many installs export either ZeroMQ::libzmq or libzmq.
|
||||
find_package(ZeroMQ QUIET CONFIG)
|
||||
|
||||
set(ZEROMQ_TARGET "")
|
||||
|
||||
if (TARGET ZeroMQ::libzmq)
|
||||
set(ZEROMQ_TARGET ZeroMQ::libzmq)
|
||||
message(STATUS "Found target: ${ZEROMQ_TARGET} version: ${ZeroMQ_VERSION}")
|
||||
elseif (TARGET libzmq)
|
||||
set(ZEROMQ_TARGET libzmq)
|
||||
message(STATUS "Found target: ${ZEROMQ_TARGET} version: ${ZeroMQ_VERSION}")
|
||||
elseif (TARGET ZeroMQ::ZeroMQ) # rare older naming
|
||||
set(ZEROMQ_TARGET ZeroMQ::ZeroMQ)
|
||||
message(STATUS "Found target: ${ZEROMQ_TARGET} version: ${ZeroMQ_VERSION}")
|
||||
endif()
|
||||
|
||||
# 2) Fallback: use pkg-config hints + manual find_* to create an imported target
|
||||
if (NOT ZEROMQ_TARGET)
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PkgConfig_FOUND)
|
||||
pkg_check_modules(PC_ZeroMQ QUIET libzmq)
|
||||
endif()
|
||||
|
||||
find_path(ZEROMQ_INCLUDE_DIR
|
||||
NAMES zmq.h
|
||||
HINTS ${PC_ZeroMQ_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(ZEROMQ_LIBRARY
|
||||
NAMES zmq libzmq
|
||||
HINTS ${PC_ZeroMQ_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if (ZEROMQ_INCLUDE_DIR AND ZEROMQ_LIBRARY)
|
||||
add_library(libzmq UNKNOWN IMPORTED)
|
||||
set_target_properties(libzmq PROPERTIES
|
||||
IMPORTED_LOCATION "${ZEROMQ_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ZEROMQ_INCLUDE_DIR}"
|
||||
)
|
||||
set(ZEROMQ_TARGET libzmq)
|
||||
endif()
|
||||
message(STATUS "ZeroMQ version (pkg-config): ${PC_ZeroMQ_VERSION}")
|
||||
|
||||
endif()
|
||||
|
||||
# 3) Error out if still not found, with a helpful message
|
||||
if (NOT ZEROMQ_TARGET)
|
||||
message(FATAL_ERROR "ZeroMQ (libzmq) not found. Please install ZeroMQ development files.")
|
||||
endif()
|
||||
|
||||
# Use it
|
||||
# target_link_libraries(your_target PRIVATE ${ZEROMQ_TARGET})
|
||||
|
||||
message(STATUS "Using system installed libzmq: ${ZeroMQ_LIBRARIES}")
|
||||
message(STATUS "ZeroMQ target: ${ZEROMQ_TARGET}")
|
||||
message(STATUS "ZeroMQ include dirs: ${ZeroMQ_INCLUDE_DIRS}")
|
||||
else()
|
||||
# Standard behaviour use libzmq included in this repo (libs/libzmq)
|
||||
FetchContent_Declare(
|
||||
libzmq
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-${SLS_LIBZMQ_VERSION}.tar.gz
|
||||
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
|
||||
UPDATE_DISCONNECTED 1
|
||||
)
|
||||
if(SLS_FETCH_ZMQ_FROM_GITHUB)
|
||||
# Opt in to pull down a zmq version from github instead of
|
||||
# using the bundled version
|
||||
FetchContent_Declare(
|
||||
libzmq
|
||||
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
|
||||
GIT_TAG v${SLS_LIBZMQ_VERSION}
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
|
||||
UPDATE_DISCONNECTED 1
|
||||
)
|
||||
else()
|
||||
# Standard behaviour use libzmq included in this repo (libs/libzmq)
|
||||
FetchContent_Declare(
|
||||
libzmq
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-${SLS_LIBZMQ_VERSION}.tar.gz
|
||||
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
|
||||
UPDATE_DISCONNECTED 1
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# Disable unwanted options from libzmq
|
||||
set(BUILD_TESTS OFF CACHE BOOL "Switch off libzmq test build")
|
||||
set(BUILD_SHARED OFF CACHE BOOL "Switch off libzmq shared libs")
|
||||
set(WITH_PERF_TOOL OFF CACHE BOOL "")
|
||||
set(ENABLE_CPACK OFF CACHE BOOL "")
|
||||
set(ENABLE_CLANG OFF CACHE BOOL "")
|
||||
set(ENABLE_CURVE OFF CACHE BOOL "")
|
||||
set(ENABLE_DRAFTS OFF CACHE BOOL "")
|
||||
set(ENABLE_PRECOMPILED OFF CACHE BOOL "")
|
||||
set(WITH_DOC OFF CACHE BOOL "")
|
||||
set(WITH_DOCS OFF CACHE BOOL "")
|
||||
|
||||
|
||||
# Using GetProperties and Populate to be able to exclude zmq
|
||||
# from install (not possible with FetchContent_MakeAvailable(libzmq))
|
||||
FetchContent_GetProperties(libzmq)
|
||||
if(NOT libzmq_POPULATED)
|
||||
FetchContent_Populate(libzmq)
|
||||
add_subdirectory(${libzmq_SOURCE_DIR} ${libzmq_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# Disable unwanted options from libzmq
|
||||
set(BUILD_TESTS OFF CACHE BOOL "Switch off libzmq test build")
|
||||
set(BUILD_SHARED OFF CACHE BOOL "Switch off libzmq shared libs")
|
||||
set(WITH_PERF_TOOL OFF CACHE BOOL "")
|
||||
set(ENABLE_CPACK OFF CACHE BOOL "")
|
||||
set(ENABLE_CLANG OFF CACHE BOOL "")
|
||||
set(ENABLE_CURVE OFF CACHE BOOL "")
|
||||
set(ENABLE_DRAFTS OFF CACHE BOOL "")
|
||||
set(ENABLE_PRECOMPILED OFF CACHE BOOL "")
|
||||
set(WITH_DOC OFF CACHE BOOL "")
|
||||
set(WITH_DOCS OFF CACHE BOOL "")
|
||||
|
||||
|
||||
|
||||
# Using GetProperties and Populate to be able to exclude zmq
|
||||
# from install (not possible with FetchContent_MakeAvailable(libzmq))
|
||||
FetchContent_GetProperties(libzmq)
|
||||
if(NOT libzmq_POPULATED)
|
||||
FetchContent_Populate(libzmq)
|
||||
add_subdirectory(${libzmq_SOURCE_DIR} ${libzmq_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# If conda build, always set lib dir to 'lib'
|
||||
@@ -122,7 +190,7 @@ endif()
|
||||
|
||||
|
||||
option(SLS_USE_HDF5 "HDF5 File format" OFF)
|
||||
option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" ON)
|
||||
option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" OFF)
|
||||
option(SLS_USE_TEXTCLIENT "Text Client" ON)
|
||||
option(SLS_USE_DETECTOR "Detector libs" ON)
|
||||
option(SLS_USE_RECEIVER "Receiver" ON)
|
||||
@@ -222,6 +290,11 @@ if(NOT TARGET slsProjectOptions)
|
||||
target_compile_features(slsProjectOptions INTERFACE cxx_std_17)
|
||||
endif()
|
||||
|
||||
set(LOG_MAX_REPORTING_LEVEL sls::logINFO CACHE STRING "set logging level")
|
||||
target_compile_definitions(slsProjectOptions
|
||||
INTERFACE LOG_MAX_REPORTING_LEVEL=${LOG_MAX_REPORTING_LEVEL}
|
||||
)
|
||||
|
||||
if (NOT TARGET slsProjectWarnings)
|
||||
add_library(slsProjectWarnings INTERFACE)
|
||||
target_compile_options(slsProjectWarnings INTERFACE
|
||||
@@ -271,6 +344,9 @@ if (NOT TARGET slsProjectCSettings)
|
||||
-Wno-format-truncation
|
||||
)
|
||||
sls_disable_c_warning("-Wstringop-truncation")
|
||||
target_link_libraries(slsProjectCSettings INTERFACE
|
||||
Threads::Threads
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
285
RELEASE.txt
285
RELEASE.txt
@@ -1,262 +1,41 @@
|
||||
SLS Detector Package Major Release 10.0.0 released on 10.09.2025
|
||||
================================================================
|
||||
SLS Detector Package Major Release x.x.x released on xx.xx.202x
|
||||
===============================================================
|
||||
|
||||
This document describes the differences between v10.0.0 and v9.2.0
|
||||
This document describes the differences between vx.x.x and v10.0.0
|
||||
|
||||
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
1 Changes
|
||||
1.1 Compilation Changes
|
||||
1.2 New or Changed Features
|
||||
1.2.1 Breaking API
|
||||
1.2.2 Resolved or Changed Features
|
||||
1.2.3 New Features
|
||||
3 On-board Detector Server Compatibility
|
||||
4 Firmware Requirements
|
||||
5 Kernel Requirements
|
||||
6 Download, Documentation & Support
|
||||
|
||||
|
||||
|
||||
|
||||
1 Changes
|
||||
==========
|
||||
|
||||
|
||||
|
||||
1.1 Compilation Changes
|
||||
========================
|
||||
|
||||
|
||||
* C++ standard
|
||||
Bumped up C++ standard from 11 (gcc4.8+) to 17 (gcc8+).
|
||||
|
||||
|
||||
* GotthardI
|
||||
Dropped support for GotthardI from v10.0.0.
|
||||
|
||||
|
||||
* PATCH
|
||||
Find PATCH command required for compilation. Needed for lib zeromq patching.
|
||||
|
||||
|
||||
* pmodules support discontinued
|
||||
|
||||
|
||||
1.2 New or Changed Features
|
||||
============================
|
||||
|
||||
|
||||
|
||||
1.2.1 Breaking API
|
||||
===================
|
||||
|
||||
|
||||
Client
|
||||
------
|
||||
|
||||
|
||||
* Shared Memory Version
|
||||
Version has changed and will throw when using an earlier version of
|
||||
shared memory without freeing it first.
|
||||
|
||||
|
||||
* [Mythen3] patternX
|
||||
This command has been changed back to 'pattern' as before.
|
||||
|
||||
|
||||
* TCP API Incompatibility
|
||||
The size of the expected structure has changed when setting rx_hostname compared to previous versions. This change makes it incompatible.
|
||||
|
||||
|
||||
* User details
|
||||
One can get user or detector details directly from shared memory without
|
||||
creating the Detector class. It is now a free function.
|
||||
C++ API: getUserDetails
|
||||
python/ command line: user
|
||||
|
||||
|
||||
Receiver
|
||||
--------
|
||||
|
||||
|
||||
* Multiple ROIs
|
||||
Previously, only one ROI was allowed per detector.
|
||||
Now, multiple ROIs are allowed, but restricted to a single ROI per
|
||||
UDP port. More details on its help.
|
||||
|
||||
As before, this ROI is cut out at the receiver level before
|
||||
writing to file. It does not affect network load, but reduces file size.
|
||||
|
||||
Please note that the signature has changed in the Detector API as it now expects a vector. getRxROI returns detector level vector of ROIs for
|
||||
the entire detector or port level vector of ROIs for the module index
|
||||
provided.
|
||||
|
||||
Command line: rx_roi, rx_clearroi
|
||||
C++ API: get/setRxROI, clearRxROI
|
||||
|
||||
|
||||
* Master File Version
|
||||
Binary Master Version: 7.3 => 8.0
|
||||
HDF5 Master Version: 6.7 => 7.0
|
||||
|
||||
|
||||
* Master File Attributes
|
||||
- Fixed master file inconsistencies between binary and hdf5 format.
|
||||
So the parameter names might differ in master file.
|
||||
- Fixed time inconsistencies due to tolerance for gotthardII.
|
||||
- Replaced many of the values that was simply writted usign 'toString'
|
||||
with array-based output.
|
||||
- JSON additional header always written.
|
||||
- HDF5 master file reads 'Version', instead of 'version'.
|
||||
|
||||
|
||||
|
||||
1.2.2 Resolved or Changed Features
|
||||
===================================
|
||||
|
||||
|
||||
Python
|
||||
------
|
||||
|
||||
|
||||
* Shared Memory outliving free
|
||||
Depending on a variable’s scope, it was possible to access an invalid
|
||||
object and its shared memory even after calling free, since resources
|
||||
were not fully released. Shared memory structures now include a flag
|
||||
indicating invalidity and will throw an error if accessed after being
|
||||
freed.
|
||||
|
||||
|
||||
Client
|
||||
------
|
||||
|
||||
|
||||
* UDP Destination List
|
||||
CLI: udp_dstlist
|
||||
C++ API: getDestinationUDPList
|
||||
Was returning incorrect values. Fixed.
|
||||
|
||||
|
||||
Receiver
|
||||
--------
|
||||
|
||||
|
||||
* [Mythen3] Master File Attributes
|
||||
Previously, did not create HDF5 Master file without crashing. Fixed now.
|
||||
|
||||
|
||||
* Default File Path
|
||||
It used to be '/'. Now, changed to empty and will throw if still
|
||||
unchanged before an acquisition.
|
||||
|
||||
|
||||
* Command Line Arguments
|
||||
They have been refactored for slsReceiver, slsMultiReceiver and
|
||||
slsFrameSynchronizer. Existing commands remain fully supported for now.
|
||||
|
||||
Usage: slsReceiver Options:
|
||||
-v, --version : Version.
|
||||
-p, --port : TCP port to communicate with client for configuration. Non-zero and 16 bit.
|
||||
-u, --uid : Set effective user id if receiver started with privileges.
|
||||
|
||||
Usage: slsMultiReceiver Options:
|
||||
-v, --version : Version.
|
||||
-n, --num-receivers : Number of receivers.
|
||||
-p, --port : TCP port to communicate with client for configuration. Non-zero and 16 bit.
|
||||
-c, --callback : Enable dummy callbacks for debugging. Disabled by default.
|
||||
-u, --uid : Set effective user id if receiver started with privileges.
|
||||
|
||||
Usage: slsFrameSynchronizer Options:
|
||||
-v, --version : Version.
|
||||
-n, --num-receivers : Number of receivers.
|
||||
-p, --port : TCP port to communicate with client for configuration. Non-zero and 16 bit.
|
||||
-c, --print-headers : Print callback headers for debugging. Disabled by default.
|
||||
-u, --uid : Set effective user id if receiver started with privileges.
|
||||
|
||||
|
||||
* [Moench] No intertpolation
|
||||
Fixed no interpolation for Moench03.
|
||||
|
||||
|
||||
|
||||
1.2.3 New Features
|
||||
===================
|
||||
|
||||
|
||||
Compilation
|
||||
-----------
|
||||
|
||||
|
||||
* Conda and pypi
|
||||
Automatic release on both upon release.
|
||||
|
||||
|
||||
Python
|
||||
------
|
||||
|
||||
|
||||
* Exposing Free Shared Memory
|
||||
One can do either `slsdet.freeSharedMemory()` or `d.free()`
|
||||
|
||||
|
||||
Client
|
||||
------
|
||||
|
||||
|
||||
* Port size and Port per Module Geometry in Detector class
|
||||
C++ API: getPortSize, getPortPerModuleGeometry
|
||||
|
||||
|
||||
* ROI structure
|
||||
Added 'overlap' function to check if it overlaps with another.
|
||||
|
||||
|
||||
Receiver
|
||||
--------
|
||||
|
||||
|
||||
* HDF5 Virtual File with ROI
|
||||
Previously, virtual file was not created with ROI. It is now.
|
||||
|
||||
|
||||
* Readout speed added to Master File
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
|
||||
* Multi Detector and Multi user
|
||||
Documentation on multi detector index and multi user considerations for
|
||||
using the same client system.
|
||||
https://slsdetectorgroup.github.io/devdoc/multidet.html
|
||||
|
||||
|
||||
* 10GbE PC tuning
|
||||
Further information for permanent ethtool settings updated.
|
||||
https://slsdetectorgroup.github.io/devdoc/troubleshooting.html#receiver-pc-tuning-options
|
||||
|
||||
|
||||
* Image Size and Output Characteristics
|
||||
Information for different detector types and different parameters that
|
||||
affect image size and characteristics have been added.
|
||||
https://slsdetectorgroup.github.io/devdoc/dataformat.html
|
||||
|
||||
|
||||
* 'How To' section added
|
||||
Software Architecture
|
||||
https://slsdetectorgroup.github.io/devdoc/softwarearchitecture.html
|
||||
|
||||
Set up commands most often used in the config file
|
||||
https://slsdetectorgroup.github.io/devdoc/configcommands.html
|
||||
|
||||
Quick start guide has been updated
|
||||
https://slsdetectorgroup.github.io/devdoc/quick_start_guide.html
|
||||
|
||||
|
||||
1 New, Changed or Resolved Features
|
||||
1.1 Compilation
|
||||
1.2 Callback
|
||||
1.3 Python
|
||||
1.4 Client
|
||||
1.5 Detector Server
|
||||
1.6 Simulator
|
||||
1.7 Receiver
|
||||
1.8 Gui
|
||||
2 On-board Detector Server Compatibility
|
||||
3 Firmware Requirements
|
||||
4 Kernel Requirements
|
||||
5 Download, Documentation & Support
|
||||
|
||||
|
||||
|
||||
1 New, Changed or Resolved Features
|
||||
=====================================
|
||||
|
||||
Building shared libraries is disabled by default. If you need to link
|
||||
against any of the libSls*.so libraries, you can enable this by passing
|
||||
-DSLS_BUILD_SHARED_LIBRARIES=ON to CMake.
|
||||
|
||||
Added SLS_USE_SYSTEM_ZMQ option (default OFF) to use the libzmq of the host
|
||||
instead of the one included in our repo.
|
||||
|
||||
Experimental support for building the detector client (including python bindings) on macOS
|
||||
|
||||
``rx_dbitlist`` keeps the order of the passed bit list
|
||||
|
||||
2 On-board Detector Server Compatibility
|
||||
==========================================
|
||||
|
||||
@@ -19,6 +19,7 @@ cmake .. -G Ninja \
|
||||
-DSLS_USE_PYTHON=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSLS_USE_HDF5=OFF \
|
||||
-DSLS_USE_SYSTEM_ZMQ=ON \
|
||||
|
||||
NCORES=$(getconf _NPROCESSORS_ONLN)
|
||||
echo "Building using: ${NCORES} cores"
|
||||
|
||||
@@ -29,6 +29,7 @@ requirements:
|
||||
- libtiff
|
||||
- zlib
|
||||
- expat
|
||||
- zeromq
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
|
||||
@@ -2,6 +2,8 @@ python:
|
||||
- 3.11
|
||||
- 3.12
|
||||
- 3.13
|
||||
- 3.14
|
||||
|
||||
|
||||
c_compiler:
|
||||
- gcc # [linux]
|
||||
@@ -13,4 +15,4 @@ cxx_compiler:
|
||||
- gxx # [linux]
|
||||
|
||||
c_stdlib_version: # [linux]
|
||||
- 2.17 # [linux]
|
||||
- 2.17 # [linux]
|
||||
|
||||
@@ -9,11 +9,11 @@ package:
|
||||
build:
|
||||
number: 0
|
||||
script:
|
||||
- unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv # [not win]
|
||||
- unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv --config-settings=cmake.define.SLS_USE_SYSTEM_ZMQ=ON # [not win]
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- python {{python}}
|
||||
- python
|
||||
- {{ compiler('c') }}
|
||||
- {{ stdlib("c") }}
|
||||
- {{ compiler('cxx') }}
|
||||
@@ -21,7 +21,7 @@ requirements:
|
||||
host:
|
||||
- cmake
|
||||
- ninja
|
||||
- python {{python}}
|
||||
- python
|
||||
- pip
|
||||
- scikit-build-core
|
||||
- pybind11 >=2.13.0
|
||||
@@ -31,7 +31,7 @@ requirements:
|
||||
- catch2
|
||||
|
||||
run:
|
||||
- python {{python}}
|
||||
- python
|
||||
- numpy
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ print(sys.path)
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'slsDetectorPackage'
|
||||
project = 'slsDetectorPackage @PROJECT_VERSION@'
|
||||
copyright = '2020, PSD Detector Group'
|
||||
author = 'PSD Detector Group'
|
||||
version = '@PROJECT_VERSION@'
|
||||
|
||||
108
docs/src/Testing.rst
Normal file
108
docs/src/Testing.rst
Normal file
@@ -0,0 +1,108 @@
|
||||
Testing
|
||||
==========
|
||||
|
||||
We use ``catch2`` and ``pytest`` for unit testing the C++ and Python code.
|
||||
|
||||
CATCH2 Tests
|
||||
----------------
|
||||
|
||||
To build and run the catch2 tests use the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
cd build
|
||||
cmake -DSLS_USE_TESTS=ON ../
|
||||
bin/tests
|
||||
|
||||
Note that this requires that you have catch2 installed on your system.
|
||||
|
||||
Naming Policy:
|
||||
-----------------
|
||||
|
||||
Per default all tests should be visible to catch2.
|
||||
|
||||
If a test fails in the github or gitea actions hide the test by adding the tag ``[.]`` to the test name.
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
TEST_CASE("This test is hidden from default runs", "[.]") {
|
||||
REQUIRE(1 == 2);
|
||||
}
|
||||
|
||||
If a test requires a detector mark them with the hidden tag ``[.detectorintegration]``.
|
||||
|
||||
If you want to disable a specific test for a specific detector add the hidden tag ``[.disable_<detector_name>]`` to the test case.
|
||||
|
||||
If you want to run tests requiring detector simulators run them as follows:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
cd build
|
||||
python bin/test_simulators.py
|
||||
|
||||
This runs all tests marked with the tag ``[.detectorintegration]`` for all detector simulators.
|
||||
If you want to run them for a specific virtual detector or a specific test use the following command:
|
||||
|
||||
.. code-block:: console
|
||||
cd build
|
||||
python bin/test_simulators.py --servers <detector_name> --test <test_name>
|
||||
|
||||
You can run all tests requiring a detector but the disabled one for a specific detector by adding the option ``--disable_<detector_name>``.
|
||||
|
||||
.. code-block:: console
|
||||
cd build
|
||||
python bin/test_simulators.py --servers <detector_name> --test <test_name> --disable_jungfrau
|
||||
|
||||
Note that this still runs all the tests for the virtual jungfrau detector except for the ones marked with the tag ``[.disable_jungfrau]``.
|
||||
|
||||
You can additionally run all the tests not requiring detectors using the script ``bin/test_simulators.py`` by passing the option ``--general_tests``.
|
||||
|
||||
|
||||
Pytest Tests
|
||||
-----------------
|
||||
|
||||
To run the python tests use the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
cd build
|
||||
cmake ../ -DSLS_USE_PYTHON=ON
|
||||
export PYTHONPATH=$PWD/bin
|
||||
python -m pytest ../python/tests/
|
||||
|
||||
If a test requires a detector mark them with the pytest marker ``@pytest.mark.detectorintegration``.
|
||||
|
||||
To run only tests requiring virtual detectors use the following command:
|
||||
|
||||
.. code-block:: console
|
||||
#in build
|
||||
python -m pytest -m detectorintegration ../python/tests/
|
||||
|
||||
There is a helper test fixture in ``slsDetectorSoftware/python/tests/conftest.py`` called ``test_with_simulators`` that sets up virtual detectors and yields the test for all detectors.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import pytest
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
def test_example_with_simulator(test_with_simulators):
|
||||
# your test code here
|
||||
|
||||
If you want to run the test only for a specific test use the parametrized test fixture:
|
||||
|
||||
Example usage:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import pytest
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
@pytest.mark.parametrize("setup_parameters", [(["<my_detector>"], <num_modules>)], indirect=True)
|
||||
def test_example_with_specific_simulators(test_with_simulators, setup_parameters):
|
||||
# your test code here
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to slsDetectorPackage's documentation!
|
||||
slsDetectorPackage
|
||||
==============================================
|
||||
|
||||
.. note ::
|
||||
|
||||
This is the documentation for the latest development version of slsDetectorPackage.
|
||||
For further documentation, visit the official page: https://www.psi.ch/en/detectors/documentation
|
||||
For further detector specific documentation, visit `this page <https://www.psi.ch/en/detectors/documentation>`__.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
@@ -66,6 +66,7 @@ Welcome to slsDetectorPackage's documentation!
|
||||
container_utils
|
||||
type_traits
|
||||
ToString
|
||||
Testing
|
||||
|
||||
.. toctree::
|
||||
:caption: Firmware
|
||||
|
||||
@@ -28,7 +28,7 @@ This instructs the firmware to execute the commands from address 0 to 4 (includi
|
||||
.. code-block::
|
||||
|
||||
start [Ctb, Xilinx_Ctb]
|
||||
patternstart [Mythen3]
|
||||
patternstart [Mythen3, Ctb, Xilinx_Ctb]
|
||||
|
||||
The maximal number of patword addresses is 8192. However, it is possible to extend the length of the pattern sequence using loops and wait commands. Loops can be configured with the following commands:
|
||||
|
||||
@@ -70,11 +70,11 @@ The mappings of bit positions in the pattern word to signals/pads of the FPGA ar
|
||||
|
||||
.. table::
|
||||
|
||||
+----+---+------+----+----------+-------------------+----------------+
|
||||
| 63 | 62| 61-57| 56 | 55-48 | 47-32 | 31-0 |
|
||||
+----+---+------+----+----------+-------------------+----------------+
|
||||
| A | D| --- | T | EXTIO | DO, stream source | DIO |
|
||||
+----+---+------+----+----------+-------------------+----------------+
|
||||
+----+---+------+----+----------+----------+----------------+
|
||||
| 63 | 62| 61-57| 56 | 55-48 | 47-32 | 31-0 |
|
||||
+----+---+------+----+----------+----------+----------------+
|
||||
| A | D| --- | T | EXTIO | DO | DIO |
|
||||
+----+---+------+----+----------+----------+----------------+
|
||||
|
||||
DIO: Driving the 32 FPGA pins corresponding to the lowest 32 bits of the patioctrl command. If bits in patioctrl are 0, the same bit positions in DIO will switch to input pins and connect to dbit sampling. Additionally, some of these 32 bits have an automatic override by detector-specific statemachines which is active whenever one of these statemachines is running (currently bits 7,8,11,14 and 20).
|
||||
|
||||
@@ -119,4 +119,12 @@ DIO: Driving the 32 FPGA pins corresponding to the lowest 32 bits of the patioct
|
||||
| SR_MODE | clk | EN | PULSE | RD | CHSIN | ANAMode | TBLOAD |
|
||||
+---------+-----+-------+-------+----+-------+---------+--------+
|
||||
|
||||
For Mythen3 the pattern word only connects to output pins of the FPGA when the pattern is running. Afterwards the signals will switch back to other logic in the FPGA. Both CTB's hold the last executed pattern word until a new pattern is started.
|
||||
For Mythen3 the pattern word only connects to output pins of the FPGA when the pattern is running. Afterwards the signals will switch back to other logic in the FPGA. Both CTB's hold the last executed pattern word until a new pattern is started.
|
||||
|
||||
**Relation of received data to pattern execution**
|
||||
|
||||
In the default configuration the Ctb will send out udp packets to the sls_receiver for every end of a pattern execution. This behavior can be changed using STREAMING_CTRL_REG, where one can configure a bit position in the 64-bit pattern word to trigger udp packets. This allows to send more than one packet per pattern or also no packets at all.
|
||||
|
||||
The "patternstart" command on the ctb exectues the pattern. As long as streaming_ctrl_reg is disabeld, every pattern execution using this command will not send UDP packets.
|
||||
|
||||
For Mythen3 the sending of udp packets is not connected to pattern execution.
|
||||
@@ -50,6 +50,12 @@ datetime.timedelta, DurationWrapper or by setting the time in seconds.
|
||||
>>> d.getExptime()
|
||||
[sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)]
|
||||
|
||||
# In C++ it is possible to use chrono literals to set time more easily
|
||||
# d.setExptime(7ms). However, this is not possible due to pythons syntax.
|
||||
# instead we can create a unit that we use for conversion.
|
||||
>>> ms = dt.timedelta(milliseconds = 1)
|
||||
>>> d.exptime = 7.5*ms
|
||||
|
||||
|
||||
|
||||
------------------------------------
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
# MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
# MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
||||
|
||||
|
||||
|
||||
# include_directories(
|
||||
# ${PROJECT_SOURCE_DIR}/catch
|
||||
# )
|
||||
|
||||
# target_sources(tests PRIVATE
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-integrationMulti.cpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-integrationDectector.cpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-eigerIntegration.cpp
|
||||
# )
|
||||
|
||||
# if(SLS_USE_TESTS)
|
||||
# set(TEST_SOURCES
|
||||
# src/test-slsDetector.cpp
|
||||
# src/test.cpp
|
||||
# )
|
||||
# add_executable(detector_test ${TEST_SOURCES})
|
||||
|
||||
# target_link_libraries(detector_test
|
||||
# slsDetectorShared
|
||||
# slsProjectOptions
|
||||
# slsProjectWarnings
|
||||
# slsSupportLib
|
||||
# pthread
|
||||
# rt
|
||||
# )
|
||||
# set_target_properties(detector_test PROPERTIES
|
||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
# )
|
||||
|
||||
|
||||
|
||||
# endif()
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "DetectorImpl.h"
|
||||
#include "catch.hpp"
|
||||
#include "sls/string_utils.h"
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class MultiDetectorFixture {
|
||||
protected:
|
||||
DetectorImpl d;
|
||||
|
||||
public:
|
||||
MultiDetectorFixture() : d(0, true, true) {
|
||||
d.setHostname(test::hostname.c_str());
|
||||
if (test::my_ip != "undefined")
|
||||
d.setReceiverHostname(test::my_ip);
|
||||
}
|
||||
~MultiDetectorFixture() { d.freeSharedMemory(); }
|
||||
};
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set and get dacs",
|
||||
"[.eigerintegration][cli]") {
|
||||
auto th = 1000;
|
||||
|
||||
// set and read back each individual dac of EIGER
|
||||
d.setDAC(0, di::SVP, 0);
|
||||
CHECK(d.setDAC(-1, di::SVP, 0) == 0);
|
||||
d.setDAC(4000, di::SVN, 0);
|
||||
CHECK(d.setDAC(-1, di::SVN, 0) == 4000);
|
||||
d.setDAC(2000, di::VTR, 0);
|
||||
CHECK(d.setDAC(-1, di::VTR, 0) == 2000);
|
||||
d.setDAC(3500, di::VRF, 0);
|
||||
CHECK(d.setDAC(-1, di::VRF, 0) == 3500);
|
||||
d.setDAC(1400, di::VRS, 0);
|
||||
CHECK(d.setDAC(-1, di::VRS, 0) == 1400);
|
||||
d.setDAC(2556, di::VTGSTV, 0);
|
||||
CHECK(d.setDAC(-1, di::VTGSTV, 0) == 2556);
|
||||
d.setDAC(1500, di::VCMP_LL, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == 1500);
|
||||
d.setDAC(1400, di::VCMP_LR, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LR, 0) == 1400);
|
||||
d.setDAC(4000, di::CAL, 0);
|
||||
CHECK(d.setDAC(-1, di::CAL, 0) == 4000);
|
||||
d.setDAC(1300, di::VCMP_RL, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RL, 0) == 1300);
|
||||
d.setDAC(1200, di::VCMP_RR, 0);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RR, 0) == 1200);
|
||||
d.setDAC(1100, di::RXB_RB, 0);
|
||||
CHECK(d.setDAC(-1, di::RXB_RB, 0) == 1100);
|
||||
d.setDAC(1100, di::RXB_LB, 0);
|
||||
CHECK(d.setDAC(-1, di::RXB_LB, 0) == 1100);
|
||||
d.setDAC(1500, di::VCP, 0);
|
||||
CHECK(d.setDAC(-1, di::VCP, 0) == 1500);
|
||||
d.setDAC(2000, di::VCN, 0);
|
||||
CHECK(d.setDAC(-1, di::VCN, 0) == 2000);
|
||||
d.setDAC(1550, di::VIS, 0);
|
||||
CHECK(d.setDAC(-1, di::VIS, 0) == 1550);
|
||||
d.setDAC(660, di::IO_DELAY, 0);
|
||||
CHECK(d.setDAC(-1, di::IO_DELAY, 0) == 660);
|
||||
|
||||
// setting threshold sets all individual vcmp
|
||||
d.setDAC(th, di::THRESHOLD, 0);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LR, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RL, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::VCMP_RR, 0) == th);
|
||||
|
||||
// different values gives -1
|
||||
if (d.getNumberOfDetectors() > 1) {
|
||||
d.setDAC(1600, di::VCMP_LL, 0, 0);
|
||||
d.setDAC(1700, di::VCMP_LL, 0, 1);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0, 0) == 1600);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0, 1) == 1700);
|
||||
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 1) == -1);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Read temperatures",
|
||||
"[.eigerintegration][cli]") {
|
||||
std::vector<di> tempindex{di::TEMPERATURE_FPGA, di::TEMPERATURE_FPGA2,
|
||||
di::TEMPERATURE_FPGA3};
|
||||
for (auto index : tempindex) {
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
double temp = static_cast<double>(d.getADC(index, 0)) / 1000;
|
||||
CHECK(temp > 20);
|
||||
CHECK(temp < 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int to_time(uint32_t reg) {
|
||||
uint32_t clocks = reg >> 3;
|
||||
uint32_t exponent = (reg & 0b111) + 1;
|
||||
return clocks * pow(10, exponent);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Read/write register",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setNumberOfFrames(1);
|
||||
d.setExposureTime(10000);
|
||||
d.acquire();
|
||||
CHECK(to_time(d.readRegister(0x4, 0)) == 10000);
|
||||
|
||||
d.writeRegister(0x4, 500);
|
||||
CHECK(d.readRegister(0x4) == 500);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set dynamic range",
|
||||
"[.eigerintegration][cli][dr]") {
|
||||
std::vector<int> dynamic_range{4, 8, 16, 32};
|
||||
for (auto dr : dynamic_range) {
|
||||
d.setDynamicRange(dr);
|
||||
CHECK(d.setDynamicRange() == dr);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set clock divider",
|
||||
"[.eigerintegration][cli][this]") {
|
||||
for (int i = 0; i != 3; ++i) {
|
||||
d.setSpeed(sv::CLOCK_DIVIDER, i);
|
||||
CHECK(d.setSpeed(sv::CLOCK_DIVIDER) == i);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Get time left",
|
||||
"[.eigerintegration][cli]") {
|
||||
CHECK_THROWS(d.getTimeLeft(ti::PROGRESS));
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
|
||||
std::string hn = test::hostname;
|
||||
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
|
||||
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
|
||||
auto hostnames = split(hn, '+');
|
||||
CHECK(hostnames.size() == d.getNumberOfDetectors());
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getId(defs::DETECTOR_SERIAL_NUMBER, 0) ==
|
||||
std::stoi(hostnames[0]));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Lock server",
|
||||
"[.eigerintegration][cli]") {
|
||||
|
||||
d.lockServer(1);
|
||||
CHECK(d.lockServer() == 1);
|
||||
d.lockServer(0);
|
||||
CHECK(d.lockServer() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Settings", "[.eigerintegration][cli]") {
|
||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set readout flags",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setReadOutFlags(defs::PARALLEL);
|
||||
CHECK((d.setReadOutFlags() & defs::PARALLEL));
|
||||
|
||||
d.setReadOutFlags(defs::NONPARALLEL);
|
||||
CHECK_FALSE((d.setReadOutFlags() & defs::PARALLEL));
|
||||
CHECK((d.setReadOutFlags() & defs::NONPARALLEL));
|
||||
}
|
||||
|
||||
// TEST_CASE_METHOD(MultiDetectorFixture, "Flow control and tengiga",
|
||||
// "[.eigerintegration][cli]") {
|
||||
// d.setFlowControl10G(1);
|
||||
// CHECK(d.setFlowControl10G() == 1);
|
||||
// d.setFlowControl10G(0);
|
||||
// CHECK(d.setFlowControl10G() == 0);
|
||||
|
||||
// d.enableTenGigabitEthernet(1);
|
||||
// CHECK(d.enableTenGigabitEthernet() == 1);
|
||||
// d.enableTenGigabitEthernet(0);
|
||||
// CHECK(d.enableTenGigabitEthernet() == 0);
|
||||
// }
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "activate", "[.eigerintegration][cli]") {
|
||||
d.activate(0);
|
||||
CHECK(d.activate() == 0);
|
||||
d.activate(1);
|
||||
CHECK(d.activate() == 1);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "all trimbits",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setAllTrimbits(32);
|
||||
CHECK(d.setAllTrimbits(-1) == 32);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "rate correction",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setRateCorrection(200);
|
||||
CHECK(d.getRateCorrection() == 200);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
@@ -1,522 +0,0 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "DetectorImpl.h"
|
||||
#include "Module.h"
|
||||
#include "sls/ClientSocket.h"
|
||||
#include "sls/logger.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
#include "sls/Timer.h"
|
||||
#include "sls/sls_detector_funcs.h"
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#define VERBOSE
|
||||
|
||||
// Header holding all configurations for different detectors
|
||||
#include "tests/config.h"
|
||||
#include "tests/globals.h"
|
||||
// using namespace test;
|
||||
// using dt = slsDetectorDefs::detectorType;
|
||||
// extern std::string hostname;
|
||||
// extern std::string detector_type;
|
||||
// extern dt type;
|
||||
|
||||
namespace sls {
|
||||
|
||||
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
||||
auto t = Module::getTypeFromDetector(test::hostname);
|
||||
CHECK(t == test::type);
|
||||
|
||||
Module d(t);
|
||||
CHECK(d.getDetectorTypeAsEnum() == t);
|
||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getHostname() == test::hostname);
|
||||
|
||||
CHECK(d.setDetectorType() == test::type);
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Set control port then create a new object with this control port",
|
||||
"[.integration][.single]") {
|
||||
/*
|
||||
TODO!
|
||||
Standard port but should not be hardcoded
|
||||
Is this the best way to initialize the detectors
|
||||
Using braces to make the object go out of scope
|
||||
*/
|
||||
int old_cport = DEFAULT_TCP_CNTRL_PORTNO;
|
||||
int old_sport = DEFAULT_TCP_STOP_PORTNO;
|
||||
int new_cport = 1993;
|
||||
int new_sport = 2000;
|
||||
{
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getControlPort() == old_cport);
|
||||
d.setControlPort(new_cport);
|
||||
CHECK(d.getStopPort() == old_sport);
|
||||
d.setStopPort(new_sport);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
{
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
d.setControlPort(new_cport);
|
||||
d.setStopPort(new_sport);
|
||||
CHECK(d.getControlPort() == new_cport);
|
||||
CHECK(d.getStopPort() == new_sport);
|
||||
|
||||
// Reset standard ports
|
||||
d.setControlPort(old_cport);
|
||||
d.setStopPort(old_sport);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getStopPort() == DEFAULT_TCP_STOP_PORTNO);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||
"[.integration][eiger]") {
|
||||
// TODO! this test should take command line arguments for config
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// Read type by connecting to the detector
|
||||
auto type = Module::getTypeFromDetector(c.hostname);
|
||||
CHECK(type == c.type_enum);
|
||||
|
||||
// Create Module of said type and set hostname and detector online
|
||||
Module d(type);
|
||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
||||
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
||||
|
||||
d.setHostname(c.hostname);
|
||||
CHECK(d.getHostname() == c.hostname);
|
||||
|
||||
CHECK(d.getUseReceiverFlag() == false);
|
||||
CHECK_NOTHROW(d.checkDetectorVersionCompatibility());
|
||||
|
||||
// Setting and reading exposure time
|
||||
auto t = 1000000000;
|
||||
d.setExptime(t);
|
||||
CHECK(d.getExptime() == t);
|
||||
|
||||
// size of an eiger half module with and without gap pixels
|
||||
CHECK(d.getTotalNumberOfChannels() == 256 * 256 * 4);
|
||||
CHECK(d.getTotalNumberOfChannels(slsDetectorDefs::dimension::X) == 1024);
|
||||
CHECK(d.getTotalNumberOfChannels(slsDetectorDefs::dimension::Y) == 256);
|
||||
// CHECK(d.getTotalNumberOfChannels(slsDetectorDefs::dimension::Z) == 1);
|
||||
CHECK(d.getTotalNumberOfChannelsInclGapPixels(
|
||||
slsDetectorDefs::dimension::X) == 1024);
|
||||
CHECK(d.getTotalNumberOfChannelsInclGapPixels(
|
||||
slsDetectorDefs::dimension::Y) == 256);
|
||||
// CHECK(d.getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::dimension::Z)
|
||||
// == 1);
|
||||
|
||||
CHECK(d.getNChans() == 256 * 256);
|
||||
CHECK(d.getNChans(slsDetectorDefs::dimension::X) == 256);
|
||||
CHECK(d.getNChans(slsDetectorDefs::dimension::Y) == 256);
|
||||
// CHECK(d.getNChans(slsDetectorDefs::dimension::Z) == 1);
|
||||
|
||||
CHECK(d.getNChips() == 4);
|
||||
CHECK(d.getNChips(slsDetectorDefs::dimension::X) == 4);
|
||||
CHECK(d.getNChips(slsDetectorDefs::dimension::Y) == 1);
|
||||
// CHECK(d.getNChips(slsDetectorDefs::dimension::Z) == 1);
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
|
||||
// Check that detector server is unlocked then lock
|
||||
CHECK(d.lockServer() == 0);
|
||||
d.lockServer(1);
|
||||
CHECK(d.lockServer() == 1);
|
||||
|
||||
// Can we still access the detector while it's locked
|
||||
auto t = 1300000000;
|
||||
d.setExptime(t);
|
||||
CHECK(d.getExptime() == t);
|
||||
|
||||
// unlock again and free
|
||||
d.lockServer(0);
|
||||
CHECK(d.lockServer() == 0);
|
||||
|
||||
CHECK(d.getLastClientIP() == test::my_ip);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Set settings", "[.integration][.single]") {
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||
}
|
||||
|
||||
TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||
// FRAME_NUMBER, /**< number of real time frames: total number of
|
||||
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
||||
// /**< exposure time */ FRAME_PERIOD, /**< period between exposures */
|
||||
// DELAY_AFTER_TRIGGER, /**< delay between trigger and start of exposure or
|
||||
// readout (in triggered mode) */ GATES_NUMBER, /**< number of gates per
|
||||
// frame (in gated mode) */ TRIGGER_NUMBER, /**< number of triggers: total
|
||||
// number of acquisitions is number or frames*number of triggers */
|
||||
// ACTUAL_TIME, /**< Actual time of the detector's internal timer */
|
||||
// MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo)
|
||||
// */
|
||||
|
||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||
// MEASUREMENTS_NUMBER,
|
||||
// FRAMES_FROM_START,
|
||||
// FRAMES_FROM_START_PG,
|
||||
// SAMPLES,
|
||||
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||
// STORAGE_CELL_NUMBER, /**<number of storage cells */
|
||||
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||
// MEASURED_PERIOD, /**< measured period */
|
||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||
// MAX_TIMERS
|
||||
|
||||
Module d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
|
||||
// Number of frames
|
||||
auto frames = 5;
|
||||
d.setNumberOfFrames(frames);
|
||||
CHECK(d.getNumberOfFrames() == frames);
|
||||
|
||||
auto exptime = 2000000000;
|
||||
d.setExptime(exptime);
|
||||
CHECK(d.getExptime() == exptime);
|
||||
|
||||
auto period = 2000000000;
|
||||
d.setPeriod(period);
|
||||
CHECK(d.getPeriod() == period);
|
||||
|
||||
if (test::type != dt::EIGER) {
|
||||
auto delay = 10000;
|
||||
d.setDelayAfterTrigger(delay);
|
||||
CHECK(d.getDelayAfterTrigger() == delay);
|
||||
}
|
||||
|
||||
auto triggers = 2;
|
||||
d.setNumberOfTriggers(triggers);
|
||||
CHECK(d.getNumberOfTriggers() == triggers);
|
||||
|
||||
if (test::type == dt::EIGER) {
|
||||
auto subtime = 200;
|
||||
d.setSubExptime(subtime);
|
||||
CHECK(d.getSubExptime() == subtime);
|
||||
}
|
||||
// for (int i =0; i!=frames; ++i)
|
||||
d.startAndReadAll();
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||
// SingleDetectorConfig c;
|
||||
// auto type = Module::getTypeFromDetector(c.hostname);
|
||||
// Module d(type);
|
||||
// d.setHostname(c.hostname);
|
||||
|
||||
// auto period = 1000000000;
|
||||
// auto exptime = 100000000;
|
||||
// d.setNumberOfFrames(5);
|
||||
// d.setExptime(exptime);
|
||||
// d.setPeriod(period);
|
||||
// d.startAndReadAll();
|
||||
|
||||
// auto rperiod =
|
||||
// d.getMeasuredPeriod();
|
||||
// CHECK(rperiod == 0.1);
|
||||
|
||||
// d.freeSharedMemory();
|
||||
// }
|
||||
|
||||
TEST_CASE(
|
||||
"Eiger Dynamic Range with effect on rate correction and clock divider",
|
||||
"[.eigerintegration]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
int ratecorr = 125;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure eiger detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
// starting state with rate correction off
|
||||
m.setRateCorrection(0);
|
||||
|
||||
// dr 16: clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(16) == 16);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 1);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
|
||||
// dr 32: clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(32) == 32);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 2);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
|
||||
// other drs: no change for clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(8) == 8);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 2);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
CHECK(m.setDynamicRange(4) == 4);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 2);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
|
||||
// switching on rate correction with dr 16, 32
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
CHECK(m.getRateCorrection() == ratecorr);
|
||||
m.setDynamicRange(32);
|
||||
CHECK(m.getRateCorrection() == ratecorr);
|
||||
|
||||
// ratecorr fail with dr 4 or 8
|
||||
CHECK_THROWS_AS(m.setDynamicRange(8), RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
m.setDynamicRange(16);
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(4), RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
uint64_t word = 0;
|
||||
int addr = 0;
|
||||
int level = 0;
|
||||
const int MAX_ADDR = 0x7fff;
|
||||
|
||||
word = 0xc000000000f47ff;
|
||||
CHECK(m.setPatternIOControl(word) == word);
|
||||
CHECK(m.setPatternIOControl(-1) == word);
|
||||
CHECK(m.setPatternIOControl(0) == 0);
|
||||
|
||||
CHECK(m.setPatternClockControl(word) == word);
|
||||
CHECK(m.setPatternClockControl(-1) == word);
|
||||
CHECK(m.setPatternClockControl(0) == 0);
|
||||
|
||||
// testing pattern word will execute the pattern as well
|
||||
addr = 0;
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = MAX_ADDR - 1;
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = 0x2FF;
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = MAX_ADDR;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
addr = -1;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
addr = 0x2FF;
|
||||
for (level = 0; level < 3; ++level) {
|
||||
CHECK(m.setPatternWaitAddr(level, addr) == addr);
|
||||
CHECK(m.setPatternWaitAddr(level, -1) == addr);
|
||||
}
|
||||
CHECK_THROWS_WITH(m.setPatternWaitAddr(-1, addr),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
CHECK_THROWS_WITH(m.setPatternWaitAddr(0, MAX_ADDR),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
for (level = 0; level < 3; ++level) {
|
||||
CHECK(m.setPatternWaitTime(level, word) == word);
|
||||
CHECK(m.setPatternWaitTime(level, -1) == word);
|
||||
}
|
||||
CHECK_THROWS_WITH(m.setPatternWaitTime(-1, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
{
|
||||
int startaddr = addr;
|
||||
int stopaddr = addr + 5;
|
||||
int nloops = 2;
|
||||
for (level = 0; level < 3; ++level) {
|
||||
m.setPatternLoops(level, startaddr, stopaddr, nloops);
|
||||
auto r = m.getPatternLoops(level);
|
||||
CHECK(r[0] == startaddr);
|
||||
CHECK(r[1] == stopaddr);
|
||||
CHECK(r[2] == nloops);
|
||||
}
|
||||
m.setPatternLoops(-1, startaddr, stopaddr, nloops);
|
||||
auto r = m.getPatternLoops(-1);
|
||||
CHECK(r[0] == startaddr);
|
||||
CHECK(r[1] == stopaddr);
|
||||
CHECK(r[2] == -1);
|
||||
|
||||
CHECK_THROWS_WITH(m.setPatternLoops(-1, startaddr, MAX_ADDR, nloops),
|
||||
Catch::Matchers::Contains("be less than"));
|
||||
CHECK_THROWS_WITH(m.setPatternLoops(-1, MAX_ADDR, stopaddr, nloops),
|
||||
Catch::Matchers::Contains("be less than"));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
||||
"[.ctbintegration][dbit]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
// dbit offset
|
||||
m.setReceiverDbitOffset(0);
|
||||
CHECK(m.getReceiverDbitOffset() == 0);
|
||||
m.setReceiverDbitOffset(-1);
|
||||
CHECK(m.getReceiverDbitOffset() == 0);
|
||||
m.setReceiverDbitOffset(5);
|
||||
CHECK(m.getReceiverDbitOffset() == 5);
|
||||
|
||||
// dbit list
|
||||
|
||||
std::vector<int> list = m.getReceiverDbitList();
|
||||
list.clear();
|
||||
for (int i = 0; i < 10; ++i)
|
||||
list.push_back(i);
|
||||
m.setReceiverDbitList(list);
|
||||
|
||||
CHECK(m.getReceiverDbitList().size() == 10);
|
||||
|
||||
list.push_back(64);
|
||||
CHECK_THROWS_AS(m.setReceiverDbitList(list), RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||
Catch::Matchers::Contains("be between 0 and 63"));
|
||||
|
||||
list.clear();
|
||||
for (int i = 0; i < 65; ++i)
|
||||
list.push_back(i);
|
||||
CHECK(list.size() == 65);
|
||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||
Catch::Matchers::Contains("be greater than 64"));
|
||||
|
||||
list.clear();
|
||||
m.setReceiverDbitList(list);
|
||||
CHECK(m.getReceiverDbitList().empty());
|
||||
|
||||
// adcinvert
|
||||
m.setADCInvert(0);
|
||||
CHECK(m.getADCInvert() == 0);
|
||||
m.setADCInvert(5);
|
||||
CHECK(m.getADCInvert() == 5);
|
||||
m.setADCInvert(-1);
|
||||
CHECK(m.getADCInvert() == -1);
|
||||
|
||||
// ext sampling reg
|
||||
m.setExternalSamplingSource(0);
|
||||
CHECK(m.getExternalSamplingSource() == 0);
|
||||
m.setExternalSamplingSource(62);
|
||||
CHECK(m.getExternalSamplingSource() == 62);
|
||||
CHECK_THROWS_WITH(m.setExternalSamplingSource(64),
|
||||
Catch::Matchers::Contains("be 0-63"));
|
||||
CHECK(m.getExternalSamplingSource() == 62);
|
||||
m.setExternalSampling(1);
|
||||
CHECK(m.getExternalSampling() == 1);
|
||||
m.setExternalSampling(0);
|
||||
CHECK(m.getExternalSampling() == 0);
|
||||
m.setExternalSampling(1);
|
||||
CHECK(m.getExternalSampling() == 1);
|
||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger or Jungfrau nextframenumber",
|
||||
"[.eigerintegration][.jungfrauintegration][nextframenumber]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(
|
||||
((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) ||
|
||||
(m.getDetectorTypeAsEnum() ==
|
||||
slsDetectorDefs::detectorType::JUNGFRAU)));
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
CHECK(m.setNumberOfFrames(1) == 1);
|
||||
|
||||
// starting fnum
|
||||
uint64_t val = 8;
|
||||
|
||||
m.setNextFrameNumber(val);
|
||||
CHECK(m.getNextFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
++val;
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
CHECK_THROWS_AS(m.setNextFrameNumber(0), RuntimeError);
|
||||
|
||||
if (m.getDetectorTypeAsString() == "Eiger") {
|
||||
val = 281474976710655;
|
||||
} else if (m.getDetectorTypeAsString() == "Jungfrau") {
|
||||
val = 18446744073709551615;
|
||||
}
|
||||
m.setNextFrameNumber(val);
|
||||
CHECK(m.getNextFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
CHECK(m.getNextFrameNumber() == (val + 1));
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger partialread", "[.eigerintegration][partialread]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
DetectorImpl m(0);
|
||||
|
||||
// ensure detector type, hostname
|
||||
REQUIRE(
|
||||
(m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
m.setDynamicRange(16);
|
||||
m.enableTenGigabitEthernet(0);
|
||||
m.setPartialReadout(256);
|
||||
CHECK(m.getPartialReadout() == 256);
|
||||
m.setPartialReadout(1);
|
||||
CHECK(m.getPartialReadout() == 1);
|
||||
|
||||
m.setDynamicRange(8);
|
||||
m.setPartialReadout(256);
|
||||
CHECK(m.getPartialReadout() == 256);
|
||||
CHECK_THROWS_AS(m.setPartialReadout(1), RuntimeError);
|
||||
CHECK(m.getPartialReadout() == 256);
|
||||
CHECK_THROWS_AS(m.setPartialReadout(0), RuntimeError);
|
||||
m.setPartialReadout(256);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
@@ -1,108 +0,0 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "DetectorImpl.h"
|
||||
#include "catch.hpp"
|
||||
#include "sls/string_utils.h"
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
using namespace Catch::literals;
|
||||
|
||||
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||
auto hostnames = split(test::hostname, '+');
|
||||
|
||||
DetectorImpl d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
|
||||
CHECK(d.getHostname() == test::hostname);
|
||||
for (size_t i = 0; i != hostnames.size(); ++i) {
|
||||
CHECK(d.getHostname(i) == hostnames[i]);
|
||||
}
|
||||
|
||||
CHECK(d.getDetectorTypeAsEnum() == test::type);
|
||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||
|
||||
CHECK(d.getNumberOfDetectors() == hostnames.size());
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
DetectorImpl d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
|
||||
// FRAME_NUMBER
|
||||
int n_frames = 3;
|
||||
d.setNumberOfFrames(n_frames);
|
||||
CHECK(d.setNumberOfFrames() == n_frames);
|
||||
|
||||
// ACQUISITION_TIME
|
||||
double exptime = 0.3;
|
||||
d.setExposureTime(exptime, true);
|
||||
CHECK(d.setExposureTime(-1, true) == Approx(exptime));
|
||||
CHECK(d.setExposureTime(-1) == Approx(exptime * 1E9));
|
||||
|
||||
// FRAME_PERIOD,
|
||||
double period = 0.5;
|
||||
d.setExposurePeriod(period, true);
|
||||
CHECK(d.setExposurePeriod(-1, true) == Approx(period));
|
||||
CHECK(d.setExposurePeriod(-1) == Approx(period * 1E9));
|
||||
|
||||
// DELAY_AFTER_TRIGGER,
|
||||
// GATES_NUMBER,
|
||||
// TRIGGER_NUMBER,
|
||||
// ACTUAL_TIME
|
||||
// MEASUREMENT_TIME
|
||||
|
||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||
// MEASUREMENTS_NUMBER,
|
||||
|
||||
// FRAMES_FROM_START,
|
||||
// FRAMES_FROM_START_PG,
|
||||
// SAMPLES,
|
||||
|
||||
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||
double subframe_exposure = 2000000; // ns
|
||||
if (test::type == dt::EIGER) {
|
||||
d.setSubFrameExposureTime(subframe_exposure);
|
||||
CHECK(d.setSubFrameExposureTime(-1) == Approx(subframe_exposure));
|
||||
}
|
||||
|
||||
// STORAGE_CELL_NUMBER, /**<number of storage cells */
|
||||
|
||||
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||
double subframe_deadtime = 4000; // ns
|
||||
if (test::type == dt::EIGER) {
|
||||
d.setSubFrameExposureDeadTime(subframe_deadtime);
|
||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||
}
|
||||
|
||||
if (test::type == dt::EIGER) {
|
||||
// 32bit is needed for subframe exposure
|
||||
d.setDynamicRange(32);
|
||||
CHECK(d.setDynamicRange(-1) == 32);
|
||||
d.setReadOutFlags(ro::PARALLEL);
|
||||
|
||||
// Needed to have measured values
|
||||
d.acquire();
|
||||
|
||||
// MEASURED_PERIOD, /**< measured period */
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getMeasuredPeriod(true, i) == Approx(period));
|
||||
}
|
||||
|
||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getMeasuredSubFramePeriod(false, i) ==
|
||||
Approx(subframe_deadtime + subframe_exposure));
|
||||
}
|
||||
}
|
||||
|
||||
// MAX_TIMERS
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
@@ -1,5 +0,0 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
// tests-main.cpp
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
||||
@@ -154,6 +154,8 @@ class AdcTab(QtWidgets.QWidget):
|
||||
self.mainWindow.analogPlots[i].setData(waveform)
|
||||
plotName = getattr(self.view, f"labelADC{i}").text()
|
||||
waveforms[plotName] = waveform
|
||||
elif checkBoxEn.isChecked():
|
||||
idx += 1
|
||||
return waveforms
|
||||
|
||||
@recordOrApplyPedestal
|
||||
|
||||
@@ -50,20 +50,20 @@ class AcquisitionTab(QtWidgets.QWidget):
|
||||
self.plotTab = self.mainWindow.plotTab
|
||||
self.toggleStartButton(False)
|
||||
if self.det.type == detectorType.XILINX_CHIPTESTBOARD:
|
||||
self.view.labelRunF.setDisabled(True)
|
||||
self.view.labelADCF.setDisabled(True)
|
||||
self.view.labelADCPhase.setDisabled(True)
|
||||
self.view.labelADCPipeline.setDisabled(True)
|
||||
self.view.labelDBITF.setDisabled(True)
|
||||
self.view.labelDBITPhase.setDisabled(True)
|
||||
self.view.labelDBITPipeline.setDisabled(True)
|
||||
self.view.spinBoxRunF.setDisabled(True)
|
||||
self.view.spinBoxADCF.setDisabled(True)
|
||||
self.view.spinBoxADCPhase.setDisabled(True)
|
||||
self.view.spinBoxADCPipeline.setDisabled(True)
|
||||
self.view.spinBoxDBITF.setDisabled(True)
|
||||
self.view.spinBoxDBITPhase.setDisabled(True)
|
||||
self.view.spinBoxDBITPipeline.setDisabled(True)
|
||||
self.view.labelRunF.setText("Run Clock Frequency (kHz):")
|
||||
self.view.labelDBITF.setText("DBIT Clock Frequency (kHz):")
|
||||
self.view.labelADCF.setText("ADC Clock Frequency (kHz):")
|
||||
self.view.spinBoxRunF.setMaximum(250000)
|
||||
self.view.spinBoxDBITF.setMaximum(250000)
|
||||
self.view.spinBoxADCF.setMaximum(250000)
|
||||
|
||||
def connect_ui(self):
|
||||
# For Acquistions Tab
|
||||
@@ -72,12 +72,13 @@ class AcquisitionTab(QtWidgets.QWidget):
|
||||
self.view.spinBoxAnalog.editingFinished.connect(self.setAnalog)
|
||||
self.view.spinBoxDigital.editingFinished.connect(self.setDigital)
|
||||
|
||||
if self.det.type == detectorType.CHIPTESTBOARD:
|
||||
if self.det.type in [detectorType.CHIPTESTBOARD, detectorType.XILINX_CHIPTESTBOARD]:
|
||||
self.view.spinBoxRunF.editingFinished.connect(self.setRunFrequency)
|
||||
self.view.spinBoxADCF.editingFinished.connect(self.setADCFrequency)
|
||||
self.view.spinBoxDBITF.editingFinished.connect(self.setDBITFrequency)
|
||||
if self.det.type == detectorType.CHIPTESTBOARD:
|
||||
self.view.spinBoxADCPhase.editingFinished.connect(self.setADCPhase)
|
||||
self.view.spinBoxADCPipeline.editingFinished.connect(self.setADCPipeline)
|
||||
self.view.spinBoxDBITF.editingFinished.connect(self.setDBITFrequency)
|
||||
self.view.spinBoxDBITPhase.editingFinished.connect(self.setDBITPhase)
|
||||
self.view.spinBoxDBITPipeline.editingFinished.connect(self.setDBITPipeline)
|
||||
|
||||
@@ -98,12 +99,13 @@ class AcquisitionTab(QtWidgets.QWidget):
|
||||
self.getAnalog()
|
||||
self.getDigital()
|
||||
|
||||
if self.det.type == detectorType.CHIPTESTBOARD:
|
||||
if self.det.type in [detectorType.CHIPTESTBOARD, detectorType.XILINX_CHIPTESTBOARD]:
|
||||
self.getRunFrequency()
|
||||
self.getADCFrequency()
|
||||
self.getDBITFrequency()
|
||||
if self.det.type == detectorType.CHIPTESTBOARD:
|
||||
self.getADCPhase()
|
||||
self.getADCPipeline()
|
||||
self.getDBITFrequency()
|
||||
self.getDBITPhase()
|
||||
self.getDBITPipeline()
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ dependencies = [
|
||||
|
||||
[tool.cibuildwheel]
|
||||
before-all = "uname -a"
|
||||
build = "cp{311,312,313}-manylinux_x86_64"
|
||||
build = "cp{311,312,313,314}-manylinux_x86_64"
|
||||
|
||||
[tool.scikit-build.build]
|
||||
verbose = true
|
||||
|
||||
@@ -24,6 +24,7 @@ import datetime as dt
|
||||
|
||||
from functools import wraps
|
||||
from collections import namedtuple
|
||||
from collections.abc import Sequence
|
||||
import socket
|
||||
import numpy as np
|
||||
|
||||
@@ -301,6 +302,46 @@ class Detector(CppDetectorApi):
|
||||
def rx_arping(self, value):
|
||||
ut.set_using_dict(self.setRxArping, value)
|
||||
|
||||
@property
|
||||
def rx_roi(self):
|
||||
"""Gets the list of ROIs configured in the receiver.
|
||||
|
||||
Note
|
||||
-----
|
||||
Each ROI is represented as a tuple of (x_start, y_start, x_end, y_end). \n
|
||||
If no ROIs are configured, returns [[-1,-1,-1,-1]].
|
||||
"""
|
||||
return self.getRxROI() #vector of Roi structs how represented?
|
||||
|
||||
@rx_roi.setter
|
||||
def rx_roi(self, rois):
|
||||
"""
|
||||
Sets the list of ROIs in the receiver.
|
||||
Can only set multiple ROIs at multi module level without gap pixels. If more than 1 ROI per
|
||||
UDP port, it will throw. Setting number of udp interfaces will clear the
|
||||
roi. Cannot be set for CTB or Xilinx CTB.
|
||||
|
||||
Note
|
||||
-----
|
||||
Each ROI should be represented as a sequence of 4 ints (x_start, y_start, x_end, y_end). \n
|
||||
For mythen3 or gotthard2 pass a sequence of 2 ints (x_start, x_end) \n
|
||||
For multiple ROI's pass a sequence of sequence \n
|
||||
Example: [[0, 100, 50, 100], [260, 270, 50,100]] \n
|
||||
"""
|
||||
# TODO: maybe better to accept py::object in setRxROI and handle there?
|
||||
if not isinstance(rois, Sequence):
|
||||
raise TypeError(
|
||||
"setRxROI failed: expected a tuple/list of ints x_min, x_max, y_min, y_max "
|
||||
"or a sequence of such."
|
||||
)
|
||||
if(not isinstance(rois[0], Sequence)):
|
||||
self.setRxROI([rois])
|
||||
else:
|
||||
self.setRxROI(rois)
|
||||
|
||||
def rx_clearroi(self):
|
||||
"""Clears all the ROIs configured in the receiver."""
|
||||
self.clearRxROI()
|
||||
|
||||
@property
|
||||
@element
|
||||
@@ -3305,7 +3346,11 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def runclk(self):
|
||||
"""[Ctb] Run clock in MHz."""
|
||||
"""
|
||||
[Ctb] Sets Run clock frequency in MHz. \n
|
||||
[Xilinx Ctb] Sets Run clock frequency in kHz.
|
||||
"""
|
||||
|
||||
return self.getRUNClock()
|
||||
|
||||
@runclk.setter
|
||||
@@ -3386,7 +3431,11 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def dbitclk(self):
|
||||
"""[Ctb] Clock for latching the digital bits in MHz."""
|
||||
"""
|
||||
[Ctb] Sets clock for latching the digital bits in MHz. \n
|
||||
[Xilinx Ctb] clock for latching the digital bits in kHz.
|
||||
"""
|
||||
|
||||
return self.getDBITClock()
|
||||
|
||||
@dbitclk.setter
|
||||
@@ -3513,7 +3562,11 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def adcclk(self):
|
||||
"""[Ctb] Sets ADC clock frequency in MHz. """
|
||||
"""
|
||||
[Ctb] Sets ADC clock frequency in MHz. \n
|
||||
[Xilinx Ctb] Sets ADC clock frequency in kHz.
|
||||
"""
|
||||
|
||||
return self.getADCClock()
|
||||
|
||||
@adcclk.setter
|
||||
|
||||
@@ -942,6 +942,7 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const std::vector<defs::ROI> &)) &
|
||||
Detector::setRxROI,
|
||||
py::arg());
|
||||
|
||||
CppDetectorApi.def("clearRxROI",
|
||||
(void (Detector::*)()) & Detector::clearRxROI);
|
||||
CppDetectorApi.def(
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#pragma once
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <datetime.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
|
||||
#include "sls/Result.h"
|
||||
#include "DurationWrapper.h"
|
||||
#include "sls/Result.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
namespace pybind11 {
|
||||
@@ -14,84 +15,130 @@ template <typename Type, typename Alloc>
|
||||
struct type_caster<sls::Result<Type, Alloc>>
|
||||
: list_caster<sls::Result<Type, Alloc>, Type> {};
|
||||
|
||||
|
||||
// Based on the typecaster in pybind11/chrono.h
|
||||
template <> struct type_caster<std::chrono::nanoseconds> {
|
||||
public:
|
||||
PYBIND11_TYPE_CASTER(std::chrono::nanoseconds, const_name("DurationWrapper"));
|
||||
public:
|
||||
PYBIND11_TYPE_CASTER(std::chrono::nanoseconds,
|
||||
const_name("DurationWrapper"));
|
||||
|
||||
// signed 25 bits required by the standard.
|
||||
using days = std::chrono::duration<int_least32_t, std::ratio<86400>>;
|
||||
// signed 25 bits required by the standard.
|
||||
using days = std::chrono::duration<int_least32_t, std::ratio<86400>>;
|
||||
|
||||
/**
|
||||
* Conversion part 1 (Python->C++): convert a PyObject into std::chrono::nanoseconds
|
||||
* try datetime.timedelta, floats and our DurationWrapper wrapper
|
||||
*/
|
||||
/**
|
||||
* Conversion part 1 (Python->C++): convert a PyObject into
|
||||
* std::chrono::nanoseconds try datetime.timedelta, floats and our
|
||||
* DurationWrapper wrapper
|
||||
*/
|
||||
|
||||
bool load(handle src, bool) {
|
||||
using namespace std::chrono;
|
||||
bool load(handle src, bool) {
|
||||
using namespace std::chrono;
|
||||
|
||||
// Lazy initialise the PyDateTime import
|
||||
if (!PyDateTimeAPI) {
|
||||
PyDateTime_IMPORT;
|
||||
}
|
||||
// Lazy initialise the PyDateTime import
|
||||
if (!PyDateTimeAPI) {
|
||||
PyDateTime_IMPORT;
|
||||
}
|
||||
|
||||
if (!src) {
|
||||
if (!src) {
|
||||
return false;
|
||||
}
|
||||
// If invoked with datetime.delta object, same as in chrono.h
|
||||
if (PyDelta_Check(src.ptr())) {
|
||||
value = duration_cast<nanoseconds>(
|
||||
days(PyDateTime_DELTA_GET_DAYS(src.ptr())) +
|
||||
seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr())) +
|
||||
microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr()))
|
||||
|
||||
);
|
||||
return true;
|
||||
}
|
||||
// If invoked with a float we assume it is seconds and convert, same as
|
||||
// in chrono.h
|
||||
if (PyFloat_Check(src.ptr())) {
|
||||
value = duration_cast<nanoseconds>(
|
||||
duration<double>(PyFloat_AsDouble(src.ptr())));
|
||||
return true;
|
||||
}
|
||||
// If invoked with an int we assume it is nanoseconds and convert, same
|
||||
// as in chrono.h
|
||||
if (PyLong_Check(src.ptr())) {
|
||||
value = duration_cast<nanoseconds>(
|
||||
duration<int64_t>(PyLong_AsLongLong(src.ptr())));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Lastly if we were actually called with a DurationWrapper object we
|
||||
// get the number of nanoseconds and create a std::chrono::nanoseconds
|
||||
// from it
|
||||
py::object py_cls =
|
||||
py::module::import("slsdet._slsdet").attr("DurationWrapper");
|
||||
if (py::isinstance(src, py_cls)) {
|
||||
sls::DurationWrapper *cls = src.cast<sls::DurationWrapper *>();
|
||||
value = nanoseconds(cls->count());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion part 2 (C++ -> Python)
|
||||
* import the module to get a handle to the wrapped class
|
||||
* Default construct an object of (wrapped) DurationWrapper
|
||||
* set the count from chrono::nanoseconds and return
|
||||
*/
|
||||
static handle cast(std::chrono::nanoseconds src,
|
||||
return_value_policy /* policy */, handle /* parent */) {
|
||||
py::object py_cls =
|
||||
py::module::import("slsdet._slsdet").attr("DurationWrapper");
|
||||
py::object *obj = new py::object;
|
||||
*obj = py_cls();
|
||||
sls::DurationWrapper *dur = obj->cast<sls::DurationWrapper *>();
|
||||
dur->set_count(src.count());
|
||||
return *obj;
|
||||
}
|
||||
};
|
||||
|
||||
// Type caster for sls::defs::ROI from tuple
|
||||
template <> struct type_caster<sls::defs::ROI> {
|
||||
PYBIND11_TYPE_CASTER(sls::defs::ROI, _("Sequence[int, int, int, int] or "
|
||||
"Sequence[int, int]"));
|
||||
|
||||
// convert c++ ROI to python tuple
|
||||
static handle cast(const sls::defs::ROI &roi, return_value_policy, handle) {
|
||||
return py::make_tuple(roi.xmin, roi.xmax, roi.ymin, roi.ymax).release();
|
||||
}
|
||||
|
||||
// convert from python to c++ ROI
|
||||
bool load(handle roi, bool /*allow implicit conversion*/) {
|
||||
|
||||
// accept tuple, list, numpy array any sequence
|
||||
py::sequence seq;
|
||||
try {
|
||||
seq = py::reinterpret_borrow<py::sequence>(roi);
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (seq.size() != 4 && seq.size() != 2)
|
||||
return false;
|
||||
// Check if each element is an int
|
||||
for (auto item : seq) {
|
||||
if (!py::isinstance<py::int_>(item)) {
|
||||
return false;
|
||||
}
|
||||
// If invoked with datetime.delta object, same as in chrono.h
|
||||
if (PyDelta_Check(src.ptr())) {
|
||||
value = duration_cast<nanoseconds>(
|
||||
days(PyDateTime_DELTA_GET_DAYS(src.ptr())) +
|
||||
seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr())) +
|
||||
microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr()))
|
||||
|
||||
);
|
||||
return true;
|
||||
}
|
||||
// If invoked with a float we assume it is seconds and convert, same as in chrono.h
|
||||
if (PyFloat_Check(src.ptr())) {
|
||||
value = duration_cast<nanoseconds>(duration<double>(PyFloat_AsDouble(src.ptr())));
|
||||
return true;
|
||||
}
|
||||
// If invoked with an int we assume it is nanoseconds and convert, same as in chrono.h
|
||||
if (PyLong_Check(src.ptr())) {
|
||||
value = duration_cast<nanoseconds>(duration<int64_t>(PyLong_AsLongLong(src.ptr())));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Lastly if we were actually called with a DurationWrapper object we get
|
||||
// the number of nanoseconds and create a std::chrono::nanoseconds from it
|
||||
py::object py_cls = py::module::import("slsdet._slsdet").attr("DurationWrapper");
|
||||
if (py::isinstance(src, py_cls)){
|
||||
sls::DurationWrapper *cls = src.cast<sls::DurationWrapper *>();
|
||||
value = nanoseconds(cls->count());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion part 2 (C++ -> Python)
|
||||
* import the module to get a handle to the wrapped class
|
||||
* Default construct an object of (wrapped) DurationWrapper
|
||||
* set the count from chrono::nanoseconds and return
|
||||
*/
|
||||
static handle cast(std::chrono::nanoseconds src, return_value_policy /* policy */, handle /* parent */) {
|
||||
py::object py_cls = py::module::import("slsdet._slsdet").attr("DurationWrapper");
|
||||
py::object* obj = new py::object;
|
||||
*obj = py_cls();
|
||||
sls::DurationWrapper *dur = obj->cast<sls::DurationWrapper *>();
|
||||
dur->set_count(src.count());
|
||||
return *obj;
|
||||
value.xmin = seq[0].cast<int>();
|
||||
value.xmax = seq[1].cast<int>();
|
||||
|
||||
if (seq.size() == 4) {
|
||||
value.ymin = seq[2].cast<int>();
|
||||
value.ymax = seq[3].cast<int>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace pybind11
|
||||
84
python/tests/conftest.py
Normal file
84
python/tests/conftest.py
Normal file
@@ -0,0 +1,84 @@
|
||||
import pytest
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
current_dir = Path(__file__).resolve().parents[2]
|
||||
|
||||
scripts_dir = current_dir / "tests" / "scripts"
|
||||
|
||||
sys.path.append(str(scripts_dir))
|
||||
|
||||
from utils_for_test import (
|
||||
Log,
|
||||
LogLevel,
|
||||
cleanup,
|
||||
startReceiver,
|
||||
startDetectorVirtualServer,
|
||||
loadConfig,
|
||||
loadBasicSettings,
|
||||
connectToVirtualServers,
|
||||
DEFAULT_UDP_DST_PORTNO,
|
||||
)
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--detector-integration", action="store_true", default=False, help="Run tests that require detectors"
|
||||
)
|
||||
|
||||
def pytest_configure(config):
|
||||
config.addinivalue_line("markers", "detectorintegration: mark test as needing detectors to run")
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
if config.getoption("--detector-integration"):
|
||||
return
|
||||
skip = pytest.mark.skip(reason="need --detector-integration option to run")
|
||||
for item in items:
|
||||
if "detectorintegration" in item.keywords:
|
||||
item.add_marker(skip)
|
||||
|
||||
#helper fixture for servers
|
||||
@pytest.fixture(scope='module')
|
||||
def setup_parameters(request): # only setup once per module if same parameters used for the scopes
|
||||
try:
|
||||
servers, nmods = request.param # comes from @pytest.mark.parametrize(..., indirect=True)
|
||||
return servers, nmods
|
||||
except AttributeError:
|
||||
# fallback default if the test did not parametrize
|
||||
return (['eiger', 'jungfrau', 'mythen3', 'gotthard2', 'ctb', 'moench', 'xilinx_ctb'], 2)
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def test_with_simulators(setup_parameters):
|
||||
""" Fixture to automatically setup virtual detector servers for testing. """
|
||||
|
||||
fp = sys.stdout
|
||||
|
||||
servers, nmods = setup_parameters
|
||||
print("servers:", servers)
|
||||
print("nmods:", nmods)
|
||||
try:
|
||||
for server in servers:
|
||||
for ninterfaces in range(1,2):
|
||||
if ninterfaces == 2 and server != 'jungfrau' and server != 'moench':
|
||||
continue
|
||||
|
||||
msg = f'Starting Python API Tests for {server}'
|
||||
|
||||
if server == 'jungfrau' or server == 'moench':
|
||||
msg += f' with {ninterfaces} interfaces'
|
||||
|
||||
Log(LogLevel.INFOBLUE, msg, fp)
|
||||
cleanup(fp)
|
||||
startDetectorVirtualServer(server, nmods, fp)
|
||||
startReceiver(nmods, fp)
|
||||
d = loadConfig(name=server, log_file_fp=fp, num_mods=nmods, num_frames=1, num_interfaces=ninterfaces)
|
||||
#loadBasicSettings(name=server, d=d, fp=fp)
|
||||
yield # run test
|
||||
cleanup(fp) # teardown
|
||||
except Exception as e:
|
||||
traceback.print_exc(file=fp)
|
||||
Log(LogLevel.ERROR, f'Tests Failed.', fp)
|
||||
cleanup(fp)
|
||||
|
||||
|
||||
@@ -7,6 +7,15 @@ Run this using: pytest -s test_free.py
|
||||
|
||||
import pytest, sys
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
current_dir = Path(__file__).resolve().parents[2]
|
||||
|
||||
scripts_dir = current_dir / "tests" / "scripts"
|
||||
|
||||
sys.path.append(str(scripts_dir))
|
||||
|
||||
|
||||
from slsdet import Detector, Ctb, freeSharedMemory
|
||||
from utils_for_test import (
|
||||
Log,
|
||||
@@ -46,7 +55,7 @@ def setup_simulator(det_config):
|
||||
cleanup(fp)
|
||||
|
||||
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
def test_exptime_after_free_should_raise(setup_simulator):
|
||||
Log(LogLevel.INFOBLUE, f'\nRunning test_exptime_after_free_should_raise')
|
||||
|
||||
@@ -64,14 +73,11 @@ def test_exptime_after_free_should_raise(setup_simulator):
|
||||
assert str(exc_info.value) == "Shared memory is invalid or freed. Close resources before access."
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def free_and_create_shm():
|
||||
k = Ctb() # opens existing shm if it exists
|
||||
k.hostname = f"localhost:{SERVER_START_PORTNO}" # free and recreate shm, maps to local shm struct
|
||||
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
def test_exptime_after_not_passing_var_should_raise(setup_simulator):
|
||||
Log(LogLevel.INFOBLUE, f'\nRunning test_exptime_after_not_passing_var_should_raise')
|
||||
|
||||
@@ -95,7 +101,7 @@ def free_and_create_shm_passing_ctb_var(k):
|
||||
k = Ctb() # opens existing shm if it exists (disregards k as its new Ctb only local to this function)
|
||||
k.hostname = f"localhost:{SERVER_START_PORTNO}" # free and recreate shm, maps to local shm struct
|
||||
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
def test_exptime_after_passing_ctb_var_should_raise(setup_simulator):
|
||||
Log(LogLevel.INFOBLUE, f'\nRunning test_exptime_after_passing_ctb_var_should_raise')
|
||||
|
||||
@@ -118,7 +124,7 @@ def free_and_create_shm_returning_ctb():
|
||||
k.hostname = f"localhost:{SERVER_START_PORTNO}" # free and recreate shm, maps to local shm struct
|
||||
return k
|
||||
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
def test_exptime_after_returning_ctb_should_raise(setup_simulator):
|
||||
Log(LogLevel.INFOBLUE, f'\nRunning test_exptime_after_returning_ctb_should_raise')
|
||||
|
||||
@@ -141,11 +147,7 @@ def test_exptime_after_returning_ctb_should_raise(setup_simulator):
|
||||
Log(LogLevel.INFOGREEN, f"✅ Test passed, exception was: {exc_info.value}")
|
||||
assert str(exc_info.value) == "Shared memory is invalid or freed. Close resources before access."
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
def test_hostname_twice_acess_old_should_raise(setup_simulator):
|
||||
Log(LogLevel.INFOBLUE, f'\nRunning test_hostname_twice_acess_old_should_raise')
|
||||
|
||||
48
python/tests/test_pythonAPI.py
Normal file
48
python/tests/test_pythonAPI.py
Normal file
@@ -0,0 +1,48 @@
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
from conftest import test_with_simulators
|
||||
|
||||
from slsdet import Detector
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
@pytest.mark.parametrize("setup_parameters", [(["moench"], 2)], indirect=True)
|
||||
def test_rx_ROI_moench(test_with_simulators, setup_parameters):
|
||||
""" Test setting and getting rx_ROI property of Detector class for moench. """
|
||||
|
||||
d = Detector()
|
||||
d.rx_roi = (0, 10, 10, 20)
|
||||
roi = d.rx_roi
|
||||
assert roi == [(0, 10, 10, 20)]
|
||||
|
||||
d.rx_roi = [5,15,15,25]
|
||||
|
||||
assert d.rx_roi == [(5,15,15,25)]
|
||||
|
||||
d.rx_roi = [[0,10,0,20], [5,20,410,420]]
|
||||
|
||||
roi = d.rx_roi
|
||||
assert roi == [(0,10,0,20), (5,20,410,420)]
|
||||
|
||||
d.rx_clearroi()
|
||||
roi = d.rx_roi
|
||||
assert roi == [(-1,-1,-1,-1)]
|
||||
|
||||
@pytest.mark.detectorintegration
|
||||
@pytest.mark.parametrize("setup_parameters", [(["mythen3"], 1)], indirect=True)
|
||||
def test_rx_ROI_mythen(test_with_simulators, setup_parameters):
|
||||
""" Test setting and getting rx_ROI property of Detector class for mythen. """
|
||||
|
||||
d = Detector()
|
||||
d.rx_roi = (0, 10)
|
||||
roi = d.rx_roi
|
||||
assert roi == [(0, 10, -1, -1)]
|
||||
|
||||
#d.rx_roi = [[5,15, 0, 1]] # not allowed for mythen3
|
||||
|
||||
d.rx_roi = [0,10, -1, -1]
|
||||
|
||||
assert d.rx_roi == [(0,10,-1,-1)]
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
add_executable(using_logger using_logger.cpp)
|
||||
target_link_libraries(using_logger
|
||||
slsSupportShared
|
||||
pthread
|
||||
rt
|
||||
)
|
||||
|
||||
set_target_properties(using_logger PROPERTIES
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -76,11 +76,8 @@ foreach(exe ${JUNGFRAU_EXECUTABLES})
|
||||
target_link_libraries(${exe}
|
||||
PUBLIC
|
||||
slsSupportStatic
|
||||
pthread
|
||||
tiffio
|
||||
fmt::fmt
|
||||
#-L/usr/lib64/
|
||||
#-lm -lstdc++ -lrt
|
||||
|
||||
PRIVATE
|
||||
slsProjectWarnings
|
||||
|
||||
@@ -69,7 +69,6 @@ foreach(exe ${MOENCH_EXECUTABLES})
|
||||
PUBLIC
|
||||
slsSupportStatic
|
||||
${ZeroMQ_LIBRARIES}
|
||||
pthread
|
||||
tiffio
|
||||
|
||||
PRIVATE
|
||||
|
||||
@@ -37,7 +37,9 @@ target_compile_definitions(ctbDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(ctbDetectorServer_virtual
|
||||
PUBLIC pthread rt m slsProjectCSettings
|
||||
PUBLIC
|
||||
m
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(ctbDetectorServer_virtual PROPERTIES
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
/* Definitions for FPGA */
|
||||
#define MEM_MAP_SHIFT 1
|
||||
#define REG_OFFSET (2)
|
||||
|
||||
/* FPGA Version RO register */
|
||||
#define FPGA_VERSION_REG (0x00 << MEM_MAP_SHIFT)
|
||||
@@ -65,8 +66,8 @@
|
||||
(0x000000FF << STATUS_PT_CNTRL_STTS_OFF_OFST)
|
||||
#define STATUS_IDLE_MSK (0x677FF)
|
||||
|
||||
/* Look at me RO register TODO */
|
||||
#define LOOK_AT_ME_REG (0x03 << MEM_MAP_SHIFT)
|
||||
/* Register containing the git hash of the FPGA firmware */
|
||||
#define FIRMWARE_GIT_HASH_REG (0x03 << MEM_MAP_SHIFT)
|
||||
|
||||
/* System Status RO register */
|
||||
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT)
|
||||
@@ -119,7 +120,7 @@
|
||||
#define MOD_SERIAL_NUMBER_VRSN_MSK (0x0000003F << MOD_SERIAL_NUMBER_VRSN_OFST)
|
||||
|
||||
/* API Version RO register */
|
||||
#define API_VERSION_REG (0x0F << MEM_MAP_SHIFT)
|
||||
#define API_VERSION_REG (0x0B << MEM_MAP_SHIFT)
|
||||
|
||||
#define API_VERSION_OFST (0)
|
||||
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
|
||||
@@ -128,24 +129,24 @@
|
||||
|
||||
/* Time from Start 64 bit RO register. t = GCLK x 50 ns. Reset using
|
||||
* CONTROL_CRST. TODO */
|
||||
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
||||
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
||||
#define TIME_FROM_START_LSB_REG (0x97 << MEM_MAP_SHIFT)
|
||||
#define TIME_FROM_START_MSB_REG (0x98 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Delay Left 64 bit RO register. t = DLY x 50 ns. TODO */
|
||||
#define DELAY_LEFT_LSB_REG (0x12 << MEM_MAP_SHIFT)
|
||||
#define DELAY_LEFT_MSB_REG (0x13 << MEM_MAP_SHIFT)
|
||||
#define DELAY_LEFT_LSB_REG (0x8D << MEM_MAP_SHIFT)
|
||||
#define DELAY_LEFT_MSB_REG (0x8E << MEM_MAP_SHIFT)
|
||||
|
||||
/* Triggers Left 64 bit RO register TODO */
|
||||
#define CYCLES_LEFT_LSB_REG (0x14 << MEM_MAP_SHIFT)
|
||||
#define CYCLES_LEFT_MSB_REG (0x15 << MEM_MAP_SHIFT)
|
||||
#define CYCLES_LEFT_LSB_REG (0x8F << MEM_MAP_SHIFT)
|
||||
#define CYCLES_LEFT_MSB_REG (0x90 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Frames Left 64 bit RO register TODO */
|
||||
#define FRAMES_LEFT_LSB_REG (0x16 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_LEFT_MSB_REG (0x17 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_LEFT_LSB_REG (0x91 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_LEFT_MSB_REG (0x92 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Period Left 64 bit RO register. t = T x 50 ns. TODO */
|
||||
#define PERIOD_LEFT_LSB_REG (0x18 << MEM_MAP_SHIFT)
|
||||
#define PERIOD_LEFT_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
||||
#define PERIOD_LEFT_LSB_REG (0x93 << MEM_MAP_SHIFT)
|
||||
#define PERIOD_LEFT_MSB_REG (0x94 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Exposure Time Left 64 bit RO register */
|
||||
// #define EXPTIME_LEFT_LSB_REG (0x1A << MEM_MAP_SHIFT) // Not
|
||||
@@ -160,34 +161,34 @@
|
||||
//// Not used in FW
|
||||
|
||||
/* Data In 64 bit RO register TODO */
|
||||
#define DATA_IN_LSB_REG (0x1E << MEM_MAP_SHIFT)
|
||||
#define DATA_IN_MSB_REG (0x1F << MEM_MAP_SHIFT)
|
||||
#define DATA_IN_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
||||
#define DATA_IN_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Out 64 bit RO register */
|
||||
#define PATTERN_OUT_LSB_REG (0x20 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_OUT_MSB_REG (0x21 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_OUT_LSB_REG (0x80 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_OUT_MSB_REG (0x81 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Frame number of next acquisition register (64 bit register) */
|
||||
#define NEXT_FRAME_NUMB_LOCAL_LSB_REG (0x22 << MEM_MAP_SHIFT)
|
||||
#define NEXT_FRAME_NUMB_LOCAL_MSB_REG (0x23 << MEM_MAP_SHIFT)
|
||||
#define NEXT_FRAME_NUMB_LOCAL_LSB_REG (0x12 << MEM_MAP_SHIFT)
|
||||
#define NEXT_FRAME_NUMB_LOCAL_MSB_REG (0x13 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Frames From Start PG 64 bit RO register. Reset using CONTROL_CRST. TODO */
|
||||
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_FROM_START_PG_LSB_REG (0x99 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_FROM_START_PG_MSB_REG (0x9A << MEM_MAP_SHIFT)
|
||||
|
||||
/* Start Frame Time (Measurement Time) 64 bit register (timestamp at a frame
|
||||
* start until reset) TODO */
|
||||
#define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT)
|
||||
#define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT)
|
||||
#define START_FRAME_TIME_LSB_REG (0x9B << MEM_MAP_SHIFT)
|
||||
#define START_FRAME_TIME_MSB_REG (0x9C << MEM_MAP_SHIFT)
|
||||
|
||||
/* Power Status RO register */
|
||||
#define POWER_STATUS_REG (0x29 << MEM_MAP_SHIFT)
|
||||
#define POWER_STATUS_REG (0x18 << MEM_MAP_SHIFT)
|
||||
|
||||
#define POWER_STATUS_ALRT_OFST (27)
|
||||
#define POWER_STATUS_ALRT_MSK (0x0000001F << POWER_STATUS_ALRT_OFST)
|
||||
|
||||
/* FIFO Transceiver In Status RO register */
|
||||
#define FIFO_TIN_STATUS_REG (0x30 << MEM_MAP_SHIFT)
|
||||
#define FIFO_TIN_STATUS_REG (0x1A << MEM_MAP_SHIFT)
|
||||
#define FIFO_TIN_STATUS_FIFO_EMPTY_1_OFST (4)
|
||||
#define FIFO_TIN_STATUS_FIFO_EMPTY_1_MSK (0x00000001 << FIFO_TIN_STATUS_FIFO_EMPTY_1_OFST)
|
||||
#define FIFO_TIN_STATUS_FIFO_EMPTY_2_OFST (5)
|
||||
@@ -198,23 +199,54 @@
|
||||
#define FIFO_TIN_STATUS_FIFO_EMPTY_4_MSK (0x00000001 << FIFO_TIN_STATUS_FIFO_EMPTY_4_OFST)
|
||||
#define FIFO_TIN_STATUS_FIFO_EMPTY_ALL_MSK (0x0000000F << FIFO_TIN_STATUS_FIFO_EMPTY_1_OFST)
|
||||
|
||||
/* FIFO Transceiver Fill level RO register */
|
||||
#define FIFO_TIN_FILL_REG (0x25 << MEM_MAP_SHIFT)
|
||||
#define FIFO_TIN_FILL_FIFO_1_OFST (0)
|
||||
#define FIFO_TIN_FILL_FIFO_1_MSK (0x00003FFF << FIFO_TIN_FILL_FIFO__1_OFST)
|
||||
#define FIFO_TIN_FILL_FIFO_2_OFST (16)
|
||||
#define FIFO_TIN_FILL_FIFO_2_MSK (0x00003FFF << FIFO_TIN_FILL_FIFO__2_OFST)
|
||||
|
||||
/* FIFO ADC Fill level RO register */
|
||||
#define FIFO_ADC_FILL_REG (0x26 << MEM_MAP_SHIFT)
|
||||
#define FIFO_ADC_FILL_FIFO_OFST (0)
|
||||
#define FIFO_ADC_FILL_FIFO_MSK (0x00003FFF << FIFO_ADC_FILL_FIFO_OFST)
|
||||
|
||||
/* Enable continuos readout register */
|
||||
#define CONTINUOUS_RO_ENABLE_REG (0x27 << MEM_MAP_SHIFT)
|
||||
#define CONTINUOUS_RO_ADC_ENABLE_OFST (0)
|
||||
#define CONTINUOUS_RO_TIN_ENABLE_OFST (1)
|
||||
#define CONTINUOUS_RO_DBIT_ENABLE_OFST (2)
|
||||
#define CONTINUOUS_RO_ADC_ENABLE_MSK (0x00000001 << CONTINUOUS_RO_ADC_ENABLE_OFST)
|
||||
#define CONTINUOUS_RO_TIN_ENABLE_MSK (0x00000001 << CONTINUOUS_RO_TIN_ENABLE_OFST)
|
||||
#define CONTINUOUS_RO_DBIT_ENABLE_MSK (0x00000001 << CONTINUOUS_RO_DBIT_ENABLE_OFST)
|
||||
#define DBIT_INJECT_COUNTER_ENA_OFST (3) // continuously injects fake-data into the dbit fifo when enabled.
|
||||
#define DBIT_INJECT_COUNTER_ENA_MSK (0x00000001 << DBIT_INJECT_COUNTER_ENA_OFST)
|
||||
#define DBIT_INJECT_COUNTER_CLKDIV_OFST (8) // Additional clock divider for fake-data injection
|
||||
#define DBIT_INJECT_COUNTER_CLKDIV_MSK (0x000000FF << DBIT_INJECT_COUNTER_CLKDIV_OFST)
|
||||
|
||||
/* 64-bit FPGA chip ID. Unique for every device. read-only */
|
||||
#define FPGA_chipID_0_REG (0x28 << MEM_MAP_SHIFT)
|
||||
#define FPGA_chipID_1_REG (0x29 << MEM_MAP_SHIFT)
|
||||
|
||||
/* FIFO Transceiver In 64 bit RO register */
|
||||
#define FIFO_TIN_LSB_REG (0x31 << MEM_MAP_SHIFT)
|
||||
#define FIFO_TIN_MSB_REG (0x32 << MEM_MAP_SHIFT)
|
||||
#define FIFO_TIN_LSB_REG (0x1B << MEM_MAP_SHIFT)
|
||||
#define FIFO_TIN_MSB_REG (0x1C << MEM_MAP_SHIFT)
|
||||
|
||||
/* FIFO Digital In Status RO register */
|
||||
#define FIFO_DIN_STATUS_REG (0x3B << MEM_MAP_SHIFT)
|
||||
#define FIFO_DIN_STATUS_REG (0x1D << MEM_MAP_SHIFT)
|
||||
#define FIFO_DIN_STATUS_FIFO_FILL_OFST (0)
|
||||
#define FIFO_DIN_STATUS_FIFO_FILL_MSK (0x00003FFF)
|
||||
#define FIFO_DIN_STATUS_FIFO_FULL_OFST (30)
|
||||
#define FIFO_DIN_STATUS_FIFO_FULL_MSK (0x00000001 << FIFO_DIN_STATUS_FIFO_FULL_OFST)
|
||||
#define FIFO_DIN_STATUS_FIFO_EMPTY_OFST (31)
|
||||
#define FIFO_DIN_STATUS_FIFO_EMPTY_MSK (0x00000001 << FIFO_DIN_STATUS_FIFO_EMPTY_OFST)
|
||||
|
||||
/* FIFO Digital In 64 bit RO register */
|
||||
#define FIFO_DIN_LSB_REG (0x3C << MEM_MAP_SHIFT)
|
||||
#define FIFO_DIN_MSB_REG (0x3D << MEM_MAP_SHIFT)
|
||||
#define FIFO_DIN_LSB_REG (0x1E << MEM_MAP_SHIFT)
|
||||
#define FIFO_DIN_MSB_REG (0x1F << MEM_MAP_SHIFT)
|
||||
|
||||
/* SPI (Serial Peripheral Interface) DAC, HV RW register */
|
||||
#define SPI_REG (0x40 << MEM_MAP_SHIFT)
|
||||
#define SPI_REG (0x20 << MEM_MAP_SHIFT)
|
||||
|
||||
#define SPI_DAC_SRL_DGTL_OTPT_OFST (0)
|
||||
#define SPI_DAC_SRL_DGTL_OTPT_MSK (0x00000001 << SPI_DAC_SRL_DGTL_OTPT_OFST)
|
||||
@@ -230,7 +262,7 @@
|
||||
#define SPI_HV_SRL_CS_OTPT_MSK (0x00000001 << SPI_HV_SRL_CS_OTPT_OFST)
|
||||
|
||||
/* ADC SPI (Serial Peripheral Interface) RW register */
|
||||
#define ADC_SPI_REG (0x41 << MEM_MAP_SHIFT)
|
||||
#define ADC_SPI_REG (0x21 << MEM_MAP_SHIFT)
|
||||
|
||||
#define ADC_SPI_SRL_CLK_OTPT_OFST (0)
|
||||
#define ADC_SPI_SRL_CLK_OTPT_MSK (0x00000001 << ADC_SPI_SRL_CLK_OTPT_OFST)
|
||||
@@ -240,7 +272,7 @@
|
||||
#define ADC_SPI_SRL_CS_OTPT_MSK (0x0000000F << ADC_SPI_SRL_CS_OTPT_OFST)
|
||||
|
||||
/* ADC Offset RW register */
|
||||
#define ADC_OFFSET_REG (0x42 << MEM_MAP_SHIFT)
|
||||
#define ADC_OFFSET_REG (0x22 << MEM_MAP_SHIFT)
|
||||
|
||||
#define ADC_OFFSET_ADC_PPLN_OFST (0)
|
||||
#define ADC_OFFSET_ADC_PPLN_MSK (0x000000FF << ADC_OFFSET_ADC_PPLN_OFST)
|
||||
@@ -248,7 +280,7 @@
|
||||
#define ADC_OFFSET_DBT_PPLN_MSK (0x000000FF << ADC_OFFSET_DBT_PPLN_OFST)
|
||||
|
||||
/* ADC Port Invert RW register */
|
||||
#define ADC_PORT_INVERT_REG (0x43 << MEM_MAP_SHIFT)
|
||||
#define ADC_PORT_INVERT_REG (0x23 << MEM_MAP_SHIFT)
|
||||
|
||||
#define ADC_PORT_INVERT_0_INPT_OFST (0)
|
||||
#define ADC_PORT_INVERT_0_INPT_MSK (0x000000FF << ADC_PORT_INVERT_0_INPT_OFST)
|
||||
@@ -260,7 +292,7 @@
|
||||
#define ADC_PORT_INVERT_3_INPT_MSK (0x000000FF << ADC_PORT_INVERT_3_INPT_OFST)
|
||||
|
||||
/* Dummy RW register */
|
||||
#define DUMMY_REG (0x44 << MEM_MAP_SHIFT)
|
||||
#define DUMMY_REG (0x24 << MEM_MAP_SHIFT)
|
||||
|
||||
#define DUMMY_FIFO_CHNNL_SLCT_OFST (0)
|
||||
#define DUMMY_FIFO_CHNNL_SLCT_MSK (0x0000003F << DUMMY_FIFO_CHNNL_SLCT_OFST)
|
||||
@@ -273,46 +305,8 @@
|
||||
#define DUMMY_TRNSCVR_FIFO_RD_STRBE_OFST (14)
|
||||
#define DUMMY_TRNSCVR_FIFO_RD_STRBE_MSK (0x00000001 << DUMMY_TRNSCVR_FIFO_RD_STRBE_OFST)
|
||||
|
||||
/* Receiver IP Address RW register */
|
||||
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
|
||||
|
||||
/* UDP Port RW register */
|
||||
#define UDP_PORT_REG (0x46 << MEM_MAP_SHIFT)
|
||||
|
||||
#define UDP_PORT_RX_OFST (0)
|
||||
#define UDP_PORT_RX_MSK (0x0000FFFF << UDP_PORT_RX_OFST)
|
||||
#define UDP_PORT_TX_OFST (16)
|
||||
#define UDP_PORT_TX_MSK (0x0000FFFF << UDP_PORT_TX_OFST)
|
||||
|
||||
/* Receiver Mac Address 64 bit RW register */
|
||||
#define RX_MAC_LSB_REG (0x47 << MEM_MAP_SHIFT)
|
||||
#define RX_MAC_MSB_REG (0x48 << MEM_MAP_SHIFT)
|
||||
|
||||
#define RX_MAC_LSB_OFST (0)
|
||||
#define RX_MAC_LSB_MSK (0xFFFFFFFF << RX_MAC_LSB_OFST)
|
||||
#define RX_MAC_MSB_OFST (0)
|
||||
#define RX_MAC_MSB_MSK (0x0000FFFF << RX_MAC_MSB_OFST)
|
||||
|
||||
/* Detector/ Transmitter Mac Address 64 bit RW register */
|
||||
#define TX_MAC_LSB_REG (0x49 << MEM_MAP_SHIFT)
|
||||
#define TX_MAC_MSB_REG (0x4A << MEM_MAP_SHIFT)
|
||||
|
||||
#define TX_MAC_LSB_OFST (0)
|
||||
#define TX_MAC_LSB_MSK (0xFFFFFFFF << TX_MAC_LSB_OFST)
|
||||
#define TX_MAC_MSB_OFST (0)
|
||||
#define TX_MAC_MSB_MSK (0x0000FFFF << TX_MAC_MSB_OFST)
|
||||
|
||||
/* Detector/ Transmitter IP Address RW register */
|
||||
#define TX_IP_REG (0x4B << MEM_MAP_SHIFT)
|
||||
|
||||
/* Detector/ Transmitter IP Checksum RW register */
|
||||
#define TX_IP_CHECKSUM_REG (0x4C << MEM_MAP_SHIFT)
|
||||
|
||||
#define TX_IP_CHECKSUM_OFST (0)
|
||||
#define TX_IP_CHECKSUM_MSK (0x0000FFFF << TX_IP_CHECKSUM_OFST)
|
||||
|
||||
/* Configuration RW register */
|
||||
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
|
||||
#define CONFIG_REG (0x2D << MEM_MAP_SHIFT)
|
||||
|
||||
#define CONFIG_LED_DSBL_OFST (0)
|
||||
#define CONFIG_LED_DSBL_MSK (0x00000001 << CONFIG_LED_DSBL_OFST)
|
||||
@@ -327,7 +321,7 @@
|
||||
#define CONFIG_GB10_SND_UDP_MSK (0x00000001 << CONFIG_GB10_SND_UDP_OFST)
|
||||
|
||||
/* External Signal RW register */
|
||||
#define EXT_SIGNAL_REG (0x4E << MEM_MAP_SHIFT)
|
||||
#define EXT_SIGNAL_REG (0x2E << MEM_MAP_SHIFT)
|
||||
|
||||
#define EXT_SIGNAL_OFST (0)
|
||||
#define EXT_SIGNAL_MSK (0x00000001 << EXT_SIGNAL_OFST)
|
||||
@@ -335,7 +329,7 @@
|
||||
#define EXT_SIGNAL_TRGGR_VAL ((0x1 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
||||
|
||||
/* Control RW register */
|
||||
#define CONTROL_REG (0x4F << MEM_MAP_SHIFT)
|
||||
#define CONTROL_REG (0x2F << MEM_MAP_SHIFT)
|
||||
|
||||
#define CONTROL_STRT_ACQSTN_OFST (0)
|
||||
#define CONTROL_STRT_ACQSTN_MSK (0x00000001 << CONTROL_STRT_ACQSTN_OFST)
|
||||
@@ -375,10 +369,10 @@
|
||||
#define CONTROL_CLR_ACQSTN_FIFO_MSK (0x00000001 << CONTROL_CLR_ACQSTN_FIFO_OFST)
|
||||
|
||||
/* Reconfiguratble PLL Paramater RW register */
|
||||
#define PLL_PARAM_REG (0x50 << MEM_MAP_SHIFT)
|
||||
#define PLL_PARAM_REG (0x30 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Reconfiguratble PLL Control RW regiser */
|
||||
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
||||
#define PLL_CNTRL_REG (0x31 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0)
|
||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK \
|
||||
@@ -390,8 +384,15 @@
|
||||
#define PLL_CNTRL_ADDR_OFST (16)
|
||||
#define PLL_CNTRL_ADDR_MSK (0x0000003F << PLL_CNTRL_ADDR_OFST)
|
||||
|
||||
/* Streaming Control RW regiser */
|
||||
#define STREAMING_CTRL_REG (0x3D << MEM_MAP_SHIFT)
|
||||
#define STREAMING_CTRL_ENA_OFST (15)
|
||||
#define STREAMING_CTRL_ENA_MSK (0x00000001 << STREAMING_CTRL_ENA_OFST)
|
||||
#define STREAMING_CTRL_SELECT_OFST (0)
|
||||
#define STREAMING_CTRL_SELECT_MSK (0x0000003F << STREAMING_CTRL_SELECT_OFST)
|
||||
|
||||
/* Pattern Control RW register */
|
||||
#define PATTERN_CNTRL_REG (0x52 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_CNTRL_REG (0x88 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_CNTRL_WR_OFST (0)
|
||||
#define PATTERN_CNTRL_WR_MSK (0x00000001 << PATTERN_CNTRL_WR_OFST)
|
||||
@@ -401,70 +402,31 @@
|
||||
#define PATTERN_CNTRL_ADDR_MSK (0x00001FFF << PATTERN_CNTRL_ADDR_OFST)
|
||||
|
||||
/* Pattern Limit RW regiser */
|
||||
#define PATTERN_LIMIT_REG (0x53 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_LIMIT_REG (0x89 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_LIMIT_STRT_OFST (0)
|
||||
#define PATTERN_LIMIT_STRT_MSK (0x00001FFF << PATTERN_LIMIT_STRT_OFST)
|
||||
#define PATTERN_LIMIT_STP_OFST (16)
|
||||
#define PATTERN_LIMIT_STP_MSK (0x00001FFF << PATTERN_LIMIT_STP_OFST)
|
||||
|
||||
/* Pattern Loop 0 Address RW regiser */
|
||||
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT)
|
||||
/** Pattern Loop and Wait Definitions, 5 regs each */
|
||||
#define PATTERN_LOOPDEF_BASE (0xA0 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_LOOP_ADDR_WORD_OFST (0)
|
||||
#define PATTERN_LOOP_ITERATION_WORD_OFST (1)
|
||||
#define PATTERN_WAIT_ADDR_WORD_OFST (2)
|
||||
#define PATTERN_WAIT_TIMER_LSB_WORD_OFST (3)
|
||||
#define PATTERN_WAIT_TIMER_MSB_WORD_OFST (4)
|
||||
#define PATTERN_LOOPDEF_NWORDS_OFST (5)
|
||||
|
||||
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_0_ADDR_STRT_MSK \
|
||||
(0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Loop 0 Iteration RW regiser */
|
||||
#define PATTERN_LOOP_0_ITERATION_REG (0x55 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Loop 1 Address RW regiser */
|
||||
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_1_ADDR_STRT_MSK \
|
||||
(0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Loop 1 Iteration RW regiser */
|
||||
#define PATTERN_LOOP_1_ITERATION_REG (0x57 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Loop 2 Address RW regiser */
|
||||
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_2_ADDR_STRT_MSK \
|
||||
(0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Loop 2 Iteration RW regiser */
|
||||
#define PATTERN_LOOP_2_ITERATION_REG (0x59 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait 0 RW regiser */
|
||||
#define PATTERN_WAIT_0_ADDR_REG (0x5A << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_WAIT_0_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_0_ADDR_MSK (0x00001FFF << PATTERN_WAIT_0_ADDR_OFST)
|
||||
// FIXME: is mask 3FF
|
||||
|
||||
/* Pattern Wait 1 RW regiser */
|
||||
#define PATTERN_WAIT_1_ADDR_REG (0x5B << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_WAIT_1_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_1_ADDR_MSK (0x00001FFF << PATTERN_WAIT_1_ADDR_OFST)
|
||||
|
||||
/* Pattern Wait 2 RW regiser */
|
||||
#define PATTERN_WAIT_2_ADDR_REG (0x5C << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_WAIT_2_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_2_ADDR_MSK (0x00001FFF << PATTERN_WAIT_2_ADDR_OFST)
|
||||
#define PATTERN_WAIT_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_ADDR_MSK (0x00001FFF << PATTERN_WAIT_ADDR_OFST)
|
||||
#define PATTERN_LOOP_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_ADDR_STP_OFST)
|
||||
|
||||
/* Samples RW register */
|
||||
#define SAMPLES_REG (0x5D << MEM_MAP_SHIFT)
|
||||
#define SAMPLES_REG (0x32 << MEM_MAP_SHIFT)
|
||||
|
||||
#define SAMPLES_DIGITAL_OFST (0)
|
||||
#define SAMPLES_DIGITAL_MSK (0x0000FFFF << SAMPLES_DIGITAL_OFST)
|
||||
@@ -472,7 +434,7 @@
|
||||
#define SAMPLES_ANALOG_MSK (0x0000FFFF << SAMPLES_ANALOG_OFST)
|
||||
|
||||
/** Power RW register */
|
||||
#define POWER_REG (0x5E << MEM_MAP_SHIFT)
|
||||
#define POWER_REG (0x33 << MEM_MAP_SHIFT)
|
||||
|
||||
#define POWER_ENBL_VLTG_RGLTR_OFST (16)
|
||||
#define POWER_ENBL_VLTG_RGLTR_MSK (0x0000001F << POWER_ENBL_VLTG_RGLTR_OFST)
|
||||
@@ -480,25 +442,25 @@
|
||||
#define POWER_HV_INTERNAL_SLCT_MSK (0x00000001 << POWER_HV_INTERNAL_SLCT_OFST)
|
||||
|
||||
/* Number of samples from transceiver RW register */
|
||||
#define SAMPLES_TRANSCEIVER_REG (0x5F << MEM_MAP_SHIFT)
|
||||
#define SAMPLES_TRANSCEIVER_REG (0x34 << MEM_MAP_SHIFT)
|
||||
#define SAMPLES_TRANSCEIVER_OFST (0)
|
||||
#define SAMPLES_TRANSCEIVER_MSK (0x0000FFFF << SAMPLES_TRANSCEIVER_OFST)
|
||||
|
||||
/* Delay 64 bit RW register. t = DLY x 50 ns. */
|
||||
#define DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT)
|
||||
#define DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT)
|
||||
#define DELAY_LSB_REG (0x8D << MEM_MAP_SHIFT)
|
||||
#define DELAY_MSB_REG (0x8E << MEM_MAP_SHIFT)
|
||||
|
||||
/* Triggers 64 bit RW register */
|
||||
#define CYCLES_LSB_REG (0x62 << MEM_MAP_SHIFT)
|
||||
#define CYCLES_MSB_REG (0x63 << MEM_MAP_SHIFT)
|
||||
#define CYCLES_LSB_REG (0x8F << MEM_MAP_SHIFT)
|
||||
#define CYCLES_MSB_REG (0x90 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Frames 64 bit RW register */
|
||||
#define FRAMES_LSB_REG (0x64 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_MSB_REG (0x65 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_LSB_REG (0x91 << MEM_MAP_SHIFT)
|
||||
#define FRAMES_MSB_REG (0x92 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Period 64 bit RW register */
|
||||
#define PERIOD_LSB_REG (0x66 << MEM_MAP_SHIFT)
|
||||
#define PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
|
||||
#define PERIOD_LSB_REG (0x93 << MEM_MAP_SHIFT)
|
||||
#define PERIOD_MSB_REG (0x94 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Period 64 bit RW register */
|
||||
// #define EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT) //
|
||||
@@ -513,33 +475,15 @@
|
||||
|
||||
/* Pattern IO Control 64 bit RW regiser
|
||||
* Each bit configured as output(1)/ input(0) */
|
||||
#define PATTERN_IO_CNTRL_LSB_REG (0x6C << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IO_CNTRL_MSB_REG (0x6D << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern IO Clock Control 64 bit RW regiser
|
||||
* When bit n enabled (1), clocked output for DIO[n] (T run clock)
|
||||
* When bit n disabled (0), Dio[n] driven by its pattern output */
|
||||
#define PATTERN_IO_CLK_CNTRL_LSB_REG (0x6E << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IO_CLK_CNTRL_MSB_REG (0x6F << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IO_CNTRL_LSB_REG (0x8A << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IO_CNTRL_MSB_REG (0x8B << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern In 64 bit RW register */
|
||||
#define PATTERN_IN_LSB_REG (0x70 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IN_MSB_REG (0x71 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait Timer 0 64 bit RW register. t = PWT1 x T run clock */
|
||||
#define PATTERN_WAIT_TIMER_0_LSB_REG (0x72 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_WAIT_TIMER_0_MSB_REG (0x73 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait Timer 1 64 bit RW register. t = PWT2 x T run clock */
|
||||
#define PATTERN_WAIT_TIMER_1_LSB_REG (0x74 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_WAIT_TIMER_1_MSB_REG (0x75 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait Timer 2 64 bit RW register. t = PWT3 x T run clock */
|
||||
#define PATTERN_WAIT_TIMER_2_LSB_REG (0x76 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_WAIT_TIMER_2_MSB_REG (0x77 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IN_LSB_REG (0x82 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_IN_MSB_REG (0x83 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Readout enable RW register */
|
||||
#define READOUT_10G_ENABLE_REG (0x79 << MEM_MAP_SHIFT)
|
||||
#define READOUT_10G_ENABLE_REG (0x3C << MEM_MAP_SHIFT)
|
||||
|
||||
#define READOUT_10G_ENABLE_ANLG_OFST (0)
|
||||
#define READOUT_10G_ENABLE_ANLG_MSK (0x000000FF << READOUT_10G_ENABLE_ANLG_OFST)
|
||||
@@ -550,7 +494,7 @@
|
||||
(0x0000000F << READOUT_10G_ENABLE_TRNSCVR_OFST)
|
||||
|
||||
/* Digital Bit External Trigger RW register */
|
||||
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT)
|
||||
#define DBIT_EXT_TRG_REG (0x3E << MEM_MAP_SHIFT)
|
||||
|
||||
#define DBIT_EXT_TRG_SRC_OFST (0)
|
||||
#define DBIT_EXT_TRG_SRC_MSK (0x0000003F << DBIT_EXT_TRG_SRC_OFST)
|
||||
@@ -558,7 +502,7 @@
|
||||
#define DBIT_EXT_TRG_OPRTN_MD_MSK (0x00000001 << DBIT_EXT_TRG_OPRTN_MD_OFST)
|
||||
|
||||
/* Pin Delay 0 RW register */
|
||||
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT)
|
||||
#define OUTPUT_DELAY_0_REG (0x3F << MEM_MAP_SHIFT)
|
||||
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
|
||||
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST \
|
||||
(0) // t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
|
||||
@@ -574,87 +518,21 @@
|
||||
|
||||
/* Pin Delay 1 RW register
|
||||
* Each bit configured as enable for dynamic output delay configuration */
|
||||
#define PIN_DELAY_1_REG (0x7D << MEM_MAP_SHIFT)
|
||||
#define PIN_DELAY_1_REG (0x40 << MEM_MAP_SHIFT)
|
||||
|
||||
/** Pattern Mask 64 bit RW regiser */
|
||||
#define PATTERN_MASK_LSB_REG (0x80 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_MASK_MSB_REG (0x81 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_MASK_LSB_REG (0x84 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_MASK_MSB_REG (0x85 << MEM_MAP_SHIFT)
|
||||
|
||||
/** Pattern Set 64 bit RW regiser */
|
||||
#define PATTERN_SET_LSB_REG (0x82 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_SET_MSB_REG (0x83 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Loop 3 Address RW regiser */
|
||||
#define PATTERN_LOOP_3_ADDR_REG (0x84 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_LOOP_3_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_3_ADDR_STRT_MSK \
|
||||
(0x00001FFF << PATTERN_LOOP_3_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_3_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_3_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_3_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Loop 3 Iteration RW regiser */
|
||||
#define PATTERN_LOOP_3_ITERATION_REG (0x85 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Loop 4 Address RW regiser */
|
||||
#define PATTERN_LOOP_4_ADDR_REG (0x86 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_LOOP_4_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_4_ADDR_STRT_MSK \
|
||||
(0x00001FFF << PATTERN_LOOP_4_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_4_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_4_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_4_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Loop 4 Iteration RW regiser */
|
||||
#define PATTERN_LOOP_4_ITERATION_REG (0x87 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Loop 5 Address RW regiser */
|
||||
#define PATTERN_LOOP_5_ADDR_REG (0x88 << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_LOOP_5_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_5_ADDR_STRT_MSK \
|
||||
(0x00001FFF << PATTERN_LOOP_5_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_5_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_5_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_5_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Loop 5 Iteration RW regiser */
|
||||
#define PATTERN_LOOP_5_ITERATION_REG (0x89 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait 3 RW regiser */
|
||||
#define PATTERN_WAIT_3_ADDR_REG (0x8A << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_WAIT_3_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_3_ADDR_MSK (0x00001FFF << PATTERN_WAIT_3_ADDR_OFST)
|
||||
|
||||
/* Pattern Wait 4 RW regiser */
|
||||
#define PATTERN_WAIT_4_ADDR_REG (0x8B << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_WAIT_4_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_4_ADDR_MSK (0x00001FFF << PATTERN_WAIT_4_ADDR_OFST)
|
||||
|
||||
/* Pattern Wait 5 RW regiser */
|
||||
#define PATTERN_WAIT_5_ADDR_REG (0x8C << MEM_MAP_SHIFT)
|
||||
|
||||
#define PATTERN_WAIT_5_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_5_ADDR_MSK (0x00001FFF << PATTERN_WAIT_5_ADDR_OFST)
|
||||
|
||||
/* Pattern Wait Timer 3 64 bit RW register. t = PWT1 x T run clock */
|
||||
#define PATTERN_WAIT_TIMER_3_LSB_REG (0x8D << MEM_MAP_SHIFT)
|
||||
#define PATTERN_WAIT_TIMER_3_MSB_REG (0x8E << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait Timer 4 64 bit RW register. t = PWT1 x T run clock */
|
||||
#define PATTERN_WAIT_TIMER_4_LSB_REG (0x8F << MEM_MAP_SHIFT)
|
||||
#define PATTERN_WAIT_TIMER_4_MSB_REG (0x90 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Pattern Wait Timer 5 64 bit RW register. t = PWT1 x T run clock */
|
||||
#define PATTERN_WAIT_TIMER_5_LSB_REG (0x91 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_WAIT_TIMER_5_MSB_REG (0x92 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_SET_LSB_REG (0x86 << MEM_MAP_SHIFT)
|
||||
#define PATTERN_SET_MSB_REG (0x87 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Slow ADC SPI Value RO register */
|
||||
#define ADC_SLOW_DATA_REG (0x93 << MEM_MAP_SHIFT)
|
||||
#define ADC_SLOW_DATA_REG (0x41 << MEM_MAP_SHIFT)
|
||||
|
||||
/* Slow ADC SPI Value Config register */
|
||||
#define ADC_SLOW_CFG_REG (0x94 << MEM_MAP_SHIFT)
|
||||
#define ADC_SLOW_CFG_REG (0x42 << MEM_MAP_SHIFT)
|
||||
/** Read back CFG Register */
|
||||
#define ADC_SLOW_CFG_RB_OFST (2)
|
||||
#define ADC_SLOW_CFG_RB_MSK (0x00000001 << ADC_SLOW_CFG_RB_OFST)
|
||||
@@ -733,7 +611,7 @@
|
||||
((0x1 << ADC_SLOW_CFG_CFG_OFST) & ADC_SLOW_CFG_CFG_MSK)
|
||||
|
||||
/* Slow ADC SPI Value Control register */
|
||||
#define ADC_SLOW_CTRL_REG (0x95 << MEM_MAP_SHIFT)
|
||||
#define ADC_SLOW_CTRL_REG (0x43 << MEM_MAP_SHIFT)
|
||||
|
||||
#define ADC_SLOW_CTRL_STRT_OFST (0)
|
||||
#define ADC_SLOW_CTRL_STRT_MSK (0x00000001 << ADC_SLOW_CTRL_STRT_OFST)
|
||||
|
||||
Binary file not shown.
@@ -54,6 +54,7 @@
|
||||
#define DEFAULT_ADC_CLK (40) // 20
|
||||
#define DEFAULT_SYNC_CLK (40) // 20
|
||||
#define DEFAULT_DBIT_CLK (200)
|
||||
#define NS_TO_CLK_CYCLE (1E-3) // ns to MHz
|
||||
#define DEFAULT_TRANSCEIVER_MASK (0x3)
|
||||
|
||||
#define MAX_TRANSCEIVER_MASK (0xF)
|
||||
|
||||
@@ -30,7 +30,8 @@ target_compile_definitions(eigerDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(eigerDetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
PUBLIC
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(eigerDetectorServer_virtual PROPERTIES
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -31,7 +31,8 @@ target_compile_definitions(gotthard2DetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(gotthard2DetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
PUBLIC
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(gotthard2DetectorServer_virtual PROPERTIES
|
||||
|
||||
Binary file not shown.
@@ -29,7 +29,8 @@ target_compile_definitions(jungfrauDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(jungfrauDetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
PUBLIC
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(jungfrauDetectorServer_virtual PROPERTIES
|
||||
|
||||
Binary file not shown.
@@ -29,7 +29,8 @@ target_compile_definitions(moenchDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(moenchDetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
PUBLIC
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(moenchDetectorServer_virtual PROPERTIES
|
||||
|
||||
Binary file not shown.
@@ -33,7 +33,8 @@ target_compile_definitions(mythen3DetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(mythen3DetectorServer_virtual
|
||||
PUBLIC pthread rt slsProjectCSettings
|
||||
PUBLIC
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(mythen3DetectorServer_virtual PROPERTIES
|
||||
|
||||
@@ -348,68 +348,21 @@
|
||||
#define PATTERN_SET_LSB_REG (0x44 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define PATTERN_SET_MSB_REG (0x45 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
/* Pattern Wait Timer 0 64bit RW Register */
|
||||
#define PATTERN_WAIT_TIMER_0_LSB_REG (0x60 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define PATTERN_WAIT_TIMER_0_MSB_REG (0x61 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
/** Pattern Loop and Wait Definitions, 5 regs each */
|
||||
#define PATTERN_LOOPDEF_BASE (0x60 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define PATTERN_LOOPDEF_NWORDS_OFST (5)
|
||||
#define PATTERN_WAIT_TIMER_LSB_WORD_OFST (0)
|
||||
#define PATTERN_WAIT_TIMER_MSB_WORD_OFST (1)
|
||||
#define PATTERN_WAIT_ADDR_WORD_OFST (2)
|
||||
#define PATTERN_LOOP_ITERATION_WORD_OFST (3)
|
||||
#define PATTERN_LOOP_ADDR_WORD_OFST (4)
|
||||
|
||||
/* Pattern Wait 0 RW Register*/
|
||||
#define PATTERN_WAIT_0_ADDR_REG (0x62 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define PATTERN_WAIT_0_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_0_ADDR_MSK (0x00001FFF << PATTERN_WAIT_0_ADDR_OFST)
|
||||
|
||||
/* Pattern Loop 0 Iteration RW Register */
|
||||
#define PATTERN_LOOP_0_ITERATION_REG (0x63 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
/* Pattern Loop 0 Address RW Register */
|
||||
#define PATTERN_LOOP_0_ADDR_REG (0x64 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_0_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Wait Timer 1 64bit RW Register */
|
||||
#define PATTERN_WAIT_TIMER_1_LSB_REG (0x65 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define PATTERN_WAIT_TIMER_1_MSB_REG (0x66 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
/* Pattern Wait 1 RW Register*/
|
||||
#define PATTERN_WAIT_1_ADDR_REG (0x67 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define PATTERN_WAIT_1_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_1_ADDR_MSK (0x00001FFF << PATTERN_WAIT_1_ADDR_OFST)
|
||||
|
||||
/* Pattern Loop 1 Iteration RW Register */
|
||||
#define PATTERN_LOOP_1_ITERATION_REG (0x68 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
/* Pattern Loop 1 Address RW Register */
|
||||
#define PATTERN_LOOP_1_ADDR_REG (0x69 * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_1_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern Wait Timer 2 64bit RW Register */
|
||||
#define PATTERN_WAIT_TIMER_2_LSB_REG (0x6A * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
#define PATTERN_WAIT_TIMER_2_MSB_REG (0x6B * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
/* Pattern Wait 2 RW Register*/
|
||||
#define PATTERN_WAIT_2_ADDR_REG (0x6C * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define PATTERN_WAIT_2_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_2_ADDR_MSK (0x00001FFF << PATTERN_WAIT_2_ADDR_OFST)
|
||||
|
||||
/* Pattern Loop 2 Iteration RW Register */
|
||||
#define PATTERN_LOOP_2_ITERATION_REG (0x6D * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
/* Pattern Loop 0 Address RW Register */
|
||||
#define PATTERN_LOOP_2_ADDR_REG (0x6E * REG_OFFSET + BASE_PATTERN_CONTROL)
|
||||
|
||||
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_2_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
|
||||
#define PATTERN_WAIT_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_ADDR_MSK (0x00001FFF << PATTERN_WAIT_ADDR_OFST)
|
||||
#define PATTERN_LOOP_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_ADDR_STP_OFST)
|
||||
|
||||
/* Pattern RAM registers --------------------------------------------------*/
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -63,6 +63,7 @@
|
||||
#define DEFAULT_SYSTEM_C1 (6) //(166666666) // str_clk, 166 MHz const
|
||||
#define DEFAULT_SYSTEM_C2 (5) //(200000000) // smp_clk, 200 MHz const
|
||||
#define DEFAULT_TRIMMING_RUN_CLKDIV (40) // (25000000) // 25 MHz
|
||||
#define NS_TO_CLK_CYCLE (1E-3) // ns to MHz
|
||||
|
||||
#define FULL_SPEED_CLKDIV (10) //(100000000) 100 MHz
|
||||
#define HALF_SPEED_CLKDIV (20) //( 50000000) 50 MHz
|
||||
|
||||
12
slsDetectorServers/slsDetectorServer/include/XILINX_PLL.h
Normal file
12
slsDetectorServers/slsDetectorServer/include/XILINX_PLL.h
Normal file
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int XILINX_PLL_setFrequency(uint32_t clk_index, uint32_t freq);
|
||||
uint32_t XILINX_PLL_getFrequency(uint32_t clkIDX);
|
||||
bool XILINX_PLL_isLocked();
|
||||
void XILINX_PLL_reset();
|
||||
void XILINX_PLL_waitForLock();
|
||||
void XILINX_PLL_load();
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
void bus_w(u_int32_t offset, u_int32_t data);
|
||||
void bus_w_csp2(u_int32_t offset, u_int32_t data);
|
||||
u_int32_t bus_r(u_int32_t offset);
|
||||
u_int32_t bus_r_csp2(u_int32_t offset);
|
||||
uint64_t getU64BitReg(int aLSB, int aMSB);
|
||||
void setU64BitReg(uint64_t value, int aLSB, int aMSB);
|
||||
u_int32_t readRegister(u_int32_t offset);
|
||||
|
||||
@@ -58,7 +58,8 @@ uint64_t getPatternMask();
|
||||
void setPatternBitMask(uint64_t mask);
|
||||
uint64_t getPatternBitMask();
|
||||
|
||||
#ifdef MYTHEN3D
|
||||
#if defined(MYTHEN3D) || defined(XILINX_CHIPTESTBOARDD) || \
|
||||
defined(CHIPTESTBOARDD)
|
||||
void startPattern();
|
||||
#endif
|
||||
char *getPatternFileName();
|
||||
|
||||
@@ -398,8 +398,8 @@ int getPower();
|
||||
void setPower(enum DACINDEX ind, int val);
|
||||
void powerOff();
|
||||
#elif XILINX_CHIPTESTBOARDD
|
||||
int getBitOffsetFromDACIndex(enum DACINDEX ind);
|
||||
int isPowerValid(enum DACINDEX ind, int val);
|
||||
|
||||
int getPower();
|
||||
void setPower(enum DACINDEX ind, int val);
|
||||
#endif
|
||||
@@ -518,8 +518,6 @@ int setPhase(enum CLKINDEX ind, int val, int degrees);
|
||||
int getPhase(enum CLKINDEX ind, int degrees);
|
||||
int getMaxPhase(enum CLKINDEX ind);
|
||||
int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval);
|
||||
int setFrequency(enum CLKINDEX ind, int val);
|
||||
int getFrequency(enum CLKINDEX ind);
|
||||
void configureSyncFrequency(enum CLKINDEX ind);
|
||||
void setADCPipeline(int val);
|
||||
int getADCPipeline();
|
||||
@@ -529,6 +527,11 @@ int setLEDEnable(int enable);
|
||||
void setDigitalIODelay(uint64_t pinMask, int delay);
|
||||
#endif
|
||||
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
int setFrequency(enum CLKINDEX ind, int val);
|
||||
int getFrequency(enum CLKINDEX ind);
|
||||
#endif
|
||||
|
||||
// jungfrau/moench specific - powerchip, autocompdisable, clockdiv, asictimer,
|
||||
// clock, pll, flashing firmware
|
||||
#if defined(MOENCHD)
|
||||
|
||||
201
slsDetectorServers/slsDetectorServer/src/XILINX_PLL.c
Normal file
201
slsDetectorServers/slsDetectorServer/src/XILINX_PLL.c
Normal file
@@ -0,0 +1,201 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "XILINX_PLL.h"
|
||||
#include "arm64.h"
|
||||
#include "clogger.h"
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// https://docs.amd.com/r/en-US/pg065-clk-wiz/Register-Space (simplified, we
|
||||
// leave some things away)
|
||||
|
||||
// clang-format off
|
||||
#define XILINX_PLL_INPUT_FREQ (100000) // 100 MHz
|
||||
#define XILINX_PLL_MIN_FREQ (10000)
|
||||
#define XILINX_PLL_MAX_FREQ (250000)
|
||||
#define XILINX_PLL_MAX_CLK_DIV (256)
|
||||
#define XILINX_PLL_NUM_CLKS (7)
|
||||
#define XILINX_PLL_MAX_NUM_CLKS_FOR_GET (3)
|
||||
#define XILINX_PLL_STEP_SIZE (125)
|
||||
#define XILINX_PLL_HALF_STEP_SIZE (62)
|
||||
|
||||
#define XILINX_PLL_BASE_ADDR (0x0)
|
||||
#define XILINX_PLL_MEASURE_BASE_ADDR0 (0x1000) // added externally, not part of CLKWIZ core for clks 0 and 1
|
||||
#define XILINX_PLL_MEASURE_BASE_ADDR0_MAX_CLKS (2)
|
||||
#define XILINX_PLL_MEASURE_BASE_ADDR1 (0x2000) // for clks 2 to 6
|
||||
#define XILINX_PLL_MEASURE_WIDTH (8) // per clock
|
||||
|
||||
#define XILINX_PLL_RESET_REG (0x000)
|
||||
#define XILINX_PLL_RESET_VAL (0xA)
|
||||
|
||||
#define XILINX_PLL_STATUS_REG (0x004)
|
||||
#define XILINX_PLL_STATUS_LOCKED_OFST (0)
|
||||
#define XILINX_PLL_STATUS_LOCKED_MSK (0x00000001 << XILINX_PLL_STATUS_LOCKED_OFST)
|
||||
|
||||
#define XILINX_PLL_CLKCONFIG_REG (XILINX_PLL_BASE_ADDR + 0x200)
|
||||
#define XILINX_PLL_DIVCLK_DIVIDE_OFST (0)
|
||||
#define XILINX_PLL_DIVCLK_DIVIDE_MSK (0x000000FF << XILINX_PLL_DIVCLK_DIVIDE_OFST)
|
||||
#define XILINX_PLL_CLKFBOUT_MULT_OFST (8)
|
||||
#define XILINX_PLL_CLKFBOUT_MULT_MSK (0x000000FF << XILINX_PLL_CLKFBOUT_MULT_OFST)
|
||||
#define XILINX_PLL_CLKFBOUT_FRAC_OFST (16)
|
||||
#define XILINX_PLL_CLKFBOUT_FRAC_MSK (0x000003FF << XILINX_PLL_CLKFBOUT_FRAC_OFST)
|
||||
// The value from 0 to 875 representing the fractional multiplied by 1000
|
||||
#define XILINX_PLL_CLKFBOUT_FRAC_MAX_VAL (875)
|
||||
|
||||
|
||||
#define XILINX_PLL_CLKCONFIG_BASE_ADDR (XILINX_PLL_BASE_ADDR + 0x208)
|
||||
#define XILINX_PLL_CLKCONFIG_WIDTH (3 * 4) // per clock (7 clocks)
|
||||
|
||||
#define XILINX_PLL_CLK_DIV_REG_OFST (0)
|
||||
#define XILINX_PLL_CLK_DIV_DIVIDE_OFST (0)
|
||||
#define XILINX_PLL_CLK_DIV_DIVIDE_MSK (0x000000FF << XILINX_PLL_CLK_DIV_DIVIDE_OFST)
|
||||
#define XILINX_PLL_CLK_DIV_FRAC_OFST (8) // works on IDX 0 only
|
||||
#define XILINX_PLL_CLK_DIV_FRAC_MSK (0x000003FF << XILINX_PLL_CLK_DIV_FRAC_OFST)
|
||||
|
||||
#define XILINX_PLL_CLK_PHASE_REG_OFST (4) // signed num for +/- phase
|
||||
#define XILINX_PLL_CLK_PHASE_OFST (0)
|
||||
#define XILINX_PLL_CLK_PHASE_MSK (0x0000FFFF << XILINX_PLL_CLK_PHASE_OFST)
|
||||
|
||||
#define XILINX_PLL_CLK_DUTY_REG_OFST (8) // (in %) * 1000
|
||||
#define XILINX_PLL_CLK_DUTY_OFST (0)
|
||||
#define XILINX_PLL_CLK_DUTY_MSK (0x0000FFFF << XILINX_PLL_CLK_DUTY_OFST)
|
||||
|
||||
|
||||
|
||||
#define XILINX_PLL_LOAD_REG (0x25C)
|
||||
#define XILINX_PLL_LOAD_RECONFIGURE_OFST (0) // load and reconfigure state machine
|
||||
#define XILINX_PLL_LOAD_RECONFIGURE_MSK (0x00000001 << XILINX_PLL_LOAD_RECONFIGURE_OFST)
|
||||
#define XILINX_PLL_LOAD_FROM_REGS_OFST (1) // 0 for default values as compiled into firmware
|
||||
#define XILINX_PLL_LOAD_FROM_REGS_MSK (0x00000001 << XILINX_PLL_LOAD_FROM_REGS_OFST)
|
||||
|
||||
// clang-format on
|
||||
|
||||
// freq in kHz !!
|
||||
int XILINX_PLL_setFrequency(uint32_t clk_index, uint32_t freq) {
|
||||
if (clk_index >= XILINX_PLL_NUM_CLKS) {
|
||||
LOG(logERROR, ("XILINX_PLL: Invalid clock index %d\n", clk_index));
|
||||
return 1;
|
||||
}
|
||||
if (freq < XILINX_PLL_MIN_FREQ || freq > XILINX_PLL_MAX_FREQ) {
|
||||
LOG(logERROR, ("XILINX_PLL: Frequency %d kHz is out of range\n", freq));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// calculate base clock frequency
|
||||
uint32_t global_reg = bus_r_csp2(XILINX_PLL_CLKCONFIG_REG);
|
||||
#ifdef VIRTUAL
|
||||
global_reg = 3073;
|
||||
#endif
|
||||
uint32_t clkfbout_mult = ((global_reg & XILINX_PLL_CLKFBOUT_MULT_MSK) >>
|
||||
XILINX_PLL_CLKFBOUT_MULT_OFST);
|
||||
uint32_t clkfbout_frac = ((global_reg & XILINX_PLL_CLKFBOUT_FRAC_MSK) >>
|
||||
XILINX_PLL_CLKFBOUT_FRAC_OFST);
|
||||
uint32_t divclk_divide = ((global_reg & XILINX_PLL_DIVCLK_DIVIDE_MSK) >>
|
||||
XILINX_PLL_DIVCLK_DIVIDE_OFST);
|
||||
uint32_t base_clk_freq = clkfbout_mult * XILINX_PLL_INPUT_FREQ;
|
||||
base_clk_freq += (clkfbout_frac * XILINX_PLL_INPUT_FREQ /
|
||||
XILINX_PLL_CLKFBOUT_FRAC_MAX_VAL);
|
||||
base_clk_freq /= divclk_divide;
|
||||
|
||||
// calcualte clock divider
|
||||
uint32_t clk_div = base_clk_freq / freq;
|
||||
if (clk_div < 1 || clk_div > XILINX_PLL_MAX_CLK_DIV) {
|
||||
LOG(logERROR,
|
||||
("XILINX_PLL: Invalid clock divider, need to change base clock\n"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint32_t clk_div_frac = 0;
|
||||
// the first clock supports fractional division, increase the precision for
|
||||
// that one fractional divide is not allowed in fixed or dynamic phase shift
|
||||
// mode !!!!
|
||||
if (clk_index == 0) {
|
||||
float clk_div_frac_f =
|
||||
(float)base_clk_freq / freq - clk_div; // eg. 2.333 => 0.333
|
||||
clk_div_frac = (uint32_t)round(clk_div_frac_f * 1000); // 0.333 => 333
|
||||
clk_div_frac = ((clk_div_frac + XILINX_PLL_HALF_STEP_SIZE) /
|
||||
XILINX_PLL_STEP_SIZE) *
|
||||
XILINX_PLL_STEP_SIZE; // round to multiples of step size,
|
||||
// 333 = > 375
|
||||
if (clk_div_frac == 1000) {
|
||||
clk_div_frac = 0;
|
||||
clk_div++;
|
||||
}
|
||||
}
|
||||
|
||||
LOG(logINFOBLUE, ("XILINX_PLL: Setting clock divider to %u.%u\n", clk_div,
|
||||
clk_div_frac));
|
||||
uint32_t clk_addr = XILINX_PLL_CLKCONFIG_BASE_ADDR +
|
||||
clk_index * XILINX_PLL_CLKCONFIG_WIDTH +
|
||||
XILINX_PLL_CLK_DIV_REG_OFST;
|
||||
uint32_t clk_config_val = ((clk_div << XILINX_PLL_CLK_DIV_DIVIDE_OFST) &
|
||||
XILINX_PLL_CLK_DIV_DIVIDE_MSK) |
|
||||
((clk_div_frac << XILINX_PLL_CLK_DIV_FRAC_OFST) &
|
||||
XILINX_PLL_CLK_DIV_FRAC_MSK);
|
||||
|
||||
bus_w_csp2(clk_addr, clk_config_val);
|
||||
XILINX_PLL_load();
|
||||
XILINX_PLL_waitForLock();
|
||||
|
||||
// wait for firmware to measure the actual frequency
|
||||
usleep(2 * 1000 * 1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t XILINX_PLL_getFrequency(uint32_t clk_index) {
|
||||
if (clk_index >= XILINX_PLL_NUM_CLKS) {
|
||||
LOG(logERROR, ("XILINX_PLL: Invalid clock index %d\n", clk_index));
|
||||
return -1;
|
||||
}
|
||||
if (clk_index > XILINX_PLL_MAX_NUM_CLKS_FOR_GET) {
|
||||
LOG(logERROR,
|
||||
("XILINX_PLL: get frequency not implemented for this clock %d\n",
|
||||
clk_index));
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint32_t base_addr = XILINX_PLL_MEASURE_BASE_ADDR0;
|
||||
if (clk_index >= XILINX_PLL_MEASURE_BASE_ADDR0_MAX_CLKS) {
|
||||
clk_index -= XILINX_PLL_MEASURE_BASE_ADDR0_MAX_CLKS;
|
||||
base_addr = XILINX_PLL_MEASURE_BASE_ADDR1;
|
||||
}
|
||||
uint32_t addr = base_addr + clk_index * XILINX_PLL_MEASURE_WIDTH;
|
||||
uint32_t counter_val = bus_r_csp2(addr);
|
||||
// Hz => round to nearest kHz
|
||||
uint32_t freq_kHz = (counter_val + 500) / 1000; // round to nearest kHz
|
||||
return freq_kHz;
|
||||
}
|
||||
|
||||
bool XILINX_PLL_isLocked() {
|
||||
uint32_t status = bus_r_csp2(XILINX_PLL_BASE_ADDR + XILINX_PLL_STATUS_REG);
|
||||
return ((status & XILINX_PLL_STATUS_LOCKED_MSK) >>
|
||||
XILINX_PLL_STATUS_LOCKED_OFST);
|
||||
}
|
||||
|
||||
void XILINX_PLL_reset() {
|
||||
bus_w_csp2(XILINX_PLL_BASE_ADDR + XILINX_PLL_RESET_REG,
|
||||
XILINX_PLL_RESET_VAL);
|
||||
}
|
||||
|
||||
void XILINX_PLL_load() {
|
||||
bus_w_csp2(
|
||||
XILINX_PLL_BASE_ADDR + XILINX_PLL_LOAD_REG,
|
||||
(XILINX_PLL_LOAD_RECONFIGURE_MSK | XILINX_PLL_LOAD_FROM_REGS_MSK));
|
||||
}
|
||||
|
||||
void XILINX_PLL_waitForLock() {
|
||||
#ifdef VIRTUAL
|
||||
return;
|
||||
#endif
|
||||
int timeout_us = 10 * 1000;
|
||||
int count = 500;
|
||||
while (count > 0) {
|
||||
usleep(timeout_us);
|
||||
if (XILINX_PLL_isLocked())
|
||||
return;
|
||||
count--;
|
||||
}
|
||||
LOG(logERROR, ("XILINX_PLL: Timeout waiting for PLL to lock (%d ms)\n",
|
||||
(count * timeout_us) / 1000));
|
||||
}
|
||||
@@ -13,11 +13,14 @@
|
||||
/* global variables */
|
||||
#define CSP0 (0xB0080000)
|
||||
#define CSP1 (0xB0050000) // udp
|
||||
#define MEM_SIZE_CSP0 (0x10000)
|
||||
#define CSP2 (0xA0000000)
|
||||
#define MEM_SIZE_CSP0 (0x20000)
|
||||
#define MEM_SIZE_CSP1 (0x2000) // smaller size for udp
|
||||
#define MEM_SIZE_CSP2 (0x4000)
|
||||
|
||||
u_int32_t *csp0base = 0;
|
||||
u_int32_t *csp1base = 0;
|
||||
u_int32_t *csp2base = 0;
|
||||
|
||||
void bus_w(u_int32_t offset, u_int32_t data) {
|
||||
volatile u_int32_t *ptr1;
|
||||
@@ -31,6 +34,18 @@ u_int32_t bus_r(u_int32_t offset) {
|
||||
return *ptr1;
|
||||
}
|
||||
|
||||
void bus_w_csp2(u_int32_t offset, u_int32_t data) {
|
||||
volatile u_int32_t *ptr1;
|
||||
ptr1 = (u_int32_t *)(csp2base + offset / (sizeof(u_int32_t)));
|
||||
*ptr1 = data;
|
||||
}
|
||||
|
||||
u_int32_t bus_r_csp2(u_int32_t offset) {
|
||||
volatile u_int32_t *ptr1;
|
||||
ptr1 = (u_int32_t *)(csp2base + offset / (sizeof(u_int32_t)));
|
||||
return *ptr1;
|
||||
}
|
||||
|
||||
uint64_t getU64BitReg(int aLSB, int aMSB) {
|
||||
uint64_t retval = bus_r(aMSB);
|
||||
retval = (retval << 32) | bus_r(aLSB);
|
||||
@@ -51,12 +66,12 @@ u_int32_t writeRegister(u_int32_t offset, u_int32_t data) {
|
||||
|
||||
int mapCSP0(void) {
|
||||
LOG(logINFO, ("Mapping memory\n"));
|
||||
u_int32_t csps[2] = {CSP0, CSP1};
|
||||
u_int32_t **cspbases[2] = {&csp0base, &csp1base};
|
||||
u_int32_t memsize[2] = {MEM_SIZE_CSP0, MEM_SIZE_CSP1};
|
||||
char names[2][10] = {"csp0base", "csp1base"};
|
||||
u_int32_t csps[3] = {CSP0, CSP1, CSP2};
|
||||
u_int32_t **cspbases[3] = {&csp0base, &csp1base, &csp2base};
|
||||
u_int32_t memsize[3] = {MEM_SIZE_CSP0, MEM_SIZE_CSP1, MEM_SIZE_CSP2};
|
||||
char names[3][10] = {"csp0base", "csp1base", "csp2base"};
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
// if not mapped
|
||||
if (*cspbases[i] == 0) {
|
||||
LOG(logINFO, ("\tMapping memory for %s\n", names[i]));
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
extern enum TLogLevel trimmingPrint;
|
||||
extern uint32_t clkDivider[];
|
||||
#endif
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
extern uint32_t clkFrequency[];
|
||||
#endif
|
||||
|
||||
@@ -54,27 +54,12 @@ void initializePatternWord() {
|
||||
memset(virtual_pattern, 0, sizeof(virtual_pattern));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
uint64_t validate_readPatternIOControl() {
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
return getU64BitReg(PATTERN_IO_CNTRL_LSB_REG, PATTERN_IO_CNTRL_MSB_REG);
|
||||
#elif defined(XILINX_CHIPTESTBOARDD)
|
||||
return (uint64_t)(bus_r(PINIOCTRLREG));
|
||||
#endif
|
||||
}
|
||||
|
||||
int validate_writePatternIOControl(char *message, uint64_t arg) {
|
||||
// validate input
|
||||
#ifdef XILINX_CHIPTESTBOARDD
|
||||
if (arg > BIT32_MSK) {
|
||||
strcpy(message, "Could not set pattern IO Control. Must be 32 bit for "
|
||||
"this detector\n");
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
writePatternIOControl(arg);
|
||||
|
||||
@@ -95,15 +80,9 @@ int validate_writePatternIOControl(char *message, uint64_t arg) {
|
||||
}
|
||||
|
||||
void writePatternIOControl(uint64_t word) {
|
||||
#ifdef CHIPTESTBOARDD
|
||||
LOG(logINFO,
|
||||
("Setting Pattern I/O Control: 0x%llx\n", (long long int)word));
|
||||
setU64BitReg(word, PATTERN_IO_CNTRL_LSB_REG, PATTERN_IO_CNTRL_MSB_REG);
|
||||
#elif defined(XILINX_CHIPTESTBOARDD)
|
||||
uint32_t val = (uint32_t)word;
|
||||
LOG(logINFO, ("Setting Pattern I/O Control: 0x%x\n", val));
|
||||
bus_w(PINIOCTRLREG, val);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -122,7 +101,7 @@ int validate_readPatternWord(char *message, int addr, uint64_t *word) {
|
||||
}
|
||||
|
||||
uint64_t readPatternWord(int addr) {
|
||||
#ifdef MYTHEN3D
|
||||
#if defined(MYTHEN3D) || defined(XILINX_CHIPTESTBOARDD)
|
||||
LOG(logDEBUG1, (" Reading Pattern Word (addr:0x%x)\n", addr));
|
||||
// the first word in RAM as base plus the offset of the word to write (addr)
|
||||
uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2;
|
||||
@@ -182,7 +161,7 @@ void writePatternWord(int addr, uint64_t word) {
|
||||
LOG(logDEBUG1, ("Setting Pattern Word (addr:0x%x, word:0x%llx)\n", addr,
|
||||
(long long int)word));
|
||||
|
||||
#ifndef MYTHEN3D
|
||||
#ifdef CHIPTESTBOARDD
|
||||
uint32_t reg = PATTERN_CNTRL_REG;
|
||||
|
||||
// write word
|
||||
@@ -199,7 +178,6 @@ void writePatternWord(int addr, uint64_t word) {
|
||||
#ifdef VIRTUAL
|
||||
virtual_pattern[addr] = word;
|
||||
#endif
|
||||
// mythen
|
||||
#else
|
||||
// the first word in RAM as base plus the offset of the word to write (addr)
|
||||
uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + addr * REG_OFFSET * 2;
|
||||
@@ -223,29 +201,15 @@ int validate_getPatternWaitAddresses(char *message, int level, int *addr) {
|
||||
}
|
||||
|
||||
int getPatternWaitAddress(int level) {
|
||||
switch (level) {
|
||||
case 0:
|
||||
return ((bus_r(PATTERN_WAIT_0_ADDR_REG) & PATTERN_WAIT_0_ADDR_MSK) >>
|
||||
PATTERN_WAIT_0_ADDR_OFST);
|
||||
case 1:
|
||||
return ((bus_r(PATTERN_WAIT_1_ADDR_REG) & PATTERN_WAIT_1_ADDR_MSK) >>
|
||||
PATTERN_WAIT_1_ADDR_OFST);
|
||||
case 2:
|
||||
return ((bus_r(PATTERN_WAIT_2_ADDR_REG) & PATTERN_WAIT_2_ADDR_MSK) >>
|
||||
PATTERN_WAIT_2_ADDR_OFST);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return ((bus_r(PATTERN_WAIT_3_ADDR_REG) & PATTERN_WAIT_3_ADDR_MSK) >>
|
||||
PATTERN_WAIT_3_ADDR_OFST);
|
||||
case 4:
|
||||
return ((bus_r(PATTERN_WAIT_4_ADDR_REG) & PATTERN_WAIT_4_ADDR_MSK) >>
|
||||
PATTERN_WAIT_4_ADDR_OFST);
|
||||
case 5:
|
||||
return ((bus_r(PATTERN_WAIT_5_ADDR_REG) & PATTERN_WAIT_5_ADDR_MSK) >>
|
||||
PATTERN_WAIT_5_ADDR_OFST);
|
||||
#endif
|
||||
default:
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return -1;
|
||||
} else {
|
||||
return ((bus_r(PATTERN_LOOPDEF_BASE +
|
||||
(PATTERN_WAIT_ADDR_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET) &
|
||||
PATTERN_WAIT_ADDR_MSK) >>
|
||||
PATTERN_WAIT_ADDR_OFST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,35 +253,13 @@ void setPatternWaitAddress(int level, int addr) {
|
||||
LOG(logINFO,
|
||||
#endif
|
||||
("Setting Pattern Wait Address (level:%d, addr:0x%x)\n", level, addr));
|
||||
switch (level) {
|
||||
case 0:
|
||||
bus_w(PATTERN_WAIT_0_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_0_ADDR_OFST) & PATTERN_WAIT_0_ADDR_MSK));
|
||||
break;
|
||||
case 1:
|
||||
bus_w(PATTERN_WAIT_1_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_1_ADDR_OFST) & PATTERN_WAIT_1_ADDR_MSK));
|
||||
break;
|
||||
case 2:
|
||||
bus_w(PATTERN_WAIT_2_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_2_ADDR_OFST) & PATTERN_WAIT_2_ADDR_MSK));
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
bus_w(PATTERN_WAIT_3_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_3_ADDR_OFST) & PATTERN_WAIT_3_ADDR_MSK));
|
||||
break;
|
||||
case 4:
|
||||
bus_w(PATTERN_WAIT_4_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_4_ADDR_OFST) & PATTERN_WAIT_4_ADDR_MSK));
|
||||
break;
|
||||
case 5:
|
||||
bus_w(PATTERN_WAIT_5_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_5_ADDR_OFST) & PATTERN_WAIT_5_ADDR_MSK));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return;
|
||||
} else {
|
||||
bus_w(PATTERN_LOOPDEF_BASE + (PATTERN_WAIT_ADDR_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET,
|
||||
((addr << PATTERN_WAIT_ADDR_OFST) & PATTERN_WAIT_ADDR_MSK));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,39 +282,24 @@ int validate_getPatternWaitClocksAndInterval(char *message, int level,
|
||||
}
|
||||
|
||||
uint64_t getPatternWaitClocks(int level) {
|
||||
switch (level) {
|
||||
case 0:
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_0_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_0_MSB_REG);
|
||||
case 1:
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_1_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_1_MSB_REG);
|
||||
case 2:
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
case 4:
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
case 5:
|
||||
return getU64BitReg(PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
#endif
|
||||
default:
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return -1;
|
||||
} else {
|
||||
return getU64BitReg(
|
||||
PATTERN_LOOPDEF_BASE + (PATTERN_WAIT_TIMER_LSB_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET,
|
||||
PATTERN_LOOPDEF_BASE + (PATTERN_WAIT_TIMER_MSB_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t getPatternWaitInterval(int level) {
|
||||
uint64_t numClocks = getPatternWaitClocks(level);
|
||||
int runclk = 0;
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
runclk = clkFrequency[RUN_CLK];
|
||||
#elif XILINX_CHIPTESTBOARDD
|
||||
runclk = RUN_CLK;
|
||||
#elif MYTHEN3D
|
||||
runclk = clkDivider[SYSTEM_C0];
|
||||
#endif
|
||||
@@ -380,7 +307,7 @@ uint64_t getPatternWaitInterval(int level) {
|
||||
LOG(logERROR, ("runclk is 0. Cannot divide by 0. Returning -1.\n"));
|
||||
return -1;
|
||||
}
|
||||
return numClocks / (1E-3 * runclk);
|
||||
return numClocks / (NS_TO_CLK_CYCLE * runclk);
|
||||
}
|
||||
|
||||
int validate_setPatternWaitClocksAndInterval(char *message, int level,
|
||||
@@ -425,35 +352,18 @@ void setPatternWaitClocks(int level, uint64_t t) {
|
||||
#endif
|
||||
("Setting Pattern Wait Time in clocks (level:%d) :%lld\n", level,
|
||||
(long long int)t));
|
||||
switch (level) {
|
||||
case 0:
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_0_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_0_MSB_REG);
|
||||
break;
|
||||
case 1:
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_1_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_1_MSB_REG);
|
||||
break;
|
||||
case 2:
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
break;
|
||||
case 4:
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
break;
|
||||
case 5:
|
||||
setU64BitReg(t, PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return;
|
||||
} else {
|
||||
return setU64BitReg(
|
||||
t,
|
||||
PATTERN_LOOPDEF_BASE + (PATTERN_WAIT_TIMER_LSB_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET,
|
||||
PATTERN_LOOPDEF_BASE + (PATTERN_WAIT_TIMER_MSB_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,14 +376,12 @@ void setPatternWaitInterval(int level, uint64_t t) {
|
||||
("Setting Pattern Wait Time (level:%d) :%lld ns\n", level,
|
||||
(long long int)t));
|
||||
int runclk = 0;
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
runclk = clkFrequency[RUN_CLK];
|
||||
#elif XILINX_CHIPTESTBOARDD
|
||||
runclk = RUN_CLK;
|
||||
#elif MYTHEN3D
|
||||
runclk = clkDivider[SYSTEM_C0];
|
||||
runclk = clkDivider[SYSTEM_C0];
|
||||
#endif
|
||||
uint64_t numClocks = t * (1E-3 * runclk);
|
||||
uint64_t numClocks = t * (NS_TO_CLK_CYCLE * runclk);
|
||||
setPatternWaitClocks(level, numClocks);
|
||||
}
|
||||
|
||||
@@ -491,23 +399,13 @@ int validate_getPatternLoopCycles(char *message, int level, int *numLoops) {
|
||||
}
|
||||
|
||||
int getPatternLoopCycles(int level) {
|
||||
switch (level) {
|
||||
case 0:
|
||||
return bus_r(PATTERN_LOOP_0_ITERATION_REG);
|
||||
case 1:
|
||||
return bus_r(PATTERN_LOOP_1_ITERATION_REG);
|
||||
case 2:
|
||||
return bus_r(PATTERN_LOOP_2_ITERATION_REG);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return bus_r(PATTERN_LOOP_3_ITERATION_REG);
|
||||
case 4:
|
||||
return bus_r(PATTERN_LOOP_4_ITERATION_REG);
|
||||
case 5:
|
||||
return bus_r(PATTERN_LOOP_5_ITERATION_REG);
|
||||
#endif
|
||||
default:
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return -1;
|
||||
} else {
|
||||
return bus_r(PATTERN_LOOPDEF_BASE +
|
||||
(PATTERN_LOOP_ITERATION_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,29 +444,13 @@ void setPatternLoopCycles(int level, int nLoop) {
|
||||
LOG(logINFO,
|
||||
#endif
|
||||
("Setting Pattern Loop Cycles(level:%d, nLoop:%d)\n", level, nLoop));
|
||||
switch (level) {
|
||||
case 0:
|
||||
bus_w(PATTERN_LOOP_0_ITERATION_REG, nLoop);
|
||||
break;
|
||||
case 1:
|
||||
bus_w(PATTERN_LOOP_1_ITERATION_REG, nLoop);
|
||||
break;
|
||||
case 2:
|
||||
bus_w(PATTERN_LOOP_2_ITERATION_REG, nLoop);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
bus_w(PATTERN_LOOP_3_ITERATION_REG, nLoop);
|
||||
break;
|
||||
case 4:
|
||||
bus_w(PATTERN_LOOP_4_ITERATION_REG, nLoop);
|
||||
break;
|
||||
case 5:
|
||||
bus_w(PATTERN_LOOP_5_ITERATION_REG, nLoop);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return;
|
||||
} else {
|
||||
bus_w(PATTERN_LOOPDEF_BASE + (PATTERN_LOOP_ITERATION_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET,
|
||||
nLoop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,59 +521,22 @@ int validate_getPatternLoopAddresses(char *message, int level, int *startAddr,
|
||||
}
|
||||
|
||||
void getPatternLoopAddresses(int level, int *startAddr, int *stopAddr) {
|
||||
switch (level) {
|
||||
case 0:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_0_ADDR_REG) & PATTERN_LOOP_0_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_0_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_0_ADDR_REG) & PATTERN_LOOP_0_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_0_ADDR_STP_OFST);
|
||||
break;
|
||||
case 1:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_1_ADDR_REG) & PATTERN_LOOP_1_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_1_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_1_ADDR_REG) & PATTERN_LOOP_1_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_1_ADDR_STP_OFST);
|
||||
break;
|
||||
case 2:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_2_ADDR_REG) & PATTERN_LOOP_2_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_2_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_2_ADDR_REG) & PATTERN_LOOP_2_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_2_ADDR_STP_OFST);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_3_ADDR_REG) & PATTERN_LOOP_3_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_3_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_3_ADDR_REG) & PATTERN_LOOP_3_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_3_ADDR_STP_OFST);
|
||||
break;
|
||||
case 4:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_4_ADDR_REG) & PATTERN_LOOP_4_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_4_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_4_ADDR_REG) & PATTERN_LOOP_4_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_4_ADDR_STP_OFST);
|
||||
break;
|
||||
case 5:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_5_ADDR_REG) & PATTERN_LOOP_5_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_5_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_5_ADDR_REG) & PATTERN_LOOP_5_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_5_ADDR_STP_OFST);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
*startAddr = -1;
|
||||
*stopAddr = -1;
|
||||
} else {
|
||||
*startAddr = ((bus_r(PATTERN_LOOPDEF_BASE +
|
||||
(PATTERN_LOOP_ADDR_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET) &
|
||||
PATTERN_LOOP_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_ADDR_STRT_OFST);
|
||||
*stopAddr = ((bus_r(PATTERN_LOOPDEF_BASE +
|
||||
(PATTERN_LOOP_ADDR_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET) &
|
||||
PATTERN_LOOP_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_ADDR_STP_OFST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -747,53 +592,16 @@ void setPatternLoopAddresses(int level, int startAddr, int stopAddr) {
|
||||
("Setting Pattern Loop Address (level:%d, startaddr:0x%x, "
|
||||
"stopaddr:0x%x)\n",
|
||||
level, startAddr, stopAddr));
|
||||
switch (level) {
|
||||
case 0:
|
||||
bus_w(PATTERN_LOOP_0_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_0_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_0_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_0_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_0_ADDR_STP_MSK));
|
||||
break;
|
||||
case 1:
|
||||
bus_w(PATTERN_LOOP_1_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_1_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_1_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_1_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_1_ADDR_STP_MSK));
|
||||
break;
|
||||
case 2:
|
||||
bus_w(PATTERN_LOOP_2_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_2_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_2_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_2_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_2_ADDR_STP_MSK));
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
bus_w(PATTERN_LOOP_3_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_3_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_3_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_3_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_3_ADDR_STP_MSK));
|
||||
break;
|
||||
case 4:
|
||||
bus_w(PATTERN_LOOP_4_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_4_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_4_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_4_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_4_ADDR_STP_MSK));
|
||||
break;
|
||||
case 5:
|
||||
bus_w(PATTERN_LOOP_5_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_5_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_5_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_5_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_5_ADDR_STP_MSK));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
return;
|
||||
} else {
|
||||
bus_w(PATTERN_LOOPDEF_BASE + (PATTERN_LOOP_ADDR_WORD_OFST +
|
||||
level * PATTERN_LOOPDEF_NWORDS_OFST) *
|
||||
REG_OFFSET,
|
||||
((startAddr << PATTERN_LOOP_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_ADDR_STP_MSK));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -815,17 +623,43 @@ uint64_t getPatternBitMask() {
|
||||
return getU64BitReg(PATTERN_SET_LSB_REG, PATTERN_SET_MSB_REG);
|
||||
}
|
||||
|
||||
#ifdef MYTHEN3D
|
||||
void startPattern() {
|
||||
LOG(logINFOBLUE, ("Starting Pattern\n"));
|
||||
#ifdef MYTHEN3D
|
||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_PATTERN_MSK);
|
||||
usleep(1);
|
||||
while (bus_r(PAT_STATUS_REG) & PAT_STATUS_RUN_BUSY_MSK) {
|
||||
usleep(1);
|
||||
}
|
||||
#elif CHIPTESTBOARDD
|
||||
// we only want to run the pattern here. No acquisition, no UDP packets
|
||||
|
||||
// disable 10G UDP temporarily
|
||||
// except if the pattern explicitly contains udp trigger points
|
||||
uint32_t conf_reg_tmp = bus_r(CONFIG_REG);
|
||||
if ((bus_r(STREAMING_CTRL_REG) & STREAMING_CTRL_ENA_MSK) == 0) {
|
||||
bus_w(CONFIG_REG, conf_reg_tmp & ~CONFIG_GB10_SND_UDP_MSK);
|
||||
}
|
||||
|
||||
// run the pattern, wait till done
|
||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_ACQSTN_MSK);
|
||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_STRT_ACQSTN_MSK);
|
||||
usleep(1);
|
||||
while (bus_r(STATUS_REG) & STATUS_RN_BSY_MSK) {
|
||||
usleep(1);
|
||||
}
|
||||
|
||||
// go back to original config
|
||||
bus_w(CONFIG_REG, conf_reg_tmp);
|
||||
#elif XILINX_CHIPTESTBOARDD
|
||||
bus_w(FLOW_CONTROL_REG, bus_r(FLOW_CONTROL_REG) | START_F_MSK);
|
||||
usleep(1);
|
||||
while (bus_r(FLOW_CONTROL_REG) & RSM_BUSY_MSK) {
|
||||
usleep(1);
|
||||
}
|
||||
#endif
|
||||
LOG(logINFOBLUE, ("Pattern done\n"));
|
||||
}
|
||||
#endif
|
||||
|
||||
char *getPatternFileName() { return clientPatternfile; }
|
||||
|
||||
|
||||
@@ -5798,7 +5798,7 @@ int set_clock_frequency(int file_des) {
|
||||
return printSocketReadError();
|
||||
LOG(logDEBUG1, ("Setting clock (%d) frequency : %u\n", args[0], args[1]));
|
||||
|
||||
#if !defined(CHIPTESTBOARDD)
|
||||
#if !defined(CHIPTESTBOARDD) && !defined(XILINX_CHIPTESTBOARDD)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
|
||||
@@ -5811,7 +5811,7 @@ int set_clock_frequency(int file_des) {
|
||||
case ADC_CLOCK:
|
||||
c = ADC_CLK;
|
||||
break;
|
||||
#ifdef CHIPTESTBOARDD
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
case DBIT_CLOCK:
|
||||
c = DBIT_CLK;
|
||||
break;
|
||||
@@ -5839,11 +5839,24 @@ int set_clock_frequency(int file_des) {
|
||||
LOG(logINFO, ("Same %s: %d %s\n", modeName, val,
|
||||
myDetectorType == GOTTHARD2 ? "Hz" : "MHz"));
|
||||
} else {
|
||||
setFrequency(c, val);
|
||||
int retval = getFrequency(c);
|
||||
LOG(logDEBUG1, ("retval %s: %d %s\n", modeName, retval,
|
||||
myDetectorType == GOTTHARD2 ? "Hz" : "MHz"));
|
||||
validate(&ret, mess, val, retval, modeName, DEC);
|
||||
int ret = setFrequency(c, val);
|
||||
if (ret == FAIL) {
|
||||
sprintf(mess, "Could not set %s to %d %s\n", modeName, val,
|
||||
myDetectorType == XILINX_CHIPTESTBOARD ? "kHz"
|
||||
: "MHz");
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
int retval = getFrequency(c);
|
||||
LOG(logDEBUG1,
|
||||
("retval %s: %d %s\n", modeName, retval,
|
||||
myDetectorType == XILINX_CHIPTESTBOARD ? "kHz"
|
||||
: "MHz"));
|
||||
#if !defined(XILINX_CHIPTESTBOARDD)
|
||||
// XCTB will give the actual frequency, which is not
|
||||
// 100% identical to the set frequency
|
||||
validate(&ret, mess, val, retval, modeName, DEC);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5861,13 +5874,14 @@ int get_clock_frequency(int file_des) {
|
||||
return printSocketReadError();
|
||||
LOG(logDEBUG1, ("Getting clock (%d) frequency\n", arg));
|
||||
|
||||
#if !defined(CHIPTESTBOARDD) && !defined(GOTTHARD2D) && !defined(MYTHEN3D)
|
||||
#if !defined(CHIPTESTBOARDD) && !defined(GOTTHARD2D) && !defined(MYTHEN3D) && \
|
||||
!defined(XILINX_CHIPTESTBOARDD)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
enum CLKINDEX c = 0;
|
||||
switch (arg) {
|
||||
#if defined(CHIPTESTBOARDD)
|
||||
#if defined(CHIPTESTBOARDD) || defined(XILINX_CHIPTESTBOARDD)
|
||||
case ADC_CLOCK:
|
||||
c = ADC_CLK;
|
||||
break;
|
||||
@@ -5897,8 +5911,11 @@ int get_clock_frequency(int file_des) {
|
||||
LOG(logDEBUG1,
|
||||
("retval %s clock (%d) frequency: %d %s\n", clock_names[c], (int)c,
|
||||
retval,
|
||||
myDetectorType == GOTTHARD2 || myDetectorType == MYTHEN3 ? "Hz"
|
||||
: "MHz"));
|
||||
myDetectorType == XILINX_CHIPTESTBOARD
|
||||
? "kHz"
|
||||
: (myDetectorType == GOTTHARD2 || myDetectorType == MYTHEN3
|
||||
? "Hz"
|
||||
: "MHz")));
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
@@ -7463,7 +7480,8 @@ int start_pattern(int file_des) {
|
||||
memset(mess, 0, sizeof(mess));
|
||||
|
||||
LOG(logDEBUG1, ("Starting Pattern\n"));
|
||||
#ifndef MYTHEN3D
|
||||
#if !defined(MYTHEN3D) && !defined(XILINX_CHIPTESTBOARDD) && \
|
||||
!defined(CHIPTESTBOARDD)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
|
||||
@@ -6,6 +6,7 @@ add_executable(xilinx_ctbDetectorServer_virtual
|
||||
../slsDetectorServer/src/slsDetectorServer_funcs.c
|
||||
../slsDetectorServer/src/communication_funcs.c
|
||||
../slsDetectorServer/src/arm64.c
|
||||
../slsDetectorServer/src/XILINX_PLL.c
|
||||
../slsDetectorServer/src/common.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
../slsDetectorServer/src/loadPattern.c
|
||||
@@ -30,7 +31,9 @@ target_compile_definitions(xilinx_ctbDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_link_libraries(xilinx_ctbDetectorServer_virtual
|
||||
PUBLIC pthread rt m slsProjectCSettings
|
||||
PUBLIC
|
||||
m
|
||||
slsProjectCSettings
|
||||
)
|
||||
|
||||
set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES
|
||||
|
||||
@@ -23,7 +23,7 @@ DESTDIR ?= bin
|
||||
INSTMODE = 0777
|
||||
|
||||
SRCS = slsDetectorFunctionList.c
|
||||
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)arm64.c $(main_src)common.c $(main_src)/sharedMemory.c $(main_src)/loadPattern.c $(md5_dir)md5.c $(main_src)programViaArm.c $(main_src)LTC2620_Driver.c
|
||||
SRCS += $(main_src)slsDetectorServer.c $(main_src)slsDetectorServer_funcs.c $(main_src)communication_funcs.c $(main_src)arm64.c $(main_src)XILINX_PLL.c $(main_src)common.c $(main_src)/sharedMemory.c $(main_src)/loadPattern.c $(md5_dir)md5.c $(main_src)programViaArm.c $(main_src)LTC2620_Driver.c
|
||||
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
|
||||
@@ -2,10 +2,16 @@
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#pragma once
|
||||
|
||||
// clang-format off
|
||||
|
||||
#define REG_OFFSET (4)
|
||||
#define PATTERN_STEP0_MSB_REG (0x10004)
|
||||
#define PATTERN_STEP0_LSB_REG (0x10000)
|
||||
|
||||
#define CTRL_REG (0x8000)
|
||||
|
||||
#define POWER_VIO_OFST (0)
|
||||
#define POWER_VIO_MSK (0x00000001 << POWER_VIO_OFST)
|
||||
#define POWER_VIO_OFST (0)
|
||||
#define POWER_VIO_MSK (0x00000001 << POWER_VIO_OFST)
|
||||
#define POWER_VCC_A_OFST (1)
|
||||
#define POWER_VCC_A_MSK (0x00000001 << POWER_VCC_A_OFST)
|
||||
#define POWER_VCC_B_OFST (2)
|
||||
@@ -17,20 +23,20 @@
|
||||
|
||||
#define STATUS_REG (0x8004)
|
||||
|
||||
#define PATTERN_RUNNING_OFST (0)
|
||||
#define PATTERN_RUNNING_MSK (0x00000001 << PATTERN_RUNNING_OFST)
|
||||
#define RX_BUSY_OFST (1)
|
||||
#define RX_BUSY_MSK (0x00000001 << RX_BUSY_OFST)
|
||||
#define PROCESSING_BUSY_OFST (2)
|
||||
#define PROCESSING_BUSY_MSK (0x00000001 << PROCESSING_BUSY_OFST)
|
||||
#define UDP_GEN_BUSY_OFST (3)
|
||||
#define UDP_GEN_BUSY_MSK (0x00000001 << UDP_GEN_BUSY_OFST)
|
||||
#define NETWORK_BUSY_OFST (4)
|
||||
#define NETWORK_BUSY_MSK (0x00000001 << NETWORK_BUSY_OFST)
|
||||
#define PATTERN_RUNNING_OFST (0)
|
||||
#define PATTERN_RUNNING_MSK (0x00000001 << PATTERN_RUNNING_OFST)
|
||||
#define RX_BUSY_OFST (1)
|
||||
#define RX_BUSY_MSK (0x00000001 << RX_BUSY_OFST)
|
||||
#define PROCESSING_BUSY_OFST (2)
|
||||
#define PROCESSING_BUSY_MSK (0x00000001 << PROCESSING_BUSY_OFST)
|
||||
#define UDP_GEN_BUSY_OFST (3)
|
||||
#define UDP_GEN_BUSY_MSK (0x00000001 << UDP_GEN_BUSY_OFST)
|
||||
#define NETWORK_BUSY_OFST (4)
|
||||
#define NETWORK_BUSY_MSK (0x00000001 << NETWORK_BUSY_OFST)
|
||||
#define WAIT_FOR_TRIGGER_OFST (5)
|
||||
#define WAIT_FOR_TRIGGER_MSK (0x00000001 << WAIT_FOR_TRIGGER_OFST)
|
||||
#define RX_NOT_GOOD_OFST (6)
|
||||
#define RX_NOT_GOOD_MSK (0x00000001 << RX_NOT_GOOD_OFST)
|
||||
#define RX_NOT_GOOD_OFST (6)
|
||||
#define RX_NOT_GOOD_MSK (0x00000001 << RX_NOT_GOOD_OFST)
|
||||
|
||||
#define STATUS_REG2 (0x8008)
|
||||
|
||||
@@ -38,8 +44,8 @@
|
||||
|
||||
#define FPGACOMPDATE_OFST (0)
|
||||
#define FPGACOMPDATE_MSK (0x00ffffff << FPGACOMPDATE_OFST)
|
||||
#define FPGADETTYPE_OFST (24)
|
||||
#define FPGADETTYPE_MSK (0x000000ff << FPGADETTYPE_OFST)
|
||||
#define FPGADETTYPE_OFST (24)
|
||||
#define FPGADETTYPE_MSK (0x000000ff << FPGADETTYPE_OFST)
|
||||
|
||||
#define FPGA_GIT_HEAD (0x8010)
|
||||
|
||||
@@ -50,8 +56,8 @@
|
||||
|
||||
#define APICOMPDATE_OFST (0)
|
||||
#define APICOMPDATE_MSK (0x00ffffff << APICOMPDATE_OFST)
|
||||
#define APIDETTYPE_OFST (24)
|
||||
#define APIDETTYPE_MSK (0x000000ff << APIDETTYPE_OFST)
|
||||
#define APIDETTYPE_OFST (24)
|
||||
#define APIDETTYPE_MSK (0x000000ff << APIDETTYPE_OFST)
|
||||
|
||||
#define A_FIFO_OVERFLOW_STATUS_REG (0x9000)
|
||||
|
||||
@@ -103,23 +109,22 @@
|
||||
|
||||
#define FIFO_TO_GB_CONTROL_REG (0xA000)
|
||||
|
||||
#define ENABLED_CHANNELS_ADC_OFST (0)
|
||||
#define ENABLED_CHANNELS_ADC_MSK (0x000000ff << ENABLED_CHANNELS_ADC_OFST)
|
||||
#define ENABLED_CHANNELS_D_OFST (8)
|
||||
#define ENABLED_CHANNELS_D_MSK (0x00000001 << ENABLED_CHANNELS_D_OFST)
|
||||
#define ENABLED_CHANNELS_X_OFST (9)
|
||||
#define ENABLED_CHANNELS_X_MSK (0x0000000f << ENABLED_CHANNELS_X_OFST)
|
||||
#define RO_MODE_ADC_OFST (13)
|
||||
#define RO_MODE_ADC_MSK (0x00000001 << RO_MODE_ADC_OFST)
|
||||
#define RO_MODE_D_OFST (14)
|
||||
#define RO_MODE_D_MSK (0x00000001 << RO_MODE_D_OFST)
|
||||
#define RO_MODE_X_OFST (15)
|
||||
#define RO_MODE_X_MSK (0x00000001 << RO_MODE_X_OFST)
|
||||
#define ENABLED_CHANNELS_ADC_OFST (0)
|
||||
#define ENABLED_CHANNELS_ADC_MSK (0x000000ff << ENABLED_CHANNELS_ADC_OFST)
|
||||
#define ENABLED_CHANNELS_D_OFST (8)
|
||||
#define ENABLED_CHANNELS_D_MSK (0x00000001 << ENABLED_CHANNELS_D_OFST)
|
||||
#define ENABLED_CHANNELS_X_OFST (9)
|
||||
#define ENABLED_CHANNELS_X_MSK (0x0000000f << ENABLED_CHANNELS_X_OFST)
|
||||
#define RO_MODE_ADC_OFST (13)
|
||||
#define RO_MODE_ADC_MSK (0x00000001 << RO_MODE_ADC_OFST)
|
||||
#define RO_MODE_D_OFST (14)
|
||||
#define RO_MODE_D_MSK (0x00000001 << RO_MODE_D_OFST)
|
||||
#define RO_MODE_X_OFST (15)
|
||||
#define RO_MODE_X_MSK (0x00000001 << RO_MODE_X_OFST)
|
||||
#define COUNT_FRAMES_FROM_UPDATE_OFST (16)
|
||||
#define COUNT_FRAMES_FROM_UPDATE_MSK \
|
||||
(0x00000001 << COUNT_FRAMES_FROM_UPDATE_OFST)
|
||||
#define START_STREAMING_P_OFST (17)
|
||||
#define START_STREAMING_P_MSK (0x00000001 << START_STREAMING_P_OFST)
|
||||
#define COUNT_FRAMES_FROM_UPDATE_MSK (0x00000001 << COUNT_FRAMES_FROM_UPDATE_OFST)
|
||||
#define START_STREAMING_P_OFST (17)
|
||||
#define START_STREAMING_P_MSK (0x00000001 << START_STREAMING_P_OFST)
|
||||
#define STREAM_BUFFER_CLEAR_OFST (18)
|
||||
#define STREAM_BUFFER_CLEAR_MSK (0x00000001 << STREAM_BUFFER_CLEAR_OFST)
|
||||
|
||||
@@ -148,26 +153,26 @@
|
||||
|
||||
#define PKTPACKETLENGTHREG (0xA020)
|
||||
|
||||
#define PACKETLENGTH1G_OFST (0)
|
||||
#define PACKETLENGTH1G_MSK (0x0000ffff << PACKETLENGTH1G_OFST)
|
||||
#define PACKETLENGTH1G_OFST (0)
|
||||
#define PACKETLENGTH1G_MSK (0x0000ffff << PACKETLENGTH1G_OFST)
|
||||
#define PACKETLENGTH10G_OFST (16)
|
||||
#define PACKETLENGTH10G_MSK (0x0000ffff << PACKETLENGTH10G_OFST)
|
||||
|
||||
#define PKTNOPACKETSREG (0xA024)
|
||||
|
||||
#define NOPACKETS1G_OFST (0)
|
||||
#define NOPACKETS1G_MSK (0x0000003f << NOPACKETS1G_OFST)
|
||||
#define NOPACKETS1G_OFST (0)
|
||||
#define NOPACKETS1G_MSK (0x0000003f << NOPACKETS1G_OFST)
|
||||
#define NOPACKETS10G_OFST (16)
|
||||
#define NOPACKETS10G_MSK (0x0000003f << NOPACKETS10G_OFST)
|
||||
|
||||
#define PKTCTRLREG (0xA028)
|
||||
|
||||
#define NOSERVERS_OFST (0)
|
||||
#define NOSERVERS_MSK (0x0000003f << NOSERVERS_OFST)
|
||||
#define NOSERVERS_OFST (0)
|
||||
#define NOSERVERS_MSK (0x0000003f << NOSERVERS_OFST)
|
||||
#define SERVERSTART_OFST (8)
|
||||
#define SERVERSTART_MSK (0x0000001f << SERVERSTART_OFST)
|
||||
#define ETHINTERF_OFST (16)
|
||||
#define ETHINTERF_MSK (0x00000001 << ETHINTERF_OFST)
|
||||
#define ETHINTERF_OFST (16)
|
||||
#define ETHINTERF_MSK (0x00000001 << ETHINTERF_OFST)
|
||||
|
||||
#define PKTCOORDREG1 (0xA02C)
|
||||
|
||||
@@ -181,363 +186,282 @@
|
||||
#define COORDZ_OFST (0)
|
||||
#define COORDZ_MSK (0x0000ffff << COORDZ_OFST)
|
||||
|
||||
#define FLOW_STATUS_REG (0xB000)
|
||||
#define PATTERN_OUT_LSB_REG (0xB000)
|
||||
|
||||
#define RSM_BUSY_OFST (0)
|
||||
#define RSM_BUSY_MSK (0x00000001 << RSM_BUSY_OFST)
|
||||
#define RSM_TRG_WAIT_OFST (3)
|
||||
#define RSM_TRG_WAIT_MSK (0x00000001 << RSM_TRG_WAIT_OFST)
|
||||
#define CSM_BUSY_OFST (17)
|
||||
#define CSM_BUSY_MSK (0x00000001 << CSM_BUSY_OFST)
|
||||
#define PATTERN_OUT_MSB_REG (0xB004)
|
||||
|
||||
#define FLOW_CONTROL_REG (0xB004)
|
||||
#define PATTERN_IN_LSB_REG (0xB008)
|
||||
|
||||
#define START_F_OFST (0)
|
||||
#define START_F_MSK (0x00000001 << START_F_OFST)
|
||||
#define STOP_F_OFST (1)
|
||||
#define STOP_F_MSK (0x00000001 << STOP_F_OFST)
|
||||
#define RST_F_OFST (2)
|
||||
#define RST_F_MSK (0x00000001 << RST_F_OFST)
|
||||
#define SW_TRIGGER_F_OFST (3)
|
||||
#define SW_TRIGGER_F_MSK (0x00000001 << SW_TRIGGER_F_OFST)
|
||||
#define TRIGGER_ENABLE_OFST (4)
|
||||
#define TRIGGER_ENABLE_MSK (0x00000001 << TRIGGER_ENABLE_OFST)
|
||||
#define PATTERN_IN_MSB_REG (0xB00C)
|
||||
|
||||
#define TIME_FROM_START_OUT_REG_1 (0xB008)
|
||||
#define PATTERN_MASK_LSB_REG (0xB010)
|
||||
|
||||
#define TIME_FROM_START_OUT_REG_2 (0xB00C)
|
||||
#define PATTERN_MASK_MSB_REG (0xB014)
|
||||
|
||||
#define FRAMES_FROM_START_OUT_REG_1 (0xB010)
|
||||
#define PATTERN_SET_LSB_REG (0xB018)
|
||||
|
||||
#define FRAMES_FROM_START_OUT_REG_2 (0xB014)
|
||||
#define PATTERN_SET_MSB_REG (0xB01C)
|
||||
|
||||
#define FRAME_TIME_OUT_REG_1 (0xB018)
|
||||
#define PATTERN_CNTRL_REG (0xB020)
|
||||
|
||||
#define FRAME_TIME_OUT_REG_2 (0xB01C)
|
||||
|
||||
#define DELAY_OUT_REG_1 (0xB020)
|
||||
|
||||
#define DELAY_OUT_REG_2 (0xB024)
|
||||
|
||||
#define CYCLES_OUT_REG_1 (0xB028)
|
||||
|
||||
#define CYCLES_OUT_REG_2 (0xB02C)
|
||||
|
||||
#define FRAMES_OUT_REG_1 (0xB030)
|
||||
|
||||
#define FRAMES_OUT_REG_2 (0xB034)
|
||||
|
||||
#define PERIOD_OUT_REG_1 (0xB038)
|
||||
|
||||
#define PERIOD_OUT_REG_2 (0xB03C)
|
||||
|
||||
#define DELAY_IN_REG_1 (0xB040)
|
||||
|
||||
#define DELAY_IN_REG_2 (0xB044)
|
||||
|
||||
#define CYCLES_IN_REG_1 (0xB048)
|
||||
|
||||
#define CYCLES_IN_REG_2 (0xB04C)
|
||||
|
||||
#define FRAMES_IN_REG_1 (0xB050)
|
||||
|
||||
#define FRAMES_IN_REG_2 (0xB054)
|
||||
|
||||
#define PERIOD_IN_REG_1 (0xB058)
|
||||
|
||||
#define PERIOD_IN_REG_2 (0xB05C)
|
||||
|
||||
#define PATTERN_OUT_LSB_REG (0xB100)
|
||||
|
||||
#define PATTERN_OUT_MSB_REG (0xB104)
|
||||
|
||||
#define PATTERN_IN_LSB_REG (0xB108)
|
||||
|
||||
#define PATTERN_IN_MSB_REG (0xB10C)
|
||||
|
||||
#define PATTERN_MASK_LSB_REG (0xB110)
|
||||
|
||||
#define PATTERN_MASK_MSB_REG (0xB114)
|
||||
|
||||
#define PATTERN_SET_LSB_REG (0xB118)
|
||||
|
||||
#define PATTERN_SET_MSB_REG (0xB11C)
|
||||
|
||||
#define PATTERN_CNTRL_REG (0xB120)
|
||||
|
||||
#define PATTERN_CNTRL_WR_OFST (0)
|
||||
#define PATTERN_CNTRL_WR_MSK (0x00000001 << PATTERN_CNTRL_WR_OFST)
|
||||
#define PATTERN_CNTRL_RD_OFST (1)
|
||||
#define PATTERN_CNTRL_RD_MSK (0x00000001 << PATTERN_CNTRL_RD_OFST)
|
||||
#define PATTERN_CNTRL_WR_OFST (0)
|
||||
#define PATTERN_CNTRL_WR_MSK (0x00000001 << PATTERN_CNTRL_WR_OFST)
|
||||
#define PATTERN_CNTRL_RD_OFST (1)
|
||||
#define PATTERN_CNTRL_RD_MSK (0x00000001 << PATTERN_CNTRL_RD_OFST)
|
||||
#define PATTERN_CNTRL_ADDR_OFST (16)
|
||||
#define PATTERN_CNTRL_ADDR_MSK (0x00001fff << PATTERN_CNTRL_ADDR_OFST)
|
||||
|
||||
#define PATTERN_LIMIT_REG (0xB124)
|
||||
#define PATTERN_LIMIT_REG (0xB024)
|
||||
|
||||
#define PATTERN_LIMIT_STRT_OFST (0)
|
||||
#define PATTERN_LIMIT_STRT_MSK (0x00001fff << PATTERN_LIMIT_STRT_OFST)
|
||||
#define PATTERN_LIMIT_STP_OFST (16)
|
||||
#define PATTERN_LIMIT_STP_MSK (0x00001fff << PATTERN_LIMIT_STP_OFST)
|
||||
#define PATTERN_LIMIT_STP_OFST (16)
|
||||
#define PATTERN_LIMIT_STP_MSK (0x00001fff << PATTERN_LIMIT_STP_OFST)
|
||||
|
||||
#define PATTERN_LOOP_0_ADDR_REG (0xB128)
|
||||
#define PATTERN_IO_CNTRL_LSB_REG (0xB028)
|
||||
|
||||
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_0_ADDR_STRT_MSK \
|
||||
(0x00001fff << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_0_ADDR_STP_OFST)
|
||||
#define PATTERN_IO_CNTRL_MSB_REG (0xB02C)
|
||||
|
||||
#define PATTERN_LOOP_0_ITERATION_REG (0xB12C)
|
||||
#define FLOW_CONTROL_REG (0xB030)
|
||||
|
||||
#define PATTERN_WAIT_0_ADDR_REG (0xB130)
|
||||
#define START_F_OFST (0)
|
||||
#define START_F_MSK (0x00000001 << START_F_OFST)
|
||||
#define STOP_F_OFST (1)
|
||||
#define STOP_F_MSK (0x00000001 << STOP_F_OFST)
|
||||
#define RST_F_OFST (2)
|
||||
#define RST_F_MSK (0x00000001 << RST_F_OFST)
|
||||
#define SW_TRIGGER_F_OFST (3)
|
||||
#define SW_TRIGGER_F_MSK (0x00000001 << SW_TRIGGER_F_OFST)
|
||||
#define TRIGGER_ENABLE_OFST (4)
|
||||
#define TRIGGER_ENABLE_MSK (0x00000001 << TRIGGER_ENABLE_OFST)
|
||||
#define RSM_BUSY_OFST (5)
|
||||
#define RSM_BUSY_MSK (0x00000001 << RSM_BUSY_OFST)
|
||||
#define RSM_TRG_WAIT_OFST (6)
|
||||
#define RSM_TRG_WAIT_MSK (0x00000001 << RSM_TRG_WAIT_OFST)
|
||||
#define CSM_BUSY_OFST (7)
|
||||
#define CSM_BUSY_MSK (0x00000001 << CSM_BUSY_OFST)
|
||||
|
||||
#define PATTERN_WAIT_0_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_0_ADDR_MSK (0x00001fff << PATTERN_WAIT_0_ADDR_OFST)
|
||||
#define DELAY_IN_REG_1 (0xB034)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_0_LSB_REG (0xB134)
|
||||
#define DELAY_IN_REG_2 (0xB038)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_0_MSB_REG (0xB138)
|
||||
#define CYCLES_IN_REG_1 (0xB03C)
|
||||
|
||||
#define PATTERN_LOOP_1_ADDR_REG (0xB13C)
|
||||
#define CYCLES_IN_REG_2 (0xB040)
|
||||
|
||||
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_1_ADDR_STRT_MSK \
|
||||
(0x00001fff << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_1_ADDR_STP_OFST)
|
||||
#define FRAMES_IN_REG_1 (0xB044)
|
||||
|
||||
#define PATTERN_LOOP_1_ITERATION_REG (0xB140)
|
||||
#define FRAMES_IN_REG_2 (0xB048)
|
||||
|
||||
#define PATTERN_WAIT_1_ADDR_REG (0xB144)
|
||||
#define PERIOD_IN_REG_1 (0xB04C)
|
||||
|
||||
#define PATTERN_WAIT_1_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_1_ADDR_MSK (0x00001fff << PATTERN_WAIT_1_ADDR_OFST)
|
||||
#define PERIOD_IN_REG_2 (0xB050)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_1_LSB_REG (0xB148)
|
||||
#define PATTERN_TEST_REG (0xB054)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_1_MSB_REG (0xB14C)
|
||||
#define PATTERN_FIRMWARE_REG (0xB058)
|
||||
|
||||
#define PATTERN_LOOP_2_ADDR_REG (0xB150)
|
||||
#define PATTERN_WIDTH_OFST (0)
|
||||
#define PATTERN_WIDTH_MSK (0x000000ff << PATTERN_WIDTH_OFST)
|
||||
#define PATTERN_ADDR_WIDTH_OFST (8)
|
||||
#define PATTERN_ADDR_WIDTH_MSK (0x000000ff << PATTERN_ADDR_WIDTH_OFST)
|
||||
#define PATTERN_NLOOPS_NWAITS_OFST (16)
|
||||
#define PATTERN_NLOOPS_NWAITS_MSK (0x000000ff << PATTERN_NLOOPS_NWAITS_OFST)
|
||||
#define DIRECT_PATTERN_RAM_OFST (24)
|
||||
#define DIRECT_PATTERN_RAM_MSK (0x00000001 << DIRECT_PATTERN_RAM_OFST)
|
||||
|
||||
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_2_ADDR_STRT_MSK \
|
||||
(0x00001fff << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_2_ADDR_STP_OFST)
|
||||
#define TIME_FROM_START_OUT_REG_1 (0xB05C)
|
||||
|
||||
#define PATTERN_LOOP_2_ITERATION_REG (0xB154)
|
||||
#define TIME_FROM_START_OUT_REG_2 (0xB060)
|
||||
|
||||
#define PATTERN_WAIT_2_ADDR_REG (0xB158)
|
||||
#define FRAMES_FROM_START_OUT_REG_1 (0xB064)
|
||||
|
||||
#define PATTERN_WAIT_2_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_2_ADDR_MSK (0x00001fff << PATTERN_WAIT_2_ADDR_OFST)
|
||||
#define FRAMES_FROM_START_OUT_REG_2 (0xB068)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_2_LSB_REG (0xB15C)
|
||||
#define FRAME_TIME_OUT_REG_1 (0xB06C)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_2_MSB_REG (0xB160)
|
||||
#define FRAME_TIME_OUT_REG_2 (0xB070)
|
||||
|
||||
#define PATTERN_LOOP_3_ADDR_REG (0xB164)
|
||||
#define PATTERN_LOOPDEF_BASE (0xB080)
|
||||
|
||||
#define PATTERN_LOOP_3_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_3_ADDR_STRT_MSK \
|
||||
(0x00001fff << PATTERN_LOOP_3_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_3_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_3_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_3_ADDR_STP_OFST)
|
||||
#define PATTERN_LOOP_ADDR_WORD_OFST (0)
|
||||
#define PATTERN_LOOP_ADDR_WORD_MSK (0x00000001 << PATTERN_LOOP_ADDR_WORD_OFST)
|
||||
#define PATTERN_LOOP_ITERATION_WORD_OFST (1)
|
||||
#define PATTERN_LOOP_ITERATION_WORD_MSK (0x00000001 << PATTERN_LOOP_ITERATION_WORD_OFST)
|
||||
#define PATTERN_WAIT_ADDR_WORD_OFST (2)
|
||||
#define PATTERN_WAIT_ADDR_WORD_MSK (0x00000001 << PATTERN_WAIT_ADDR_WORD_OFST)
|
||||
#define PATTERN_WAIT_TIMER_LSB_WORD_OFST (3)
|
||||
#define PATTERN_WAIT_TIMER_LSB_WORD_MSK (0x00000001 << PATTERN_WAIT_TIMER_LSB_WORD_OFST)
|
||||
#define PATTERN_WAIT_TIMER_MSB_WORD_OFST (4)
|
||||
#define PATTERN_WAIT_TIMER_MSB_WORD_MSK (0x00000001 << PATTERN_WAIT_TIMER_MSB_WORD_OFST)
|
||||
#define PATTERN_LOOPDEF_NWORDS_OFST (5)
|
||||
#define PATTERN_LOOPDEF_NWORDS_MSK (0x00000001 << PATTERN_LOOPDEF_NWORDS_OFST)
|
||||
#define PATTERN_WAIT_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_ADDR_MSK (0x00001fff << PATTERN_WAIT_ADDR_OFST)
|
||||
#define PATTERN_LOOP_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_ADDR_STRT_MSK (0x00001fff << PATTERN_LOOP_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_ADDR_STP_OFST)
|
||||
|
||||
#define PATTERN_LOOP_3_ITERATION_REG (0xB168)
|
||||
#define DBITFIFOCTRLREG (0xC000)
|
||||
|
||||
#define PATTERN_WAIT_3_ADDR_REG (0xB16C)
|
||||
|
||||
#define PATTERN_WAIT_3_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_3_ADDR_MSK (0x00001fff << PATTERN_WAIT_3_ADDR_OFST)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_3_LSB_REG (0xB170)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_3_MSB_REG (0xB174)
|
||||
|
||||
#define PATTERN_LOOP_4_ADDR_REG (0xB178)
|
||||
|
||||
#define PATTERN_LOOP_4_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_4_ADDR_STRT_MSK \
|
||||
(0x00001fff << PATTERN_LOOP_4_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_4_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_4_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_4_ADDR_STP_OFST)
|
||||
|
||||
#define PATTERN_LOOP_4_ITERATION_REG (0xB17C)
|
||||
|
||||
#define PATTERN_WAIT_4_ADDR_REG (0xB180)
|
||||
|
||||
#define PATTERN_WAIT_4_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_4_ADDR_MSK (0x00001fff << PATTERN_WAIT_4_ADDR_OFST)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_4_LSB_REG (0xB184)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_4_MSB_REG (0xB188)
|
||||
|
||||
#define PATTERN_LOOP_5_ADDR_REG (0xB18C)
|
||||
|
||||
#define PATTERN_LOOP_5_ADDR_STRT_OFST (0)
|
||||
#define PATTERN_LOOP_5_ADDR_STRT_MSK \
|
||||
(0x00001fff << PATTERN_LOOP_5_ADDR_STRT_OFST)
|
||||
#define PATTERN_LOOP_5_ADDR_STP_OFST (16)
|
||||
#define PATTERN_LOOP_5_ADDR_STP_MSK (0x00001fff << PATTERN_LOOP_5_ADDR_STP_OFST)
|
||||
|
||||
#define PATTERN_LOOP_5_ITERATION_REG (0xB190)
|
||||
|
||||
#define PATTERN_WAIT_5_ADDR_REG (0xB194)
|
||||
|
||||
#define PATTERN_WAIT_5_ADDR_OFST (0)
|
||||
#define PATTERN_WAIT_5_ADDR_MSK (0x00001fff << PATTERN_WAIT_5_ADDR_OFST)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_5_LSB_REG (0xB198)
|
||||
|
||||
#define PATTERN_WAIT_TIMER_5_MSB_REG (0xB19C)
|
||||
|
||||
#define PINIOCTRLREG (0xB1A0)
|
||||
|
||||
#define DBITFIFOCTRLREG (0xB1A4)
|
||||
|
||||
#define DBITRD_OFST (0)
|
||||
#define DBITRD_MSK (0x00000001 << DBITRD_OFST)
|
||||
#define DBITRST_OFST (1)
|
||||
#define DBITRST_MSK (0x00000001 << DBITRST_OFST)
|
||||
#define DBITFULL_OFST (2)
|
||||
#define DBITFULL_MSK (0x00000001 << DBITFULL_OFST)
|
||||
#define DBITEMPTY_OFST (3)
|
||||
#define DBITEMPTY_MSK (0x00000001 << DBITEMPTY_OFST)
|
||||
#define DBITRD_OFST (0)
|
||||
#define DBITRD_MSK (0x00000001 << DBITRD_OFST)
|
||||
#define DBITRST_OFST (1)
|
||||
#define DBITRST_MSK (0x00000001 << DBITRST_OFST)
|
||||
#define DBITFULL_OFST (2)
|
||||
#define DBITFULL_MSK (0x00000001 << DBITFULL_OFST)
|
||||
#define DBITEMPTY_OFST (3)
|
||||
#define DBITEMPTY_MSK (0x00000001 << DBITEMPTY_OFST)
|
||||
#define DBITUNDERFLOW_OFST (4)
|
||||
#define DBITUNDERFLOW_MSK (0x00000001 << DBITUNDERFLOW_OFST)
|
||||
#define DBITOVERFLOW_OFST (5)
|
||||
#define DBITOVERFLOW_MSK (0x00000001 << DBITOVERFLOW_OFST)
|
||||
#define DBITOVERFLOW_OFST (5)
|
||||
#define DBITOVERFLOW_MSK (0x00000001 << DBITOVERFLOW_OFST)
|
||||
|
||||
#define DBITFIFODATAREG1 (0xB1A8)
|
||||
#define DBITFIFODATAREG1 (0xC004)
|
||||
|
||||
#define DBITFIFODATAREG2 (0xB1AC)
|
||||
#define DBITFIFODATAREG2 (0xC008)
|
||||
|
||||
#define MATTERHORNSPIREG1 (0xB1B0)
|
||||
#define MATTERHORNSPIREG1 (0xC00C)
|
||||
|
||||
#define MATTERHORNSPIREG2 (0xB1B4)
|
||||
#define MATTERHORNSPIREG2 (0xC010)
|
||||
|
||||
#define MATTERHORNSPICTRL (0xB1B8)
|
||||
#define MATTERHORNSPICTRL (0xC014)
|
||||
|
||||
#define CONFIGSTART_P_OFST (0)
|
||||
#define CONFIGSTART_P_MSK (0x00000001 << CONFIGSTART_P_OFST)
|
||||
#define PERIPHERYRST_P_OFST (1)
|
||||
#define PERIPHERYRST_P_MSK (0x00000001 << PERIPHERYRST_P_OFST)
|
||||
#define STARTREAD_P_OFST (2)
|
||||
#define STARTREAD_P_MSK (0x00000001 << STARTREAD_P_OFST)
|
||||
#define BUSY_OFST (3)
|
||||
#define BUSY_MSK (0x00000001 << BUSY_OFST)
|
||||
#define CONFIGSTART_P_OFST (0)
|
||||
#define CONFIGSTART_P_MSK (0x00000001 << CONFIGSTART_P_OFST)
|
||||
#define PERIPHERYRST_P_OFST (1)
|
||||
#define PERIPHERYRST_P_MSK (0x00000001 << PERIPHERYRST_P_OFST)
|
||||
#define STARTREAD_P_OFST (2)
|
||||
#define STARTREAD_P_MSK (0x00000001 << STARTREAD_P_OFST)
|
||||
#define BUSY_OFST (3)
|
||||
#define BUSY_MSK (0x00000001 << BUSY_OFST)
|
||||
#define READOUTFROMASIC_OFST (4)
|
||||
#define READOUTFROMASIC_MSK (0x00000001 << READOUTFROMASIC_OFST)
|
||||
|
||||
#define TRANSCEIVERRXCTRL0REG1 (0xB800)
|
||||
#define TRANSCEIVERRXCTRL0REG1 (0xC100)
|
||||
|
||||
#define TRANSCEIVERRXCTRL0REG2 (0xB804)
|
||||
#define TRANSCEIVERRXCTRL0REG2 (0xC104)
|
||||
|
||||
#define TRANSCEIVERRXCTRL1REG1 (0xB808)
|
||||
#define TRANSCEIVERRXCTRL1REG1 (0xC108)
|
||||
|
||||
#define TRANSCEIVERRXCTRL1REG2 (0xB80C)
|
||||
#define TRANSCEIVERRXCTRL1REG2 (0xC10C)
|
||||
|
||||
#define TRANSCEIVERRXCTRL2REG (0xB810)
|
||||
#define TRANSCEIVERRXCTRL2REG (0xC110)
|
||||
|
||||
#define TRANSCEIVERRXCTRL3REG (0xB814)
|
||||
#define TRANSCEIVERRXCTRL3REG (0xC114)
|
||||
|
||||
#define TRANSCEIVERSTATUS (0xB818)
|
||||
#define TRANSCEIVERSTATUS (0xC118)
|
||||
|
||||
#define LINKDOWNLATCHEDOUT_OFST (0)
|
||||
#define LINKDOWNLATCHEDOUT_MSK (0x00000001 << LINKDOWNLATCHEDOUT_OFST)
|
||||
#define TXUSERCLKACTIVE_OFST (1)
|
||||
#define TXUSERCLKACTIVE_MSK (0x00000001 << TXUSERCLKACTIVE_OFST)
|
||||
#define RXUSERCLKACTIVE_OFST (2)
|
||||
#define RXUSERCLKACTIVE_MSK (0x00000001 << RXUSERCLKACTIVE_OFST)
|
||||
#define RXCOMMADET_OFST (3)
|
||||
#define RXCOMMADET_MSK (0x0000000f << RXCOMMADET_OFST)
|
||||
#define RXBYTEREALIGN_OFST (7)
|
||||
#define RXBYTEREALIGN_MSK (0x0000000f << RXBYTEREALIGN_OFST)
|
||||
#define RXBYTEISALIGNED_OFST (11)
|
||||
#define RXBYTEISALIGNED_MSK (0x0000000f << RXBYTEISALIGNED_OFST)
|
||||
#define GTWIZRXCDRSTABLE_OFST (15)
|
||||
#define GTWIZRXCDRSTABLE_MSK (0x00000001 << GTWIZRXCDRSTABLE_OFST)
|
||||
#define RESETTXDONE_OFST (16)
|
||||
#define RESETTXDONE_MSK (0x00000001 << RESETTXDONE_OFST)
|
||||
#define RESETRXDONE_OFST (17)
|
||||
#define RESETRXDONE_MSK (0x00000001 << RESETRXDONE_OFST)
|
||||
#define RXPMARESETDONE_OFST (18)
|
||||
#define RXPMARESETDONE_MSK (0x0000000f << RXPMARESETDONE_OFST)
|
||||
#define TXPMARESETDONE_OFST (22)
|
||||
#define TXPMARESETDONE_MSK (0x0000000f << TXPMARESETDONE_OFST)
|
||||
#define GTTPOWERGOOD_OFST (26)
|
||||
#define GTTPOWERGOOD_MSK (0x0000000f << GTTPOWERGOOD_OFST)
|
||||
#define TXUSERCLKACTIVE_OFST (1)
|
||||
#define TXUSERCLKACTIVE_MSK (0x00000001 << TXUSERCLKACTIVE_OFST)
|
||||
#define RXUSERCLKACTIVE_OFST (2)
|
||||
#define RXUSERCLKACTIVE_MSK (0x00000001 << RXUSERCLKACTIVE_OFST)
|
||||
#define RXCOMMADET_OFST (3)
|
||||
#define RXCOMMADET_MSK (0x0000000f << RXCOMMADET_OFST)
|
||||
#define RXBYTEREALIGN_OFST (7)
|
||||
#define RXBYTEREALIGN_MSK (0x0000000f << RXBYTEREALIGN_OFST)
|
||||
#define RXBYTEISALIGNED_OFST (11)
|
||||
#define RXBYTEISALIGNED_MSK (0x0000000f << RXBYTEISALIGNED_OFST)
|
||||
#define GTWIZRXCDRSTABLE_OFST (15)
|
||||
#define GTWIZRXCDRSTABLE_MSK (0x00000001 << GTWIZRXCDRSTABLE_OFST)
|
||||
#define RESETTXDONE_OFST (16)
|
||||
#define RESETTXDONE_MSK (0x00000001 << RESETTXDONE_OFST)
|
||||
#define RESETRXDONE_OFST (17)
|
||||
#define RESETRXDONE_MSK (0x00000001 << RESETRXDONE_OFST)
|
||||
#define RXPMARESETDONE_OFST (18)
|
||||
#define RXPMARESETDONE_MSK (0x0000000f << RXPMARESETDONE_OFST)
|
||||
#define TXPMARESETDONE_OFST (22)
|
||||
#define TXPMARESETDONE_MSK (0x0000000f << TXPMARESETDONE_OFST)
|
||||
#define GTTPOWERGOOD_OFST (26)
|
||||
#define GTTPOWERGOOD_MSK (0x0000000f << GTTPOWERGOOD_OFST)
|
||||
|
||||
#define TRANSCEIVERSTATUS2 (0xB81C)
|
||||
#define TRANSCEIVERSTATUS2 (0xC11C)
|
||||
|
||||
#define RXLOCKED_OFST (0)
|
||||
#define RXLOCKED_MSK (0x0000000f << RXLOCKED_OFST)
|
||||
|
||||
#define TRANSCEIVERCONTROL (0xB820)
|
||||
#define TRANSCEIVERCONTROL (0xC120)
|
||||
|
||||
#define GTWIZRESETALL_OFST (0)
|
||||
#define GTWIZRESETALL_MSK (0x00000001 << GTWIZRESETALL_OFST)
|
||||
#define GTWIZRESETALL_OFST (0)
|
||||
#define GTWIZRESETALL_MSK (0x00000001 << GTWIZRESETALL_OFST)
|
||||
#define RESETTXPLLANDDATAPATH_OFST (1)
|
||||
#define RESETTXPLLANDDATAPATH_MSK (0x00000001 << RESETTXPLLANDDATAPATH_OFST)
|
||||
#define RESETTXDATAPATHIN_OFST (2)
|
||||
#define RESETTXDATAPATHIN_MSK (0x00000001 << RESETTXDATAPATHIN_OFST)
|
||||
#define RESETTXDATAPATHIN_OFST (2)
|
||||
#define RESETTXDATAPATHIN_MSK (0x00000001 << RESETTXDATAPATHIN_OFST)
|
||||
#define RESETRXPLLANDDATAPATH_OFST (3)
|
||||
#define RESETRXPLLANDDATAPATH_MSK (0x00000001 << RESETRXPLLANDDATAPATH_OFST)
|
||||
#define RESETRXDATAPATHIN_OFST (4)
|
||||
#define RESETRXDATAPATHIN_MSK (0x00000001 << RESETRXDATAPATHIN_OFST)
|
||||
#define RXPOLARITY_OFST (5)
|
||||
#define RXPOLARITY_MSK (0x0000000f << RXPOLARITY_OFST)
|
||||
#define RXERRORCNTRESET_OFST (9)
|
||||
#define RXERRORCNTRESET_MSK (0x0000000f << RXERRORCNTRESET_OFST)
|
||||
#define RXMSBLSBINVERT_OFST (13)
|
||||
#define RXMSBLSBINVERT_MSK (0x0000000f << RXMSBLSBINVERT_OFST)
|
||||
#define RESETRXDATAPATHIN_OFST (4)
|
||||
#define RESETRXDATAPATHIN_MSK (0x00000001 << RESETRXDATAPATHIN_OFST)
|
||||
#define RXPOLARITY_OFST (5)
|
||||
#define RXPOLARITY_MSK (0x0000000f << RXPOLARITY_OFST)
|
||||
#define RXERRORCNTRESET_OFST (9)
|
||||
#define RXERRORCNTRESET_MSK (0x0000000f << RXERRORCNTRESET_OFST)
|
||||
#define RXMSBLSBINVERT_OFST (13)
|
||||
#define RXMSBLSBINVERT_MSK (0x0000000f << RXMSBLSBINVERT_OFST)
|
||||
|
||||
#define TRANSCEIVERERRCNT_REG0 (0xB824)
|
||||
#define TRANSCEIVERERRCNT_REG0 (0xC124)
|
||||
|
||||
#define TRANSCEIVERERRCNT_REG1 (0xB828)
|
||||
#define TRANSCEIVERERRCNT_REG1 (0xC128)
|
||||
|
||||
#define TRANSCEIVERERRCNT_REG2 (0xB82C)
|
||||
#define TRANSCEIVERERRCNT_REG2 (0xC12C)
|
||||
|
||||
#define TRANSCEIVERERRCNT_REG3 (0xB830)
|
||||
#define TRANSCEIVERERRCNT_REG3 (0xC130)
|
||||
|
||||
#define TRANSCEIVERALIGNCNT_REG0 (0xB834)
|
||||
#define TRANSCEIVERALIGNCNT_REG0 (0xC134)
|
||||
|
||||
#define RXALIGNCNTCH0_OFST (0)
|
||||
#define RXALIGNCNTCH0_MSK (0x0000ffff << RXALIGNCNTCH0_OFST)
|
||||
|
||||
#define TRANSCEIVERALIGNCNT_REG1 (0xB838)
|
||||
#define TRANSCEIVERALIGNCNT_REG1 (0xC138)
|
||||
|
||||
#define RXALIGNCNTCH1_OFST (0)
|
||||
#define RXALIGNCNTCH1_MSK (0x0000ffff << RXALIGNCNTCH1_OFST)
|
||||
|
||||
#define TRANSCEIVERALIGNCNT_REG2 (0xB83C)
|
||||
#define TRANSCEIVERALIGNCNT_REG2 (0xC13C)
|
||||
|
||||
#define RXALIGNCNTCH2_OFST (0)
|
||||
#define RXALIGNCNTCH2_MSK (0x0000ffff << RXALIGNCNTCH2_OFST)
|
||||
|
||||
#define TRANSCEIVERALIGNCNT_REG3 (0xB840)
|
||||
#define TRANSCEIVERALIGNCNT_REG3 (0xC140)
|
||||
|
||||
#define RXALIGNCNTCH3_OFST (0)
|
||||
#define RXALIGNCNTCH3_MSK (0x0000ffff << RXALIGNCNTCH3_OFST)
|
||||
|
||||
#define TRANSCEIVERLASTWORD_REG0 (0xB844)
|
||||
#define TRANSCEIVERLASTWORD_REG0 (0xC144)
|
||||
|
||||
#define RXDATACH0_OFST (0)
|
||||
#define RXDATACH0_MSK (0x0000ffff << RXDATACH0_OFST)
|
||||
|
||||
#define TRANSCEIVERLASTWORD_REG1 (0xB848)
|
||||
#define TRANSCEIVERLASTWORD_REG1 (0xC148)
|
||||
|
||||
#define RXDATACH1_OFST (0)
|
||||
#define RXDATACH1_MSK (0x0000ffff << RXDATACH1_OFST)
|
||||
|
||||
#define TRANSCEIVERLASTWORD_REG2 (0xB84C)
|
||||
#define TRANSCEIVERLASTWORD_REG2 (0xC14C)
|
||||
|
||||
#define RXDATACH2_OFST (0)
|
||||
#define RXDATACH2_MSK (0x0000ffff << RXDATACH2_OFST)
|
||||
|
||||
#define TRANSCEIVERLASTWORD_REG3 (0xB850)
|
||||
#define TRANSCEIVERLASTWORD_REG3 (0xC150)
|
||||
|
||||
#define RXDATACH3_OFST (0)
|
||||
#define RXDATACH3_MSK (0x0000ffff << RXDATACH3_OFST)
|
||||
|
||||
|
||||
// ----------------------------------------------------
|
||||
// TODO: fix these in the firmware reg generator:
|
||||
// ----------------------------------------------------:
|
||||
|
||||
#define DELAY_OUT_REG_1 (0xB054)
|
||||
#define DELAY_OUT_REG_2 (0xB058)
|
||||
#define CYCLES_OUT_REG_1 (0xB05C)
|
||||
#define CYCLES_OUT_REG_2 (0xB060)
|
||||
#define FRAMES_OUT_REG_1 (0xB064)
|
||||
#define FRAMES_OUT_REG_2 (0xB068)
|
||||
#define PERIOD_OUT_REG_1 (0xB06C)
|
||||
#define PERIOD_OUT_REG_2 (0xB070)
|
||||
|
||||
// clang-format on
|
||||
|
||||
Binary file not shown.
@@ -1,24 +1,24 @@
|
||||
# Prepare MH02 configuration
|
||||
reg 0xB1B0 0x00000041
|
||||
reg 0xB1B4 0x01200004
|
||||
reg 0xC00C 0x00040041
|
||||
reg 0xC010 0x01200004
|
||||
|
||||
# configure Matterhorn SPI
|
||||
setbit 0xB1B8 0
|
||||
setbit 0xC014 0
|
||||
|
||||
# wait till config is done
|
||||
pollbit 0xB1B8 3 0
|
||||
pollbit 0xC014 3 0
|
||||
|
||||
# reset transceiver
|
||||
reg 0xB820 0x0
|
||||
reg 0xB820 0x1
|
||||
reg 0xB820 0x0
|
||||
reg 0xC120 0x0
|
||||
reg 0xC120 0x1
|
||||
reg 0xC120 0x0
|
||||
|
||||
# set MSB LSB inversions and polarity for transceiver
|
||||
reg 0xB820 0x61e0
|
||||
reg 0xC120 0x1e0
|
||||
|
||||
# Enable MH02 PLL clock
|
||||
pattern enable_clock_pattern.pyat
|
||||
# start the flow
|
||||
setbit 0xB004 0
|
||||
clearbit 0xB004 0
|
||||
setbit 0xB030 0
|
||||
clearbit 0xB030 0
|
||||
sleep 1
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
|
||||
# turn off clock
|
||||
setbit 0xB1B0 16
|
||||
setbit 0xB1B8 0
|
||||
clearbit 0xB018 15
|
||||
setbit 0xB010 15
|
||||
sleep 1
|
||||
|
||||
# reset Matterhorn periphery
|
||||
setbit 0xB1B8 1
|
||||
setbit 0xC014 1
|
||||
sleep 1
|
||||
|
||||
# turn on clock
|
||||
clearbit 0xB1B0 16
|
||||
setbit 0xB1B8 0
|
||||
clearbit 0xB010 15
|
||||
sleep 1
|
||||
|
||||
# reset rx transceiver datapath
|
||||
setbit 0xB820 4
|
||||
setbit 0xC120 4
|
||||
sleep 1
|
||||
|
||||
# reset 8b10b counters
|
||||
setbit 0xB820 9
|
||||
setbit 0xB820 10
|
||||
setbit 0xB820 11
|
||||
setbit 0xB820 12
|
||||
setbit 0xC120 9
|
||||
setbit 0xC120 10
|
||||
setbit 0xC120 11
|
||||
setbit 0xC120 12
|
||||
sleep 1
|
||||
clearbit 0xB820 9
|
||||
clearbit 0xB820 10
|
||||
clearbit 0xC120 9
|
||||
clearbit 0xC120 10
|
||||
|
||||
# reset buffer fifos
|
||||
reg 0x9024 0xFFFFFFFF
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "sls/versionAPI.h"
|
||||
|
||||
#include "LTC2620_Driver.h"
|
||||
#include "XILINX_PLL.h"
|
||||
|
||||
#include "loadPattern.h"
|
||||
#ifdef VIRTUAL
|
||||
@@ -39,6 +40,7 @@ char initErrorMessage[MAX_STR_LENGTH];
|
||||
|
||||
int detPos[2] = {0, 0};
|
||||
|
||||
uint32_t clkFrequency[NUM_CLOCKS] = {};
|
||||
int chipConfigured = 0;
|
||||
int analogEnable = 0;
|
||||
int digitalEnable = 0;
|
||||
@@ -373,6 +375,10 @@ void setupDetector() {
|
||||
LOG(logINFO, ("Setting up Server for 1 Xilinx Chip Test Board\n"));
|
||||
|
||||
// default variables
|
||||
clkFrequency[RUN_CLK] = DEFAULT_RUN_CLK;
|
||||
clkFrequency[ADC_CLK] = DEFAULT_ADC_CLK;
|
||||
clkFrequency[SYNC_CLK] = DEFAULT_SYNC_CLK;
|
||||
clkFrequency[DBIT_CLK] = DEFAULT_DBIT_CLK;
|
||||
chipConfigured = 0;
|
||||
analogEnable = 0;
|
||||
digitalEnable = 0;
|
||||
@@ -434,14 +440,18 @@ void cleanFifos() {
|
||||
#ifdef VIRTUAL
|
||||
return;
|
||||
#endif
|
||||
uint32_t t_enable_mask = getTransceiverEnableMask();
|
||||
uint32_t tclean_msk =
|
||||
((t_enable_mask << X_FIFO_CLEAN_OFST) & X_FIFO_CLEAN_MSK);
|
||||
uint32_t t_before_reg = bus_r(X_FIFO_CLEAN_REG);
|
||||
LOG(logINFO, ("Clearing Acquisition Fifos\n"));
|
||||
bus_w(A_FIFO_CLEAN_REG, bus_r(A_FIFO_CLEAN_REG) | BIT32_MSK);
|
||||
bus_w(D_FIFO_CLEAN_REG, bus_r(D_FIFO_CLEAN_REG) | D_FIFO_CLEAN_MSK);
|
||||
bus_w(X_FIFO_CLEAN_REG, bus_r(X_FIFO_CLEAN_REG) | X_FIFO_CLEAN_MSK);
|
||||
bus_w(X_FIFO_CLEAN_REG, t_before_reg | tclean_msk);
|
||||
|
||||
bus_w(A_FIFO_CLEAN_REG, 0);
|
||||
bus_w(D_FIFO_CLEAN_REG, bus_r(D_FIFO_CLEAN_REG) & ~D_FIFO_CLEAN_MSK);
|
||||
bus_w(X_FIFO_CLEAN_REG, bus_r(X_FIFO_CLEAN_REG) & ~X_FIFO_CLEAN_MSK);
|
||||
bus_w(X_FIFO_CLEAN_REG, t_before_reg);
|
||||
}
|
||||
|
||||
void resetFlow() {
|
||||
@@ -1058,12 +1068,12 @@ int setPeriod(int64_t val) {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Setting period %lld ns\n", (long long int)val));
|
||||
val *= (1E-3 * RUN_CLK);
|
||||
val *= (NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
setU64BitReg(val, PERIOD_IN_REG_1, PERIOD_IN_REG_2);
|
||||
|
||||
// validate for tolerance
|
||||
int64_t retval = getPeriod();
|
||||
val /= (1E-3 * RUN_CLK);
|
||||
val /= (NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
if (val != retval) {
|
||||
return FAIL;
|
||||
}
|
||||
@@ -1071,7 +1081,8 @@ int setPeriod(int64_t val) {
|
||||
}
|
||||
|
||||
int64_t getPeriod() {
|
||||
return getU64BitReg(PERIOD_IN_REG_1, PERIOD_IN_REG_2) / (1E-3 * RUN_CLK);
|
||||
return getU64BitReg(PERIOD_IN_REG_1, PERIOD_IN_REG_2) /
|
||||
(NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
}
|
||||
|
||||
int setDelayAfterTrigger(int64_t val) {
|
||||
@@ -1080,12 +1091,12 @@ int setDelayAfterTrigger(int64_t val) {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Setting delay after trigger %ld ns\n", val));
|
||||
val *= (1E-3 * RUN_CLK);
|
||||
val *= (NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
setU64BitReg(val, DELAY_IN_REG_1, DELAY_IN_REG_2);
|
||||
|
||||
// validate for tolerance
|
||||
int64_t retval = getDelayAfterTrigger();
|
||||
val /= (1E-3 * RUN_CLK);
|
||||
val /= (NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
if (val != retval) {
|
||||
return FAIL;
|
||||
}
|
||||
@@ -1093,7 +1104,8 @@ int setDelayAfterTrigger(int64_t val) {
|
||||
}
|
||||
|
||||
int64_t getDelayAfterTrigger() {
|
||||
return getU64BitReg(DELAY_IN_REG_1, DELAY_IN_REG_2) / (1E-3 * RUN_CLK);
|
||||
return getU64BitReg(DELAY_IN_REG_1, DELAY_IN_REG_2) /
|
||||
(NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
}
|
||||
|
||||
int64_t getNumFramesLeft() {
|
||||
@@ -1105,11 +1117,13 @@ int64_t getNumTriggersLeft() {
|
||||
}
|
||||
|
||||
int64_t getDelayAfterTriggerLeft() {
|
||||
return getU64BitReg(DELAY_OUT_REG_1, DELAY_OUT_REG_2) / (1E-3 * RUN_CLK);
|
||||
return getU64BitReg(DELAY_OUT_REG_1, DELAY_OUT_REG_2) /
|
||||
(NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
}
|
||||
|
||||
int64_t getPeriodLeft() {
|
||||
return getU64BitReg(PERIOD_OUT_REG_1, PERIOD_OUT_REG_2) / (1E-3 * RUN_CLK);
|
||||
return getU64BitReg(PERIOD_OUT_REG_1, PERIOD_OUT_REG_2) /
|
||||
(NS_TO_CLK_CYCLE * clkFrequency[RUN_CLK]);
|
||||
}
|
||||
|
||||
int64_t getFramesFromStart() {
|
||||
@@ -1119,12 +1133,12 @@ int64_t getFramesFromStart() {
|
||||
|
||||
int64_t getActualTime() {
|
||||
return getU64BitReg(TIME_FROM_START_OUT_REG_1, TIME_FROM_START_OUT_REG_2) /
|
||||
(1E-3 * TICK_CLK);
|
||||
(NS_TO_CLK_CYCLE * clkFrequency[SYNC_CLK]);
|
||||
}
|
||||
|
||||
int64_t getMeasurementTime() {
|
||||
return getU64BitReg(FRAME_TIME_OUT_REG_1, FRAME_TIME_OUT_REG_2) /
|
||||
(1E-3 * TICK_CLK);
|
||||
(NS_TO_CLK_CYCLE * clkFrequency[SYNC_CLK]);
|
||||
}
|
||||
|
||||
/* parameters - dac, adc, hv */
|
||||
@@ -1191,6 +1205,26 @@ void setVLimit(int l) {
|
||||
vLimit = l;
|
||||
}
|
||||
|
||||
int getBitOffsetFromDACIndex(enum DACINDEX ind) {
|
||||
switch (ind) {
|
||||
case D_PWR_IO:
|
||||
return POWER_VIO_OFST;
|
||||
case D_PWR_A:
|
||||
return POWER_VCC_A_OFST;
|
||||
case D_PWR_B:
|
||||
return POWER_VCC_B_OFST;
|
||||
case D_PWR_C:
|
||||
return POWER_VCC_C_OFST;
|
||||
case D_PWR_D:
|
||||
return POWER_VCC_D_OFST;
|
||||
default:
|
||||
LOG(logERROR,
|
||||
("DAC index %d is not defined to get offset in ctrl register\n",
|
||||
ind));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int isPowerValid(enum DACINDEX ind, int val) {
|
||||
char *powerNames[] = {PWR_NAMES};
|
||||
int pwrIndex = (int)(ind - D_PWR_D);
|
||||
@@ -1213,10 +1247,23 @@ int isPowerValid(enum DACINDEX ind, int val) {
|
||||
}
|
||||
|
||||
int getPower(enum DACINDEX ind) {
|
||||
// get bit offset in ctrl register
|
||||
int bitOffset = getBitOffsetFromDACIndex(ind);
|
||||
if (bitOffset == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// powered enable off
|
||||
{
|
||||
uint32_t addr = CTRL_REG;
|
||||
uint32_t mask = (1 << bitOffset);
|
||||
if (!(bus_r(addr) & mask))
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *powerNames[] = {PWR_NAMES};
|
||||
int pwrIndex = (int)(ind - D_PWR_D);
|
||||
|
||||
// check dac value
|
||||
// not set yet
|
||||
if (dacValues[ind] == -1) {
|
||||
LOG(logERROR,
|
||||
@@ -1226,7 +1273,8 @@ int getPower(enum DACINDEX ind) {
|
||||
|
||||
// dac powered off
|
||||
if (dacValues[ind] == LTC2620_D_GetPowerDownValue()) {
|
||||
LOG(logWARNING, ("Power V%s is powered down\n", powerNames[pwrIndex]));
|
||||
LOG(logWARNING, ("Power V%s enabled, but voltage is at minimum or 0.\n",
|
||||
powerNames[pwrIndex]));
|
||||
return LTC2620_D_GetPowerDownValue();
|
||||
}
|
||||
|
||||
@@ -1240,26 +1288,43 @@ int getPower(enum DACINDEX ind) {
|
||||
}
|
||||
|
||||
void setPower(enum DACINDEX ind, int val) {
|
||||
// validate index and get bit offset in ctrl register
|
||||
int bitOffset = getBitOffsetFromDACIndex(ind);
|
||||
if (bitOffset == -1) {
|
||||
return;
|
||||
}
|
||||
uint32_t addr = CTRL_REG;
|
||||
uint32_t mask = (1 << bitOffset);
|
||||
|
||||
if (val == -1)
|
||||
return;
|
||||
|
||||
char *powerNames[] = {PWR_NAMES};
|
||||
int pwrIndex = (int)(ind - D_PWR_D);
|
||||
LOG(logINFO, ("Setting Power V%s to %d mV\n", powerNames[pwrIndex], val));
|
||||
|
||||
// power down dac
|
||||
if (val == LTC2620_D_GetPowerDownValue()) {
|
||||
LOG(logINFO, ("\tPowering down V%d\n", powerNames[pwrIndex]));
|
||||
setDAC(ind, LTC2620_D_GetPowerDownValue(), 0);
|
||||
// validate value (already checked at tcp (funcs.c))
|
||||
if (!isPowerValid(ind, val)) {
|
||||
LOG(logERROR, ("Invalid power value for V%s: %d mV\n",
|
||||
powerNames[pwrIndex], val));
|
||||
return;
|
||||
}
|
||||
|
||||
// set dac
|
||||
else if (val >= 0) {
|
||||
LOG(logINFO,
|
||||
("Setting Power V%s to %d mV\n", powerNames[pwrIndex], val));
|
||||
// Switch off power enable
|
||||
LOG(logDEBUG1, ("Switching off power enable\n"));
|
||||
bus_w(addr, bus_r(addr) & ~(mask));
|
||||
|
||||
// validate value (already checked at tcp (funcs.c))
|
||||
if (!isPowerValid(ind, val)) {
|
||||
return;
|
||||
}
|
||||
// power down dac
|
||||
LOG(logINFO, ("\tPowering down V%d\n", powerNames[pwrIndex]));
|
||||
setDAC(ind, LTC2620_D_GetPowerDownValue(), 0);
|
||||
|
||||
//(power off is anyway done with power enable)
|
||||
if (val == 0)
|
||||
val = LTC2620_D_GetPowerDownValue();
|
||||
|
||||
// convert voltage to dac (power off is anyway done with power enable)
|
||||
if (val != LTC2620_D_GetPowerDownValue()) {
|
||||
|
||||
// convert voltage to dac
|
||||
int dacval = -1;
|
||||
if (ConvertToDifferentRange(
|
||||
POWER_RGLTR_MIN, POWER_RGLTR_MAX, LTC2620_D_GetMaxInput(),
|
||||
@@ -1276,6 +1341,12 @@ void setPower(enum DACINDEX ind, int val) {
|
||||
LOG(logINFO, ("Setting Power V%s: %d mV (%d dac)\n",
|
||||
powerNames[pwrIndex], val, dacval));
|
||||
setDAC(ind, dacval, 0);
|
||||
|
||||
// if valid, enable power
|
||||
if (dacval >= 0) {
|
||||
LOG(logDEBUG1, ("Switching on power enable\n"));
|
||||
bus_w(addr, bus_r(addr) | mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1629,7 +1700,7 @@ int stopStateMachine() {
|
||||
#endif
|
||||
// stop state machine
|
||||
bus_w(FLOW_CONTROL_REG, bus_r(FLOW_CONTROL_REG) | STOP_F_MSK);
|
||||
|
||||
cleanFifos();
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1778,3 +1849,37 @@ void getNumberOfChannels(int *nchanx, int *nchany) {
|
||||
int getNumberOfChips() { return NCHIP; }
|
||||
int getNumberOfDACs() { return NDAC; }
|
||||
int getNumberOfChannelsPerChip() { return NCHAN; }
|
||||
|
||||
int setFrequency(enum CLKINDEX ind, int val) {
|
||||
if (ind < 0 || ind >= NUM_CLOCKS) {
|
||||
LOG(logERROR, ("Unknown clock index %d to set frequency\n", ind));
|
||||
return FAIL;
|
||||
}
|
||||
if (val <= 0) {
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
char *clock_names[] = {CLK_NAMES};
|
||||
LOG(logINFO, ("\tSetting %s clock (%d) frequency to %d kHz\n",
|
||||
clock_names[ind], ind, val));
|
||||
|
||||
if (XILINX_PLL_setFrequency(ind, val) == FAIL) {
|
||||
LOG(logERROR, ("\tCould not set %s clock (%d) frequency to %d kHz\n",
|
||||
clock_names[ind], ind, val));
|
||||
return FAIL;
|
||||
}
|
||||
clkFrequency[ind] = val;
|
||||
// TODO later: connect setPhase as phase gets reset on freq change
|
||||
return OK;
|
||||
}
|
||||
|
||||
int getFrequency(enum CLKINDEX ind) {
|
||||
if (ind < 0 || ind >= NUM_CLOCKS) {
|
||||
LOG(logERROR, ("Unknown clock index %d to get frequency\n", ind));
|
||||
return -1;
|
||||
}
|
||||
#ifndef VIRTUAL
|
||||
clkFrequency[ind] = XILINX_PLL_getFrequency(ind);
|
||||
#endif
|
||||
return clkFrequency[ind];
|
||||
}
|
||||
@@ -71,12 +71,6 @@
|
||||
#define POWER_RGLTR_MAX (2661)
|
||||
#define VIO_MIN_MV (1200) // for fpga to function
|
||||
|
||||
#define TICK_CLK (20) // MHz (trig_timeFromStart, frametime, timeFromStart)
|
||||
#define RUN_CLK \
|
||||
(100) // MHz (framesFromStart, c_swTrigger, run, waitForTrigger, starting,
|
||||
// acquiring, waitForPeriod, internalStop, c_framesFromSTart_reset,
|
||||
// s_start, c_stop, triggerEnable, period, frames, cycles, delay)
|
||||
|
||||
/* Defines in the Firmware */
|
||||
#define WAIT_TIME_PATTERN_READ (10)
|
||||
#define WAIT_TIME_OUT_0US_TIMES (35000) // 2s
|
||||
@@ -158,3 +152,12 @@ typedef struct udp_header_struct {
|
||||
|
||||
#define IP_HEADER_SIZE (20)
|
||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||
|
||||
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
||||
#define CLK_NAMES "run", "adc", "sync", "dbit"
|
||||
|
||||
#define DEFAULT_RUN_CLK (20000) // 20 MHz
|
||||
#define DEFAULT_ADC_CLK (100000) // 100 MHz
|
||||
#define DEFAULT_SYNC_CLK (20000) // 20 MHz
|
||||
#define DEFAULT_DBIT_CLK (100000) // 100 MHz
|
||||
#define NS_TO_CLK_CYCLE (1E-6) // ns to kHz
|
||||
|
||||
@@ -28,12 +28,11 @@ target_link_libraries(slsDetectorObject
|
||||
PUBLIC
|
||||
slsProjectOptions
|
||||
slsSupportStatic
|
||||
pthread
|
||||
rt
|
||||
PRIVATE
|
||||
slsProjectWarnings
|
||||
)
|
||||
|
||||
|
||||
set(DETECTOR_LIBRARY_TARGETS slsDetectorObject)
|
||||
|
||||
|
||||
@@ -98,8 +97,7 @@ if(SLS_USE_TEXTCLIENT)
|
||||
add_executable(${val1} src/CmdApp.cpp)
|
||||
|
||||
target_link_libraries(${val1}
|
||||
slsDetectorStatic
|
||||
pthread
|
||||
slsDetectorStatic
|
||||
)
|
||||
SET_SOURCE_FILES_PROPERTIES( src/Caller.cpp PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-but-set-variable")
|
||||
|
||||
|
||||
@@ -1272,7 +1272,7 @@ asamples:
|
||||
function: setNumberOfAnalogSamples
|
||||
|
||||
adcclk:
|
||||
help: "[n_clk in MHz]\n\t[Ctb] ADC clock frequency in MHz."
|
||||
help: "[n_clk in MHz]\n\t[Ctb] ADC clock frequency in MHz.\n\t[xilinx Ctb] ADC clock frequency in kHz."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@@ -1281,7 +1281,7 @@ adcclk:
|
||||
function: setADCClock
|
||||
|
||||
runclk:
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Run clock in MHz."
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Run clock in MHz.\n\t[xilinx Ctb] Run clock in kHz."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@@ -1318,7 +1318,7 @@ romode:
|
||||
input_types: [ defs::readoutMode ]
|
||||
|
||||
dbitclk:
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz."
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz.\n\t[xilinx Ctb] Clock for latching the digital bits in kHz."
|
||||
inherit_actions: INTEGER_COMMAND_VEC_ID
|
||||
actions:
|
||||
GET:
|
||||
@@ -1791,7 +1791,7 @@ defaultpattern:
|
||||
|
||||
patternstart:
|
||||
inherit_actions: EXECUTE_SET_COMMAND
|
||||
help: "\n\t[Mythen3] Starts Pattern"
|
||||
help: "\n\t[Mythen3][Ctb][Xilinx Ctb] Starts Pattern"
|
||||
actions:
|
||||
PUT:
|
||||
function: startPattern
|
||||
|
||||
@@ -106,7 +106,8 @@ adcclk:
|
||||
store_result_in_t: false
|
||||
command_name: adcclk
|
||||
function_alias: adcclk
|
||||
help: "[n_clk in MHz]\n\t[Ctb] ADC clock frequency in MHz."
|
||||
help: "[n_clk in MHz]\n\t[Ctb] ADC clock frequency in MHz.\n\t[xilinx Ctb] ADC clock\
|
||||
\ frequency in kHz."
|
||||
infer_action: true
|
||||
template: true
|
||||
adcenable:
|
||||
@@ -2219,7 +2220,8 @@ dbitclk:
|
||||
store_result_in_t: false
|
||||
command_name: dbitclk
|
||||
function_alias: dbitclk
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz."
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Clock for latching the digital bits in MHz.\n\t[xilinx\
|
||||
\ Ctb] Clock for latching the digital bits in kHz."
|
||||
infer_action: true
|
||||
template: true
|
||||
dbitphase:
|
||||
@@ -6515,7 +6517,7 @@ patternstart:
|
||||
store_result_in_t: false
|
||||
command_name: patternstart
|
||||
function_alias: patternstart
|
||||
help: "\n\t[Mythen3] Starts Pattern"
|
||||
help: "\n\t[Mythen3][Ctb][Xilinx Ctb] Starts Pattern"
|
||||
infer_action: true
|
||||
template: true
|
||||
patwait:
|
||||
@@ -8133,7 +8135,7 @@ runclk:
|
||||
store_result_in_t: false
|
||||
command_name: runclk
|
||||
function_alias: runclk
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Run clock in MHz."
|
||||
help: "[n_clk in MHz]\n\t[Ctb] Run clock in MHz.\n\t[xilinx Ctb] Run clock in kHz."
|
||||
infer_action: true
|
||||
template: true
|
||||
runtime:
|
||||
|
||||
@@ -1612,16 +1612,16 @@ class Detector {
|
||||
/** [CTB] */
|
||||
void setNumberOfAnalogSamples(int value, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] in MHz, [XCTB] in kHz */
|
||||
Result<int> getADCClock(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] in MHz, [XCTB] in kHz */
|
||||
void setADCClock(int value_in_MHz, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] in MHz, [XCTB] in kHz */
|
||||
Result<int> getRUNClock(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] in MHz, [XCTB] in kHz */
|
||||
void setRUNClock(int value_in_MHz, Positions pos = {});
|
||||
|
||||
/** [CTB] in MHZ */
|
||||
@@ -1691,10 +1691,10 @@ class Detector {
|
||||
*/
|
||||
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] in MHz, [XCTB] in kHz */
|
||||
Result<int> getDBITClock(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] in MHz, [XCTB] in kHz */
|
||||
void setDBITClock(int value_in_MHz, Positions pos = {});
|
||||
|
||||
/**
|
||||
@@ -1943,7 +1943,7 @@ class Detector {
|
||||
* selected bits */
|
||||
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
||||
|
||||
/** [Mythen3] */
|
||||
/** [CTB][Mythen3][Xilinx CTB] */
|
||||
void startPattern(Positions pos = {});
|
||||
///@}
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ std::string Caller::adcclk(int action) {
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N([n_clk in MHz]
|
||||
[Ctb] ADC clock frequency in MHz. )V0G0N"
|
||||
[Ctb] ADC clock frequency in MHz.
|
||||
[xilinx Ctb] ADC clock frequency in kHz. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@@ -2805,7 +2806,8 @@ std::string Caller::dbitclk(int action) {
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N([n_clk in MHz]
|
||||
[Ctb] Clock for latching the digital bits in MHz. )V0G0N"
|
||||
[Ctb] Clock for latching the digital bits in MHz.
|
||||
[xilinx Ctb] Clock for latching the digital bits in kHz. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@@ -8452,7 +8454,7 @@ std::string Caller::patternstart(int action) {
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N(
|
||||
[Mythen3] Starts Pattern )V0G0N"
|
||||
[Mythen3][Xilinx Ctb] Starts Pattern )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
@@ -10429,7 +10431,8 @@ std::string Caller::runclk(int action) {
|
||||
// print help
|
||||
if (action == slsDetectorDefs::HELP_ACTION) {
|
||||
os << R"V0G0N([n_clk in MHz]
|
||||
[Ctb] Run clock in MHz. )V0G0N"
|
||||
[Ctb] Run clock in MHz.
|
||||
[xilinx Ctb] Run clock in kHz. )V0G0N"
|
||||
<< std::endl;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@ void CmdParser::Parse(std::string s) {
|
||||
// taking s by value we can modify it.
|
||||
Reset();
|
||||
|
||||
// If the string is empty there is nothing to parse
|
||||
if (s.empty())
|
||||
return;
|
||||
|
||||
// Are we looking at -h --help? avoid removing h from command starting
|
||||
// with h when combined with detector id (ex, 1-hostname)
|
||||
bool h = replace_first(&s, "--help", " ");
|
||||
|
||||
@@ -1202,7 +1202,7 @@ void Module::setDestinationUDPIP(const IpAddr ip) {
|
||||
}
|
||||
sendToDetector(F_SET_DEST_UDP_IP, ip, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
MacAddr retval(0LU);
|
||||
MacAddr retval;
|
||||
sendToReceiver(F_SET_RECEIVER_UDP_IP, ip, retval);
|
||||
LOG(logINFO) << "Setting destination udp mac of Module " << moduleIndex
|
||||
<< " to " << retval;
|
||||
@@ -1225,7 +1225,7 @@ void Module::setDestinationUDPIP2(const IpAddr ip) {
|
||||
}
|
||||
sendToDetector(F_SET_DEST_UDP_IP2, ip, nullptr);
|
||||
if (shm()->useReceiverFlag) {
|
||||
MacAddr retval(0LU);
|
||||
MacAddr retval;
|
||||
sendToReceiver(F_SET_RECEIVER_UDP_IP2, ip, retval);
|
||||
LOG(logINFO) << "Setting destination udp mac2 of Module " << moduleIndex
|
||||
<< " to " << retval;
|
||||
@@ -2568,17 +2568,15 @@ std::vector<int> Module::getReceiverDbitList() const {
|
||||
|
||||
void Module::setReceiverDbitList(std::vector<int> list) {
|
||||
LOG(logDEBUG1) << "Setting Receiver Dbit List";
|
||||
if (list.size() > 64) {
|
||||
throw RuntimeError("Dbit list size cannot be greater than 64\n");
|
||||
}
|
||||
|
||||
for (auto &it : list) {
|
||||
if (it < 0 || it > 63) {
|
||||
throw RuntimeError("Dbit list value must be between 0 and 63\n");
|
||||
}
|
||||
}
|
||||
std::sort(begin(list), end(list));
|
||||
auto last = std::unique(begin(list), end(list));
|
||||
list.erase(last, list.end());
|
||||
auto r = stableRemoveDuplicates(list);
|
||||
if(r)
|
||||
LOG(logWARNING) << "Removed duplicated from receiver dbit list";
|
||||
|
||||
StaticVector<int, MAX_RX_DBIT> arg = list;
|
||||
sendToReceiver(F_SET_RECEIVER_DBIT_LIST, arg, nullptr);
|
||||
|
||||
@@ -25,15 +25,27 @@
|
||||
#include <sys/stat.h> // fstat
|
||||
#include <unistd.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
struct CtbConfig;
|
||||
// struct sharedDetector;
|
||||
// ********************** Defines for shared memory. **********************
|
||||
// WARNING! before chaning these search the codebase for their usage!
|
||||
|
||||
#define SHM_IS_VALID_CHECK_VERSION 0x250820
|
||||
|
||||
//Max shared memory name length in macOS is 31 characters
|
||||
#ifdef __APPLE__
|
||||
#define SHM_DETECTOR_PREFIX "/sls_"
|
||||
#define SHM_MODULE_PREFIX "_mod_"
|
||||
#else
|
||||
#define SHM_DETECTOR_PREFIX "/slsDetectorPackage_detector_"
|
||||
#define SHM_MODULE_PREFIX "_module_"
|
||||
#endif
|
||||
|
||||
#define SHM_ENV_NAME "SLSDETNAME"
|
||||
// ************************************************************************
|
||||
|
||||
namespace sls {
|
||||
|
||||
class CtbConfig;
|
||||
|
||||
|
||||
template <typename T, typename U> constexpr bool is_type() {
|
||||
return std::is_same_v<std::decay_t<U>, T>;
|
||||
@@ -267,6 +279,11 @@ template <typename T> class SharedMemory {
|
||||
throw SharedMemoryError(msg);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// On macOS, fstat returns the allocated size and not the requested size.
|
||||
// This means we can't check for size since we always get for example 16384 bytes.
|
||||
return;
|
||||
#endif
|
||||
auto actual_size = static_cast<size_t>(sb.st_size);
|
||||
auto expected_size = sizeof(T);
|
||||
if (actual_size != expected_size) {
|
||||
|
||||
@@ -8,6 +8,7 @@ target_sources(tests PRIVATE
|
||||
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-rx.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-rx-running.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-pattern.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-eiger.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-jungfrau.cpp
|
||||
|
||||
@@ -16,8 +16,11 @@ namespace sls {
|
||||
using test::GET;
|
||||
using test::PUT;
|
||||
|
||||
// disable for jungfrau as it requires higher maximum receive buffer size
|
||||
// sysctl net.core.rmem_max=$((100*1024*1024))
|
||||
// sysctl net.core.rmem_default=$((100*1024*1024))
|
||||
TEST_CASE("jungfrau_or_moench_acquire_check_file_size",
|
||||
"[.cmdcall][.cmdacquire]") {
|
||||
"[.detectorintegration][.cmdacquire][.disable_jungfrau]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
@@ -47,7 +50,8 @@ TEST_CASE("jungfrau_or_moench_acquire_check_file_size",
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("eiger_acquire_check_file_size", "[.cmdcall][.cmdacquire]") {
|
||||
TEST_CASE("eiger_acquire_check_file_size",
|
||||
"[.detectorintegration][.cmdacquire]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type =
|
||||
@@ -78,7 +82,8 @@ TEST_CASE("eiger_acquire_check_file_size", "[.cmdcall][.cmdacquire]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("mythen3_acquire_check_file_size", "[.cmdcall][.cmdacquire]") {
|
||||
TEST_CASE("mythen3_acquire_check_file_size",
|
||||
"[.detectorintegration][.cmdacquire]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type =
|
||||
@@ -111,7 +116,8 @@ TEST_CASE("mythen3_acquire_check_file_size", "[.cmdcall][.cmdacquire]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gotthard2_acquire_check_file_size", "[.cmdcall][.cmdacquire]") {
|
||||
TEST_CASE("gotthard2_acquire_check_file_size",
|
||||
"[.detectorintegration][.cmdacquire]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type =
|
||||
@@ -150,7 +156,11 @@ void test_ctb_file_size_with_acquire(Detector &det, Caller &caller,
|
||||
expected_image_size));
|
||||
}
|
||||
|
||||
TEST_CASE("ctb_acquire_check_file_size", "[.cmdcall][.cmdacquire]") {
|
||||
// disable for xilinx_ctb as it requires higher maximum receive buffer size
|
||||
// sysctl net.core.rmem_max=$((100*1024*1024))
|
||||
// sysctl net.core.rmem_default=$((100*1024*1024))
|
||||
TEST_CASE("ctb_acquire_check_file_size",
|
||||
"[.detectorintegration][.cmdacquire][.disable_xilinx_ctb]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type =
|
||||
|
||||
@@ -19,7 +19,7 @@ using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("dacname", "[.cmdcall]") {
|
||||
TEST_CASE("dacname", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -54,7 +54,7 @@ TEST_CASE("dacname", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("dacindex", "[.cmdcall]") {
|
||||
TEST_CASE("dacindex", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -80,7 +80,7 @@ TEST_CASE("dacindex", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adclist", "[.cmdcall]") {
|
||||
TEST_CASE("adclist", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -113,7 +113,7 @@ TEST_CASE("adclist", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcname", "[.cmdcall]") {
|
||||
TEST_CASE("adcname", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -148,7 +148,7 @@ TEST_CASE("adcname", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcindex", "[.cmdcall]") {
|
||||
TEST_CASE("adcindex", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -174,7 +174,7 @@ TEST_CASE("adcindex", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("signallist", "[.cmdcall]") {
|
||||
TEST_CASE("signallist", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -207,7 +207,7 @@ TEST_CASE("signallist", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("signalname", "[.cmdcall]") {
|
||||
TEST_CASE("signalname", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -242,7 +242,7 @@ TEST_CASE("signalname", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("signalindex", "[.cmdcall]") {
|
||||
TEST_CASE("signalindex", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -269,7 +269,7 @@ TEST_CASE("signalindex", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("powerlist", "[.cmdcall]") {
|
||||
TEST_CASE("powerlist", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -302,7 +302,7 @@ TEST_CASE("powerlist", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("powername", "[.cmdcall]") {
|
||||
TEST_CASE("powername", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -337,7 +337,7 @@ TEST_CASE("powername", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("powerindex", "[.cmdcall]") {
|
||||
TEST_CASE("powerindex", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -364,7 +364,7 @@ TEST_CASE("powerindex", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("powervalues", "[.cmdcall]") {
|
||||
TEST_CASE("powervalues", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -377,7 +377,7 @@ TEST_CASE("powervalues", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("slowadcvalues", "[.cmdcall]") {
|
||||
TEST_CASE("slowadcvalues", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -390,7 +390,7 @@ TEST_CASE("slowadcvalues", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("slowadclist", "[.cmdcall]") {
|
||||
TEST_CASE("slowadclist", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -423,7 +423,7 @@ TEST_CASE("slowadclist", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("slowadcname", "[.cmdcall]") {
|
||||
TEST_CASE("slowadcname", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -459,7 +459,7 @@ TEST_CASE("slowadcname", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("slowadcindex", "[.cmdcall]") {
|
||||
TEST_CASE("slowadcindex", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -488,7 +488,7 @@ TEST_CASE("slowadcindex", "[.cmdcall]") {
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("dac", "[.cmdcall][.dacs]") {
|
||||
TEST_CASE("dac", "[.detectorintegration][.dacs]") {
|
||||
// dac 0 to dac 17
|
||||
|
||||
Detector det;
|
||||
@@ -564,7 +564,7 @@ TEST_CASE("dac", "[.cmdcall][.dacs]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcvpp", "[.cmdcall]") {
|
||||
TEST_CASE("adcvpp", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -596,7 +596,7 @@ TEST_CASE("adcvpp", "[.cmdcall]") {
|
||||
|
||||
/* CTB Specific */
|
||||
|
||||
TEST_CASE("samples", "[.cmdcall]") {
|
||||
TEST_CASE("samples", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -640,7 +640,7 @@ TEST_CASE("samples", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("asamples", "[.cmdcall]") {
|
||||
TEST_CASE("asamples", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -671,7 +671,7 @@ TEST_CASE("asamples", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcclk", "[.cmdcall]") {
|
||||
TEST_CASE("adcclk", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -702,7 +702,7 @@ TEST_CASE("adcclk", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("runclk", "[.cmdcall]") {
|
||||
TEST_CASE("runclk", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -733,7 +733,7 @@ TEST_CASE("runclk", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("syncclk", "[.cmdcall]") {
|
||||
TEST_CASE("syncclk", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -745,7 +745,7 @@ TEST_CASE("syncclk", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_limit", "[.cmdcall]") {
|
||||
TEST_CASE("v_limit", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -784,7 +784,7 @@ TEST_CASE("v_limit", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcenable", "[.cmdcall]") {
|
||||
TEST_CASE("adcenable", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -814,7 +814,7 @@ TEST_CASE("adcenable", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcenable10g", "[.cmdcall]") {
|
||||
TEST_CASE("adcenable10g", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -845,7 +845,7 @@ TEST_CASE("adcenable10g", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("transceiverenable", "[.cmdcall]") {
|
||||
TEST_CASE("transceiverenable", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -878,7 +878,7 @@ TEST_CASE("transceiverenable", "[.cmdcall]") {
|
||||
|
||||
/* CTB Specific */
|
||||
|
||||
TEST_CASE("dsamples", "[.cmdcall]") {
|
||||
TEST_CASE("dsamples", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -909,7 +909,7 @@ TEST_CASE("dsamples", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("tsamples", "[.cmdcall]") {
|
||||
TEST_CASE("tsamples", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -940,7 +940,7 @@ TEST_CASE("tsamples", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("romode", "[.cmdcall]") {
|
||||
TEST_CASE("romode", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -994,7 +994,7 @@ TEST_CASE("romode", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("dbitclk", "[.cmdcall]") {
|
||||
TEST_CASE("dbitclk", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1025,95 +1025,46 @@ TEST_CASE("dbitclk", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_a", "[.cmdcall]") {
|
||||
TEST_CASE("v_abcd", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_A);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("v_a", {"1200"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "v_a 1200\n");
|
||||
caller.call("v_a", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "v_a 1200\n");
|
||||
|
||||
std::vector<std::string> cmds{"v_a", "v_b", "v_c", "v_d"};
|
||||
std::vector<defs::dacIndex> indices{defs::V_POWER_A, defs::V_POWER_B,
|
||||
defs::V_POWER_C, defs::V_POWER_D};
|
||||
|
||||
if (det.isVirtualDetectorServer().tsquash("Inconsistent virtual servers")) {
|
||||
cmds.push_back("v_io");
|
||||
indices.push_back(defs::V_POWER_IO);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < cmds.size(); ++i) {
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(indices[i]);
|
||||
{
|
||||
std::ostringstream oss;
|
||||
caller.call(cmds[i], {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == cmds[i] + " 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call(cmds[i], {"1200"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == cmds[i] + " 1200\n");
|
||||
caller.call(cmds[i], {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == cmds[i] + " 1200\n");
|
||||
}
|
||||
for (int nmodules = 0; nmodules != det.size(); ++i) {
|
||||
det.setPower(indices[i], prev_val[i], {nmodules});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call(cmds[i], {}, -1, GET));
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPower(defs::V_POWER_A, prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_a", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_b", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_B);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("v_b", {"1200"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "v_b 1200\n");
|
||||
caller.call("v_b", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "v_b 1200\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPower(defs::V_POWER_B, prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_b", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_c", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_C);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("v_c", {"1200"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "v_c 1200\n");
|
||||
caller.call("v_c", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "v_c 1200\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPower(defs::V_POWER_C, prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_c", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_d", "[.cmdcall]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_val = det.getPower(defs::V_POWER_D);
|
||||
{
|
||||
std::ostringstream oss1, oss2;
|
||||
caller.call("v_d", {"1200"}, -1, PUT, oss1);
|
||||
REQUIRE(oss1.str() == "v_d 1200\n");
|
||||
caller.call("v_d", {}, -1, GET, oss2);
|
||||
REQUIRE(oss2.str() == "v_d 1200\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setPower(defs::V_POWER_D, prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("v_d", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_io", "[.cmdcall]") {
|
||||
TEST_CASE("v_io", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1126,7 +1077,7 @@ TEST_CASE("v_io", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("v_chip", "[.cmdcall]") {
|
||||
TEST_CASE("v_chip", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1138,7 +1089,7 @@ TEST_CASE("v_chip", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vm_a", "[.cmdcall]") {
|
||||
TEST_CASE("vm_a", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1149,7 +1100,7 @@ TEST_CASE("vm_a", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vm_b", "[.cmdcall]") {
|
||||
TEST_CASE("vm_b", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1160,7 +1111,7 @@ TEST_CASE("vm_b", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vm_c", "[.cmdcall]") {
|
||||
TEST_CASE("vm_c", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1171,7 +1122,7 @@ TEST_CASE("vm_c", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vm_d", "[.cmdcall]") {
|
||||
TEST_CASE("vm_d", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1182,7 +1133,7 @@ TEST_CASE("vm_d", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vm_io", "[.cmdcall]") {
|
||||
TEST_CASE("vm_io", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1193,7 +1144,7 @@ TEST_CASE("vm_io", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("im_a", "[.cmdcall]") {
|
||||
TEST_CASE("im_a", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1204,7 +1155,7 @@ TEST_CASE("im_a", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("im_b", "[.cmdcall]") {
|
||||
TEST_CASE("im_b", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1215,7 +1166,7 @@ TEST_CASE("im_b", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("im_c", "[.cmdcall]") {
|
||||
TEST_CASE("im_c", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1226,7 +1177,7 @@ TEST_CASE("im_c", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("im_d", "[.cmdcall]") {
|
||||
TEST_CASE("im_d", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1237,7 +1188,7 @@ TEST_CASE("im_d", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("im_io", "[.cmdcall]") {
|
||||
TEST_CASE("im_io", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1248,7 +1199,7 @@ TEST_CASE("im_io", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("slowadc", "[.cmdcall]") {
|
||||
TEST_CASE("slowadc", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1264,7 +1215,7 @@ TEST_CASE("slowadc", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("extsampling", "[.cmdcall]") {
|
||||
TEST_CASE("extsampling", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1294,7 +1245,7 @@ TEST_CASE("extsampling", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("extsamplingsrc", "[.cmdcall]") {
|
||||
TEST_CASE("extsamplingsrc", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1325,7 +1276,7 @@ TEST_CASE("extsamplingsrc", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("diodelay", "[.cmdcall]") {
|
||||
TEST_CASE("diodelay", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1348,7 +1299,7 @@ TEST_CASE("diodelay", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("led", "[.cmdcall]") {
|
||||
TEST_CASE("led", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
@@ -19,7 +19,7 @@ using test::PUT;
|
||||
|
||||
/** temperature */
|
||||
|
||||
TEST_CASE("temp_fpgaext", "[.cmdcall]") {
|
||||
TEST_CASE("temp_fpgaext", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -34,7 +34,7 @@ TEST_CASE("temp_fpgaext", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_10ge", "[.cmdcall]") {
|
||||
TEST_CASE("temp_10ge", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -49,7 +49,7 @@ TEST_CASE("temp_10ge", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_dcdc", "[.cmdcall]") {
|
||||
TEST_CASE("temp_dcdc", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -64,7 +64,7 @@ TEST_CASE("temp_dcdc", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_sodl", "[.cmdcall]") {
|
||||
TEST_CASE("temp_sodl", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -79,7 +79,7 @@ TEST_CASE("temp_sodl", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_sodr", "[.cmdcall]") {
|
||||
TEST_CASE("temp_sodr", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -94,7 +94,7 @@ TEST_CASE("temp_sodr", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_fpgafl", "[.cmdcall]") {
|
||||
TEST_CASE("temp_fpgafl", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -109,7 +109,7 @@ TEST_CASE("temp_fpgafl", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_fpgafr", "[.cmdcall]") {
|
||||
TEST_CASE("temp_fpgafr", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -126,7 +126,8 @@ TEST_CASE("temp_fpgafr", "[.cmdcall]") {
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("Setting and reading back EIGER dacs", "[.cmdcall][.dacs]") {
|
||||
TEST_CASE("Setting and reading back EIGER dacs",
|
||||
"[.detectorintegration][.dacs]") {
|
||||
// vsvp, vtr, vrf, vrs, vsvn, vtgstv, vcmp_ll, vcmp_lr, vcal, vcmp_rl,
|
||||
// rxb_rb, rxb_lb, vcmp_rr, vcp, vcn, vis, vthreshold
|
||||
Detector det;
|
||||
@@ -232,7 +233,7 @@ TEST_CASE("Setting and reading back EIGER dacs", "[.cmdcall][.dacs]") {
|
||||
|
||||
/* Network Configuration (Detector<->Receiver) */
|
||||
|
||||
TEST_CASE("txdelay_left", "[.cmdcall]") {
|
||||
TEST_CASE("txdelay_left", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -253,7 +254,7 @@ TEST_CASE("txdelay_left", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("txdelay_right", "[.cmdcall]") {
|
||||
TEST_CASE("txdelay_right", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -276,7 +277,7 @@ TEST_CASE("txdelay_right", "[.cmdcall]") {
|
||||
|
||||
/* Eiger Specific */
|
||||
|
||||
TEST_CASE("subexptime", "[.cmdcall]") {
|
||||
TEST_CASE("subexptime", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
|
||||
@@ -297,7 +298,7 @@ TEST_CASE("subexptime", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("subdeadtime", "[.cmdcall]") {
|
||||
TEST_CASE("subdeadtime", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
|
||||
@@ -318,7 +319,7 @@ TEST_CASE("subdeadtime", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("overflow", "[.cmdcall]") {
|
||||
TEST_CASE("overflow", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -339,7 +340,7 @@ TEST_CASE("overflow", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("ratecorr", "[.cmdcall]") {
|
||||
TEST_CASE("ratecorr", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -373,7 +374,7 @@ TEST_CASE("ratecorr", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("interruptsubframe", "[.cmdcall]") {
|
||||
TEST_CASE("interruptsubframe", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -397,7 +398,7 @@ TEST_CASE("interruptsubframe", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("measuredperiod", "[.cmdcall]") {
|
||||
TEST_CASE("measuredperiod", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -434,7 +435,7 @@ TEST_CASE("measuredperiod", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("measuredsubperiod", "[.cmdcall]") {
|
||||
TEST_CASE("measuredsubperiod", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -474,7 +475,7 @@ TEST_CASE("measuredsubperiod", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("activate", "[.cmdcall]") {
|
||||
TEST_CASE("activate", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -505,7 +506,7 @@ TEST_CASE("activate", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("partialreset", "[.cmdcall]") {
|
||||
TEST_CASE("partialreset", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -527,7 +528,7 @@ TEST_CASE("partialreset", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("pulse", "[.cmdcall]") {
|
||||
TEST_CASE("pulse", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -542,7 +543,7 @@ TEST_CASE("pulse", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("pulsenmove", "[.cmdcall]") {
|
||||
TEST_CASE("pulsenmove", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -557,7 +558,7 @@ TEST_CASE("pulsenmove", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("pulsechip", "[.cmdcall]") {
|
||||
TEST_CASE("pulsechip", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -572,7 +573,7 @@ TEST_CASE("pulsechip", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("quad", "[.cmdcall]") {
|
||||
TEST_CASE("quad", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -588,7 +589,7 @@ TEST_CASE("quad", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("datastream", "[.cmdcall]") {
|
||||
TEST_CASE("datastream", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -628,7 +629,7 @@ TEST_CASE("datastream", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("top", "[.cmdcall]") {
|
||||
TEST_CASE("top", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
@@ -151,7 +151,7 @@ void test_acquire_with_receiver(Caller &caller, const Detector &det) {
|
||||
|
||||
void create_files_for_acquire(
|
||||
Detector &det, Caller &caller, int64_t num_frames,
|
||||
const std::optional<testCtbAcquireInfo> &test_info) {
|
||||
const std::optional<testCtbAcquireInfo> &test_info, bool check_num_frames) {
|
||||
|
||||
// save previous state
|
||||
testFileInfo prev_file_info = get_file_state(det);
|
||||
@@ -172,9 +172,13 @@ void create_files_for_acquire(
|
||||
|
||||
// acquire and get num frames caught
|
||||
REQUIRE_NOTHROW(test_acquire_with_receiver(caller, det));
|
||||
auto frames_caught = det.getFramesCaught().tsquash(
|
||||
"Inconsistent number of frames caught")[0];
|
||||
REQUIRE(frames_caught == num_frames);
|
||||
// TODO: maybe there should not be REQUIRE statements in void function at
|
||||
// all
|
||||
if (check_num_frames) {
|
||||
auto frames_caught = det.getFramesCaught().tsquash(
|
||||
"Inconsistent number of frames caught")[0];
|
||||
REQUIRE(frames_caught == num_frames);
|
||||
}
|
||||
|
||||
// hdf5
|
||||
#ifdef HDF5C
|
||||
@@ -184,9 +188,11 @@ void create_files_for_acquire(
|
||||
|
||||
// acquire and get num frames caught
|
||||
test_acquire_with_receiver(caller, det);
|
||||
frames_caught = det.getFramesCaught().tsquash(
|
||||
"Inconsistent number of frames caught")[0];
|
||||
REQUIRE(frames_caught == num_frames);
|
||||
if (check_num_frames) {
|
||||
auto frames_caught = det.getFramesCaught().tsquash(
|
||||
"Inconsistent number of frames caught")[0];
|
||||
REQUIRE(frames_caught == num_frames);
|
||||
}
|
||||
#endif
|
||||
|
||||
// restore previous state
|
||||
|
||||
@@ -94,7 +94,8 @@ void test_acquire_with_receiver(Caller &caller, const Detector &det);
|
||||
|
||||
void create_files_for_acquire(
|
||||
Detector &det, Caller &caller, int64_t num_frames = 1,
|
||||
const std::optional<testCtbAcquireInfo> &test_info = std::nullopt);
|
||||
const std::optional<testCtbAcquireInfo> &test_info = std::nullopt,
|
||||
bool check_num_frames = true);
|
||||
|
||||
testCtbAcquireInfo get_ctb_config_state(const Detector &det);
|
||||
void set_ctb_config_state(Detector &det,
|
||||
|
||||
@@ -18,7 +18,7 @@ using test::GET;
|
||||
using test::PUT;
|
||||
|
||||
// time specific measurements for gotthard2
|
||||
TEST_CASE("timegotthard2", "[.cmdcall]") {
|
||||
TEST_CASE("timegotthard2", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -106,7 +106,8 @@ TEST_CASE("timegotthard2", "[.cmdcall]") {
|
||||
}
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("Setting and reading back GOTTHARD2 dacs", "[.cmdcall][.dacs]") {
|
||||
TEST_CASE("Setting and reading back GOTTHARD2 dacs",
|
||||
"[.detectorintegration][.dacs]") {
|
||||
// vref_h_adc, vb_comp_fe, vb_comp_adc, vcom_cds,
|
||||
// vref_restore, vb_opa_1st, vref_comp_fe, vcom_adc1,
|
||||
// vref_prech, vref_l_adc, vref_cds, vb_cs,
|
||||
@@ -215,7 +216,7 @@ TEST_CASE("Setting and reading back GOTTHARD2 dacs", "[.cmdcall][.dacs]") {
|
||||
|
||||
/* on chip dacs */
|
||||
|
||||
TEST_CASE("vchip_comp_fe", "[.cmdcall][.onchipdacs]") {
|
||||
TEST_CASE("vchip_comp_fe", "[.detectorintegration][.onchipdacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -228,7 +229,7 @@ TEST_CASE("vchip_comp_fe", "[.cmdcall][.onchipdacs]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vchip_opa_1st", "[.cmdcall][.onchipdacs]") {
|
||||
TEST_CASE("vchip_opa_1st", "[.detectorintegration][.onchipdacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -241,7 +242,7 @@ TEST_CASE("vchip_opa_1st", "[.cmdcall][.onchipdacs]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vchip_opa_fd", "[.cmdcall][.onchipdacs]") {
|
||||
TEST_CASE("vchip_opa_fd", "[.detectorintegration][.onchipdacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -254,7 +255,7 @@ TEST_CASE("vchip_opa_fd", "[.cmdcall][.onchipdacs]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vchip_comp_adc", "[.cmdcall][.onchipdacs]") {
|
||||
TEST_CASE("vchip_comp_adc", "[.detectorintegration][.onchipdacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -267,7 +268,7 @@ TEST_CASE("vchip_comp_adc", "[.cmdcall][.onchipdacs]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vchip_ref_comp_fe", "[.cmdcall][.onchipdacs]") {
|
||||
TEST_CASE("vchip_ref_comp_fe", "[.detectorintegration][.onchipdacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -281,7 +282,7 @@ TEST_CASE("vchip_ref_comp_fe", "[.cmdcall][.onchipdacs]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vchip_cs", "[.cmdcall][.onchipdacs]") {
|
||||
TEST_CASE("vchip_cs", "[.detectorintegration][.onchipdacs]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -296,7 +297,7 @@ TEST_CASE("vchip_cs", "[.cmdcall][.onchipdacs]") {
|
||||
|
||||
/* Gotthard2 Specific */
|
||||
|
||||
TEST_CASE("bursts", "[.cmdcall]") {
|
||||
TEST_CASE("bursts", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -370,7 +371,7 @@ TEST_CASE("bursts", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("burstperiod", "[.cmdcall]") {
|
||||
TEST_CASE("burstperiod", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -392,7 +393,7 @@ TEST_CASE("burstperiod", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("burstsl", "[.cmdcall]") {
|
||||
TEST_CASE("burstsl", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -403,7 +404,7 @@ TEST_CASE("burstsl", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("inj_ch", "[.cmdcall]") {
|
||||
TEST_CASE("inj_ch", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -428,7 +429,7 @@ TEST_CASE("inj_ch", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vetophoton", "[.cmdcall]") {
|
||||
TEST_CASE("vetophoton", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -450,7 +451,7 @@ TEST_CASE("vetophoton", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vetoref", "[.cmdcall]") {
|
||||
TEST_CASE("vetoref", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -465,7 +466,7 @@ TEST_CASE("vetoref", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vetofile", "[.cmdcall]") {
|
||||
TEST_CASE("vetofile", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -479,7 +480,7 @@ TEST_CASE("vetofile", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("burstmode", "[.cmdcall]") {
|
||||
TEST_CASE("burstmode", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -510,7 +511,7 @@ TEST_CASE("burstmode", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("cdsgain", "[.cmdcall]") {
|
||||
TEST_CASE("cdsgain", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -540,7 +541,7 @@ TEST_CASE("cdsgain", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("timingsource", "[.cmdcall]") {
|
||||
TEST_CASE("timingsource", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -570,7 +571,7 @@ TEST_CASE("timingsource", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("veto", "[.cmdcall]") {
|
||||
TEST_CASE("veto", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -600,7 +601,7 @@ TEST_CASE("veto", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("vetostream", "[.cmdcall]") {
|
||||
TEST_CASE("vetostream", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -646,7 +647,7 @@ TEST_CASE("vetostream", "[.cmdcall]") {
|
||||
REQUIRE_THROWS(caller.call("vetostream", {"dfgd"}, -1, GET));
|
||||
}
|
||||
|
||||
TEST_CASE("vetoalg", "[.cmdcall]") {
|
||||
TEST_CASE("vetoalg", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -702,7 +703,7 @@ TEST_CASE("vetoalg", "[.cmdcall]") {
|
||||
REQUIRE_THROWS(caller.call("vetoalg", {"dfgd"}, -1, GET));
|
||||
}
|
||||
|
||||
TEST_CASE("confadc", "[.cmdcall]") {
|
||||
TEST_CASE("confadc", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
@@ -17,7 +17,8 @@ using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("Setting and reading back Jungfrau dacs", "[.cmdcall][.dacs]") {
|
||||
TEST_CASE("Setting and reading back Jungfrau dacs",
|
||||
"[.detectorintegration][.dacs]") {
|
||||
// vb_comp, vdd_prot, vin_com, vref_prech, vb_pixbuf, vb_ds, vref_ds,
|
||||
// vref_comp
|
||||
Detector det;
|
||||
@@ -95,7 +96,7 @@ TEST_CASE("Setting and reading back Jungfrau dacs", "[.cmdcall][.dacs]") {
|
||||
|
||||
/* Network Configuration (Detector<->Receiver) */
|
||||
|
||||
TEST_CASE("selinterface", "[.cmdcall]") {
|
||||
TEST_CASE("selinterface", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -126,7 +127,7 @@ TEST_CASE("selinterface", "[.cmdcall]") {
|
||||
|
||||
/* Jungfrau/moench Specific */
|
||||
|
||||
TEST_CASE("temp_threshold", "[.cmdcall]") {
|
||||
TEST_CASE("temp_threshold", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -156,7 +157,7 @@ TEST_CASE("temp_threshold", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("chipversion", "[.cmdcall]") {
|
||||
TEST_CASE("chipversion", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -168,7 +169,7 @@ TEST_CASE("chipversion", "[.cmdcall]") {
|
||||
REQUIRE_THROWS(caller.call("chipversion", {"0"}, -1, PUT));
|
||||
}
|
||||
|
||||
TEST_CASE("temp_control", "[.cmdcall]") {
|
||||
TEST_CASE("temp_control", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -198,7 +199,7 @@ TEST_CASE("temp_control", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("temp_event", "[.cmdcall]") {
|
||||
TEST_CASE("temp_event", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -219,7 +220,7 @@ TEST_CASE("temp_event", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("autocompdisable", "[.cmdcall]") {
|
||||
TEST_CASE("autocompdisable", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -249,7 +250,7 @@ TEST_CASE("autocompdisable", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("compdisabletime", "[.cmdcall]") {
|
||||
TEST_CASE("compdisabletime", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -279,7 +280,7 @@ TEST_CASE("compdisabletime", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("extrastoragecells", "[.cmdcall]") {
|
||||
TEST_CASE("extrastoragecells", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -322,7 +323,7 @@ TEST_CASE("extrastoragecells", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("storagecell_start", "[.cmdcall]") {
|
||||
TEST_CASE("storagecell_start", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -367,7 +368,7 @@ TEST_CASE("storagecell_start", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("storagecell_delay", "[.cmdcall]") {
|
||||
TEST_CASE("storagecell_delay", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -408,7 +409,7 @@ TEST_CASE("storagecell_delay", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gainmode", "[.cmdcall]") {
|
||||
TEST_CASE("gainmode", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -457,7 +458,7 @@ TEST_CASE("gainmode", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("filtercells", "[.cmdcall]") {
|
||||
TEST_CASE("filtercells", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -501,7 +502,7 @@ TEST_CASE("filtercells", "[.cmdcall]") {
|
||||
REQUIRE_THROWS(caller.call("filtercells", {"0"}, -1, PUT));
|
||||
}
|
||||
}
|
||||
TEST_CASE("pedestalmode", "[.cmdcall]") {
|
||||
TEST_CASE("pedestalmode", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -657,7 +658,7 @@ TEST_CASE("pedestalmode", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("timing_info_decoder", "[.cmdcall]") {
|
||||
TEST_CASE("timing_info_decoder", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::JUNGFRAU &&
|
||||
@@ -686,7 +687,7 @@ TEST_CASE("timing_info_decoder", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("collectionmode", "[.cmdcall]") {
|
||||
TEST_CASE("collectionmode", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::JUNGFRAU) {
|
||||
@@ -714,7 +715,7 @@ TEST_CASE("collectionmode", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("sync", "[.cmdcall]") {
|
||||
TEST_CASE("sync", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
@@ -1032,7 +1032,8 @@ void open_hdf5_file(const std::string &file_path) {
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_CASE("check_master_file_attributes", "[.cmdcall][.cmdacquire][.cmdattr]") {
|
||||
TEST_CASE("check_master_file_attributes",
|
||||
"[.detectorintegration][.cmdacquire][.cmdattr]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
@@ -1041,12 +1042,14 @@ TEST_CASE("check_master_file_attributes", "[.cmdcall][.cmdacquire][.cmdattr]") {
|
||||
|
||||
int64_t num_frames = 1;
|
||||
switch (det_type) {
|
||||
case defs::EIGER:
|
||||
case defs::JUNGFRAU:
|
||||
create_files_for_acquire(det, caller, num_frames, std::nullopt, false);
|
||||
break;
|
||||
case defs::EIGER:
|
||||
case defs::MOENCH:
|
||||
case defs::MYTHEN3:
|
||||
case defs::GOTTHARD2:
|
||||
create_files_for_acquire(det, caller, num_frames);
|
||||
create_files_for_acquire(det, caller, num_frames, std::nullopt);
|
||||
break;
|
||||
case defs::CHIPTESTBOARD:
|
||||
case defs::XILINX_CHIPTESTBOARD: {
|
||||
|
||||
@@ -17,7 +17,8 @@ using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("Setting and reading back moench dacs", "[.cmdcall][.dacs]") {
|
||||
TEST_CASE("Setting and reading back moench dacs",
|
||||
"[.detectorintegration][.dacs]") {
|
||||
// vbp_colbuf, vipre, vin_cm, vb_sda, vcasc_sfp, vout_cm, vipre_cds,
|
||||
// ibias_sfp
|
||||
Detector det;
|
||||
|
||||
@@ -19,7 +19,8 @@ using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("Setting and reading back MYTHEN3 dacs", "[.cmdcall][.dacs]") {
|
||||
TEST_CASE("Setting and reading back MYTHEN3 dacs",
|
||||
"[.detectorintegration][.dacs]") {
|
||||
// vcassh, vth2, vshaper, vshaperneg, vipre_out, vth3, vth1,
|
||||
// vicin, vcas, vpreamp, vpl, vipre, viinsh, vph, vtrim, vdcsh,
|
||||
|
||||
@@ -184,7 +185,7 @@ TEST_CASE("Setting and reading back MYTHEN3 dacs", "[.cmdcall][.dacs]") {
|
||||
|
||||
/* acquisition */
|
||||
|
||||
TEST_CASE("readout", "[.cmdcall]") {
|
||||
TEST_CASE("readout", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
// PUT only command
|
||||
@@ -201,7 +202,7 @@ TEST_CASE("readout", "[.cmdcall]") {
|
||||
|
||||
/* Mythen3 Specific */
|
||||
|
||||
TEST_CASE("counters", "[.cmdcall]") {
|
||||
TEST_CASE("counters", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -233,7 +234,7 @@ TEST_CASE("counters", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gates", "[.cmdcall]") {
|
||||
TEST_CASE("gates", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -263,7 +264,7 @@ TEST_CASE("gates", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("exptime1", "[.cmdcall]") {
|
||||
TEST_CASE("exptime1", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -292,7 +293,7 @@ TEST_CASE("exptime1", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("exptime2", "[.cmdcall]") {
|
||||
TEST_CASE("exptime2", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -321,7 +322,7 @@ TEST_CASE("exptime2", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("exptime3", "[.cmdcall]") {
|
||||
TEST_CASE("exptime3", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -350,7 +351,7 @@ TEST_CASE("exptime3", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gatedelay", "[.cmdcall]") {
|
||||
TEST_CASE("gatedelay", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -386,7 +387,7 @@ TEST_CASE("gatedelay", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gatedelay1", "[.cmdcall]") {
|
||||
TEST_CASE("gatedelay1", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -415,7 +416,7 @@ TEST_CASE("gatedelay1", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gatedelay2", "[.cmdcall]") {
|
||||
TEST_CASE("gatedelay2", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -444,7 +445,7 @@ TEST_CASE("gatedelay2", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("gatedelay3", "[.cmdcall]") {
|
||||
TEST_CASE("gatedelay3", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -473,7 +474,7 @@ TEST_CASE("gatedelay3", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("polarity", "[.cmdcall]") {
|
||||
TEST_CASE("polarity", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::MYTHEN3) {
|
||||
@@ -501,7 +502,7 @@ TEST_CASE("polarity", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("interpolation", "[.cmdcall]") {
|
||||
TEST_CASE("interpolation", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::MYTHEN3) {
|
||||
@@ -555,7 +556,7 @@ TEST_CASE("interpolation", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("pumpprobe", "[.cmdcall]") {
|
||||
TEST_CASE("pumpprobe", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::MYTHEN3) {
|
||||
@@ -632,7 +633,7 @@ TEST_CASE("pumpprobe", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("apulse", "[.cmdcall]") {
|
||||
TEST_CASE("apulse", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::MYTHEN3) {
|
||||
@@ -660,7 +661,7 @@ TEST_CASE("apulse", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("dpulse", "[.cmdcall]") {
|
||||
TEST_CASE("dpulse", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
if (det.getDetectorType().squash() == defs::MYTHEN3) {
|
||||
|
||||
@@ -19,7 +19,7 @@ using test::PUT;
|
||||
|
||||
/* Pattern */
|
||||
|
||||
TEST_CASE("patfname", "[.cmdcall]") {
|
||||
TEST_CASE("patfname", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -32,7 +32,7 @@ TEST_CASE("patfname", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("pattern", "[.cmdcall]") {
|
||||
TEST_CASE("pattern", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -45,7 +45,7 @@ TEST_CASE("pattern", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("savepattern", "[.cmdcall]") {
|
||||
TEST_CASE("savepattern", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -63,7 +63,7 @@ TEST_CASE("savepattern", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("defaultpattern", "[.cmdcall]") {
|
||||
TEST_CASE("defaultpattern", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -76,7 +76,7 @@ TEST_CASE("defaultpattern", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patioctrl", "[.cmdcall]") {
|
||||
TEST_CASE("patioctrl", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -107,7 +107,7 @@ TEST_CASE("patioctrl", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patword", "[.cmdcall]") {
|
||||
TEST_CASE("patword", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -149,7 +149,7 @@ TEST_CASE("patword", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patlimits", "[.cmdcall]") {
|
||||
TEST_CASE("patlimits", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -176,7 +176,7 @@ TEST_CASE("patlimits", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patloop", "[.cmdcall]") {
|
||||
TEST_CASE("patloop", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -225,7 +225,7 @@ TEST_CASE("patloop", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patnloop", "[.cmdcall]") {
|
||||
TEST_CASE("patnloop", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -271,7 +271,7 @@ TEST_CASE("patnloop", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patwait", "[.cmdcall]") {
|
||||
TEST_CASE("patwait", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -317,7 +317,7 @@ TEST_CASE("patwait", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patwaittime", "[.cmdcall]") {
|
||||
TEST_CASE("patwaittime", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -379,7 +379,7 @@ TEST_CASE("patwaittime", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patmask", "[.cmdcall]") {
|
||||
TEST_CASE("patmask", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -405,7 +405,7 @@ TEST_CASE("patmask", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patsetbit", "[.cmdcall]") {
|
||||
TEST_CASE("patsetbit", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -431,12 +431,13 @@ TEST_CASE("patsetbit", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("patternstart", "[.cmdcall]") {
|
||||
TEST_CASE("patternstart", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
REQUIRE_THROWS(caller.call("patternstart", {}, -1, GET));
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::MYTHEN3) {
|
||||
if (det_type == defs::MYTHEN3 || det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
REQUIRE_NOTHROW(caller.call("patternstart", {}, -1, PUT));
|
||||
} else {
|
||||
REQUIRE_THROWS(caller.call("patternstart", {}, -1, PUT));
|
||||
|
||||
246
slsDetectorSoftware/tests/Caller/test-Caller-rx-running.cpp
Normal file
246
slsDetectorSoftware/tests/Caller/test-Caller-rx-running.cpp
Normal file
@@ -0,0 +1,246 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
// Copyright (C) 2025 Contributors to the SLS Detector Package
|
||||
#include "Caller.h"
|
||||
#include "catch.hpp"
|
||||
#include "sls/Detector.h"
|
||||
#include "tests/globals.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
using test::PUT;
|
||||
|
||||
TEST_CASE("Ctb and xilinx - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD ||
|
||||
det_type == defs::XILINX_CHIPTESTBOARD) {
|
||||
auto prev_romode = det.getReadoutMode();
|
||||
auto prev_asamples = det.getNumberOfAnalogSamples();
|
||||
auto prev_dsamples = det.getNumberOfDigitalSamples();
|
||||
auto prev_tsamples = det.getNumberOfTransceiverSamples();
|
||||
auto prev_adcenable10g = det.getTenGigaADCEnableMask();
|
||||
auto prev_trasnsceiverenable = det.getTransceiverEnableMask();
|
||||
auto prev_rxdbitlist = det.getRxDbitList();
|
||||
auto prev_rxdbitoffset = det.getRxDbitOffset();
|
||||
auto prev_rxdbitreorder = det.getRxDbitReorder();
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("romode", {"digital"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("asamples", {"5"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("dsamples", {"100"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("tsamples", {"2"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("adcenable10g", {"0xFF00FFFF"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("transceiverenable", {"0x3"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("rx_dbitlist", {"{1,2,10}"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("rx_dbitoffset", {"5"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("rx_dbitreorder", {"0"}, -1, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setReadoutMode(prev_romode[i], {i});
|
||||
det.setNumberOfAnalogSamples(prev_asamples[i], {i});
|
||||
det.setNumberOfDigitalSamples(prev_dsamples[i], {i});
|
||||
det.setNumberOfTransceiverSamples(prev_tsamples[i], {i});
|
||||
det.setTenGigaADCEnableMask(prev_adcenable10g[i], {i});
|
||||
det.setTransceiverEnableMask(prev_trasnsceiverenable[i], {i});
|
||||
det.setRxDbitList(prev_rxdbitlist[i], {i});
|
||||
det.setRxDbitOffset(prev_rxdbitoffset[i], {i});
|
||||
det.setRxDbitReorder(prev_rxdbitreorder[i], {i});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("adcenable - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::CHIPTESTBOARD) {
|
||||
auto prev_adcenable = det.getADCEnableMask();
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("adcenable", {"0xFFFFFF00"}, -1, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setADCEnableMask(prev_adcenable[i], {i});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("bursts - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::GOTTHARD2) {
|
||||
auto prev_burst =
|
||||
det.getNumberOfBursts().tsquash("#bursts should be same to test");
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("bursts", {"20"}, -1, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
det.setNumberOfBursts(prev_burst);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("counters - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::MYTHEN3) {
|
||||
auto prev_counters = det.getCounterMask();
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("counters", {"0 1 2"}, -1, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setCounterMask(prev_counters[i], {i});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("numinterfaces - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
|
||||
auto prev_numinterfaces = det.getNumberofUDPInterfaces().tsquash(
|
||||
"Number of UDP Interfaces is not consistent among modules");
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("numinterfaces", {"2"}, -1, PUT));
|
||||
|
||||
auto numinterfaces = det.getNumberofUDPInterfaces();
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
det.setNumberofUDPInterfaces(prev_numinterfaces);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("dr - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::EIGER || det_type == defs::MYTHEN3) {
|
||||
auto prev_dr =
|
||||
det.getDynamicRange().tsquash("dr should be same to test");
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("dr", {"16"}, -1, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
det.setDynamicRange(prev_dr);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("tengiga - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
|
||||
det_type == defs::CHIPTESTBOARD) {
|
||||
auto prev_tengiga = det.getTenGiga();
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("tengiga", {"1"}, -1, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setTenGiga(prev_tengiga[i], {i});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("general - cant put if receiver is not idle",
|
||||
"[.detectorintegration][.rx]") {
|
||||
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
|
||||
{
|
||||
auto prev_frames =
|
||||
det.getNumberOfFrames().tsquash("#frames should be same to test");
|
||||
auto prev_triggers =
|
||||
det.getNumberOfTriggers().tsquash("#triggers must be same to test");
|
||||
auto prev_findex = det.getAcquisitionIndex();
|
||||
auto prev_fwrite = det.getFileWrite();
|
||||
auto prev_fifodepth = det.getRxFifoDepth();
|
||||
auto rx_hostname = det.getRxHostname();
|
||||
|
||||
// start receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_start", {}, -1, PUT));
|
||||
|
||||
REQUIRE_THROWS(caller.call("frames", {"10"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("triggers", {"5"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("findex", {"2"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("fwrite", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("rx_fifodepth", {"1000"}, -1, PUT));
|
||||
REQUIRE_THROWS(caller.call("rx_hostname", {rx_hostname[0]}, 0, PUT));
|
||||
|
||||
// stop receiver
|
||||
REQUIRE_NOTHROW(caller.call("rx_stop", {}, -1, PUT));
|
||||
|
||||
det.setNumberOfFrames(prev_frames);
|
||||
det.setNumberOfTriggers(prev_triggers);
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setAcquisitionIndex(prev_findex[i], {i});
|
||||
det.setFileWrite(prev_fwrite[i], {i});
|
||||
det.setRxFifoDepth(prev_fifodepth[i], {i});
|
||||
det.setRxHostname(rx_hostname[i], {i});
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace sls
|
||||
@@ -25,7 +25,7 @@ python/scripts/list_tested_cmd.py to check if all commands are covered
|
||||
|
||||
/* configuration */
|
||||
|
||||
TEST_CASE("rx_version", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_version", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
std::ostringstream oss;
|
||||
@@ -39,7 +39,7 @@ TEST_CASE("rx_version", "[.cmdcall][.rx]") {
|
||||
}
|
||||
|
||||
/* acquisition */
|
||||
TEST_CASE("rx_start", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_start", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
det.setFileWrite(false); // avoid writing or error on file creation
|
||||
@@ -57,7 +57,7 @@ TEST_CASE("rx_start", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_stop", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_stop", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
// PUT only command
|
||||
@@ -74,7 +74,7 @@ TEST_CASE("rx_stop", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_status", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_status", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
det.setFileWrite(false); // avoid writing or error on file creation
|
||||
@@ -92,7 +92,7 @@ TEST_CASE("rx_status", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_framescaught", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_framescaught", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
// This ensures 0 caught frames
|
||||
@@ -126,7 +126,7 @@ TEST_CASE("rx_framescaught", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_missingpackets", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_missingpackets", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFileWrite();
|
||||
@@ -171,7 +171,7 @@ TEST_CASE("rx_missingpackets", "[.cmdcall][.rx]") {
|
||||
det.setNumberOfFrames(prev_frames);
|
||||
}
|
||||
|
||||
TEST_CASE("rx_frameindex", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_frameindex", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
caller.call("rx_frameindex", {}, -1, GET);
|
||||
@@ -182,7 +182,7 @@ TEST_CASE("rx_frameindex", "[.cmdcall][.rx]") {
|
||||
|
||||
/* Network Configuration (Detector<->Receiver) */
|
||||
|
||||
TEST_CASE("rx_printconfig", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_printconfig", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
REQUIRE_NOTHROW(caller.call("rx_printconfig", {}, -1, GET));
|
||||
@@ -190,7 +190,7 @@ TEST_CASE("rx_printconfig", "[.cmdcall][.rx]") {
|
||||
|
||||
/* Receiver Config */
|
||||
|
||||
TEST_CASE("rx_hostname", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_hostname", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxHostname();
|
||||
@@ -222,7 +222,7 @@ TEST_CASE("rx_hostname", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_tcpport", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_tcpport", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxPort();
|
||||
@@ -261,7 +261,7 @@ TEST_CASE("rx_tcpport", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_fifodepth", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_fifodepth", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxFifoDepth();
|
||||
@@ -285,7 +285,7 @@ TEST_CASE("rx_fifodepth", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_silent", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_silent", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxSilentMode();
|
||||
@@ -309,7 +309,7 @@ TEST_CASE("rx_silent", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_discardpolicy", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_discardpolicy", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxFrameDiscardPolicy();
|
||||
@@ -338,7 +338,7 @@ TEST_CASE("rx_discardpolicy", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_padding", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_padding", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getPartialFramesPadding();
|
||||
@@ -362,7 +362,7 @@ TEST_CASE("rx_padding", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_udpsocksize", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_udpsocksize", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash(
|
||||
@@ -382,7 +382,7 @@ TEST_CASE("rx_udpsocksize", "[.cmdcall][.rx]") {
|
||||
det.setRxUDPSocketBufferSize(prev_val);
|
||||
}
|
||||
|
||||
TEST_CASE("rx_realudpsocksize", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_realudpsocksize", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
uint64_t val = 0;
|
||||
@@ -401,7 +401,7 @@ TEST_CASE("rx_realudpsocksize", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_lock", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_lock", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxLock();
|
||||
@@ -425,7 +425,7 @@ TEST_CASE("rx_lock", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_lastclient", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_lastclient", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
std::ostringstream oss;
|
||||
@@ -435,14 +435,14 @@ TEST_CASE("rx_lastclient", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_threads", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_threads", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
std::ostringstream oss;
|
||||
REQUIRE_NOTHROW(caller.call("rx_threads", {}, -1, GET, oss));
|
||||
}
|
||||
|
||||
TEST_CASE("rx_arping", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_arping", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxArping();
|
||||
@@ -467,7 +467,7 @@ TEST_CASE("rx_arping", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
}
|
||||
TEST_CASE("rx_roi", "[.cmdcall]") {
|
||||
TEST_CASE("rx_roi", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -756,7 +756,8 @@ TEST_CASE("rx_roi", "[.cmdcall]") {
|
||||
// check master file creation
|
||||
// TODO: check roi in master file
|
||||
{
|
||||
REQUIRE_NOTHROW(create_files_for_acquire(det, caller));
|
||||
REQUIRE_NOTHROW(
|
||||
create_files_for_acquire(det, caller, 1, std::nullopt, false));
|
||||
testFileInfo file_info;
|
||||
std::string master_file_prefix =
|
||||
file_info.getMasterFileNamePrefix();
|
||||
@@ -782,7 +783,7 @@ TEST_CASE("rx_roi", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_clearroi", "[.cmdcall]") {
|
||||
TEST_CASE("rx_clearroi", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -808,7 +809,7 @@ TEST_CASE("rx_clearroi", "[.cmdcall]") {
|
||||
|
||||
/* File */
|
||||
|
||||
TEST_CASE("fformat", "[.cmdcall]") {
|
||||
TEST_CASE("fformat", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFileFormat();
|
||||
@@ -827,7 +828,7 @@ TEST_CASE("fformat", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("fpath", "[.cmdcall]") {
|
||||
TEST_CASE("fpath", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFilePath();
|
||||
@@ -849,7 +850,7 @@ TEST_CASE("fpath", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("fname", "[.cmdcall]") {
|
||||
TEST_CASE("fname", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFileNamePrefix();
|
||||
@@ -876,7 +877,7 @@ TEST_CASE("fname", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("findex", "[.cmdcall]") {
|
||||
TEST_CASE("findex", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getAcquisitionIndex();
|
||||
@@ -900,7 +901,7 @@ TEST_CASE("findex", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("fwrite", "[.cmdcall]") {
|
||||
TEST_CASE("fwrite", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFileWrite();
|
||||
@@ -924,7 +925,7 @@ TEST_CASE("fwrite", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("fmaster", "[.cmdcall]") {
|
||||
TEST_CASE("fmaster", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getMasterFileWrite();
|
||||
@@ -946,7 +947,7 @@ TEST_CASE("fmaster", "[.cmdcall]") {
|
||||
det.setMasterFileWrite(prev_val);
|
||||
}
|
||||
|
||||
TEST_CASE("foverwrite", "[.cmdcall]") {
|
||||
TEST_CASE("foverwrite", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFileOverWrite();
|
||||
@@ -970,7 +971,7 @@ TEST_CASE("foverwrite", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_framesperfile", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_framesperfile", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getFramesPerFile();
|
||||
@@ -1001,7 +1002,7 @@ TEST_CASE("rx_framesperfile", "[.cmdcall][.rx]") {
|
||||
|
||||
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
||||
|
||||
TEST_CASE("rx_zmqstream", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_zmqstream", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxZmqDataStream();
|
||||
@@ -1027,7 +1028,7 @@ TEST_CASE("rx_zmqstream", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_zmqfreq", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_zmqfreq", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxZmqFrequency();
|
||||
@@ -1051,7 +1052,7 @@ TEST_CASE("rx_zmqfreq", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_zmqstartfnum", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_zmqstartfnum", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getRxZmqStartingFrame();
|
||||
@@ -1075,7 +1076,7 @@ TEST_CASE("rx_zmqstartfnum", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_zmqport", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_zmqport", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val_zmqport = det.getRxZmqPort();
|
||||
@@ -1123,7 +1124,7 @@ TEST_CASE("rx_zmqport", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_zmqhwm", "[.cmdcall]") {
|
||||
TEST_CASE("rx_zmqhwm", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val =
|
||||
@@ -1153,7 +1154,7 @@ TEST_CASE("rx_zmqhwm", "[.cmdcall]") {
|
||||
|
||||
/* CTB Specific */
|
||||
|
||||
TEST_CASE("rx_dbitlist", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_dbitlist", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1183,7 +1184,7 @@ TEST_CASE("rx_dbitlist", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_dbitoffset", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_dbitoffset", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1218,7 +1219,7 @@ TEST_CASE("rx_dbitoffset", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_dbitreorder", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_dbitreorder", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
@@ -1249,7 +1250,7 @@ TEST_CASE("rx_dbitreorder", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_jsonaddheader", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_jsonaddheader", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getAdditionalJsonHeader();
|
||||
@@ -1275,7 +1276,7 @@ TEST_CASE("rx_jsonaddheader", "[.cmdcall][.rx]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("rx_jsonpara", "[.cmdcall][.rx]") {
|
||||
TEST_CASE("rx_jsonpara", "[.detectorintegration][.rx]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto prev_val = det.getAdditionalJsonHeader();
|
||||
|
||||
@@ -19,7 +19,7 @@ using test::PUT;
|
||||
|
||||
/* dacs */
|
||||
|
||||
TEST_CASE("configtransceiver", "[.cmdcall]") {
|
||||
TEST_CASE("configtransceiver", "[.detectorintegration]") {
|
||||
Detector det;
|
||||
Caller caller(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,10 +38,16 @@ void freeShm(const int dindex, const int mIndex) {
|
||||
}
|
||||
|
||||
constexpr int shm_id = 10;
|
||||
|
||||
//macOS does not expose shm in the filesystem
|
||||
#ifndef __APPLE__
|
||||
|
||||
const std::string file_path =
|
||||
std::string("/dev/shm/slsDetectorPackage_detector_") +
|
||||
std::to_string(shm_id);
|
||||
|
||||
|
||||
|
||||
TEST_CASE("Free obsolete (without isValid)", "[detector][shm]") {
|
||||
|
||||
// ensure its clean to start
|
||||
@@ -89,6 +95,8 @@ TEST_CASE("Free obsolete (without isValid)", "[detector][shm]") {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
TEST_CASE("Create SharedMemory read and write", "[detector][shm]") {
|
||||
SharedMemory<Data> shm(shm_id, -1);
|
||||
if (shm.exists()) {
|
||||
@@ -96,9 +104,9 @@ TEST_CASE("Create SharedMemory read and write", "[detector][shm]") {
|
||||
}
|
||||
shm.createSharedMemory();
|
||||
|
||||
const char *env_p = std::getenv("SLSDETNAME");
|
||||
const char *env_p = std::getenv(SHM_ENV_NAME);
|
||||
std::string env_name = env_p ? ("_" + std::string(env_p)) : "";
|
||||
CHECK(shm.getName() == std::string("/slsDetectorPackage_detector_") +
|
||||
CHECK(shm.getName() == std::string(SHM_DETECTOR_PREFIX) +
|
||||
std::to_string(shm_id) + env_name);
|
||||
shm()->x = 3;
|
||||
shm()->y = 5.7;
|
||||
@@ -168,11 +176,11 @@ TEST_CASE("Open two shared memories to the same place", "[detector][shm]") {
|
||||
}
|
||||
|
||||
TEST_CASE("Move SharedMemory", "[detector][shm]") {
|
||||
const char *env_p = std::getenv("SLSDETNAME");
|
||||
const char *env_p = std::getenv(SHM_ENV_NAME);
|
||||
std::string env_name = env_p ? ("_" + std::string(env_p)) : "";
|
||||
|
||||
SharedMemory<Data> shm(shm_id, -1);
|
||||
CHECK(shm.getName() == std::string("/slsDetectorPackage_detector_") +
|
||||
CHECK(shm.getName() == std::string(SHM_DETECTOR_PREFIX) +
|
||||
std::to_string(shm_id) + env_name);
|
||||
shm.createSharedMemory();
|
||||
shm()->x = 9;
|
||||
@@ -183,13 +191,13 @@ TEST_CASE("Move SharedMemory", "[detector][shm]") {
|
||||
CHECK(shm2()->x == 9);
|
||||
REQUIRE_THROWS(
|
||||
shm()); // trying to access should throw instead of returning a nullptr
|
||||
CHECK(shm2.getName() == std::string("/slsDetectorPackage_detector_") +
|
||||
CHECK(shm2.getName() == std::string(SHM_DETECTOR_PREFIX) +
|
||||
std::to_string(shm_id) + env_name);
|
||||
shm2.removeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Create several shared memories", "[detector][shm]") {
|
||||
const char *env_p = std::getenv("SLSDETNAME");
|
||||
const char *env_p = std::getenv(SHM_ENV_NAME);
|
||||
std::string env_name = env_p ? ("_" + std::string(env_p)) : "";
|
||||
|
||||
constexpr int N = 5;
|
||||
@@ -205,7 +213,7 @@ TEST_CASE("Create several shared memories", "[detector][shm]") {
|
||||
|
||||
for (int i = 0; i != N; ++i) {
|
||||
CHECK(v[i]()->x == i);
|
||||
CHECK(v[i].getName() == std::string("/slsDetectorPackage_detector_") +
|
||||
CHECK(v[i].getName() == std::string(SHM_DETECTOR_PREFIX) +
|
||||
std::to_string(i + shm_id) + env_name);
|
||||
}
|
||||
|
||||
@@ -216,12 +224,12 @@ TEST_CASE("Create several shared memories", "[detector][shm]") {
|
||||
}
|
||||
|
||||
TEST_CASE("Create create a shared memory with a tag") {
|
||||
const char *env_p = std::getenv("SLSDETNAME");
|
||||
const char *env_p = std::getenv(SHM_ENV_NAME);
|
||||
std::string env_name = env_p ? ("_" + std::string(env_p)) : "";
|
||||
|
||||
SharedMemory<Data> shm(0, -1, "ctbdacs");
|
||||
REQUIRE(shm.getName() ==
|
||||
"/slsDetectorPackage_detector_0" + env_name + "_ctbdacs");
|
||||
std::string(SHM_DETECTOR_PREFIX) + "0" + env_name + "_ctbdacs");
|
||||
}
|
||||
|
||||
TEST_CASE("Create create a shared memory with a tag when SLSDETNAME is set") {
|
||||
@@ -235,7 +243,7 @@ TEST_CASE("Create create a shared memory with a tag when SLSDETNAME is set") {
|
||||
setenv(SHM_ENV_NAME, "myprefix", 1);
|
||||
|
||||
SharedMemory<Data> shm(0, -1, "ctbdacs");
|
||||
REQUIRE(shm.getName() == "/slsDetectorPackage_detector_0_myprefix_ctbdacs");
|
||||
REQUIRE(shm.getName() == std::string(SHM_DETECTOR_PREFIX) + "0_myprefix_ctbdacs");
|
||||
|
||||
// Clean up after us
|
||||
if (old_slsdetname.empty())
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user