Skip to content

Commit

Permalink
Changed the comment format in the RTL samples and tests to the right …
Browse files Browse the repository at this point in the history
…one.
  • Loading branch information
carljohnsen committed Oct 19, 2023
1 parent 684de2a commit 6292c11
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 110 deletions.
9 changes: 5 additions & 4 deletions samples/fpga/rtl/add_fortytwo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# This sample shows adding a constant integer value to a stream of integers.
#
# It is intended for running hardware_emulation or hardware xilinx targets.
"""
This sample shows adding a constant integer value to a stream of integers.
It is intended for running hardware_emulation or hardware xilinx targets.
"""

import dace
import numpy as np
Expand Down
11 changes: 6 additions & 5 deletions samples/fpga/rtl/axpy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# This sample shows the AXPY BLAS routine. It is implemented through Xilinx IPs in order to utilize floating point
# operations.
#
# It is intended for running hardware_emulation or hardware xilinx targets.
"""
This sample shows the AXPY BLAS routine. It is implemented through Xilinx IPs in order to utilize floating point
operations.
It is intended for running hardware_emulation or hardware xilinx targets.
"""

import dace
import numpy as np
Expand Down
139 changes: 70 additions & 69 deletions samples/fpga/rtl/axpy_double_pump.py
Original file line number Diff line number Diff line change
@@ -1,73 +1,74 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# This sample shows the AXPY BLAS routine. It is implemented through Xilinx
# IPs in order to utilize double pumping, which doubles the performance per
# consumed FPGA resource. The double pumping operation is "inwards", which
# means that the internal vectorization width of the core computation is half
# that of the external vectorization width. This translates into utilizing half
# the amount of internal computing resources, compared to a regular vectorized
# implementetation. The block diagram of the design for a 32-bit floating-point
# implementation using vectorization width 2 is:
#
# ap_aclk s_axis_y_in s_axis_x_in a
# │ │ │ │
# │ │ │ │
# │ │ │ │
# ┌───────┼─────────┬────────┼─────────┐ │ │
# │ │ │ │ │ │ │
# │ │ │ ▼ │ ▼ │
# │ │ │ ┌────────────┐ │ ┌────────────┐ │
# │ │ └─►│ │ └─►│ │ │
# │ │ │ Clock sync │ │ Clock sync │ │
# │ │ ┌─►│ │ ┌─►│ │ │
# │ ▼ 300 MHz │ └─────┬──────┘ │ └─────┬──────┘ │
# │ ┌────────────┐ │ │ │ │ │
# │ │ Clock │ │ │ │ │ │
# │ │ │ ├────────┼─────────┤ │ │
# │ │ Multiplier │ │ │ │ │ │
# │ └─────┬──────┘ │ ▼ 64 bit │ ▼ 64 bit │
# │ │ 600 MHz │ ┌────────────┐ │ ┌────────────┐ │
# │ │ │ │ │ │ │ │ │
# │ └─────────┼─►│ Data issue │ └─►│ Data issue │ │
# │ │ │ │ │ │ │
# │ │ └─────┬──────┘ └─────┬──────┘ │
# │ │ │ 32 bit │ 32 bit │
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ ▼ ▼
# │ │ │ ┌────────────┐
# │ │ │ │ │
# │ ├────────┼────────────────►│ Multiplier │
# │ │ │ │ │
# │ │ │ └─────┬──────┘
# │ │ │ │
# │ │ │ ┌──────────────┘
# │ │ │ │
# │ │ ▼ ▼
# │ │ ┌────────────┐
# │ │ │ │
# │ ├─────►│ Adder │
# │ │ │ │
# │ │ └─────┬──────┘
# │ │ │
# │ │ ▼ 32 bit
# │ │ ┌─────────────┐
# │ │ │ │
# │ ├─────►│ Data packer │
# │ │ │ │
# │ │ └─────┬───────┘
# │ │ │ 64 bit
# │ │ ▼
# │ │ ┌────────────┐
# │ └─────►│ │
# │ │ Clock sync │
# └───────────────────────►│ │
# └─────┬──────┘
# │
# ▼
# m_axis_result_out
#
# It is intended for running hardware_emulation or hardware xilinx targets.
"""
This sample shows the AXPY BLAS routine. It is implemented through Xilinx
IPs in order to utilize double pumping, which doubles the performance per
consumed FPGA resource. The double pumping operation is "inwards", which
means that the internal vectorization width of the core computation is half
that of the external vectorization width. This translates into utilizing half
the amount of internal computing resources, compared to a regular vectorized
implementetation. The block diagram of the design for a 32-bit floating-point
implementation using vectorization width 2 is:
ap_aclk s_axis_y_in s_axis_x_in a
│ │ │ │
│ │ │ │
│ │ │ │
┌───────┼─────────┬────────┼─────────┐ │ │
│ │ │ │ │ │ │
│ │ │ ▼ │ ▼ │
│ │ │ ┌────────────┐ │ ┌────────────┐ │
│ │ └─►│ │ └─►│ │ │
│ │ │ Clock sync │ │ Clock sync │ │
│ │ ┌─►│ │ ┌─►│ │ │
│ ▼ 300 MHz │ └─────┬──────┘ │ └─────┬──────┘ │
│ ┌────────────┐ │ │ │ │ │
│ │ Clock │ │ │ │ │ │
│ │ │ ├────────┼─────────┤ │ │
│ │ Multiplier │ │ │ │ │ │
│ └─────┬──────┘ │ ▼ 64 bit │ ▼ 64 bit │
│ │ 600 MHz │ ┌────────────┐ │ ┌────────────┐ │
│ │ │ │ │ │ │ │ │
│ └─────────┼─►│ Data issue │ └─►│ Data issue │ │
│ │ │ │ │ │ │
│ │ └─────┬──────┘ └─────┬──────┘ │
│ │ │ 32 bit │ 32 bit │
│ │ │ │ │
│ │ │ │ │
│ │ │ ▼ ▼
│ │ │ ┌────────────┐
│ │ │ │ │
│ ├────────┼────────────────►│ Multiplier │
│ │ │ │ │
│ │ │ └─────┬──────┘
│ │ │ │
│ │ │ ┌──────────────┘
│ │ │ │
│ │ ▼ ▼
│ │ ┌────────────┐
│ │ │ │
│ ├─────►│ Adder │
│ │ │ │
│ │ └─────┬──────┘
│ │ │
│ │ ▼ 32 bit
│ │ ┌─────────────┐
│ │ │ │
│ ├─────►│ Data packer │
│ │ │ │
│ │ └─────┬───────┘
│ │ │ 64 bit
│ │ ▼
│ │ ┌────────────┐
│ └─────►│ │
│ │ Clock sync │
└───────────────────────►│ │
└─────┬──────┘
m_axis_result_out
It is intended for running hardware_emulation or hardware xilinx targets.
"""

