diff --git a/.github/actions/setupenv/action.yml b/.github/actions/setupenv/action.yml new file mode 100644 index 000000000..bc0e0c51b --- /dev/null +++ b/.github/actions/setupenv/action.yml @@ -0,0 +1,18 @@ +name: "Perform Repetitive Tasks" +description: "Composite action that checks out repos, and adjusts directory permissions for runner" + +runs: + using: "composite" + steps: + - name: Checkout PandABlocks-rootfs + uses: actions/checkout@v4 + with: + repository: PandABlocks/PandABlocks-rootfs + path: repos/PandABlocks-rootfs + fetch-depth: 0 + + - name: Give runner build perms, and adjust repos config path + shell: bash + run: | + sudo mkdir /build + sudo chmod -R 777 /build \ No newline at end of file diff --git a/.github/scripts/Find_Tests.sh b/.github/scripts/Find_Tests.sh new file mode 100644 index 000000000..d0edb7a07 --- /dev/null +++ b/.github/scripts/Find_Tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Modules path +search_dir=$1 +work_dir=$2 + +# Find files matching timing name pattern +found_files=$(find "$search_dir" -type f -name "*.timing.ini") +echo $found_files +# Array of modules and their test count +module_grps=() + +# Check if any files were found +if [ -z "$found_files" ]; then + echo "No timing tests found" +else + # Loop through each found file + for file in $found_files; do + # Count occurrences of [*] in the file + # Min 5 char to filter descriptions and index + count=$(grep -o '\[[^][]\{5,\}\]' "$file" | wc -l) + # Duplicate names allowed for multiple test files in same module subdirectory + module_name=$(basename "$(dirname "$file")") + module_grps+=("$module_name" "$count") + done + # Run python script to define job matrix based on found tests + python3 $work_dir/Group_Tests.py "${module_grps[@]}" +fi \ No newline at end of file diff --git a/.github/scripts/Group_Tests.py b/.github/scripts/Group_Tests.py new file mode 100644 index 000000000..1ff648443 --- /dev/null +++ b/.github/scripts/Group_Tests.py @@ -0,0 +1,43 @@ +import sys +import json + +modules_grps = (sys.argv)[1:] +print(modules_grps) +modules = [] +num_jobs = 5 + + +# Allocate modules to jobs with lowest load +def split_modules(modules, num_jobs): + modules.sort(key=lambda x: x[1], reverse=True) + jobs = [[] for _ in range(num_jobs)] + for module, count in modules: + min_sum_job_idx = min( + range(num_jobs), key=lambda i: sum(subset[1] for subset in jobs[i]) + ) + jobs[min_sum_job_idx].append([module, count]) + return jobs + + +# Produce matrix in format expected by 'make hdl_test' job step +def generate_matrix(jobs): + matrix = {"modules": []} + for job in jobs: + job_include = " ".join(module[0] for module in job) + matrix["modules"].append(job_include) + return matrix + + +# Convert bash array to sensible py array +for i in range(0, len(modules_grps) - 1, 2): + # If duplicate module names are found, add their counts + if modules and modules_grps[i] == modules_grps[i - 2]: + modules[-1][1] += int(modules_grps[i + 1]) + # If no duplicate present, append new element + else: + modules.append([modules_grps[i], int(modules_grps[i + 1])]) +print(modules) + +# Produce JSON file to pass to GH job +with open("github_tests.json", "w") as matrix_file: + json.dump(generate_matrix(split_modules(modules, num_jobs)), matrix_file) diff --git a/.github/scripts/mount-s3-bucket.sh b/.github/scripts/mount-s3-bucket.sh deleted file mode 100755 index 6e0bafd6d..000000000 --- a/.github/scripts/mount-s3-bucket.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Grants access to the s3 bucket containing vivado - - S3_ACCESS_KEY_ID=$1 - S3_SECRET_ACCESS_KEY=$2 - -sudo mkdir -p /scratch/Xilinx -sudo chmod a+w /scratch -mkdir -p $HOME/.config/rclone - -cat >> $HOME/.config/rclone/rclone.conf < ~/.passwd-s3fs -# chmod 600 ~/.passwd-s3fs -# s3fs dls-controls-fpga-vivado /scratch/Xilinx -o passwd_file=${HOME}/.passwd-s3fs -o url=https://s3.echo.stfc.ac.uk -o use_path_request_style -o ro diff --git a/.github/scripts/rclone-patch.sh b/.github/scripts/rclone-patch.sh deleted file mode 100644 index 1395d54f7..000000000 --- a/.github/scripts/rclone-patch.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Installation of go & temporary rclone patch applied until symlinks issue using rclone mount is resolved (see below): -# https://github.com/rclone/rclone/issues/2975 - -if [[ -z "$HOME" ]]; then - export HOME=/root -fi - -#Install go -curl -OL https://golang.org/dl/go1.17.linux-amd64.tar.gz -sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz -export PATH=$PATH:/usr/local/go/bin -go version - -#Install rclone patch -git clone https://github.com/PandABlocks/rclone.git -cd rclone -git checkout traack_symlinks -make -./rclone version -cd $HOME/go/bin/ -sudo cp rclone /usr/bin/ -sudo chown root:root /usr/bin/rclone -sudo chmod 755 /usr/bin/rclone -sudo mkdir -p /usr/local/share/man/man1 -sudo cp rclone /usr/local/share/man/man1/ -sudo mandb -rclone version diff --git a/.github/workflows/_make_boot.yml b/.github/workflows/_make_boot.yml new file mode 100644 index 000000000..95f7ca067 --- /dev/null +++ b/.github/workflows/_make_boot.yml @@ -0,0 +1,59 @@ +on: + workflow_call: + +jobs: + make_boot: + strategy: + fail-fast: false + matrix: + include: + - platform: zynq + app: PandABox-no-fmc + - platform: zynqmp + app: xu5_st1-no-fmc + runs-on: + group: iris_runners + container: + image: ghcr.io/pandablocks/pandablocks-dev-container:latest + options: --privileged + + steps: + # Necessary to find action.yml + - name: Checkout Source + uses: actions/checkout@v4 + with: + path: repos/PandABlocks-fpga + fetch-depth: 0 + + - name: Checkout rootfs and Give Directory Perms + uses: ./repos/PandABlocks-fpga/.github/actions/setupenv + + # Generate bootable image + - name: Make boot + id: make_boot + continue-on-error: true + #timeout set to expected upper-limit of build + timeout-minutes: 60 + run: | + echo "boot_files=false" >> $GITHUB_OUTPUT + cd repos/PandABlocks-fpga + ln -s CONFIG.example CONFIG + make boot APP_NAME=${{ matrix.app }} + if test -f /build/boot*.zip; then + echo "boot_files=true" >> $GITHUB_OUTPUT + fi + + # Current workflow hangs upon make_boot completion, requiring a timeout + # Envvar boot_files is set true if timeout reached after successful boot build + # Envvar boot_files is set false on boot build error and/or failure to generate zip files + - name: Fail workflow if boot files absent + if: ${{ steps.make_boot.outputs.boot_files == 'false'}} + run: exit 1 + + # Upload artifacts if boot files present + - name: Upload boot + if: ${{ steps.make_boot.outputs.boot_files == 'true'}} + uses: actions/upload-artifact@v4 + with: + name: boot-${{ matrix.app }} + path: /build/boot*.zip \ No newline at end of file diff --git a/.github/workflows/_make_zpkg.yml b/.github/workflows/_make_zpkg.yml new file mode 100644 index 000000000..f8bb964cd --- /dev/null +++ b/.github/workflows/_make_zpkg.yml @@ -0,0 +1,53 @@ +on: + workflow_call: + +env: + WORK_DIR: /__w/PandABlocks-FPGA/PandABlocks-FPGA + +jobs: + make_zpkg: + strategy: + fail-fast: false + matrix: + app: [ + "PandABox-no-fmc", + "PandABox-fmc_24vio", + "PandABox-fmc_acq427", + "PandABox-fmc_acq430", + "PandABox-fmc_lback-sfp_lback", + "ZedBoard-no-fmc", + "xu5_st1-no-fmc", + "xu5_st1-fmc_acq430" + ] + runs-on: + group: iris_runners + container: + image: ghcr.io/pandablocks/pandablocks-dev-container:latest + options: --privileged + + steps: + # Necessary to find action.yml + - name: Checkout Source + uses: actions/checkout@v4 + with: + path: repos/PandABlocks-fpga + fetch-depth: 0 + + - name: Checkout rootfs and Give Directory Perms + uses: ./repos/PandABlocks-fpga/.github/actions/setupenv + + # Make zpkgs + - name: build carrier_ip and zpkg + id: make_zpkg + run: | + cd repos/PandABlocks-fpga + ln -s CONFIG.example CONFIG + make WORK_DIR=$WORK_DIR carrier_ip APP_NAME=${{ matrix.app }} + make WORK_DIR=$WORK_DIR zpkg APP_NAME=${{ matrix.app }} + + # Artifacts + - name: Upload zpkg + uses: actions/upload-artifact@v4 + with: + name: zpkgs-${{ matrix.app }} + path: /build/panda-fpga@*.zpg \ No newline at end of file diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml new file mode 100644 index 000000000..5acf9b029 --- /dev/null +++ b/.github/workflows/_release.yml @@ -0,0 +1,25 @@ +on: + workflow_call: + +jobs: + release: + runs-on: ubuntu-latest + # make a release on every tag + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + steps: + - uses: actions/download-artifact@v4 + with: + path: zpkgs + merge-multiple: true + + + - name: Github Release + # We pin to the SHA, not the tag, for security reasons. + # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions + uses: softprops/action-gh-release@2d72d869af3bf23602f9593a1e3fd739b80ac1eb # v0.1.12 + with: + prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }} + files: zpkgs/* + body: See [Changelog](CHANGELOG.rst) for more details + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/_test_hdl.yml b/.github/workflows/_test_hdl.yml new file mode 100644 index 000000000..f66af11c0 --- /dev/null +++ b/.github/workflows/_test_hdl.yml @@ -0,0 +1,36 @@ +on: + workflow_call: + inputs: + matrix: + required: true + type: string + +jobs: + test: + strategy: + fail-fast: false + # Using generated matrix from previous job + matrix: ${{fromJSON(inputs.matrix)}} + runs-on: + group: iris_runners + container: + image: ghcr.io/pandablocks/pandablocks-dev-container:latest + options: --privileged + + steps: + # Necessary to find action.yml + - name: Checkout Source + uses: actions/checkout@v4 + with: + path: repos/PandABlocks-fpga + fetch-depth: 0 + + - name: Checkout rootfs and Give Directory Perms + uses: ./repos/PandABlocks-fpga/.github/actions/setupenv + + # Run tests + - name: Make hdl Tests + run: | + cd repos/PandABlocks-fpga + ln -s CONFIG.example CONFIG + make hdl_test MODULES="${{matrix.modules}}" \ No newline at end of file diff --git a/.github/workflows/_test_matrix.yml b/.github/workflows/_test_matrix.yml new file mode 100644 index 000000000..3b7884038 --- /dev/null +++ b/.github/workflows/_test_matrix.yml @@ -0,0 +1,32 @@ +on: + workflow_call: + outputs: + matrix: + value: ${{ jobs.test_matrix.outputs.matrix }} + +env: + WORK_DIR: /__w/PandABlocks-FPGA/PandABlocks-FPGA + +jobs: + test_matrix: + runs-on: + group: iris_runners + container: + image: docker.io/shihabdls/pandablocks-container-extension:v2.5 + options: --privileged + outputs: + matrix: ${{steps.make_matrix.outputs.matrix}} + steps: + - name: Checkout Source + uses: actions/checkout@v4 + with: + path: repos/PandABlocks-fpga + fetch-depth: 0 + + - name: Evaluate number of modules/tests & generate job matrix + id: make_matrix + run: | + bash $WORK_DIR/repos/PandABlocks-fpga/.github/scripts/Find_Tests.sh "$WORK_DIR/repos/PandABlocks-fpga/modules" "$WORK_DIR/repos/PandABlocks-fpga/.github/scripts" + json_content=$(cat github_tests.json) + echo "::set-output name=matrix::$json_content" + echo "$json_content" \ No newline at end of file diff --git a/.github/workflows/_test_python_autogen.yml b/.github/workflows/_test_python_autogen.yml new file mode 100644 index 000000000..3f6d02a70 --- /dev/null +++ b/.github/workflows/_test_python_autogen.yml @@ -0,0 +1,30 @@ +on: + workflow_call: + +jobs: + test_python_autogen: + runs-on: + group: iris_runners + container: + image: ghcr.io/pandablocks/pandablocks-dev-container:latest + options: --privileged + + steps: + # Necessary to find action.yml + - name: Checkout Source + uses: actions/checkout@v4 + with: + path: repos/PandABlocks-fpga + fetch-depth: 0 + + - name: Checkout rootfs and Give Directory Perms + uses: ./repos/PandABlocks-fpga/.github/actions/setupenv + + # Run tests + - name: Make Python Tests + run: | + cd repos/PandABlocks-fpga + ln -s CONFIG.example CONFIG + make python_tests + make python_timing + make autogen \ No newline at end of file diff --git a/.github/workflows/_undo.yml b/.github/workflows/_undo.yml new file mode 100644 index 000000000..cc637c8a8 --- /dev/null +++ b/.github/workflows/_undo.yml @@ -0,0 +1,19 @@ +on: + workflow_call: + +jobs: + undo: + runs-on: ubuntu-latest + if: ${{ always() && failure() && github.event_name == 'push' && contains(github.event.head_commit.message,'undo_true')}} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.branch }} + fetch-depth: 0 + - name: Revert pushed commit + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git revert -m 1 --no-edit HEAD + git push diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 4b882282e..5a3868dba 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -1,344 +1,46 @@ name: Code CI on: + # Only run on changes to branches with open PRs pull_request: + types: [opened, edited, synchronize] + # Run after PR merged, on implicit push, and on tag pushes push: + tags: + - '*' + branches: [master] jobs: - make_boot: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - strategy: - fail-fast: false - matrix: - include: - - platform: zynq - app: PandABox-no-fmc - - platform: zynqmp - app: xu5_st1-no-fmc - runs-on: ubuntu-latest - - steps: - # Git repositories - - name: Checkout Source - uses: actions/checkout@v2 - with: - path: PandABlocks-fpga - # require history to get back to last tag for version number of branches - fetch-depth: 0 - - - name: Checkout PandABlocks-rootfs - uses: actions/checkout@v2 - with: - repository: PandABlocks/PandABlocks-rootfs - path: PandABlocks-rootfs - - # Installation of go & temporary rclone patch applied until symlinks issue using rclone mount is resolved (see below): - # https://github.com/rclone/rclone/issues/2975 - - name: Install rclone patch - run: bash PandABlocks-fpga/.github/scripts/rclone-patch.sh - - # S3 bucket - - name: Mount Vivado S3 bucket - run: sudo bash PandABlocks-fpga/.github/scripts/mount-s3-bucket.sh ${{ secrets.VIVADO_S3_ACCESS_KEY_ID }} ${{ secrets.VIVADO_S3_SECRET_ACCESS_KEY }} - # Get container image - - name: login to github container registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Mount in rclone bucket from runner into conatiner - - name: make boot - run: | - docker pull ghcr.io/pandablocks/pandablocks-dev-container:latest - docker run \ - -v "${{ github.workspace }}:/repos" \ - -v "${{ github.workspace }}/build:/build" \ - -v "/scratch/Xilinx:/scratch/Xilinx" \ - ghcr.io/pandablocks/pandablocks-dev-container:latest\ - /bin/bash -c \ - "cd PandABlocks-fpga && ln -s CONFIG.example CONFIG && make boot APP_NAME=${{ matrix.app }}" - - # Artifacts - - name: Upload boot - uses: actions/upload-artifact@v3 - with: - name: zpkgs - path: ./build/boot*.zip + # Make Boot files + make_boot: + uses: ./.github/workflows/_make_boot.yml # Make zpkg for FPGA apps make_zpkg: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - strategy: - fail-fast: false - matrix: - app: [ - "PandABox-no-fmc", - "PandABox-fmc_24vio", - "PandABox-fmc_acq427", - "PandABox-fmc_acq430", - "PandABox-fmc_lback-sfp_lback", - "ZedBoard-no-fmc", - ] - - runs-on: ubuntu-latest - steps: - - # Git repositories - - name: Checkout Source - uses: actions/checkout@v2 - with: - path: PandABlocks-fpga - # require history to get back to last tag for version number of branches - fetch-depth: 0 - - - name: Checkout PandABlocks-rootfs - uses: actions/checkout@v2 - with: - repository: PandABlocks/PandABlocks-rootfs - path: PandABlocks-rootfs - - # Installation of go & temporary rclone patch applied until symlinks issue using rclone mount is resolved (see below): - # https://github.com/rclone/rclone/issues/2975 - - name: Install rclone patch - run: bash PandABlocks-fpga/.github/scripts/rclone-patch.sh - - # S3 bucket - - name: Mount Vivado S3 bucket - run: sudo bash PandABlocks-fpga/.github/scripts/mount-s3-bucket.sh ${{ secrets.VIVADO_S3_ACCESS_KEY_ID }} ${{ secrets.VIVADO_S3_SECRET_ACCESS_KEY }} - - # Login into ghcr - - name: login to ghcr - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Mount in rclone bucket from runner into conatiner - - name: build carrier_ip and zpkg - run: | - docker pull ghcr.io/pandablocks/pandablocks-dev-container:latest - docker run \ - --net=host \ - -v "${{ github.workspace }}:/repos" \ - -v "${{ github.workspace }}/build:/build" \ - -v "/scratch/Xilinx:/scratch/Xilinx" \ - ghcr.io/pandablocks/pandablocks-dev-container:latest\ - /bin/bash -c \ - "cd PandABlocks-fpga && ln -s CONFIG.example CONFIG && make carrier_ip APP_NAME=${{ matrix.app }} && make zpkg APP_NAME=${{ matrix.app }} " - - # Artifacts - - name: Upload zpkg - uses: actions/upload-artifact@v3 - with: - name: zpkgs - path: ./build/panda-fpga@*.zpg - - # Seting up AWS runners for high memory apps - start-runner: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - name: Start self hosted aws runner - runs-on: ubuntu-latest - outputs: - label: ${{ steps.start-ec2-runner.outputs.label }} - ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} - steps: - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} - - - name: Start EC2 runner - id: start-ec2-runner - uses: machulav/ec2-github-runner@v2 - with: - mode: start - github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - ec2-image-id: ${{ secrets.AWS_AMI_ID }} - ec2-instance-type: t3.xlarge - subnet-id: ${{ secrets.AWS_SUBNET_ID }} - security-group-id: ${{ secrets.AWS_SECURITY_GROUP_ID }} - aws-resource-tags: > - [ - {"Key": "Name", "Value": "ec2-github-runner"}, - {"Key": "GitHubRepository", "Value": "${{ github.repository }}"} - ] - - # Build rclone and mount S3 bucket - setup_aws_runner: - name: setup rclone and mount on runner - needs: start-runner - runs-on: ${{ needs.start-runner.outputs.label }} - steps: - # Git repositories - - name: Checkout Source - uses: actions/checkout@v2 - with: - path: PandABlocks-fpga - # require history to get back to last tag for version number of branches - fetch-depth: 0 - - # Installation of go & temporary rclone patch applied until symlinks issue using rclone mount is resolved (see below): - # https://github.com/rclone/rclone/issues/2975 - - name: Install rclone patch - run: bash PandABlocks-fpga/.github/scripts/rclone-patch.sh - - # S3 bucket - - name: Mount Vivado S3 bucket - run: sudo bash PandABlocks-fpga/.github/scripts/mount-s3-bucket.sh ${{ secrets.VIVADO_S3_ACCESS_KEY_ID }} ${{ secrets.VIVADO_S3_SECRET_ACCESS_KEY }} - - - make_zpkg_aws: - strategy: - fail-fast: false - matrix: - app: - [ - "xu5_st1-no-fmc", - "xu5_st1-fmc_acq430", - ] - - name: make zpkg on aws - needs: - - start-runner - - setup_aws_runner # required to start the main job when the runner is ready - runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner - - steps: - # Git repositories - - name: Checkout Source - uses: actions/checkout@v2 - with: - path: PandABlocks-fpga - # require history to get back to last tag for version number of branches - fetch-depth: 0 - - - name: Checkout PandABlocks-rootfs - uses: actions/checkout@v2 - with: - repository: PandABlocks/PandABlocks-rootfs - path: PandABlocks-rootfs - - # Login into ghcr - - name: login to ghcr - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Mount in rclone bucket from vm into conatiner - - name: build carrier_ip and zpkg - run: | - sudo docker pull ghcr.io/pandablocks/pandablocks-dev-container:latest - sudo docker run \ - --net=host \ - -v "${{ github.workspace }}:/repos" \ - -v "${{ github.workspace }}/build:/build" \ - -v "/scratch/Xilinx:/scratch/Xilinx" \ - ghcr.io/pandablocks/pandablocks-dev-container:latest\ - /bin/bash -c \ - "cd PandABlocks-fpga && ln -s CONFIG.example CONFIG && make carrier_ip APP_NAME=${{ matrix.app }} && make zpkg APP_NAME=${{ matrix.app }}" - - # Artifacts - - name: Upload zpkg - uses: actions/upload-artifact@v3 - with: - name: zpkgs - path: ./build/panda-fpga@*.zpg - - # Stop the AWS runner - stop-runner: - name: Stop self hosted EC2 runnner - needs: - - start-runner - - setup_aws_runner - - make_zpkg_aws - runs-on: ubuntu-latest - if: ${{ always() }} - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} - - - name: Stop EC2 runner - uses: machulav/ec2-github-runner@v2 - continue-on-error: true - with: - mode: stop - github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - label: ${{ needs.start-runner.outputs.label }} - ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} - - test: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - runs-on: ubuntu-latest - steps: - # Git repositories - - name: Checkout Source - uses: actions/checkout@v2 - with: - path: PandABlocks-fpga - # require history to get back to last tag for version number of branches - fetch-depth: 0 - - # Installation of go & temporary rclone patch applied until symlinks issue using rclone mount is resolved (see below): - # https://github.com/rclone/rclone/issues/2975 - - name: Install rclone patch - run: bash PandABlocks-fpga/.github/scripts/rclone-patch.sh - - # S3 bucket - - name: Mount Vivado S3 bucket - run: sudo bash PandABlocks-fpga/.github/scripts/mount-s3-bucket.sh ${{ secrets.VIVADO_S3_ACCESS_KEY_ID }} ${{ secrets.VIVADO_S3_SECRET_ACCESS_KEY }} - - # Login into ghcr - - name: login to ghcr - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Run tests - - name: Make python and hdl tests - run: | - docker pull ghcr.io/pandablocks/pandablocks-dev-container:latest - docker run \ - -v "${{ github.workspace }}:/repos" \ - -v "${{ github.workspace }}/build:/build" \ - -v "/scratch/Xilinx:/scratch/Xilinx" \ - ghcr.io/pandablocks/pandablocks-dev-container:latest \ - /bin/bash -c \ - "cd PandABlocks-fpga && ln -s CONFIG.example CONFIG && make python_tests && make python_timing && \ - make autogen && make hdl_test" - + uses: ./.github/workflows/_make_zpkg.yml + + # Optional revert on failed push workflow + undo: + needs: [ make_boot, make_zpkg, test_hdl ] + uses: ./.github/workflows/_undo.yml + + # Release on push to tag release: - needs: [ make_boot, make_zpkg, make_zpkg_aws, test ] - runs-on: ubuntu-latest - # make a release on every tag - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - steps: - - uses: actions/download-artifact@v3 - with: - name: zpkgs - path: zpkgs - - - name: Github Release - # We pin to the SHA, not the tag, for security reasons. - # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: softprops/action-gh-release@2d72d869af3bf23602f9593a1e3fd739b80ac1eb # v0.1.12 - with: - prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }} - files: zpkgs/* - body: See [Changelog](CHANGELOG.rst) for more details - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + needs: [ make_boot, make_zpkg, test_hdl, test_matrix, test_python_autogen ] + uses: ./.github/workflows/_release.yml + + # Generate job matrix to evenly split tests + test_matrix: + uses: ./.github/workflows/_test_matrix.yml + + # python and autogen tests + test_python_autogen: + uses: ./.github/workflows/_test_python_autogen.yml + + # hdl tests + test_hdl: + needs: [test_matrix, test_python_autogen] + uses: ./.github/workflows/_test_hdl.yml + with: + matrix: ${{needs.test_matrix.outputs.matrix}} \ No newline at end of file diff --git a/CONFIG.example b/CONFIG.example index c8acc20f0..0c7389430 100644 --- a/CONFIG.example +++ b/CONFIG.example @@ -27,7 +27,8 @@ export ROOTFS_TOP = /rootfs export TAR_FILES = /tar-files # Path to root filesystem -PANDA_ROOTFS = /repos/PandABlocks-rootfs +# WORK_DIR can be ignored for local builds, explicitly set in CI +PANDA_ROOTFS = $(WORK_DIR)/repos/PandABlocks-rootfs # MAKE_ZPKG = $(PANDA_ROOTFS)/make-zpkg # Python interpreter for running scripts @@ -43,4 +44,4 @@ PANDA_ROOTFS = /repos/PandABlocks-rootfs # FPGA Application Name APP_NAME = PandABox-fmc_lback-sfp_lback -# vim: set filetype=make: +# vim: set filetype=make: \ No newline at end of file diff --git a/modules/counter/counter_doc.rst b/modules/counter/counter_doc.rst index 86a2cd1cd..1f56c006a 100644 --- a/modules/counter/counter_doc.rst +++ b/modules/counter/counter_doc.rst @@ -16,20 +16,20 @@ The most common use of a counter block is when you would like to track the number of trigger edges received while enabled: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Count Up only when enabled The TRIG_EDGE field can be used to select the track on rising, falling, or both edges: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Setting trigger edge You can also set the start value to be loaded on enable, and step up by a number other than one: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Non-zero start and step values You can also set the direction that a pulse should apply step, so it becomes @@ -37,17 +37,14 @@ an up/down counter. The direction is sampled on the same clock tick as the pulse edge: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Setting direction -.. timing_plot:: - :path: modules/counter/counter.timing.ini - :section: Setting direction When the OUT_MODE is set to On-Disable, the OUT output will only be changed to the internal counter value on ENABLE's falling edge: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: On-Disable mode counting @@ -59,20 +56,20 @@ output gets set high and the counter rolls. The CARRY output stays high for as long as the trigger input stays high. .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Overflow A similar thing happens for a negative overflow: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Overflow negative When the OUT_MODE is set to On-Disable, the CARRY output will get set to high on ENABLE's falling edge if any overflow produced while the counter was enabled: .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: On-Disable mode counting with overflow @@ -83,12 +80,12 @@ If the Enable input goes low at the same time as a trigger, there will be no output value on the next clock tick. .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Disable and trigger If the step size is changed at the same time as a trigger input edge, the output value for that trigger will be the new step size. .. timing_plot:: - :path: modules/counter/counter.timing.ini + :path: modules/counter/counter_documentation.timing.ini :section: Change step and trigger diff --git a/modules/counter/counter.timing.ini b/modules/counter/counter_documentation.timing.ini similarity index 86% rename from modules/counter/counter.timing.ini rename to modules/counter/counter_documentation.timing.ini index cdc1e347d..809dc0237 100644 --- a/modules/counter/counter.timing.ini +++ b/modules/counter/counter_documentation.timing.ini @@ -1,5 +1,5 @@ [.] -description: Timing diagrams for COUNTER block +description: Documentation timing diagrams for COUNTER block scope: counter.block.ini [Count Up only when enabled] @@ -81,25 +81,6 @@ scope: counter.block.ini 27 : TRIG=0 -> CARRY=0 28 : ENABLE=0 -[Overflow when counting on falling and both edges] -2 : START=2147483645, TRIG_EDGE=1 -3 : ENABLE=1 -> OUT=2147483645 -10 : TRIG=1 -13 : TRIG=0 -> OUT=2147483646 -17 : TRIG=1 -23 : TRIG=0 -> OUT=2147483647 -24 : TRIG=1 -27 : TRIG=0 -> OUT=-2147483648, CARRY=1 -28 : TRIG=1 -> CARRY=0 -29 : TRIG=0 -> OUT=-2147483647 -30 : ENABLE=0, TRIG_EDGE=2 -32 : ENABLE=1 -> OUT=2147483645 -35 : TRIG=1 -> OUT=2147483646 -37 : TRIG=0 -> OUT=2147483647 -40 : TRIG=1 -> OUT=-2147483648, CARRY=1 -43 : TRIG=0 -> OUT=-2147483647, CARRY=0 -45 : ENABLE=0 - [Overflow negative] 2 : START=-2147483645, STEP=3, DIR=1 3 : ENABLE=1 -> OUT=-2147483645 @@ -138,7 +119,6 @@ scope: counter.block.ini 15 : TRIG=1,ENABLE=0 16 : TRIG=0 - [Change step and trigger] 3 : START=20, STEP=1 6 : ENABLE=1 -> OUT=20 @@ -147,6 +127,7 @@ scope: counter.block.ini 15 : TRIG=1,STEP=2 -> OUT=23 16 : TRIG=0 18 : ENABLE=0 +<<<<<<< HEAD:modules/counter/counter.timing.ini [Setting Max and Min Values] 3 : START=5, STEP=4, MAX=10, MIN=-10 @@ -214,3 +195,5 @@ scope: counter.block.ini [Manual set value disabled] 3 : SET=42 -> OUT=42 +======= +>>>>>>> ecc152a4 (Splitting off timing tests):modules/counter/counter_documentation.timing.ini diff --git a/modules/counter/counter_functionality.timing.ini b/modules/counter/counter_functionality.timing.ini new file mode 100644 index 000000000..63d53f360 --- /dev/null +++ b/modules/counter/counter_functionality.timing.ini @@ -0,0 +1,78 @@ +[.] +description: Functionality timing diagrams for COUNTER block +scope: counter.block.ini + +[Overflow when counting on falling and both edges] +2 : START=2147483645, TRIG_EDGE=1 +3 : ENABLE=1 -> OUT=2147483645 +10 : TRIG=1 +13 : TRIG=0 -> OUT=2147483646 +17 : TRIG=1 +23 : TRIG=0 -> OUT=2147483647 +24 : TRIG=1 +27 : TRIG=0 -> OUT=-2147483648, CARRY=1 +28 : TRIG=1 -> CARRY=0 +29 : TRIG=0 -> OUT=-2147483647 +30 : ENABLE=0, TRIG_EDGE=2 +32 : ENABLE=1 -> OUT=2147483645 +35 : TRIG=1 -> OUT=2147483646 +37 : TRIG=0 -> OUT=2147483647 +40 : TRIG=1 -> OUT=-2147483648, CARRY=1 +43 : TRIG=0 -> OUT=-2147483647, CARRY=0 +45 : ENABLE=0 + +[Setting Max and Min Values] +3 : START=5, STEP=4, MAX=10, MIN=-10 +6 : ENABLE=1 -> OUT=5 +7 : TRIG=1 -> OUT=9 +8 : TRIG=0 +9 : TRIG=1 -> OUT=-8, CARRY = 1 +10 : TRIG=0 -> CARRY=0 +11 : TRIG=1 -> OUT=-4 +12 : TRIG=0 +13 : TRIG=1 -> OUT=0 +14 : TRIG=0 +15 : TRIG=1 -> OUT=4 +16 : TRIG=0, ENABLE=0 +17 : DIR=1, START=0, STEP=4, MAX=10, MIN=-10 +18 : ENABLE=1 -> OUT=0 +19 : TRIG=1 -> OUT=-4 +20 : TRIG=0 +21 : TRIG=1 -> OUT=-8 +22 : TRIG=0 +23 : TRIG=1 -> OUT=9, CARRY=1 +24 : TRIG=0 -> CARRY=0 +25 : TRIG=1 -> OUT=5 +26 : TRIG=0 +27 : TRIG=1 -> OUT=1 +28 : TRIG=0 +29 : ENABLE=0 + +[Carry resets on falling enable] +3 : START=8, STEP=4, MAX=10, MIN=-10 +6 : ENABLE=1 -> OUT=8 +9 : TRIG=1 -> OUT=-9, CARRY=1 +11 : ENABLE=0 -> CARRY=0 +12 : TRIG=0 + +[Positive Min Value] +3 : START=5, STEP=3, MAX=10, MIN=2 +6 : ENABLE=1 -> OUT=5 +7 : TRIG=1 -> OUT=8 +8 : TRIG=0 +9 : TRIG=1 -> OUT=2, CARRY = 1 +10 : TRIG=0 -> CARRY=0 +11 : TRIG=1 -> OUT=5 +12 : TRIG=0 +13 : ENABLE=0 + +[Negative Max Value] +3 : START=-5, STEP=4, MAX=-1, MIN=-10 +6 : ENABLE=1 -> OUT=-5 +7 : TRIG=1 -> OUT=-1 +8 : TRIG=0 +9 : TRIG=1 -> OUT=-7, CARRY = 1 +10 : TRIG=0 -> CARRY=0 +11 : TRIG=1 -> OUT=-3 +12 : TRIG=0 +13 : ENABLE=0 diff --git a/modules/filter/filter_doc.rst b/modules/filter/filter_doc.rst index a19a0ae6a..1186a5af7 100644 --- a/modules/filter/filter_doc.rst +++ b/modules/filter/filter_doc.rst @@ -19,21 +19,21 @@ given as the the current input value minus the latched value. .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Difference mode After the operation, the latched value is updated to be the current value on the input. .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Difference mode positive ramping input The operation continues to work if the current value is less than the latched value: a negative result is outputted .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Difference mode negative ramping input Average @@ -44,15 +44,15 @@ signal is received it divides the summed value by the number of clock pulses that have passed. .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Average mode summing inputs .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Average mode positive ramp .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Average mode negative ramp If a calculation is triggered before the calculation is ready, the system will @@ -60,9 +60,9 @@ show an error on the HEALTH output and will then need to be re-enabled before another calculation can be sent. .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Average mode trigger before calculation ready .. timing_plot:: - :path: modules/filter/filter.timing.ini + :path: modules/filter/filter_documentation.timing.ini :section: Zero division diff --git a/modules/filter/filter.timing.ini b/modules/filter/filter_documentation.timing.ini similarity index 92% rename from modules/filter/filter.timing.ini rename to modules/filter/filter_documentation.timing.ini index 693117738..db7e93bb1 100644 --- a/modules/filter/filter.timing.ini +++ b/modules/filter/filter_documentation.timing.ini @@ -1,5 +1,5 @@ [.] -description: Timing diagrams for FILTER block +description: Documentation timing diagrams for FILTER block scope: filter.block.ini [Difference mode] @@ -42,18 +42,6 @@ scope: filter.block.ini 17 : TRIG = 0 -> READY = 0 18 : ENABLE = 0 -[Difference mode 0 output] -3 : MODE = 0 -4 : INP = -10 -5 : ENABLE = 1 -6 : INP = 0 -7 : INP = 10 -8 : INP = 0 -9 : INP = -10 -11 : TRIG = 1 -> OUT=0, READY=1 -12 : TRIG = 0 -> READY=0 -15 : ENABLE = 0 - [Average mode summing inputs] 2 : MODE = 1 3 : INP = 20 diff --git a/modules/filter/filter_functionality.timing.ini b/modules/filter/filter_functionality.timing.ini new file mode 100644 index 000000000..32a33c990 --- /dev/null +++ b/modules/filter/filter_functionality.timing.ini @@ -0,0 +1,15 @@ +[.] +description: Functionality timing diagrams for FILTER block +scope: filter.block.ini + +[Difference mode 0 output - fun] +3 : MODE = 0 +4 : INP = -10 +5 : ENABLE = 1 +6 : INP = 0 +7 : INP = 10 +8 : INP = 0 +9 : INP = -10 +11 : TRIG = 1 -> OUT=0, READY=1 +12 : TRIG = 0 -> READY=0 +15 : ENABLE = 0 diff --git a/modules/pcap/pcap_doc.rst b/modules/pcap/pcap_doc.rst index 78ee9c8ad..a97d6f360 100644 --- a/modules/pcap/pcap_doc.rst +++ b/modules/pcap/pcap_doc.rst @@ -19,13 +19,13 @@ The active signal is raised immediately on ARM, and dropped either on ``*PCAP.DISARM``: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Arming and soft disarm Or on the falling edge of ENABLE: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Arming and hard disarm @@ -47,7 +47,7 @@ The following example shows PCAP being configured to capture the timestamp when CAPTURE goes high (0x24 is the bottom 32-bits of TS_CAPTURE). .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture timestamp @@ -64,7 +64,7 @@ Mode 0 - Value This gives an instantaneous capture of value no matter what the state of GATE: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 5 Value Mode 1 - Difference @@ -74,7 +74,7 @@ This is mainly used for something like an incrementing counter value. It will only count the differences while GATE was high: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 11 Difference Mode 2/3 - Sum Lo/Hi @@ -83,14 +83,14 @@ Mode 2/3 - Sum Lo/Hi Mode 2 is the lower 32-bits of the sum of all samples while GATE was high: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 3 Sum Mode 2 and 3 together gives the full 64-bits of sum, needed for any sizeable values on the pos_bus: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 2 Sum large values If long frame times (> 2**32 SAMPLES, > 30s), are to be used, then SHIFT_SUM @@ -99,7 +99,7 @@ accomodate up to 125 hour frames. This example demonstrates the effect with smaller numbers: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 9 Sum shifted @@ -112,13 +112,13 @@ Mode 4 produces the min of all values or zero if the gate was low for all of the current capture: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 8 Min Mode 5 produces the max of all values in a similar way: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 4 Max @@ -133,7 +133,7 @@ Mode 6 is the lower 32-bits while GATE was high, Mode 7 is the middle 32-bits, and Mode 8 is the higher 32-bits: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 2 Sum^2 If long frame times (> 2**32 SAMPLES, > 30s), are to be used, then SHIFT_SUM @@ -141,7 +141,7 @@ can be used to shift both the sum of squared values and SAMPLES field by up to 8-bits to accomodate up to 125 hour frames: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture pos bus entry 2 Sum^2 Samples shifted @@ -155,7 +155,7 @@ the mean value of the field during the capture period. It can also be captured separately to give the gate length: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture gate length @@ -170,7 +170,7 @@ example we capture TS_START (0x20), TS_END (0x22) and TS_CAPTURE (0x24) lower bits: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture more timestamps @@ -182,13 +182,13 @@ quadrants of 32-bits each. For example, to capture signals 0..31 on the bit bus we would use BITS0 (0x27): .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture bit bus quadrant 0 By capturing all 4 quadrants (0x27..0x2A) we get the whole bit bus: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture bit bus all quadrants @@ -207,14 +207,14 @@ example, to capture the amount POS[1] changes in each capture gate we could connect GATE and CAPTURE to the same signal: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Gate and capture signals the same Another option would be a gap-less acquisition of sum while gate is high with capture boundaries marked with a toggle of CAPTURE: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Gap-less sum @@ -229,5 +229,5 @@ In this example there are 3 fields captured (TS_CAPTURE_L, TS_CAPTURE_H, SAMPLES), but only 2 clock ticks between the 2nd and 3rd capture signals: .. timing_plot:: - :path: modules/pcap/pcap.timing.ini + :path: modules/pcap/pcap_documentation.timing.ini :section: Capture too close together diff --git a/modules/pcap/pcap.timing.ini b/modules/pcap/pcap_documentation.timing.ini similarity index 57% rename from modules/pcap/pcap.timing.ini rename to modules/pcap/pcap_documentation.timing.ini index 01a2cefc9..470824167 100644 --- a/modules/pcap/pcap.timing.ini +++ b/modules/pcap/pcap_documentation.timing.ini @@ -1,5 +1,5 @@ [.] -description: Timing diagrams for PCAP block +description: Documentation timing diagrams for PCAP block scope: pcap.block.ini [Arming and soft disarm] @@ -43,20 +43,6 @@ scope: pcap.block.ini 22 : TRIG=0 -> DATA=6 24 : ENABLE=0 -> ACTIVE=0 - -[Capture pos bus entry 5 Value low ENABLE] -2 : START_WRITE=0 -4 : WRITE=0x50 -6 : POS[5]=20 -10 : ARM=0 -> ACTIVE=1 -13 : TRIG=1 -14 : TRIG=0, POS[5]=100 -15 : TRIG=1 -16 : TRIG=0 -18 : TRIG=1, POS[5]=6 -19 : POS[5]=2 -22 : DISARM=0, TRIG=0 -> ACTIVE=0 - [Capture pos bus entry 11 Difference] 2 : START_WRITE=0 4 : WRITE=0xB1 @@ -211,46 +197,6 @@ scope: pcap.block.ini 35 : -> DATA=4 37 : ENABLE=0 -> ACTIVE=0 -[Capture pos bus entry 2 Sum Sum^2 Samples] -1 : POS[2]=-3 -2 : START_WRITE=0 -3 : WRITE=0x22 -4 : WRITE=0x23 -5 : WRITE=0x26 -6 : WRITE=0x27 -7 : WRITE=0x28 -8 : WRITE=0x260 -10 : ARM=0 -> ACTIVE=1 -11 : ENABLE=1 -12 : GATE=1 -14 : TRIG=1 -15 : POS[2]=3, TRIG=0 -16 : POS[2]=4 -17 : POS[2]=5 -18 : POS[2]=6 -> DATA=-6 -19 : POS[2]=9 -> DATA=-1 -# POS[2]=0x7FFFFFFF -20 : POS[2]=2147483647, TRIG=1 -> DATA=18 -21 : TRIG=0 -> DATA=0 -22 : -> DATA=0 -23 : -> DATA=2 -24 : -> DATA=24 -25 : -> DATA=0 -26 : -> DATA=176 -27 : -> DATA=0 -28 : TRIG=1 -> DATA=0 -29 : GATE=0,TRIG=0 -> DATA=6 -# 0x7FFFFFFF * 8 = 0x3FFFFFFF8 -32 : -> DATA=0xFFFFFFF8 -33 : -> DATA=0x00000003 -# 0x7FFFFFFF * 0x7FFFFFFF = 0x3FFFFFFF00000001 -34 : -> DATA=0x00000008 -35 : -> DATA=0xFFFFFFF8 -36 : -> DATA=0x00000001 -37 : -> DATA=8 -39 : ENABLE=0 -> ACTIVE=0 - - [Capture pos bus entry 8 Min] 2 : START_WRITE=0 3 : GATE=1 @@ -397,26 +343,6 @@ scope: pcap.block.ini 32 : -> DATA=0x20 34 : ENABLE=0 -> ACTIVE=0 -[Capture bit bus all quadrants ENABLE low] -1 : START_WRITE=0 -2 : WRITE=0x270 -5 : WRITE=0x280 -8 : WRITE=0x290 -11 : WRITE=0x2A0 -12 : ARM=0 -> ACTIVE=1 -13 : TRIG=1, BIT[2]=1 -# BIT[2] appears as bit 2 (0x4) of BITS0 -14 : TRIG=0 -17 : TRIG=1, BIT[58]=1 -18 : TRIG=0 -# BIT[58] appears as bit 26 (0x4000000) of BITS1 -21 : TRIG=1, BIT[101]=1 -22 : TRIG=0 -# BIT[101] appears as bit 5 (0x20) of BITS3 -25 : TRIG=1, BIT[10]=1 -# BIT[10] appears as bit 10 (0x400) of BITS0 -26 : DISARM=0, TRIG=0 -> ACTIVE=0 - [Gate and capture signals the same] 2 : START_WRITE=0 4 : WRITE=0x11 @@ -478,249 +404,3 @@ scope: pcap.block.ini 22 : -> DATA=0, HEALTH=1, ACTIVE=0 24 : ENABLE=0 - -[Test ENABLE reset after 1st pulse] -1 : POS[2]=10 -2 : START_WRITE=0 -3 : WRITE=0x22 -8 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -12 : GATE=1 -13 : TRIG=1 -14 : TRIG=0 -17 : -> DATA=10 -19 : ENABLE=0 -> ACTIVE=0 -22 : ENABLE=1 -24 : ARM=0 -> ACTIVE=1 -26 : TRIG=1 -27 : TRIG=0 -30 : -> DATA=20 -36 : TRIG=1 -37 : POS[2]=-20, TRIG=0 -38 : -39 : TRIG=1 -40 : TRIG=0 -> DATA=100 -43 : -> DATA=-30 -44 : TRIG=1 -45 : TRIG=0 -48 : -> DATA=-100 -50 : TRIG=1 -51 : TRIG=0 -54 : -> DATA=-120 -57 : GATE=0 -59 : ENABLE=0 -> ACTIVE=0 - -[Test ENABLE reset after 1st pulse no re-arm] -1 : POS[2]=10 -2 : START_WRITE=0 -3 : WRITE=0x22 -8 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -12 : GATE=1 -13 : TRIG=1 -14 : TRIG=0 -17 : -> DATA=10 -19 : ENABLE=0 -> ACTIVE=0 -22 : ENABLE=1 -26 : TRIG=1 -27 : TRIG=0 -36 : TRIG=1 -37 : POS[2]=-20, TRIG=0 -39 : TRIG=1 -40 : TRIG=0 -44 : TRIG=1 -45 : TRIG=0 -50 : TRIG=1 -51 : TRIG=0 -57 : GATE=0 -59 : ENABLE=0 - -[Test ENABLE reset after 3rd pulse] -1 : POS[2]=10 -2 : START_WRITE=0 -3 : WRITE=0x22 -8 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -12 : GATE=1 -13 : TRIG=1 -14 : TRIG=0 -16 : TRIG=1 -17 : TRIG=0 -> DATA=10 -20 : -> DATA=30 -26 : TRIG=1 -27 : TRIG=0, POS[2]=-20 -30 : -> DATA=100 -32 : ENABLE=0 -> ACTIVE=0 -33 : ENABLE=1 -35 : ARM=0 -> ACTIVE=1 -39 : TRIG=1 -40 : TRIG=0 -43 : -> DATA=-80 -44 : TRIG=1 -45 : TRIG=0 -48 : -> DATA=-100 -50 : TRIG=1 -51 : TRIG=0 -54 : -> DATA=-120 -57 : GATE=0 -59 : ENABLE=0 -> ACTIVE=0 - -[Test ENABLE reset after 3rd pulse no re-arm] -1 : POS[2]=10 -2 : START_WRITE=0 -3 : WRITE=0x22 -8 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -12 : GATE=1 -13 : TRIG=1 -14 : TRIG=0 -16 : TRIG=1 -17 : TRIG=0 -> DATA=10 -20 : -> DATA=30 -26 : TRIG=1 -27 : TRIG=0, POS[2]=-20 -30 : -> DATA=100 -32 : ENABLE=0 -> ACTIVE=0 -33 : ENABLE=1 -39 : TRIG=1 -40 : TRIG=0 -44 : TRIG=1 -45 : TRIG=0 -50 : TRIG=1 -51 : TRIG=0 -57 : GATE=0 -59 : ENABLE=0 - -[timestamps re-enable] -1 : START_WRITE=0 -2 : WRITE=0x200 -9 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -14 : GATE=1 -16 : GATE=0 -17 : TRIG=1 -18 : TRIG=0 -20 : GATE=1 -21 : -> DATA=4 -24 : GATE=0, ENABLE=0 -> ACTIVE=0 -35 : ARM=0, ENABLE=1 -> ACTIVE=1 -37 : GATE=1 -40 : GATE=0, TRIG=1 -41 : TRIG=0 -44 : -> DATA=2 -46 : GATE=1 -49 : GATE=0, TRIG=1 -50 : TRIG=0 -53 : -> DATA=11 -55 : ENABLE=0 -> ACTIVE=0 - -[timestamps re-enable no re-arm] -1 : START_WRITE=0 -2 : WRITE=0x200 -9 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -14 : GATE=1 -16 : GATE=0 -17 : TRIG=1 -18 : TRIG=0 -20 : GATE=1 -21 : -> DATA=4 -24 : GATE=0, ENABLE=0 -> ACTIVE=0 -35 : ENABLE=1 -37 : GATE=1 -40 : GATE=0, TRIG=1 -41 : TRIG=0 -46 : GATE=1 -49 : GATE=0, TRIG=1 -53 : ENABLE=0 - -[timestamps disarm re-arm] -1 : START_WRITE=0, ENABLE=1 -2 : WRITE=0x200 -10 : ARM=0 -> ACTIVE=1 -14 : GATE=1 -16 : GATE=0 -17 : TRIG=1 -18 : TRIG=0 -20 : GATE=1 -21 : -> DATA=4 -24 : GATE=0, DISARM=0 -> ACTIVE=0 -35 : ARM=0 -> ACTIVE=1 -37 : GATE=1 -40 : GATE=0, TRIG=1 -41 : TRIG=0 -44 : -> DATA=2 -46 : GATE=1 -49 : GATE=0, TRIG=1 -50 : TRIG=0 -53 : -> DATA=11 -55 : ENABLE=0 -> ACTIVE=0 - -[test disable Difference] -2 : START_WRITE=0 -4 : WRITE=0xB1 -5 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -11 : POS[11]=10 -12 : GATE=1 -14 : POS[11]=11 -15 : GATE=0 -18 : ENABLE=0 -> ACTIVE=0 -21 : ENABLE=1, ARM=0 -> ACTIVE=1 -22 : GATE=1 -23 : GATE=0, POS[11]=14 -25 : TRIG=1, GATE=1, POS[11]=19 -27 : TRIG=0, POS[11]=18 -28 : GATE=0, TRIG=1 -29 : -> DATA=3 -30 : TRIG=0 -32 : ENABLE=0 -> DATA=-1, ACTIVE=0 - -[test disable min] -2 : START_WRITE=0 -3 : GATE=1 -4 : WRITE=0x84 -5 : POS[8]=35 -6 : ENABLE=1 -10 : ARM=0 -> ACTIVE=1 -11 : POS[8]=10 -13 : POS[8]=20 -14 : TRIG=1 -15 : TRIG=0 -16 : POS[8]=8 -18 : POS[8]=30 -> DATA=10 -20 : ENABLE=0 -> ACTIVE=0 -24 : ENABLE=1, ARM=0 -> ACTIVE=1 -29 : TRIG=1 -30 : POS[8]=22, TRIG=0 -32 : POS[8]=21 -33 : GATE=0, TRIG=1 -> DATA=30 -34 : TRIG=0 -35 : TRIG=1 -37 : TRIG=0 -> DATA=21 -39 : ENABLE=0 -> DATA=0x7FFFFFFF, ACTIVE=0 - -[test disable max] -2 : START_WRITE=0 -3 : GATE=1 -4 : WRITE=0x45 -5 : POS[4]=35 -6 : ENABLE=1 -10 : ARM=0, POS[4]=10 -> ACTIVE=1 -13 : POS[4]=20 -14 : TRIG=1 -15 : TRIG=0 -16 : POS[4]=24 -18 : POS[4]=30 -> DATA=20 -19 : TRIG=1 -20 : POS[4]=22, TRIG=0 -23 : -> DATA=30 -25 : ENABLE=0 -> ACTIVE=0 -28 : ENABLE=1 -29 : ARM=0 -> ACTIVE=1 -32 : POS[4]=21 -33 : GATE=0, TRIG=1 -34 : TRIG=0 -35 : TRIG=1 -37 : TRIG=0 -> DATA=22 -39 : ENABLE=0 -> DATA=-0x80000000, ACTIVE=0 diff --git a/modules/pcap/pcap_functionality.timing.ini b/modules/pcap/pcap_functionality.timing.ini new file mode 100644 index 000000000..34e317084 --- /dev/null +++ b/modules/pcap/pcap_functionality.timing.ini @@ -0,0 +1,321 @@ +[.] +description: Functionality timing diagrams for PCAP block +scope: pcap.block.ini + +[Capture pos bus entry 5 Value low ENABLE] +2 : START_WRITE=0 +4 : WRITE=0x50 +6 : POS[5]=20 +10 : ARM=0 -> ACTIVE=1 +13 : TRIG=1 +14 : TRIG=0, POS[5]=100 +15 : TRIG=1 +16 : TRIG=0 +18 : TRIG=1, POS[5]=6 +19 : POS[5]=2 +22 : DISARM=0, TRIG=0 -> ACTIVE=0 + +[Capture pos bus entry 2 Sum Sum^2 Samples] +1 : POS[2]=-3 +2 : START_WRITE=0 +3 : WRITE=0x22 +4 : WRITE=0x23 +5 : WRITE=0x26 +6 : WRITE=0x27 +7 : WRITE=0x28 +8 : WRITE=0x260 +10 : ARM=0 -> ACTIVE=1 +11 : ENABLE=1 +12 : GATE=1 +14 : TRIG=1 +15 : POS[2]=3, TRIG=0 +16 : POS[2]=4 +17 : POS[2]=5 +18 : POS[2]=6 -> DATA=-6 +19 : POS[2]=9 -> DATA=-1 +# POS[2]=0x7FFFFFFF +20 : POS[2]=2147483647, TRIG=1 -> DATA=18 +21 : TRIG=0 -> DATA=0 +22 : -> DATA=0 +23 : -> DATA=2 +24 : -> DATA=24 +25 : -> DATA=0 +26 : -> DATA=176 +27 : -> DATA=0 +28 : TRIG=1 -> DATA=0 +29 : GATE=0,TRIG=0 -> DATA=6 +# 0x7FFFFFFF * 8 = 0x3FFFFFFF8 +32 : -> DATA=0xFFFFFFF8 +33 : -> DATA=0x00000003 +# 0x7FFFFFFF * 0x7FFFFFFF = 0x3FFFFFFF00000001 +34 : -> DATA=0x00000008 +35 : -> DATA=0xFFFFFFF8 +36 : -> DATA=0x00000001 +37 : -> DATA=8 +39 : ENABLE=0 -> ACTIVE=0 + +[Capture bit bus all quadrants ENABLE low] +1 : START_WRITE=0 +2 : WRITE=0x270 +5 : WRITE=0x280 +8 : WRITE=0x290 +11 : WRITE=0x2A0 +12 : ARM=0 -> ACTIVE=1 +13 : TRIG=1, BIT[2]=1 +# BIT[2] appears as bit 2 (0x4) of BITS0 +14 : TRIG=0 +17 : TRIG=1, BIT[58]=1 +18 : TRIG=0 +# BIT[58] appears as bit 26 (0x4000000) of BITS1 +21 : TRIG=1, BIT[101]=1 +22 : TRIG=0 +# BIT[101] appears as bit 5 (0x20) of BITS3 +25 : TRIG=1, BIT[10]=1 +# BIT[10] appears as bit 10 (0x400) of BITS0 +26 : DISARM=0, TRIG=0 -> ACTIVE=0 + +[Test ENABLE reset after 1st pulse] +1 : POS[2]=10 +2 : START_WRITE=0 +3 : WRITE=0x22 +8 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +12 : GATE=1 +13 : TRIG=1 +14 : TRIG=0 +17 : -> DATA=10 +19 : ENABLE=0 -> ACTIVE=0 +22 : ENABLE=1 +24 : ARM=0 -> ACTIVE=1 +26 : TRIG=1 +27 : TRIG=0 +30 : -> DATA=20 +36 : TRIG=1 +37 : POS[2]=-20, TRIG=0 +38 : +39 : TRIG=1 +40 : TRIG=0 -> DATA=100 +43 : -> DATA=-30 +44 : TRIG=1 +45 : TRIG=0 +48 : -> DATA=-100 +50 : TRIG=1 +51 : TRIG=0 +54 : -> DATA=-120 +57 : GATE=0 +59 : ENABLE=0 -> ACTIVE=0 + +[Test ENABLE reset after 1st pulse no re-arm] +1 : POS[2]=10 +2 : START_WRITE=0 +3 : WRITE=0x22 +8 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +12 : GATE=1 +13 : TRIG=1 +14 : TRIG=0 +17 : -> DATA=10 +19 : ENABLE=0 -> ACTIVE=0 +22 : ENABLE=1 +26 : TRIG=1 +27 : TRIG=0 +36 : TRIG=1 +37 : POS[2]=-20, TRIG=0 +39 : TRIG=1 +40 : TRIG=0 +44 : TRIG=1 +45 : TRIG=0 +50 : TRIG=1 +51 : TRIG=0 +57 : GATE=0 +59 : ENABLE=0 + +[Test ENABLE reset after 3rd pulse] +1 : POS[2]=10 +2 : START_WRITE=0 +3 : WRITE=0x22 +8 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +12 : GATE=1 +13 : TRIG=1 +14 : TRIG=0 +16 : TRIG=1 +17 : TRIG=0 -> DATA=10 +20 : -> DATA=30 +26 : TRIG=1 +27 : TRIG=0, POS[2]=-20 +30 : -> DATA=100 +32 : ENABLE=0 -> ACTIVE=0 +33 : ENABLE=1 +35 : ARM=0 -> ACTIVE=1 +39 : TRIG=1 +40 : TRIG=0 +43 : -> DATA=-80 +44 : TRIG=1 +45 : TRIG=0 +48 : -> DATA=-100 +50 : TRIG=1 +51 : TRIG=0 +54 : -> DATA=-120 +57 : GATE=0 +59 : ENABLE=0 -> ACTIVE=0 + +[Test ENABLE reset after 3rd pulse no re-arm] +1 : POS[2]=10 +2 : START_WRITE=0 +3 : WRITE=0x22 +8 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +12 : GATE=1 +13 : TRIG=1 +14 : TRIG=0 +16 : TRIG=1 +17 : TRIG=0 -> DATA=10 +20 : -> DATA=30 +26 : TRIG=1 +27 : TRIG=0, POS[2]=-20 +30 : -> DATA=100 +32 : ENABLE=0 -> ACTIVE=0 +33 : ENABLE=1 +39 : TRIG=1 +40 : TRIG=0 +44 : TRIG=1 +45 : TRIG=0 +50 : TRIG=1 +51 : TRIG=0 +57 : GATE=0 +59 : ENABLE=0 + +[timestamps re-enable] +1 : START_WRITE=0 +2 : WRITE=0x200 +9 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +14 : GATE=1 +16 : GATE=0 +17 : TRIG=1 +18 : TRIG=0 +20 : GATE=1 +21 : -> DATA=4 +24 : GATE=0, ENABLE=0 -> ACTIVE=0 +35 : ARM=0, ENABLE=1 -> ACTIVE=1 +37 : GATE=1 +40 : GATE=0, TRIG=1 +41 : TRIG=0 +44 : -> DATA=2 +46 : GATE=1 +49 : GATE=0, TRIG=1 +50 : TRIG=0 +53 : -> DATA=11 +55 : ENABLE=0 -> ACTIVE=0 + +[timestamps re-enable no re-arm] +1 : START_WRITE=0 +2 : WRITE=0x200 +9 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +14 : GATE=1 +16 : GATE=0 +17 : TRIG=1 +18 : TRIG=0 +20 : GATE=1 +21 : -> DATA=4 +24 : GATE=0, ENABLE=0 -> ACTIVE=0 +35 : ENABLE=1 +37 : GATE=1 +40 : GATE=0, TRIG=1 +41 : TRIG=0 +46 : GATE=1 +49 : GATE=0, TRIG=1 +53 : ENABLE=0 + +[timestamps disarm re-arm] +1 : START_WRITE=0, ENABLE=1 +2 : WRITE=0x200 +10 : ARM=0 -> ACTIVE=1 +14 : GATE=1 +16 : GATE=0 +17 : TRIG=1 +18 : TRIG=0 +20 : GATE=1 +21 : -> DATA=4 +24 : GATE=0, DISARM=0 -> ACTIVE=0 +35 : ARM=0 -> ACTIVE=1 +37 : GATE=1 +40 : GATE=0, TRIG=1 +41 : TRIG=0 +44 : -> DATA=2 +46 : GATE=1 +49 : GATE=0, TRIG=1 +50 : TRIG=0 +53 : -> DATA=11 +55 : ENABLE=0 -> ACTIVE=0 + +[test disable Difference] +2 : START_WRITE=0 +4 : WRITE=0xB1 +5 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +11 : POS[11]=10 +12 : GATE=1 +14 : POS[11]=11 +15 : GATE=0 +18 : ENABLE=0 -> ACTIVE=0 +21 : ENABLE=1, ARM=0 -> ACTIVE=1 +22 : GATE=1 +23 : GATE=0, POS[11]=14 +25 : TRIG=1, GATE=1, POS[11]=19 +27 : TRIG=0, POS[11]=18 +28 : GATE=0, TRIG=1 +29 : -> DATA=3 +30 : TRIG=0 +32 : ENABLE=0 -> DATA=-1, ACTIVE=0 + +[test disable min] +2 : START_WRITE=0 +3 : GATE=1 +4 : WRITE=0x84 +5 : POS[8]=35 +6 : ENABLE=1 +10 : ARM=0 -> ACTIVE=1 +11 : POS[8]=10 +13 : POS[8]=20 +14 : TRIG=1 +15 : TRIG=0 +16 : POS[8]=8 +18 : POS[8]=30 -> DATA=10 +20 : ENABLE=0 -> ACTIVE=0 +24 : ENABLE=1, ARM=0 -> ACTIVE=1 +29 : TRIG=1 +30 : POS[8]=22, TRIG=0 +32 : POS[8]=21 +33 : GATE=0, TRIG=1 -> DATA=30 +34 : TRIG=0 +35 : TRIG=1 +37 : TRIG=0 -> DATA=21 +39 : ENABLE=0 -> DATA=0x7FFFFFFF, ACTIVE=0 + +[test disable max] +2 : START_WRITE=0 +3 : GATE=1 +4 : WRITE=0x45 +5 : POS[4]=35 +6 : ENABLE=1 +10 : ARM=0, POS[4]=10 -> ACTIVE=1 +13 : POS[4]=20 +14 : TRIG=1 +15 : TRIG=0 +16 : POS[4]=24 +18 : POS[4]=30 -> DATA=20 +19 : TRIG=1 +20 : POS[4]=22, TRIG=0 +23 : -> DATA=30 +25 : ENABLE=0 -> ACTIVE=0 +28 : ENABLE=1 +29 : ARM=0 -> ACTIVE=1 +32 : POS[4]=21 +33 : GATE=0, TRIG=1 +34 : TRIG=0 +35 : TRIG=1 +37 : TRIG=0 -> DATA=22 +39 : ENABLE=0 -> DATA=-0x80000000, ACTIVE=0 diff --git a/modules/posenc/posenc_doc.rst b/modules/posenc/posenc_doc.rst index 430043ce2..72d4e169d 100644 --- a/modules/posenc/posenc_doc.rst +++ b/modules/posenc/posenc_doc.rst @@ -24,11 +24,11 @@ The state output is '0' while ENABLE is low, '1' when the count is equal to the signal on the INP line and '2' while it is counting towards the INP value. .. timing_plot:: - :path: modules/posenc/posenc.timing.ini + :path: modules/posenc/posenc_documentation.timing.ini :section: Quadrature rising and falling .. timing_plot:: - :path: modules/posenc/posenc.timing.ini + :path: modules/posenc/posenc_documentation.timing.ini :section: Longer Period Quadrature @@ -42,9 +42,9 @@ lower than the inputted target value (it is counting up), and '1' when it is greater or equal to. .. timing_plot:: - :path: modules/posenc/posenc.timing.ini + :path: modules/posenc/posenc_documentation.timing.ini :section: Step/Direction .. timing_plot:: - :path: modules/posenc/posenc.timing.ini + :path: modules/posenc/posenc_documentation.timing.ini :section: Longer Period Step/Direction diff --git a/modules/posenc/posenc.timing.ini b/modules/posenc/posenc_documentation.timing.ini similarity index 64% rename from modules/posenc/posenc.timing.ini rename to modules/posenc/posenc_documentation.timing.ini index 294258931..6d9e975d8 100644 --- a/modules/posenc/posenc.timing.ini +++ b/modules/posenc/posenc_documentation.timing.ini @@ -1,5 +1,5 @@ [.] -description: Timing diagrams for the posenc block +description: Documentation timing diagrams for the posenc block scope: posenc.block.ini [Quadrature rising and falling] @@ -31,84 +31,6 @@ scope: posenc.block.ini 52 : -> B=1, STATE=1 60 : ENABLE=0 -> B=0, STATE=0 -[Quadrature rising and falling. Period set to 1] -1 : INP=1, PERIOD=1, PROTOCOL=0 -2 : ENABLE=1 -> STATE=1 -4 : INP=6 -> STATE=2 -5 : -> A=1 -6 : -> B=1 -7 : -> A=0 -8 : -> B=0 -9 : -> A=1, STATE=1 -16 : INP=11 -> STATE=2 -17 : -> B=1 -18 : -> A=0 -19 : -> B=0 -20 : -> A=1 -21 : -> B=1, STATE=1 -30 : INP=0 -> STATE=2 -31 : -> B=0 -32 : -> A=0 -33 : -> B=1 -34 : -> A=1 -35 : -> B=0 -36 : -> A=0 -37 : -> B=1 -38 : -> A=1 -39 : -> B=0 -40 : -> A=0 -41 : -> B=1, STATE=1 -60 : ENABLE=0 -> B=0, STATE=0 - -[Step/Direction PERIOD 1] -1 : INP=1, PERIOD=2, PROTOCOL=1 -2 : ENABLE=1 -> A=0, B=0, STATE=1 -3 : -> B=1 -4 : INP=6 -> STATE=2, B=0 -6 : -> A=1 -7 : -> A=0 -8 : -> A=1 -9 : -> A=0 -10 : -> A=1 -11 : -> A=0 -12 : -> A=1 -13 : -> A=0 -14 : -> A=1, B=1, STATE=1 -15 : -> A=0 -16 : INP=11 -> B=0, STATE=2 -18 : -> A=1 -19 : -> A=0 -20 : -> A=1 -21 : -> A=0 -22 : -> A=1 -23 : -> A=0 -24 : -> A=1 -25 : -> A=0 -26 : -> A=1, B=1, STATE=1 -27 : -> A=0 -30 : INP=1 -> STATE=2 -32 : -> A=1 -33 : -> A=0 -34 : -> A=1 -35 : -> A=0 -36 : -> A=1 -37 : -> A=0 -38 : -> A=1 -39 : -> A=0 -40 : -> A=1 -41 : -> A=0 -42 : -> A=1 -43 : -> A=0 -44 : -> A=1 -45 : -> A=0 -46 : -> A=1 -47 : -> A=0 -48 : -> A=1 -49 : -> A=0 -50 : -> A=1, STATE=1 -51 : -> A=0 -54 : ENABLE=0 -> B=0, STATE=0 - [Step/Direction] 1 : INP=1, PERIOD=2, PROTOCOL=1 2 : ENABLE=1 -> A=0, B=0, STATE=1 diff --git a/modules/posenc/posenc_functionality.timing.ini b/modules/posenc/posenc_functionality.timing.ini new file mode 100644 index 000000000..d4ba3cc47 --- /dev/null +++ b/modules/posenc/posenc_functionality.timing.ini @@ -0,0 +1,81 @@ +[.] +description: Documentation timing diagrams for the posenc block +scope: posenc.block.ini + +[Quadrature rising and falling. Period set to 1] +1 : INP=1, PERIOD=1, PROTOCOL=0 +2 : ENABLE=1 -> STATE=1 +4 : INP=6 -> STATE=2 +5 : -> A=1 +6 : -> B=1 +7 : -> A=0 +8 : -> B=0 +9 : -> A=1, STATE=1 +16 : INP=11 -> STATE=2 +17 : -> B=1 +18 : -> A=0 +19 : -> B=0 +20 : -> A=1 +21 : -> B=1, STATE=1 +30 : INP=0 -> STATE=2 +31 : -> B=0 +32 : -> A=0 +33 : -> B=1 +34 : -> A=1 +35 : -> B=0 +36 : -> A=0 +37 : -> B=1 +38 : -> A=1 +39 : -> B=0 +40 : -> A=0 +41 : -> B=1, STATE=1 +60 : ENABLE=0 -> B=0, STATE=0 + +[Step/Direction PERIOD 1] +1 : INP=1, PERIOD=2, PROTOCOL=1 +2 : ENABLE=1 -> A=0, B=0, STATE=1 +3 : -> B=1 +4 : INP=6 -> STATE=2, B=0 +6 : -> A=1 +7 : -> A=0 +8 : -> A=1 +9 : -> A=0 +10 : -> A=1 +11 : -> A=0 +12 : -> A=1 +13 : -> A=0 +14 : -> A=1, B=1, STATE=1 +15 : -> A=0 +16 : INP=11 -> B=0, STATE=2 +18 : -> A=1 +19 : -> A=0 +20 : -> A=1 +21 : -> A=0 +22 : -> A=1 +23 : -> A=0 +24 : -> A=1 +25 : -> A=0 +26 : -> A=1, B=1, STATE=1 +27 : -> A=0 +30 : INP=1 -> STATE=2 +32 : -> A=1 +33 : -> A=0 +34 : -> A=1 +35 : -> A=0 +36 : -> A=1 +37 : -> A=0 +38 : -> A=1 +39 : -> A=0 +40 : -> A=1 +41 : -> A=0 +42 : -> A=1 +43 : -> A=0 +44 : -> A=1 +45 : -> A=0 +46 : -> A=1 +47 : -> A=0 +48 : -> A=1 +49 : -> A=0 +50 : -> A=1, STATE=1 +51 : -> A=0 +54 : ENABLE=0 -> B=0, STATE=0 diff --git a/modules/qdec/qdec_doc.rst b/modules/qdec/qdec_doc.rst index a294cbb32..e4603d2c3 100644 --- a/modules/qdec/qdec_doc.rst +++ b/modules/qdec/qdec_doc.rst @@ -16,11 +16,11 @@ the sequence. If the sequence is reversed the count will decrease at each edge. The initial value is set to the value of the SETP input. .. timing_plot:: - :path: modules/qdec/qdec.timing.ini + :path: modules/qdec/qdec_documentation.timing.ini :section: No Set Point .. timing_plot:: - :path: modules/qdec/qdec.timing.ini + :path: modules/qdec/qdec_documentation.timing.ini :section: Up then Down Resetting @@ -31,7 +31,7 @@ that this functionality is enabled by setting the RST_ON_Z input to '1'. If the SETP input is changed the count value changes to the new value. .. timing_plot:: - :path: modules/qdec/qdec.timing.ini + :path: modules/qdec/qdec_documentation.timing.ini :section: Up then down with reset and change of Set Point Limitations @@ -41,12 +41,12 @@ The block can continue to count when there is not a constant period between the pulses. .. timing_plot:: - :path: modules/qdec/qdec.timing.ini + :path: modules/qdec/qdec_documentation.timing.ini :section: Variable quadrature period The output takes three clock pulses to update. If the inputs are changing faster than this, inputs can be lost. .. timing_plot:: - :path: modules/qdec/qdec.timing.ini - :section: Faster input than output \ No newline at end of file + :path: modules/qdec/qdec_documentation.timing.ini + :section: Faster input than output diff --git a/modules/qdec/qdec.timing.ini b/modules/qdec/qdec_documentation.timing.ini similarity index 88% rename from modules/qdec/qdec.timing.ini rename to modules/qdec/qdec_documentation.timing.ini index 9cbd3719c..e251e6ef2 100644 --- a/modules/qdec/qdec.timing.ini +++ b/modules/qdec/qdec_documentation.timing.ini @@ -1,5 +1,5 @@ [.] -description: Timing diagrams for the qdec block +description: Documentation timing diagrams for the qdec block scope: qdec.block.ini [Up then Down] @@ -113,15 +113,3 @@ scope: qdec.block.ini 9 : A=0 -> OUT=3 10 : B=0 11 : -> OUT=4 - -[count below zero] - -3 : B=1, LINKUP_INCR=1 -5 : A=1 -> OUT=-1, HOMED=0 -7 : B=0 -> OUT=-2 -9 : A=0 -> OUT=-3 -11 : B=1 -> OUT=-4 -13 : A=1 -> OUT=-5 -15 : B=0 -> OUT=-6 -17 : A=0 -> OUT=-7 -19 : -> OUT=-8 diff --git a/modules/qdec/qdec_functionality.timing.ini b/modules/qdec/qdec_functionality.timing.ini new file mode 100644 index 000000000..8c0082bd0 --- /dev/null +++ b/modules/qdec/qdec_functionality.timing.ini @@ -0,0 +1,15 @@ +[.] +description: Functionality timing diagrams for the qdec block +scope: qdec.block.ini + +[count below zero] + +3 : B=1, LINKUP_INCR=1 +5 : A=1 -> OUT=-1, HOMED=0 +7 : B=0 -> OUT=-2 +9 : A=0 -> OUT=-3 +11 : B=1 -> OUT=-4 +13 : A=1 -> OUT=-5 +15 : B=0 -> OUT=-6 +17 : A=0 -> OUT=-7 +19 : -> OUT=-8 diff --git a/modules/seq/seq_doc.rst b/modules/seq/seq_doc.rst index f623ed2ad..10d70978a 100644 --- a/modules/seq/seq_doc.rst +++ b/modules/seq/seq_doc.rst @@ -57,7 +57,7 @@ that is repeated 3 times. When enabled it will become active and immediately start producing pulses, remaining active until the pulses have been produced: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: 3 evenly spaced pulses We can also use it to generate irregular streams of pulses on different outputs @@ -65,20 +65,20 @@ by adding more lines to the table. Note that OUTB which was high at the end of Phase2 of the first line remains high in Phase1 of the second line: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Irregular pulses And we can set repeats on the entire table too. Note that in the second line of this table we have suppressed phase1 by setting its time to 0: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Table repeats There are 6 outputs which allow for complex patterns to be generated: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Using all 6 outputs Statemachine @@ -126,14 +126,14 @@ see when the Block is waiting for a trigger signal as it will enter the WAIT_TRIGGER(2) state: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Waiting on bit inputs You can also use a position field as a trigger condition in the same way, this is useful to do a table based position compare: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Table based position compare @@ -145,7 +145,7 @@ scaled with a block wide prescaler to allow a frame to be longer than 2**32 * 8e-9 = about 34 seconds. For example: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Prescaled pulses @@ -156,20 +156,20 @@ Setting the repeats on a table row to 0 will cause it to iterate until interrupted by a falling ENABLE signal: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Infinite repeats of a row interrupted In a similar way, REPEATS=0 on a table will cause the whole table to be iterated until interrupted by a falling ENABLE signal: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Infinite repeats of a table interrupted And a rising edge of the ENABLE will re-run the same table from the start: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Restarting the same table @@ -180,7 +180,7 @@ If a table is written while enabled, the outputs and table state are reset and operation begins again from the first repeat of the first line of the table: .. timing_plot:: - :path: modules/seq/seq.timing.ini + :path: modules/seq/seq_documentation.timing.ini :section: Rewriting a table Double table mode @@ -194,5 +194,5 @@ that will be repeated according to the REPEATS register. .. timing_plot:: - :path: modules/seq/seq_double_table.timing.ini + :path: modules/seq/seq_double_table_documentation.timing.ini :section: Test case for double table writting while running diff --git a/modules/seq/seq_documentation.timing.ini b/modules/seq/seq_documentation.timing.ini new file mode 100644 index 000000000..88a30eef7 --- /dev/null +++ b/modules/seq/seq_documentation.timing.ini @@ -0,0 +1,360 @@ +[.] +description: Documentation timing diagrams for the seq block +scope: seq.block.ini + +[3 evenly spaced pulses] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0003 +5 : TABLE_DATA=0x100003 +6 : TABLE_DATA=0 +7 : TABLE_DATA=5 +8 : TABLE_DATA=5 +9 : TABLE_LENGTH=4 +10 : -> STATE=1 +12 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, OUTA=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 +17 : -> OUTA=0, STATE=4 +22 : -> OUTA=1, LINE_REPEAT=2, STATE=3 +27 : -> OUTA=0, STATE=4 +32 : -> OUTA=1, LINE_REPEAT=3, STATE=3 +37 : -> OUTA=0, STATE=4 +42 : -> ACTIVE=0, STATE=1 +47 : ENABLE=0 + +[Irregular pulses] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x81 (OUT1=A, OUT2=B) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0002 +5 : TABLE_DATA=0x8100002 +6 : TABLE_DATA=0 +7 : TABLE_DATA=5 +8 : TABLE_DATA=2 + +# OUT = 0x3 (OUT1=AB) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0003 +9 : TABLE_DATA=0x300003 +10 : TABLE_DATA=0 +11 : TABLE_DATA=1 +12 : TABLE_DATA=2 + +13 : TABLE_LENGTH=8 +14 : -> STATE=1 +22 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, OUTA=1, TABLE_REPEAT=1, STATE=3 +27 : -> OUTA=0, OUTB=1, STATE=4 +29 : -> OUTA=1, OUTB=0, LINE_REPEAT=2, STATE=3 +34 : -> OUTA=0, OUTB=1, STATE=4 +36 : -> OUTA=1, OUTB=1, LINE_REPEAT=1, TABLE_LINE=2, STATE=3 +37 : -> OUTA=0, OUTB=0, STATE=4 +39 : -> OUTA=1, OUTB=1, LINE_REPEAT=2, STATE=3 +40 : -> OUTA=0, OUTB=0, STATE=4 +42 : -> OUTA=1, OUTB=1, LINE_REPEAT=3, STATE=3 +43 : -> OUTA=0, OUTB=0, STATE=4 +45 : -> ACTIVE=0, STATE=1 +49 : ENABLE=0 + +[Table repeats] +2 : REPEATS=2 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0002 +5 : TABLE_DATA=0x100002 +6 : TABLE_DATA=0 +7 : TABLE_DATA=5 +8 : TABLE_DATA=2 + +# OUT = 0x80 (OUT2=B) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +9 : TABLE_DATA=0x8000001 +10 : TABLE_DATA=0 +11 : TABLE_DATA=0 +12 : TABLE_DATA=5 + +13 : TABLE_LENGTH=8 +14 : -> STATE=1 +22 : ENABLE=1 -> OUTA=1, ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 +27 : -> OUTA=0, STATE=4 +29 : -> OUTA=1, LINE_REPEAT=2, STATE=3 +34 : -> OUTA=0, STATE=4 +36 : -> OUTB=1, LINE_REPEAT=1, TABLE_LINE=2 +41 : -> OUTB=0, OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=2, STATE=3 +46 : -> OUTA=0, STATE=4 +48 : -> OUTA=1, LINE_REPEAT=2, STATE=3 +53 : -> OUTA=0, STATE=4 +55 : -> OUTB=1, LINE_REPEAT=1, TABLE_LINE=2 +60 : -> OUTB=0, ACTIVE=0, STATE=1 +62 : ENABLE=0 + +[Using all 6 outputs] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0xC1 (OUT1=A, OUT2=AB) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +5 : TABLE_DATA=0xC100001 +6 : TABLE_DATA=0 +7 : TABLE_DATA=3 +8 : TABLE_DATA=4 + +# OUT = 0x3C7 (OUT1=ABC, OUT2=ABCD) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +9 : TABLE_DATA=0x3C700001 +10 : TABLE_DATA=0 +11 : TABLE_DATA=5 +12 : TABLE_DATA=6 + +# OUT = 0xFDF (OUT1=ABCDE, OUT2=ABCDEF) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +13 : TABLE_DATA=0xFDF00001 +14 : TABLE_DATA=0 +15 : TABLE_DATA=7 +16 : TABLE_DATA=8 + +17 : TABLE_LENGTH=12 +18 : -> STATE=1 +25 : ENABLE=1 -> ACTIVE=1, TABLE_LINE=1, OUTA=1, LINE_REPEAT=1, TABLE_REPEAT=1, STATE=3 +28 : -> OUTB=1, STATE=4 +32 : -> OUTC=1, TABLE_LINE=2, STATE=3 +37 : -> OUTD=1, STATE=4 +43 : -> OUTE=1, TABLE_LINE=3, STATE=3 +50 : -> OUTF=1, STATE=4 +58 : -> OUTA=0, OUTB=0, OUTC=0, OUTD=0, OUTE=0, OUTF=0, ACTIVE=0, STATE=1 +65 : ENABLE=0 + + +[Waiting on bit inputs] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x2 (BITA=1) +# REPEATS = 0x0003 +5 : TABLE_DATA=0x120003 +6 : TABLE_DATA=0 +7 : TABLE_DATA=2 +8 : TABLE_DATA=1 + +# OUT = 0x2 (OUT1=B) +# TRIGGER = 0x4 (BITB=1) +# REPEATS = 0x0001 +9 : TABLE_DATA=0x240001 +10 : TABLE_DATA=0 +11 : TABLE_DATA=3 +12 : TABLE_DATA=2 + +13 : TABLE_LENGTH=8 +14 : -> STATE=1 +15 : ENABLE=1 -> STATE=2, ACTIVE=1, TABLE_LINE=1, LINE_REPEAT=1, TABLE_REPEAT=1 +18 : BITA=1 -> STATE=3, OUTA=1 +19 : BITA=0 +20 : -> STATE=4, OUTA=0 +21 : -> STATE=2, LINE_REPEAT=2 +27 : BITA=1 -> STATE=3, OUTA=1 +29 : -> STATE=4, OUTA=0 +30 : -> STATE=3, OUTA=1, LINE_REPEAT=3 +32 : -> STATE=4, OUTA=0 +33 : BITB=1 -> STATE=3, OUTB=1, TABLE_LINE=2, LINE_REPEAT=1 +34 : BITB=0 +36 : -> STATE=4, OUTB=0 +38 : -> STATE=1, ACTIVE=0 +41 : BITA=0 +44 : ENABLE=0 + +[Table based position compare] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x80 (OUT2=B) +# TRIGGER = 0x7 (POSA>=POSITION) +# REPEATS = 0x0001 +5 : TABLE_DATA=0x8070001 +6 : TABLE_DATA=20 +7 : TABLE_DATA=0 +8 : TABLE_DATA=4 + +# OUT = 0x83 (OUT1=AB, OUT2=B) +# TRIGGER = 0 (Immediate) +# REPEATS = 0x0003 +9 : TABLE_DATA=0x8300003 +10 : TABLE_DATA=0 +11 : TABLE_DATA=1 +12 : TABLE_DATA=3 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x8 (POSA<=POSITION) +# REPEATS = 0x0002 +13 : TABLE_DATA=0x180002 +14 : TABLE_DATA=10 +15 : TABLE_DATA=1 +16 : TABLE_DATA=3 + + +17 : TABLE_LENGTH=12 +18 : -> STATE=1 +19 : ENABLE=1 -> ACTIVE=1, TABLE_LINE=1, LINE_REPEAT=1, TABLE_REPEAT=1, STATE=2 +20 : POSA=19 +23 : POSA=20 -> OUTB=1, STATE=4 +27 : -> OUTA=1, TABLE_LINE=2, STATE=3 +28 : -> OUTA=0, STATE=4 +31 : POSA=19 -> OUTA=1, LINE_REPEAT=2, STATE=3 +32 : -> OUTA=0, STATE=4 +35 : POSA=16 -> OUTA=1, LINE_REPEAT=3, STATE=3 +36 : -> OUTA=0, STATE=4 +39 : POSA=12 -> TABLE_LINE=3, LINE_REPEAT=1, STATE=2 +43 : POSA=9 -> OUTA=1, OUTB=0, STATE=3 +44 : -> OUTA=0, STATE=4 +47 : -> OUTA=1, LINE_REPEAT=2, STATE=3 +48 : POSA=7 -> OUTA=0, STATE=4 +51 : -> ACTIVE=0, STATE=1 +55 : ENABLE=0 + +[Prescaled pulses] +2 : REPEATS=1, PRESCALE=10 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0002 +5 : TABLE_DATA=0x100002 +6 : TABLE_DATA=0 +7 : TABLE_DATA=1 +8 : TABLE_DATA=1 + +9 : TABLE_LENGTH=4 +10 : -> STATE=1 +12 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, OUTA=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 +22 : -> OUTA=0, STATE=4 +32 : -> OUTA=1, LINE_REPEAT=2, STATE=3 +42 : -> OUTA=0, STATE=4 +52 : -> ACTIVE=0, STATE=1 +57 : ENABLE=0 + +[Infinite repeats of a row interrupted] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0000 +5 : TABLE_DATA=0x100000 +6 : TABLE_DATA=0 +7 : TABLE_DATA=5 +8 : TABLE_DATA=5 + +9 : TABLE_LENGTH=4 +10 : -> STATE=1 +12 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, OUTA=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 +17 : -> OUTA=0, STATE=4 +22 : -> OUTA=1, LINE_REPEAT=2, STATE=3 +27 : -> OUTA=0, STATE=4 +32 : -> OUTA=1, LINE_REPEAT=3, STATE=3 +34 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 + +[Infinite repeats of a table interrupted] +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x40 (OUT2=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +5 : TABLE_DATA=0x4000001 +6 : TABLE_DATA=0 +7 : TABLE_DATA=0 +8 : TABLE_DATA=5 + +# OUT = 0x0 (OUT1=0) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0002 +9 : TABLE_DATA=0x000002 +10 : TABLE_DATA=0 +11 : TABLE_DATA=0 +12 : TABLE_DATA=3 + +13 : TABLE_LENGTH=8 +14 : -> STATE=1 +17 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=1, OUTA=1, STATE=4 +22 : -> OUTA=0, TABLE_LINE=2 +25 : -> LINE_REPEAT=2 +28 : -> OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=2 +33 : -> OUTA=0, TABLE_LINE=2 +36 : -> LINE_REPEAT=2 +39 : -> OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=3 +41 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 + +[Restarting the same table] +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +5 : TABLE_DATA=0x100001 +6 : TABLE_DATA=0 +7 : TABLE_DATA=5 +8 : TABLE_DATA=5 + +9 : TABLE_LENGTH=4 +10 : -> STATE=1 +13 : ENABLE=1 -> ACTIVE=1, TABLE_REPEAT=1, OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, STATE=3 +18 : -> OUTA=0, STATE=4 +23 : -> OUTA=1, TABLE_REPEAT=2, STATE=3 +25 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 +29 : ENABLE=1 -> ACTIVE=1, TABLE_REPEAT=1, OUTA=1, STATE=3 +34 : -> OUTA=0, STATE=4 +39 : -> OUTA=1, TABLE_REPEAT=2, STATE=3 +40 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 + + +############### CHANGED THE CODE BELOW BECAUSE THE ENABLE_RISE GOES ACTIVE WHILST STILL IN STATE LOAD_TABLE +[Rewriting a table] +3 : TABLE_START=1 +4 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +5 : TABLE_DATA=0x100001 +6 : TABLE_DATA=0 +7 : TABLE_DATA=5 +8 : TABLE_DATA=5 + +9 : TABLE_LENGTH=4 +10 : -> STATE=1 +13 : ENABLE=1 -> STATE=3, ACTIVE=1, TABLE_REPEAT=1, OUTA=1, TABLE_LINE=1, LINE_REPEAT=1 +18 : -> STATE=4, OUTA=0 +23 : -> STATE=3, OUTA=1, TABLE_REPEAT=2 +25 : TABLE_START=1 +26 : TABLE_START=0 + +# OUT = 0x1 (OUT1=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +27 : TABLE_DATA=0x100001 +28 : TABLE_DATA=0 -> STATE=4, OUTA=0, TABLE_REPEAT=2 +29 : TABLE_DATA=8 +30 : TABLE_DATA=2 +31 : TABLE_LENGTH=4 +32 : -> STATE=3, OUTA=1, TABLE_REPEAT=1 +40 : -> STATE=4, OUTA=0 +42 : -> STATE=3, OUTA=1, TABLE_REPEAT=2 +43 : ENABLE=0 -> STATE=1, OUTA=0, ACTIVE=0 diff --git a/modules/seq/seq_double_table_documentation.timing.ini b/modules/seq/seq_double_table_documentation.timing.ini new file mode 100644 index 000000000..d59a2e8cc --- /dev/null +++ b/modules/seq/seq_double_table_documentation.timing.ini @@ -0,0 +1,71 @@ +[.] +description: Documentation timing diagrams for the seq block double table feature +scope: seq.block.ini + +[Test case for double table writting while running] +2 : REPEATS=1 +3 : TABLE_START=1 +4 : TABLE_START=0 +# OUT = 0x40 (OUT2=A) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +# TIME2 = 20 +5 : TABLE_DATA=0x4000001 +6 : TABLE_DATA=0 +7 : TABLE_DATA=0 +8 : TABLE_DATA=20 +# OUT = 0x00 (OUT2=0) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +# TIME2 = 20 +9 : TABLE_DATA=0x0000001 +10 : TABLE_DATA=0 +11 : TABLE_DATA=0 +12 : TABLE_DATA=20 +13 : TABLE_DATA=0 +14 : TABLE_DATA=0 +15 : TABLE_DATA=0 +16 : TABLE_DATA=0 +17 : TABLE_LENGTH=12 -> CAN_WRITE_NEXT=1 +18 : -> STATE=1 +19 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=1, OUTA=1, STATE=4 + +22 : TABLE_START=1 +23 : TABLE_START=0 +# OUT = 0x80 (OUT2=B) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +# TIME2 = 16 +24 : TABLE_DATA=0x8000001 +25 : TABLE_DATA=0 +26 : TABLE_DATA=0 +27 : TABLE_DATA=20 +# OUT = 0x00 (OUT2=0) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +# TIME2 = 16 +28 : TABLE_DATA=0x0000001 +29 : TABLE_DATA=0 +30 : TABLE_DATA=0 +31 : TABLE_DATA=20 +32 : TABLE_DATA=0 +33 : TABLE_DATA=0 +34 : TABLE_DATA=0 +35 : TABLE_DATA=0 +36 : TABLE_LENGTH=12 -> CAN_WRITE_NEXT=0 +39 : -> OUTA=0, TABLE_LINE=2, CAN_WRITE_NEXT=1 +40 : TABLE_START=1 +41 : TABLE_START=0 +# OUT = 0x100 (OUT2=C) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +# TIME2 = 20 +42 : TABLE_DATA=0x10000001 +43 : TABLE_DATA=0 +44 : TABLE_DATA=0 +45 : TABLE_DATA=20 +46 : TABLE_LENGTH=4 -> CAN_WRITE_NEXT=0 +59 : -> OUTB=1, TABLE_LINE=1 +79 : -> OUTB=0, TABLE_LINE=2 +99 : -> OUTC=1, TABLE_LINE=1 +119 : -> ACTIVE=0, OUTC=0, STATE=1 diff --git a/modules/seq/seq_double_table.timing.ini b/modules/seq/seq_double_table_functionality.timing.ini similarity index 70% rename from modules/seq/seq_double_table.timing.ini rename to modules/seq/seq_double_table_functionality.timing.ini index 893eba8c1..28daf264a 100644 --- a/modules/seq/seq_double_table.timing.ini +++ b/modules/seq/seq_double_table_functionality.timing.ini @@ -1,5 +1,5 @@ [.] -description: Timing diagrams for the seq block double table feature +description: Functionality timing diagrams for the seq block double table feature scope: seq.block.ini [Test case for double table run in one go] @@ -50,74 +50,6 @@ scope: seq.block.ini 48 : -> OUTD=0, ACTIVE=0, STATE=1 56 : ENABLE=0 -[Test case for double table writting while running] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 -# OUT = 0x40 (OUT2=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -# TIME2 = 20 -5 : TABLE_DATA=0x4000001 -6 : TABLE_DATA=0 -7 : TABLE_DATA=0 -8 : TABLE_DATA=20 -# OUT = 0x00 (OUT2=0) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -# TIME2 = 20 -9 : TABLE_DATA=0x0000001 -10 : TABLE_DATA=0 -11 : TABLE_DATA=0 -12 : TABLE_DATA=20 -13 : TABLE_DATA=0 -14 : TABLE_DATA=0 -15 : TABLE_DATA=0 -16 : TABLE_DATA=0 -17 : TABLE_LENGTH=12 -> CAN_WRITE_NEXT=1 -18 : -> STATE=1 -19 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=1, OUTA=1, STATE=4 - -22 : TABLE_START=1 -23 : TABLE_START=0 -# OUT = 0x80 (OUT2=B) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -# TIME2 = 16 -24 : TABLE_DATA=0x8000001 -25 : TABLE_DATA=0 -26 : TABLE_DATA=0 -27 : TABLE_DATA=20 -# OUT = 0x00 (OUT2=0) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -# TIME2 = 16 -28 : TABLE_DATA=0x0000001 -29 : TABLE_DATA=0 -30 : TABLE_DATA=0 -31 : TABLE_DATA=20 -32 : TABLE_DATA=0 -33 : TABLE_DATA=0 -34 : TABLE_DATA=0 -35 : TABLE_DATA=0 -36 : TABLE_LENGTH=12 -> CAN_WRITE_NEXT=0 -39 : -> OUTA=0, TABLE_LINE=2, CAN_WRITE_NEXT=1 -40 : TABLE_START=1 -41 : TABLE_START=0 -# OUT = 0x100 (OUT2=C) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -# TIME2 = 20 -42 : TABLE_DATA=0x10000001 -43 : TABLE_DATA=0 -44 : TABLE_DATA=0 -45 : TABLE_DATA=20 -46 : TABLE_LENGTH=4 -> CAN_WRITE_NEXT=0 -59 : -> OUTB=1, TABLE_LINE=1 -79 : -> OUTB=0, TABLE_LINE=2 -99 : -> OUTC=1, TABLE_LINE=1 -119 : -> ACTIVE=0, OUTC=0, STATE=1 - [Test case for double table underrun condition] 2 : REPEATS=1 3 : TABLE_START=1 diff --git a/modules/seq/seq.timing.ini b/modules/seq/seq_functionality.timing.ini similarity index 60% rename from modules/seq/seq.timing.ini rename to modules/seq/seq_functionality.timing.ini index 3d97093c5..4fe7c548d 100644 --- a/modules/seq/seq.timing.ini +++ b/modules/seq/seq_functionality.timing.ini @@ -1,365 +1,7 @@ [.] -description: Timing diagrams for the seq block +description: Functionality timing diagrams for the seq block scope: seq.block.ini -[3 evenly spaced pulses] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0003 -5 : TABLE_DATA=0x100003 -6 : TABLE_DATA=0 -7 : TABLE_DATA=5 -8 : TABLE_DATA=5 -9 : TABLE_LENGTH=4 -10 : -> STATE=1 -12 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, OUTA=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 -17 : -> OUTA=0, STATE=4 -22 : -> OUTA=1, LINE_REPEAT=2, STATE=3 -27 : -> OUTA=0, STATE=4 -32 : -> OUTA=1, LINE_REPEAT=3, STATE=3 -37 : -> OUTA=0, STATE=4 -42 : -> ACTIVE=0, STATE=1 -47 : ENABLE=0 - -[Irregular pulses] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x81 (OUT1=A, OUT2=B) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0002 -5 : TABLE_DATA=0x8100002 -6 : TABLE_DATA=0 -7 : TABLE_DATA=5 -8 : TABLE_DATA=2 - -# OUT = 0x3 (OUT1=AB) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0003 -9 : TABLE_DATA=0x300003 -10 : TABLE_DATA=0 -11 : TABLE_DATA=1 -12 : TABLE_DATA=2 - -13 : TABLE_LENGTH=8 -14 : -> STATE=1 -22 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, OUTA=1, TABLE_REPEAT=1, STATE=3 -27 : -> OUTA=0, OUTB=1, STATE=4 -29 : -> OUTA=1, OUTB=0, LINE_REPEAT=2, STATE=3 -34 : -> OUTA=0, OUTB=1, STATE=4 -36 : -> OUTA=1, OUTB=1, LINE_REPEAT=1, TABLE_LINE=2, STATE=3 -37 : -> OUTA=0, OUTB=0, STATE=4 -39 : -> OUTA=1, OUTB=1, LINE_REPEAT=2, STATE=3 -40 : -> OUTA=0, OUTB=0, STATE=4 -42 : -> OUTA=1, OUTB=1, LINE_REPEAT=3, STATE=3 -43 : -> OUTA=0, OUTB=0, STATE=4 -45 : -> ACTIVE=0, STATE=1 -49 : ENABLE=0 - -[Table repeats] -2 : REPEATS=2 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0002 -5 : TABLE_DATA=0x100002 -6 : TABLE_DATA=0 -7 : TABLE_DATA=5 -8 : TABLE_DATA=2 - -# OUT = 0x80 (OUT2=B) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -9 : TABLE_DATA=0x8000001 -10 : TABLE_DATA=0 -11 : TABLE_DATA=0 -12 : TABLE_DATA=5 - -13 : TABLE_LENGTH=8 -14 : -> STATE=1 -22 : ENABLE=1 -> OUTA=1, ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 -27 : -> OUTA=0, STATE=4 -29 : -> OUTA=1, LINE_REPEAT=2, STATE=3 -34 : -> OUTA=0, STATE=4 -36 : -> OUTB=1, LINE_REPEAT=1, TABLE_LINE=2 -41 : -> OUTB=0, OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=2, STATE=3 -46 : -> OUTA=0, STATE=4 -48 : -> OUTA=1, LINE_REPEAT=2, STATE=3 -53 : -> OUTA=0, STATE=4 -55 : -> OUTB=1, LINE_REPEAT=1, TABLE_LINE=2 -60 : -> OUTB=0, ACTIVE=0, STATE=1 -62 : ENABLE=0 - -[Using all 6 outputs] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0xC1 (OUT1=A, OUT2=AB) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -5 : TABLE_DATA=0xC100001 -6 : TABLE_DATA=0 -7 : TABLE_DATA=3 -8 : TABLE_DATA=4 - -# OUT = 0x3C7 (OUT1=ABC, OUT2=ABCD) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -9 : TABLE_DATA=0x3C700001 -10 : TABLE_DATA=0 -11 : TABLE_DATA=5 -12 : TABLE_DATA=6 - -# OUT = 0xFDF (OUT1=ABCDE, OUT2=ABCDEF) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -13 : TABLE_DATA=0xFDF00001 -14 : TABLE_DATA=0 -15 : TABLE_DATA=7 -16 : TABLE_DATA=8 - -17 : TABLE_LENGTH=12 -18 : -> STATE=1 -25 : ENABLE=1 -> ACTIVE=1, TABLE_LINE=1, OUTA=1, LINE_REPEAT=1, TABLE_REPEAT=1, STATE=3 -28 : -> OUTB=1, STATE=4 -32 : -> OUTC=1, TABLE_LINE=2, STATE=3 -37 : -> OUTD=1, STATE=4 -43 : -> OUTE=1, TABLE_LINE=3, STATE=3 -50 : -> OUTF=1, STATE=4 -58 : -> OUTA=0, OUTB=0, OUTC=0, OUTD=0, OUTE=0, OUTF=0, ACTIVE=0, STATE=1 -65 : ENABLE=0 - - -[Waiting on bit inputs] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x2 (BITA=1) -# REPEATS = 0x0003 -5 : TABLE_DATA=0x120003 -6 : TABLE_DATA=0 -7 : TABLE_DATA=2 -8 : TABLE_DATA=1 - -# OUT = 0x2 (OUT1=B) -# TRIGGER = 0x4 (BITB=1) -# REPEATS = 0x0001 -9 : TABLE_DATA=0x240001 -10 : TABLE_DATA=0 -11 : TABLE_DATA=3 -12 : TABLE_DATA=2 - -13 : TABLE_LENGTH=8 -14 : -> STATE=1 -15 : ENABLE=1 -> STATE=2, ACTIVE=1, TABLE_LINE=1, LINE_REPEAT=1, TABLE_REPEAT=1 -18 : BITA=1 -> STATE=3, OUTA=1 -19 : BITA=0 -20 : -> STATE=4, OUTA=0 -21 : -> STATE=2, LINE_REPEAT=2 -27 : BITA=1 -> STATE=3, OUTA=1 -29 : -> STATE=4, OUTA=0 -30 : -> STATE=3, OUTA=1, LINE_REPEAT=3 -32 : -> STATE=4, OUTA=0 -33 : BITB=1 -> STATE=3, OUTB=1, TABLE_LINE=2, LINE_REPEAT=1 -34 : BITB=0 -36 : -> STATE=4, OUTB=0 -38 : -> STATE=1, ACTIVE=0 -41 : BITA=0 -44 : ENABLE=0 - -[Table based position compare] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x80 (OUT2=B) -# TRIGGER = 0x7 (POSA>=POSITION) -# REPEATS = 0x0001 -5 : TABLE_DATA=0x8070001 -6 : TABLE_DATA=20 -7 : TABLE_DATA=0 -8 : TABLE_DATA=4 - -# OUT = 0x83 (OUT1=AB, OUT2=B) -# TRIGGER = 0 (Immediate) -# REPEATS = 0x0003 -9 : TABLE_DATA=0x8300003 -10 : TABLE_DATA=0 -11 : TABLE_DATA=1 -12 : TABLE_DATA=3 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x8 (POSA<=POSITION) -# REPEATS = 0x0002 -13 : TABLE_DATA=0x180002 -14 : TABLE_DATA=10 -15 : TABLE_DATA=1 -16 : TABLE_DATA=3 - - -17 : TABLE_LENGTH=12 -18 : -> STATE=1 -19 : ENABLE=1 -> ACTIVE=1, TABLE_LINE=1, LINE_REPEAT=1, TABLE_REPEAT=1, STATE=2 -20 : POSA=19 -23 : POSA=20 -> OUTB=1, STATE=4 -27 : -> OUTA=1, TABLE_LINE=2, STATE=3 -28 : -> OUTA=0, STATE=4 -31 : POSA=19 -> OUTA=1, LINE_REPEAT=2, STATE=3 -32 : -> OUTA=0, STATE=4 -35 : POSA=16 -> OUTA=1, LINE_REPEAT=3, STATE=3 -36 : -> OUTA=0, STATE=4 -39 : POSA=12 -> TABLE_LINE=3, LINE_REPEAT=1, STATE=2 -43 : POSA=9 -> OUTA=1, OUTB=0, STATE=3 -44 : -> OUTA=0, STATE=4 -47 : -> OUTA=1, LINE_REPEAT=2, STATE=3 -48 : POSA=7 -> OUTA=0, STATE=4 -51 : -> ACTIVE=0, STATE=1 -55 : ENABLE=0 - -[Prescaled pulses] -2 : REPEATS=1, PRESCALE=10 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0002 -5 : TABLE_DATA=0x100002 -6 : TABLE_DATA=0 -7 : TABLE_DATA=1 -8 : TABLE_DATA=1 - -9 : TABLE_LENGTH=4 -10 : -> STATE=1 -12 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, OUTA=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 -22 : -> OUTA=0, STATE=4 -32 : -> OUTA=1, LINE_REPEAT=2, STATE=3 -42 : -> OUTA=0, STATE=4 -52 : -> ACTIVE=0, STATE=1 -57 : ENABLE=0 - -[Infinite repeats of a row interrupted] -2 : REPEATS=1 -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0000 -5 : TABLE_DATA=0x100000 -6 : TABLE_DATA=0 -7 : TABLE_DATA=5 -8 : TABLE_DATA=5 - -9 : TABLE_LENGTH=4 -10 : -> STATE=1 -12 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, OUTA=1, TABLE_LINE=1, TABLE_REPEAT=1, STATE=3 -17 : -> OUTA=0, STATE=4 -22 : -> OUTA=1, LINE_REPEAT=2, STATE=3 -27 : -> OUTA=0, STATE=4 -32 : -> OUTA=1, LINE_REPEAT=3, STATE=3 -34 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 - -[Infinite repeats of a table interrupted] -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x40 (OUT2=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -5 : TABLE_DATA=0x4000001 -6 : TABLE_DATA=0 -7 : TABLE_DATA=0 -8 : TABLE_DATA=5 - -# OUT = 0x0 (OUT1=0) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0002 -9 : TABLE_DATA=0x000002 -10 : TABLE_DATA=0 -11 : TABLE_DATA=0 -12 : TABLE_DATA=3 - -13 : TABLE_LENGTH=8 -14 : -> STATE=1 -17 : ENABLE=1 -> ACTIVE=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=1, OUTA=1, STATE=4 -22 : -> OUTA=0, TABLE_LINE=2 -25 : -> LINE_REPEAT=2 -28 : -> OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=2 -33 : -> OUTA=0, TABLE_LINE=2 -36 : -> LINE_REPEAT=2 -39 : -> OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, TABLE_REPEAT=3 -41 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 - -[Restarting the same table] -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -5 : TABLE_DATA=0x100001 -6 : TABLE_DATA=0 -7 : TABLE_DATA=5 -8 : TABLE_DATA=5 - -9 : TABLE_LENGTH=4 -10 : -> STATE=1 -13 : ENABLE=1 -> ACTIVE=1, TABLE_REPEAT=1, OUTA=1, LINE_REPEAT=1, TABLE_LINE=1, STATE=3 -18 : -> OUTA=0, STATE=4 -23 : -> OUTA=1, TABLE_REPEAT=2, STATE=3 -25 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 -29 : ENABLE=1 -> ACTIVE=1, TABLE_REPEAT=1, OUTA=1, STATE=3 -34 : -> OUTA=0, STATE=4 -39 : -> OUTA=1, TABLE_REPEAT=2, STATE=3 -40 : ENABLE=0 -> ACTIVE=0, OUTA=0, STATE=1 - - -############### CHANGED THE CODE BELOW BECAUSE THE ENABLE_RISE GOES ACTIVE WHILST STILL IN STATE LOAD_TABLE -[Rewriting a table] -3 : TABLE_START=1 -4 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -5 : TABLE_DATA=0x100001 -6 : TABLE_DATA=0 -7 : TABLE_DATA=5 -8 : TABLE_DATA=5 - -9 : TABLE_LENGTH=4 -10 : -> STATE=1 -13 : ENABLE=1 -> STATE=3, ACTIVE=1, TABLE_REPEAT=1, OUTA=1, TABLE_LINE=1, LINE_REPEAT=1 -18 : -> STATE=4, OUTA=0 -23 : -> STATE=3, OUTA=1, TABLE_REPEAT=2 -25 : TABLE_START=1 -26 : TABLE_START=0 - -# OUT = 0x1 (OUT1=A) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -27 : TABLE_DATA=0x100001 -28 : TABLE_DATA=0 -> STATE=4, OUTA=0, TABLE_REPEAT=2 -29 : TABLE_DATA=8 -30 : TABLE_DATA=2 -31 : TABLE_LENGTH=4 -32 : -> STATE=3, OUTA=1, TABLE_REPEAT=1 -40 : -> STATE=4, OUTA=0 -42 : -> STATE=3, OUTA=1, TABLE_REPEAT=2 -43 : ENABLE=0 -> STATE=1, OUTA=0, ACTIVE=0 - - [Rewriting table whilst in wait for position trigger] 3 : TABLE_START=1 4 : TABLE_START=0, PRESCALE=3 @@ -641,77 +283,6 @@ scope: seq.block.ini 84 : -> OUTD=1, STATE=3, TABLE_REPEAT=3, LINE_REPEAT=1, TABLE_LINE=1 85 : ENABLE=0 -> STATE=1, ACTIVE=0, OUTD=0 -[Time1 and Time2 set to 0] -3 : TABLE_START=1 -4 : TABLE_START=0, PRESCALE=1 - -# OUT = 0x81 (OUT1=A, OUT2=B) -# TRIGGER = 0x8 (POSA<=POSITION) -# REPEATS = 0x0001 -5 : TABLE_DATA=0x8180001 -6 : TABLE_DATA=20 -7 : TABLE_DATA=1 -8 : TABLE_DATA=0 -# OUT = 0x41 (OUT1=A, OUT2=A) -# TRIGGER = 0x8 (POSA<=POSITION) -# REPEATS = 0x0001 -9 : TABLE_DATA=0x4180001 -10 : TABLE_DATA=20 -11 : TABLE_DATA=0 -12 : TABLE_DATA=0 -# OUT = 0x2 (OUT1=B) -# TRIGGER = 0x7 (POSA>=POSITION) -# REPEATS = 0x0003 -13 : TABLE_DATA=0x270003 -14 : TABLE_DATA=20 -15 : TABLE_DATA=3 -16 : TABLE_DATA=3 - -17 : TABLE_LENGTH=12 -18 : -> STATE=1 -25 : ENABLE=1 -> STATE=3, ACTIVE=1, TABLE_REPEAT=1, LINE_REPEAT=1, TABLE_LINE=1, OUTA=1 -26 : -> STATE=4, OUTA=0, OUTB=1 -27 : -> TABLE_LINE=2, OUTA=1, OUTB=0 -28 : -> STATE=2, TABLE_LINE=3 -36 : TABLE_START=1 -37 : TABLE_START=0 -# OUT = 0x8 (OUT1=D) -# TRIGGER = 0x0 (Immediate) -# REPEATS = 0x0001 -52 : TABLE_DATA=0x800001 -53 : TABLE_DATA=0 -54 : TABLE_DATA=1 -55 : TABLE_DATA=2 - - -# OUT = 0x4 (OUT1=C) -# TRIGGER = 0x8 (POSA<=POSITION) -# REPEATS = 0x0003 -56 : TABLE_DATA=0x480003 -57 : TABLE_DATA=20 -58 : TABLE_DATA=1 -59 : TABLE_DATA=0 - -65 : TABLE_LENGTH=8 -66 : -> STATE=3, OUTA=0, TABLE_REPEAT=1, OUTD=1, TABLE_LINE=1, LINE_REPEAT=1, ACTIVE=1, HEALTH=0 -67 : -> OUTD=0, STATE=4 -69 : -> OUTC=1, STATE=3, TABLE_LINE=2 -70 : -> OUTC=0, STATE=4 -71 : -> OUTC=1, STATE=3, LINE_REPEAT=2 -72 : -> OUTC=0, STATE=4 -73 : -> OUTC=1, STATE=3, LINE_REPEAT=3 -74 : -> OUTC=0, STATE=4 -75 : -> OUTD=1, STATE=3, TABLE_REPEAT=2, LINE_REPEAT=1, TABLE_LINE=1 -76 : -> OUTD=0, STATE=4 -78 : -> OUTC=1, STATE=3, TABLE_LINE=2 -79 : -> OUTC=0, STATE=4 -80 : -> OUTC=1, STATE=3, LINE_REPEAT=2 -81 : -> OUTC=0, STATE=4 -82 : -> OUTC=1, STATE=3, LINE_REPEAT=3 -83 : -> OUTC=0, STATE=4 -84 : -> OUTD=1, STATE=3, TABLE_REPEAT=3, LINE_REPEAT=1, TABLE_LINE=1 -85 : ENABLE=0 -> STATE=1, ACTIVE=0, OUTD=0 - [Time1 set to 0] 3 : TABLE_START=1 4 : TABLE_START=0, PRESCALE=1 @@ -893,3 +464,74 @@ scope: seq.block.ini 42 : -> STATE=3, OUTB=1, TABLE_LINE=2 43 : -> STATE=4, OUTB=0 44 : ENABLE=0 -> STATE=1, ACTIVE=0 + +[Time1 and Time2 set to 0] +3 : TABLE_START=1 +4 : TABLE_START=0, PRESCALE=1 + +# OUT = 0x81 (OUT1=A, OUT2=B) +# TRIGGER = 0x8 (POSA<=POSITION) +# REPEATS = 0x0001 +5 : TABLE_DATA=0x8180001 +6 : TABLE_DATA=20 +7 : TABLE_DATA=1 +8 : TABLE_DATA=0 +# OUT = 0x41 (OUT1=A, OUT2=A) +# TRIGGER = 0x8 (POSA<=POSITION) +# REPEATS = 0x0001 +9 : TABLE_DATA=0x4180001 +10 : TABLE_DATA=20 +11 : TABLE_DATA=0 +12 : TABLE_DATA=0 +# OUT = 0x2 (OUT1=B) +# TRIGGER = 0x7 (POSA>=POSITION) +# REPEATS = 0x0003 +13 : TABLE_DATA=0x270003 +14 : TABLE_DATA=20 +15 : TABLE_DATA=3 +16 : TABLE_DATA=3 + +17 : TABLE_LENGTH=12 +18 : -> STATE=1 +25 : ENABLE=1 -> STATE=3, ACTIVE=1, TABLE_REPEAT=1, LINE_REPEAT=1, TABLE_LINE=1, OUTA=1 +26 : -> STATE=4, OUTA=0, OUTB=1 +27 : -> TABLE_LINE=2, OUTA=1, OUTB=0 +28 : -> STATE=2, TABLE_LINE=3 +36 : TABLE_START=1 +37 : TABLE_START=0 +# OUT = 0x8 (OUT1=D) +# TRIGGER = 0x0 (Immediate) +# REPEATS = 0x0001 +52 : TABLE_DATA=0x800001 +53 : TABLE_DATA=0 +54 : TABLE_DATA=1 +55 : TABLE_DATA=2 + + +# OUT = 0x4 (OUT1=C) +# TRIGGER = 0x8 (POSA<=POSITION) +# REPEATS = 0x0003 +56 : TABLE_DATA=0x480003 +57 : TABLE_DATA=20 +58 : TABLE_DATA=1 +59 : TABLE_DATA=0 + +65 : TABLE_LENGTH=8 +66 : -> STATE=3, OUTA=0, TABLE_REPEAT=1, OUTD=1, TABLE_LINE=1, LINE_REPEAT=1, ACTIVE=1, HEALTH=0 +67 : -> OUTD=0, STATE=4 +69 : -> OUTC=1, STATE=3, TABLE_LINE=2 +70 : -> OUTC=0, STATE=4 +71 : -> OUTC=1, STATE=3, LINE_REPEAT=2 +72 : -> OUTC=0, STATE=4 +73 : -> OUTC=1, STATE=3, LINE_REPEAT=3 +74 : -> OUTC=0, STATE=4 +75 : -> OUTD=1, STATE=3, TABLE_REPEAT=2, LINE_REPEAT=1, TABLE_LINE=1 +76 : -> OUTD=0, STATE=4 +78 : -> OUTC=1, STATE=3, TABLE_LINE=2 +79 : -> OUTC=0, STATE=4 +80 : -> OUTC=1, STATE=3, LINE_REPEAT=2 +81 : -> OUTC=0, STATE=4 +82 : -> OUTC=1, STATE=3, LINE_REPEAT=3 +83 : -> OUTC=0, STATE=4 +84 : -> OUTD=1, STATE=3, TABLE_REPEAT=3, LINE_REPEAT=1, TABLE_LINE=1 +85 : ENABLE=0 -> STATE=1, ACTIVE=0, OUTD=0