import dace
import numpy as np
Expand Down
13 changes: 7 additions & 6 deletions samples/fpga/rtl/fladd.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# This sample shows how to utilize an IP core in an RTL tasklet. This is done
# through the vector add problem, which adds two floating point vectors
# together.
#
# It is intended for running hardware_emulation or hardware xilinx targets.
"""
This sample shows how to utilize an IP core in an RTL tasklet. This is done
through the vector add problem, which adds two floating point vectors
together.
It is intended for running hardware_emulation or hardware xilinx targets.
"""

import dace
import numpy as np
Expand Down
11 changes: 6 additions & 5 deletions samples/fpga/rtl/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# This sample shows a DEPTH deep pipeline, where each stage adds 1 to the
# integer input stream.
#
# It is intended for running hardware_emulation or hardware xilinx targets.
"""
This sample shows a DEPTH deep pipeline, where each stage adds 1 to the
integer input stream.
It is intended for running hardware_emulation or hardware xilinx targets.
"""

import dace
import numpy as np
Expand Down
9 changes: 5 additions & 4 deletions samples/fpga/rtl/rtl_multi_tasklet.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# Two sequential RTL tasklets connected through a memlet.
#
# It is intended for running simulation xilinx targets.
"""
Two sequential RTL tasklets connected through a memlet.
It is intended for running simulation xilinx targets.
"""

import dace
import numpy as np
Expand Down
9 changes: 5 additions & 4 deletions samples/fpga/rtl/rtl_tasklet_parameter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# Simple RTL tasklet with a single scalar input and a single scalar output. It increments b from a up to 100.
#
# It is intended for running simulation xilinx targets.
"""
Simple RTL tasklet with a single scalar input and a single scalar output. It increments b from a up to 100.
It is intended for running simulation xilinx targets.
"""

import dace
import numpy as np
Expand Down
9 changes: 5 additions & 4 deletions samples/fpga/rtl/rtl_tasklet_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# Pipelined, AXI-handshake compliant example that increments b from a up to 100.
#
# It is intended for running simulation xilinx targets.
"""
Pipelined, AXI-handshake compliant example that increments b from a up to 100.
It is intended for running simulation xilinx targets.
"""

import dace
import numpy as np
Expand Down
9 changes: 5 additions & 4 deletions samples/fpga/rtl/rtl_tasklet_scalar.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# Simple RTL tasklet with a single scalar input and a single scalar output. It increments b from a up to 100.
#
# It is intended for running simulation xilinx targets.
"""
Simple RTL tasklet with a single scalar input and a single scalar output. It increments b from a up to 100.
It is intended for running simulation xilinx targets.
"""

import dace
import numpy as np
Expand Down
9 changes: 5 additions & 4 deletions samples/fpga/rtl/rtl_tasklet_vector.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
#
# RTL tasklet with a vector input of 4 int32 (width=128bits) and a single scalar output. It increments b from a[31:0] up to 100.
#
# It is intended for running simulation xilinx targets.
"""
RTL tasklet with a vector input of 4 int32 (width=128bits) and a single scalar output. It increments b from a[31:0] up to 100.
It is intended for running simulation xilinx targets.
"""

import dace
import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions tests/rtl/hardware_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
"""
Test suite for testing RTL integration with DaCe targeting Xilinx FPGAs.
"""
import dace
from dace.fpga_testing import rtl_test
import numpy as np
Expand Down
4 changes: 3 additions & 1 deletion tests/rtl/simulation_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.

"""
Test suite for testing RTL tasklets in DaCe with Verilator as a backend for simulation.
"""
import dace
import numpy as np
import pytest
Expand Down

0 comments on commit 6292c11

Please sign in to comment.