Initial commit

This commit is contained in:
Johannes Kutning committed 2023-10-31 07:47:27 +01:00
commit 0d1b73e3e0
255 files changed
+16057

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
#pragma once
float expected_add_rand[] = {3.300000e+00,5.979374e+00,-1.273212e+00,1.413406e+00,1.212657e+00,-1.098742e+00,8.600979e-01,3.074980e+00,5.712167e+00,1.224368e+01,4.397655e+00,5.907616e+00,8.287786e+00,-2.341430e+00,2.140778e+00,3.261984e+00,5.349493e+00,-5.446398e+00,-1.035838e+00,1.256405e-01,2.339691e+00,-7.945903e+00,-3.254658e+00,-1.822752e+00,2.592759e-01,-6.111606e+00,-2.727094e+00,-7.978969e-01,1.267851e+00,-4.639330e+00,-7.658790e-01,1.629532e+00,1.857379e+00,6.370057e+00,-7.737207e-02,2.933810e+00,3.965793e+00,6.693081e+00,1.285952e+00,4.314163e+00,7.201293e+00,4.283216e+00,4.484528e+00,6.428241e+00,2.994931e+00,2.868188e+00,5.110010e+00,6.364252e-01,9.541907e-01,4.540222e+00,-2.345174e+00,-1.970663e+00,7.703996e-02,-3.771856e+00,-1.821991e+00,-4.376534e+00,-1.877988e+00,-4.546524e+00,-2.057958e-01,-4.380636e+00,4.450349e+00,-4.848163e+00,-3.701720e-01,2.189660e-01,7.356873e-01,1.046872e+00,3.265196e+00,-2.191743e+00,-3.826990e+00,-1.382052e+00,-3.815104e+00,-1.972775e+00,5.505013e-02,2.391754e+00,2.661475e+00,5.272482e+00,1.030286e+00,4.165329e+00,-5.783374e+00,-1.743220e+00,-1.174764e+00,3.750136e+00,-4.311719e+00,-1.574450e+00,-4.752204e+00,-1.630630e+00,-5.874487e+00,-1.849608e+00,-1.349572e+01,-1.307724e+01,-7.233801e+00,-3.974126e+00,-3.993254e+00,1.833310e-01,-4.084670e+00,-4.084611e-02,-5.414014e+00,-6.929903e+00,-4.184460e+00,-2.065172e-01,6.581552e+00,3.885840e-01,2.137746e+00,3.438265e+00,6.065754e+00,1.435268e+00,3.830912e+00,-8.258921e-01,7.412688e-01,3.101440e+00,-3.970874e+00,-7.499379e+00,-3.058542e+00,-1.916880e+00,-3.115893e+00,-3.606315e+00,-3.397209e+00,-4.363531e+00,-1.913524e+00,-1.145990e+01,-6.588683e+00,-5.032800e+00,1.824259e+00,-1.094771e+01,-5.347169e+00,-3.075692e+00,-4.133999e-01,-2.288789e+00,2.670866e+00,-8.228311e+00,-7.210553e+00,-6.033318e+00,1.910579e-01,3.439228e+00,3.363443e+00,3.205876e+00,7.354259e+00,9.230280e-01,5.476341e-01,-1.748672e-01,-1.436147e+00,1.252664e+00,2.326433e+00,3.516393e+00,-6.678423e-01,-4.209119e-01,-1.570241e+00,-2.065862e+00,5.601709e-01,-9.445417e+00,-4.723877e+00,-1.746883e+00,-4.013597e+00,-3.581566e+00,-5.373631e-01,-3.251447e+00,4.806249e+00,-8.305822e+00,-2.293268e+00,5.375365e-01,8.779492e-01,1.997497e+00,2.411813e+00,5.651120e+00,4.108989e-01,-8.424878e-01,3.889938e+00,9.246611e+00,4.495306e+00,5.210482e+00,5.072436e+00,4.857080e+00,6.989478e+00,3.309129e+00,9.989450e+00,6.497641e-01,2.547559e+00,1.309483e+00,2.727267e+00,-8.565928e-01,-8.519061e-01,2.064074e+00,-8.950025e+00,-8.087983e+00,-3.218967e+00,-1.669546e+00,-1.132110e-01,4.690856e+00,-2.059488e+00,2.021932e+00,-2.353524e+00,9.246132e-01,7.736388e+00,-1.067027e+00,-3.701580e+00,-2.196118e+00,3.615768e+00,6.013890e+00,5.915015e+00,1.222257e+01,4.849790e+00,8.522993e+00,2.489893e+00,5.102859e-01,4.110977e+00,4.423498e+00,9.949041e+00,-2.175272e+00,1.210299e+00,1.378659e+00,7.631117e+00,-1.970389e+00,2.908651e-01,1.548586e+00,-6.041686e+00,-2.680084e+00,-2.102909e+00,4.216309e-01,-5.253438e+00,-6.658023e+00,-1.956970e+00,3.330639e+00,-4.828597e-01,2.665081e+00,3.348377e+00,3.975455e+00,9.146870e+00,2.421384e+00,4.726796e+00,7.539860e+00,8.947539e-01,-2.858034e+00,-2.739030e+00,-2.680142e+00,-2.583707e+00,2.612494e+00,4.922718e+00,3.759308e+00,6.208842e+00,-6.309598e+00,-6.916836e+00,-7.292119e+00,-7.172835e+00,-6.064957e+00,-3.023405e+00,-2.853139e+00,-3.290050e-01,-8.198313e+00,-6.337807e+00,-6.787097e+00,-7.549071e+00,-3.852088e+00,-1.246901e+00,-9.962839e-01,1.875456e+00,-1.507444e+00,9.389480e-01,1.157786e+00,6.052736e+00,-1.355084e+00,-1.867138e+00,2.129020e+00,5.114331e+00,8.187211e-01,2.984676e+00,6.255657e+00,2.421887e+00,5.269785e+00,1.511524e+00,1.579108e+00,2.203119e+00,1.250459e+00,1.169740e-01,1.464309e+00,-3.291651e+00,-2.501908e+00,-1.748014e+00,-7.902800e+00,-9.543344e+00,-7.810252e+00,-5.781384e+00,-2.350099e+00,-1.029299e+01,-5.774566e+00,-4.342439e+00,3.266203e+00,-4.975637e+00,-1.345373e+00,-1.089056e+00,3.226560e+00,-9.533690e-01,4.676887e-01,4.203101e+00,-3.873314e+00,-1.516416e+00,1.635924e+00,5.005208e+00,1.683337e+00,2.194184e+00,3.284619e+00,8.490452e+00,-1.607745e+00,6.182781e+00,-2.534814e+00,-1.160179e+00,2.429072e+00,-6.680118e+00,-8.913355e+00,-7.504832e+00,-8.724944e+00,-1.151155e+01,-6.783382e+00,1.796107e+00,-7.586480e+00,1.117470e+00,-6.419213e+00,-3.769720e+00,1.037369e+00,-3.964674e+00,1.527749e+00,-9.467120e+00,-8.498121e+00,-7.406638e+00,-9.761139e-01,6.955874e+00,1.015319e+00,2.722770e+00,7.283591e+00,4.207802e-02,-6.688211e-01,-2.944642e+00,-1.262878e+00,1.390626e+00,5.062559e+00,-6.866218e+00,-1.844342e+00,5.818851e-01,2.159121e+00,-2.700428e+00,2.970469e+00,-4.414018e+00,3.597045e+00,-1.115471e+01,-1.028305e+01,-5.355669e+00,3.458477e+00,-1.133516e+01,-5.208582e+00,2.601890e+00,-5.841000e+00,-7.754324e+00,-1.829335e+00,2.572763e+00,-1.925788e+00,-2.007329e+00,-4.619769e+00,1.625730e+00,8.381837e+00,1.573226e+00,4.278665e+00,4.927870e+00,5.339962e+00,8.346523e+00,-3.538850e+00,-3.638062e+00,1.471237e+00,3.812289e+00,5.070636e+00,7.Line truncated
+4
View File
@@ -0,0 +1,4 @@
data = [3.300000e+00,5.979374e+00,-1.273212e+00,1.413406e+00,1.212657e+00,-1.098742e+00,8.600979e-01,3.074980e+00,5.712167e+00,1.224368e+01,4.397655e+00,5.907616e+00,8.287786e+00,-2.341430e+00,2.140778e+00,3.261984e+00,5.349493e+00,-5.446398e+00,-1.035838e+00,1.256405e-01,2.339691e+00,-7.945903e+00,-3.254658e+00,-1.822752e+00,2.592759e-01,-6.111606e+00,-2.727094e+00,-7.978969e-01,1.267851e+00,-4.639330e+00,-7.658790e-01,1.629532e+00,1.857379e+00,6.370057e+00,-7.737207e-02,2.933810e+00,3.965793e+00,6.693081e+00,1.285952e+00,4.314163e+00,7.201293e+00,4.283216e+00,4.484528e+00,6.428241e+00,2.994931e+00,2.868188e+00,5.110010e+00,6.364252e-01,9.541907e-01,4.540222e+00,-2.345174e+00,-1.970663e+00,7.703996e-02,-3.771856e+00,-1.821991e+00,-4.376534e+00,-1.877988e+00,-4.546524e+00,-2.057958e-01,-4.380636e+00,4.450349e+00,-4.848163e+00,-3.701720e-01,2.189660e-01,7.356873e-01,1.046872e+00,3.265196e+00,-2.191743e+00,-3.826990e+00,-1.382052e+00,-3.815104e+00,-1.972775e+00,5.505013e-02,2.391754e+00,2.661475e+00,5.272482e+00,1.030286e+00,4.165329e+00,-5.783374e+00,-1.743220e+00,-1.174764e+00,3.750136e+00,-4.311719e+00,-1.574450e+00,-4.752204e+00,-1.630630e+00,-5.874487e+00,-1.849608e+00,-1.349572e+01,-1.307724e+01,-7.233801e+00,-3.974126e+00,-3.993254e+00,1.833310e-01,-4.084670e+00,-4.084611e-02,-5.414014e+00,-6.929903e+00,-4.184460e+00,-2.065172e-01,6.581552e+00,3.885840e-01,2.137746e+00,3.438265e+00,6.065754e+00,1.435268e+00,3.830912e+00,-8.258921e-01,7.412688e-01,3.101440e+00,-3.970874e+00,-7.499379e+00,-3.058542e+00,-1.916880e+00,-3.115893e+00,-3.606315e+00,-3.397209e+00,-4.363531e+00,-1.913524e+00,-1.145990e+01,-6.588683e+00,-5.032800e+00,1.824259e+00,-1.094771e+01,-5.347169e+00,-3.075692e+00,-4.133999e-01,-2.288789e+00,2.670866e+00,-8.228311e+00,-7.210553e+00,-6.033318e+00,1.910579e-01,3.439228e+00,3.363443e+00,3.205876e+00,7.354259e+00,9.230280e-01,5.476341e-01,-1.748672e-01,-1.436147e+00,1.252664e+00,2.326433e+00,3.516393e+00,-6.678423e-01,-4.209119e-01,-1.570241e+00,-2.065862e+00,5.601709e-01,-9.445417e+00,-4.723877e+00,-1.746883e+00,-4.013597e+00,-3.581566e+00,-5.373631e-01,-3.251447e+00,4.806249e+00,-8.305822e+00,-2.293268e+00,5.375365e-01,8.779492e-01,1.997497e+00,2.411813e+00,5.651120e+00,4.108989e-01,-8.424878e-01,3.889938e+00,9.246611e+00,4.495306e+00,5.210482e+00,5.072436e+00,4.857080e+00,6.989478e+00,3.309129e+00,9.989450e+00,6.497641e-01,2.547559e+00,1.309483e+00,2.727267e+00,-8.565928e-01,-8.519061e-01,2.064074e+00,-8.950025e+00,-8.087983e+00,-3.218967e+00,-1.669546e+00,-1.132110e-01,4.690856e+00,-2.059488e+00,2.021932e+00,-2.353524e+00,9.246132e-01,7.736388e+00,-1.067027e+00,-3.701580e+00,-2.196118e+00,3.615768e+00,6.013890e+00,5.915015e+00,1.222257e+01,4.849790e+00,8.522993e+00,2.489893e+00,5.102859e-01,4.110977e+00,4.423498e+00,9.949041e+00,-2.175272e+00,1.210299e+00,1.378659e+00,7.631117e+00,-1.970389e+00,2.908651e-01,1.548586e+00,-6.041686e+00,-2.680084e+00,-2.102909e+00,4.216309e-01,-5.253438e+00,-6.658023e+00,-1.956970e+00,3.330639e+00,-4.828597e-01,2.665081e+00,3.348377e+00,3.975455e+00,9.146870e+00,2.421384e+00,4.726796e+00,7.539860e+00,8.947539e-01,-2.858034e+00,-2.739030e+00,-2.680142e+00,-2.583707e+00,2.612494e+00,4.922718e+00,3.759308e+00,6.208842e+00,-6.309598e+00,-6.916836e+00,-7.292119e+00,-7.172835e+00,-6.064957e+00,-3.023405e+00,-2.853139e+00,-3.290050e-01,-8.198313e+00,-6.337807e+00,-6.787097e+00,-7.549071e+00,-3.852088e+00,-1.246901e+00,-9.962839e-01,1.875456e+00,-1.507444e+00,9.389480e-01,1.157786e+00,6.052736e+00,-1.355084e+00,-1.867138e+00,2.129020e+00,5.114331e+00,8.187211e-01,2.984676e+00,6.255657e+00,2.421887e+00,5.269785e+00,1.511524e+00,1.579108e+00,2.203119e+00,1.250459e+00,1.169740e-01,1.464309e+00,-3.291651e+00,-2.501908e+00,-1.748014e+00,-7.902800e+00,-9.543344e+00,-7.810252e+00,-5.781384e+00,-2.350099e+00,-1.029299e+01,-5.774566e+00,-4.342439e+00,3.266203e+00,-4.975637e+00,-1.345373e+00,-1.089056e+00,3.226560e+00,-9.533690e-01,4.676887e-01,4.203101e+00,-3.873314e+00,-1.516416e+00,1.635924e+00,5.005208e+00,1.683337e+00,2.194184e+00,3.284619e+00,8.490452e+00,-1.607745e+00,6.182781e+00,-2.534814e+00,-1.160179e+00,2.429072e+00,-6.680118e+00,-8.913355e+00,-7.504832e+00,-8.724944e+00,-1.151155e+01,-6.783382e+00,1.796107e+00,-7.586480e+00,1.117470e+00,-6.419213e+00,-3.769720e+00,1.037369e+00,-3.964674e+00,1.527749e+00,-9.467120e+00,-8.498121e+00,-7.406638e+00,-9.761139e-01,6.955874e+00,1.015319e+00,2.722770e+00,7.283591e+00,4.207802e-02,-6.688211e-01,-2.944642e+00,-1.262878e+00,1.390626e+00,5.062559e+00,-6.866218e+00,-1.844342e+00,5.818851e-01,2.159121e+00,-2.700428e+00,2.970469e+00,-4.414018e+00,3.597045e+00,-1.115471e+01,-1.028305e+01,-5.355669e+00,3.458477e+00,-1.133516e+01,-5.208582e+00,2.601890e+00,-5.841000e+00,-7.754324e+00,-1.829335e+00,2.572763e+00,-1.925788e+00,-2.007329e+00,-4.619769e+00,1.625730e+00,8.381837e+00,1.573226e+00,4.278665e+00,4.927870e+00,5.339962e+00,8.346523e+00,-3.538850e+00,-3.638062e+00,1.471237e+00,3.812289e+00,5.070636e+00,7.536049e-01,1.115999e+Line truncated
title = 'Task add_rand'
interval = 1e-5
xlabel = 't'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package add_rand_data is
constant expected : real_array( 0 to 1023 ) := (3.300000e+00,5.979374e+00,-1.273212e+00,1.413406e+00,1.212657e+00,-1.098742e+00,8.600979e-01,3.074980e+00,5.712167e+00,1.224368e+01,4.397655e+00,5.907616e+00,8.287786e+00,-2.341430e+00,2.140778e+00,3.261984e+00,5.349493e+00,-5.446398e+00,-1.035838e+00,1.256405e-01,2.339691e+00,-7.945903e+00,-3.254658e+00,-1.822752e+00,2.592759e-01,-6.111606e+00,-2.727094e+00,-7.978969e-01,1.267851e+00,-4.639330e+00,-7.658790e-01,1.629532e+00,1.857379e+00,6.370057e+00,-7.737207e-02,2.933810e+00,3.965793e+00,6.693081e+00,1.285952e+00,4.314163e+00,7.201293e+00,4.283216e+00,4.484528e+00,6.428241e+00,2.994931e+00,2.868188e+00,5.110010e+00,6.364252e-01,9.541907e-01,4.540222e+00,-2.345174e+00,-1.970663e+00,7.703996e-02,-3.771856e+00,-1.821991e+00,-4.376534e+00,-1.877988e+00,-4.546524e+00,-2.057958e-01,-4.380636e+00,4.450349e+00,-4.848163e+00,-3.701720e-01,2.189660e-01,7.356873e-01,1.046872e+00,3.265196e+00,-2.191743e+00,-3.826990e+00,-1.382052e+00,-3.815104e+00,-1.972775e+00,5.505013e-02,2.391754e+00,2.661475e+00,5.272482e+00,1.030286e+00,4.165329e+00,-5.783374e+00,-1.743220e+00,-1.174764e+00,3.750136e+00,-4.311719e+00,-1.574450e+00,-4.752204e+00,-1.630630e+00,-5.874487e+00,-1.849608e+00,-1.349572e+01,-1.307724e+01,-7.233801e+00,-3.974126e+00,-3.993254e+00,1.833310e-01,-4.084670e+00,-4.084611e-02,-5.414014e+00,-6.929903e+00,-4.184460e+00,-2.065172e-01,6.581552e+00,3.885840e-01,2.137746e+00,3.438265e+00,6.065754e+00,1.435268e+00,3.830912e+00,-8.258921e-01,7.412688e-01,3.101440e+00,-3.970874e+00,-7.499379e+00,-3.058542e+00,-1.916880e+00,-3.115893e+00,-3.606315e+00,-3.397209e+00,-4.363531e+00,-1.913524e+00,-1.145990e+01,-6.588683e+00,-5.032800e+00,1.824259e+00,-1.094771e+01,-5.347169e+00,-3.075692e+00,-4.133999e-01,-2.288789e+00,2.670866e+00,-8.228311e+00,-7.210553e+00,-6.033318e+00,1.910579e-01,3.439228e+00,3.363443e+00,3.205876e+00,7.354259e+00,9.230280e-01,5.476341e-01,-1.748672e-01,-1.436147e+00,1.252664e+00,2.326433e+00,3.516393e+00,-6.678423e-01,-4.209119e-01,-1.570241e+00,-2.065862e+00,5.601709e-01,-9.445417e+00,-4.723877e+00,-1.746883e+00,-4.013597e+00,-3.581566e+00,-5.373631e-01,-3.251447e+00,4.806249e+00,-8.305822e+00,-2.293268e+00,5.375365e-01,8.779492e-01,1.997497e+00,2.411813e+00,5.651120e+00,4.108989e-01,-8.424878e-01,3.889938e+00,9.246611e+00,4.495306e+00,5.210482e+00,5.072436e+00,4.857080e+00,6.989478e+00,3.309129e+00,9.989450e+00,6.497641e-01,2.547559e+00,1.309483e+00,2.727267e+00,-8.565928e-01,-8.519061e-01,2.064074e+00,-8.950025e+00,-8.087983e+00,-3.218967e+00,-1.669546e+00,-1.132110e-01,4.690856e+00,-2.059488e+00,2.021932e+00,-2.353524e+00,9.246132e-01,7.736388e+00,-1.067027e+00,-3.701580e+00,-2.196118e+00,3.615768e+00,6.013890e+00,5.915015e+00,1.222257e+01,4.849790e+00,8.522993e+00,2.489893e+00,5.102859e-01,4.110977e+00,4.423498e+00,9.949041e+00,-2.175272e+00,1.210299e+00,1.378659e+00,7.631117e+00,-1.970389e+00,2.908651e-01,1.548586e+00,-6.041686e+00,-2.680084e+00,-2.102909e+00,4.216309e-01,-5.253438e+00,-6.658023e+00,-1.956970e+00,3.330639e+00,-4.828597e-01,2.665081e+00,3.348377e+00,3.975455e+00,9.146870e+00,2.421384e+00,4.726796e+00,7.539860e+00,8.947539e-01,-2.858034e+00,-2.739030e+00,-2.680142e+00,-2.583707e+00,2.612494e+00,4.922718e+00,3.759308e+00,6.208842e+00,-6.309598e+00,-6.916836e+00,-7.292119e+00,-7.172835e+00,-6.064957e+00,-3.023405e+00,-2.853139e+00,-3.290050e-01,-8.198313e+00,-6.337807e+00,-6.787097e+00,-7.549071e+00,-3.852088e+00,-1.246901e+00,-9.962839e-01,1.875456e+00,-1.507444e+00,9.389480e-01,1.157786e+00,6.052736e+00,-1.355084e+00,-1.867138e+00,2.129020e+00,5.114331e+00,8.187211e-01,2.984676e+00,6.255657e+00,2.421887e+00,5.269785e+00,1.511524e+00,1.579108e+00,2.203119e+00,1.250459e+00,1.169740e-01,1.464309e+00,-3.291651e+00,-2.501908e+00,-1.748014e+00,-7.902800e+00,-9.543344e+00,-7.810252e+00,-5.781384e+00,-2.350099e+00,-1.029299e+01,-5.774566e+00,-4.342439e+00,3.266203e+00,-4.975637e+00,-1.345373e+00,-1.089056e+00,3.226560e+00,-9.533690e-01,4.676887e-01,4.203101e+00,-3.873314e+00,-1.516416e+00,1.635924e+00,5.005208e+00,1.683337e+00,2.194184e+00,3.284619e+00,8.490452e+00,-1.607745e+00,6.182781e+00,-2.534814e+00,-1.160179e+00,2.429072e+00,-6.680118e+00,-8.913355e+00,-7.504832e+00,-8.724944e+00,-1.151155e+01,-6.783382e+00,1.796107e+00,-7.586480e+00,1.117470e+00,-6.419213e+00,-3.769720e+00,1.037369e+00,-3.964674e+00,1.527749e+00,-9.467120e+00,-8.498121e+00,-7.406638e+00,-9.761139e-01,6.955874e+00,1.015319e+00,2.722770e+00,7.283591e+00,4.207802e-02,-6.688211e-01,-2.944642e+00,-1.262878e+00,1.390626e+00,5.062559e+00,-6.866218e+00,-1.844342e+00,5.818851e-01,2.159121e+00,-2.700428e+00,2.970469e+00,-4.414018e+00,3.597045e+00,-1.115471e+01,-1.028305e+01,-5.355669e+00,3.458477e+00,-1.133516e+01,-5.208582e+00,2.601890e+00,-5.841000e+00,-7.754324e+00,-1.829335e+00,2.572763e+00,-1.925788e+00,-2.007329e+00,-4.619769e+00,1.625730e+00,8.381837e+00,1.573226e+00,4.278665e+00,4.927870e+00,5.339962e+00,8.346523e+00,-3.538850e+00,-3.638062e+00,1.471237e+00,3.812Line truncated
end package add_rand_data;
+3
View File
@@ -0,0 +1,3 @@
#pragma once
float expected_cosine [] = {2.000000e+00,1.999013e+00,1.996053e+00,1.991124e+00,1.984229e+00,1.975377e+00,1.964574e+00,1.951833e+00,1.937166e+00,1.920587e+00,1.902113e+00,1.881762e+00,1.859553e+00,1.835509e+00,1.809654e+00,1.782013e+00,1.752613e+00,1.721484e+00,1.688656e+00,1.654161e+00,1.618034e+00,1.580310e+00,1.541026e+00,1.500222e+00,1.457937e+00,1.414214e+00,1.369094e+00,1.322624e+00,1.274848e+00,1.225814e+00,1.175570e+00,1.124167e+00,1.071653e+00,1.018083e+00,9.635071e-01,9.079807e-01,8.515583e-01,7.942955e-01,7.362492e-01,6.774759e-01,6.180341e-01,5.579823e-01,4.973798e-01,4.362865e-01,3.747626e-01,3.128689e-01,2.506664e-01,1.882165e-01,1.255809e-01,6.282137e-02,-1.748456e-07,-6.282172e-02,-1.255808e-01,-1.882164e-01,-2.506667e-01,-3.128692e-01,-3.747630e-01,-4.362864e-01,-4.973797e-01,-5.579821e-01,-6.180344e-01,-6.774758e-01,-7.362491e-01,-7.942958e-01,-8.515586e-01,-9.079811e-01,-9.635074e-01,-1.018083e+00,-1.071654e+00,-1.124167e+00,-1.175571e+00,-1.225814e+00,-1.274848e+00,-1.322624e+00,-1.369094e+00,-1.414213e+00,-1.457937e+00,-1.500222e+00,-1.541026e+00,-1.580310e+00,-1.618034e+00,-1.654161e+00,-1.688656e+00,-1.721484e+00,-1.752613e+00,-1.782013e+00,-1.809654e+00,-1.835509e+00,-1.859553e+00,-1.881761e+00,-1.902113e+00,-1.920587e+00,-1.937166e+00,-1.951833e+00,-1.964574e+00,-1.975377e+00,-1.984229e+00,-1.991124e+00,-1.996053e+00,-1.999013e+00,-2.000000e+00,-1.999013e+00,-1.996053e+00,-1.991124e+00,-1.984229e+00,-1.975377e+00,-1.964574e+00,-1.951833e+00,-1.937166e+00,-1.920587e+00,-1.902113e+00,-1.881761e+00,-1.859553e+00,-1.835509e+00,-1.809654e+00,-1.782013e+00,-1.752614e+00,-1.721484e+00,-1.688656e+00,-1.654161e+00,-1.618034e+00,-1.580310e+00,-1.541026e+00,-1.500222e+00,-1.457937e+00,-1.414214e+00,-1.369094e+00,-1.322624e+00,-1.274848e+00,-1.225814e+00,-1.175571e+00,-1.124167e+00,-1.071653e+00,-1.018083e+00,-9.635074e-01,-9.079810e-01,-8.515586e-01,-7.942958e-01,-7.362491e-01,-6.774758e-01,-6.180339e-01,-5.579821e-01,-4.973796e-01,-4.362863e-01,-3.747624e-01,-3.128687e-01,-2.506662e-01,-1.882164e-01,-1.255807e-01,-6.282119e-02,3.496911e-07,6.282189e-02,1.255814e-01,1.882161e-01,2.506660e-01,3.128684e-01,3.747622e-01,4.362870e-01,4.973803e-01,5.579827e-01,6.180345e-01,6.774764e-01,7.362489e-01,7.942955e-01,8.515584e-01,9.079808e-01,9.635072e-01,1.018083e+00,1.071653e+00,1.124167e+00,1.175571e+00,1.225814e+00,1.274848e+00,1.322624e+00,1.369094e+00,1.414214e+00,1.457937e+00,1.500222e+00,1.541027e+00,1.580310e+00,1.618034e+00,1.654161e+00,1.688656e+00,1.721484e+00,1.752614e+00,1.782013e+00,1.809654e+00,1.835509e+00,1.859553e+00,1.881762e+00,1.902113e+00,1.920587e+00,1.937166e+00,1.951833e+00,1.964575e+00,1.975377e+00,1.984229e+00,1.991124e+00,1.996053e+00,1.999013e+00,2.000000e+00,1.999013e+00,1.996053e+00,1.991124e+00,1.984229e+00,1.975377e+00,1.964574e+00,1.951833e+00,1.937166e+00,1.920587e+00,1.902113e+00,1.881762e+00,1.859553e+00,1.835509e+00,1.809654e+00,1.782013e+00,1.752613e+00,1.721484e+00,1.688656e+00,1.654161e+00,1.618034e+00,1.580310e+00,1.541026e+00,1.500222e+00,1.457937e+00,1.414214e+00,1.369094e+00,1.322624e+00,1.274848e+00,1.225814e+00,1.175570e+00,1.124167e+00,1.071653e+00,1.018083e+00,9.635071e-01,9.079807e-01,8.515583e-01,7.942955e-01,7.362492e-01,6.774759e-01,6.180341e-01,5.579823e-01,4.973798e-01,4.362865e-01,3.747626e-01,3.128689e-01,2.506664e-01,1.882165e-01,1.255809e-01,6.282137e-02,-1.748456e-07,-6.282172e-02,-1.255808e-01,-1.882164e-01,-2.506667e-01,-3.128692e-01,-3.747630e-01,-4.362864e-01,-4.973797e-01,-5.579821e-01,-6.180344e-01,-6.774758e-01,-7.362491e-01,-7.942958e-01,-8.515586e-01,-9.079811e-01,-9.635074e-01,-1.018083e+00,-1.071654e+00,-1.124167e+00,-1.175571e+00,-1.225814e+00,-1.274848e+00,-1.322624e+00,-1.369094e+00,-1.414213e+00,-1.457937e+00,-1.500222e+00,-1.541026e+00,-1.580310e+00,-1.618034e+00,-1.654161e+00,-1.688656e+00,-1.721484e+00,-1.752613e+00,-1.782013e+00,-1.809654e+00,-1.835509e+00,-1.859553e+00,-1.881761e+00,-1.902113e+00,-1.920587e+00,-1.937166e+00,-1.951833e+00,-1.964574e+00,-1.975377e+00,-1.984229e+00,-1.991124e+00,-1.996053e+00,-1.999013e+00,-2.000000e+00,-1.999013e+00,-1.996053e+00,-1.991124e+00,-1.984229e+00,-1.975377e+00,-1.964574e+00,-1.951833e+00,-1.937166e+00,-1.920587e+00,-1.902113e+00,-1.881761e+00,-1.859553e+00,-1.835509e+00,-1.809654e+00,-1.782013e+00,-1.752614e+00,-1.721484e+00,-1.688656e+00,-1.654161e+00,-1.618034e+00,-1.580310e+00,-1.541026e+00,-1.500222e+00,-1.457937e+00,-1.414214e+00,-1.369094e+00,-1.322624e+00,-1.274848e+00,-1.225814e+00,-1.175571e+00,-1.124167e+00,-1.071653e+00,-1.018083e+00,-9.635074e-01,-9.079810e-01,-8.515586e-01,-7.942958e-01,-7.362491e-01,-6.774758e-01,-6.180339e-01,-5.579821e-01,-4.973796e-01,-4.362863e-01,-3.747624e-01,-3.128687e-01,-2.506662e-01,-1.882164e-01,-1.255807e-01,-6.282119e-02,3.496911e-07,6.282189e-02,1.255814e-01,1.882161e-01,2.506660e-01,3.128684e-01,3.747622e-01,4.362870e-01,4.973803e-01,5.579827e-01,6.180345e-01,6.774764e-01,7.362489e-01,7.942955e-01,8.515584e-01,9.079808e-01,9.635072e-01,Line truncated
+4
View File
@@ -0,0 +1,4 @@
data = [2.000000e+00,1.999013e+00,1.996053e+00,1.991124e+00,1.984229e+00,1.975377e+00,1.964574e+00,1.951833e+00,1.937166e+00,1.920587e+00,1.902113e+00,1.881762e+00,1.859553e+00,1.835509e+00,1.809654e+00,1.782013e+00,1.752613e+00,1.721484e+00,1.688656e+00,1.654161e+00,1.618034e+00,1.580310e+00,1.541026e+00,1.500222e+00,1.457937e+00,1.414214e+00,1.369094e+00,1.322624e+00,1.274848e+00,1.225814e+00,1.175570e+00,1.124167e+00,1.071653e+00,1.018083e+00,9.635071e-01,9.079807e-01,8.515583e-01,7.942955e-01,7.362492e-01,6.774759e-01,6.180341e-01,5.579823e-01,4.973798e-01,4.362865e-01,3.747626e-01,3.128689e-01,2.506664e-01,1.882165e-01,1.255809e-01,6.282137e-02,-1.748456e-07,-6.282172e-02,-1.255808e-01,-1.882164e-01,-2.506667e-01,-3.128692e-01,-3.747630e-01,-4.362864e-01,-4.973797e-01,-5.579821e-01,-6.180344e-01,-6.774758e-01,-7.362491e-01,-7.942958e-01,-8.515586e-01,-9.079811e-01,-9.635074e-01,-1.018083e+00,-1.071654e+00,-1.124167e+00,-1.175571e+00,-1.225814e+00,-1.274848e+00,-1.322624e+00,-1.369094e+00,-1.414213e+00,-1.457937e+00,-1.500222e+00,-1.541026e+00,-1.580310e+00,-1.618034e+00,-1.654161e+00,-1.688656e+00,-1.721484e+00,-1.752613e+00,-1.782013e+00,-1.809654e+00,-1.835509e+00,-1.859553e+00,-1.881761e+00,-1.902113e+00,-1.920587e+00,-1.937166e+00,-1.951833e+00,-1.964574e+00,-1.975377e+00,-1.984229e+00,-1.991124e+00,-1.996053e+00,-1.999013e+00,-2.000000e+00,-1.999013e+00,-1.996053e+00,-1.991124e+00,-1.984229e+00,-1.975377e+00,-1.964574e+00,-1.951833e+00,-1.937166e+00,-1.920587e+00,-1.902113e+00,-1.881761e+00,-1.859553e+00,-1.835509e+00,-1.809654e+00,-1.782013e+00,-1.752614e+00,-1.721484e+00,-1.688656e+00,-1.654161e+00,-1.618034e+00,-1.580310e+00,-1.541026e+00,-1.500222e+00,-1.457937e+00,-1.414214e+00,-1.369094e+00,-1.322624e+00,-1.274848e+00,-1.225814e+00,-1.175571e+00,-1.124167e+00,-1.071653e+00,-1.018083e+00,-9.635074e-01,-9.079810e-01,-8.515586e-01,-7.942958e-01,-7.362491e-01,-6.774758e-01,-6.180339e-01,-5.579821e-01,-4.973796e-01,-4.362863e-01,-3.747624e-01,-3.128687e-01,-2.506662e-01,-1.882164e-01,-1.255807e-01,-6.282119e-02,3.496911e-07,6.282189e-02,1.255814e-01,1.882161e-01,2.506660e-01,3.128684e-01,3.747622e-01,4.362870e-01,4.973803e-01,5.579827e-01,6.180345e-01,6.774764e-01,7.362489e-01,7.942955e-01,8.515584e-01,9.079808e-01,9.635072e-01,1.018083e+00,1.071653e+00,1.124167e+00,1.175571e+00,1.225814e+00,1.274848e+00,1.322624e+00,1.369094e+00,1.414214e+00,1.457937e+00,1.500222e+00,1.541027e+00,1.580310e+00,1.618034e+00,1.654161e+00,1.688656e+00,1.721484e+00,1.752614e+00,1.782013e+00,1.809654e+00,1.835509e+00,1.859553e+00,1.881762e+00,1.902113e+00,1.920587e+00,1.937166e+00,1.951833e+00,1.964575e+00,1.975377e+00,1.984229e+00,1.991124e+00,1.996053e+00,1.999013e+00,2.000000e+00,1.999013e+00,1.996053e+00,1.991124e+00,1.984229e+00,1.975377e+00,1.964574e+00,1.951833e+00,1.937166e+00,1.920587e+00,1.902113e+00,1.881762e+00,1.859553e+00,1.835509e+00,1.809654e+00,1.782013e+00,1.752613e+00,1.721484e+00,1.688656e+00,1.654161e+00,1.618034e+00,1.580310e+00,1.541026e+00,1.500222e+00,1.457937e+00,1.414214e+00,1.369094e+00,1.322624e+00,1.274848e+00,1.225814e+00,1.175570e+00,1.124167e+00,1.071653e+00,1.018083e+00,9.635071e-01,9.079807e-01,8.515583e-01,7.942955e-01,7.362492e-01,6.774759e-01,6.180341e-01,5.579823e-01,4.973798e-01,4.362865e-01,3.747626e-01,3.128689e-01,2.506664e-01,1.882165e-01,1.255809e-01,6.282137e-02,-1.748456e-07,-6.282172e-02,-1.255808e-01,-1.882164e-01,-2.506667e-01,-3.128692e-01,-3.747630e-01,-4.362864e-01,-4.973797e-01,-5.579821e-01,-6.180344e-01,-6.774758e-01,-7.362491e-01,-7.942958e-01,-8.515586e-01,-9.079811e-01,-9.635074e-01,-1.018083e+00,-1.071654e+00,-1.124167e+00,-1.175571e+00,-1.225814e+00,-1.274848e+00,-1.322624e+00,-1.369094e+00,-1.414213e+00,-1.457937e+00,-1.500222e+00,-1.541026e+00,-1.580310e+00,-1.618034e+00,-1.654161e+00,-1.688656e+00,-1.721484e+00,-1.752613e+00,-1.782013e+00,-1.809654e+00,-1.835509e+00,-1.859553e+00,-1.881761e+00,-1.902113e+00,-1.920587e+00,-1.937166e+00,-1.951833e+00,-1.964574e+00,-1.975377e+00,-1.984229e+00,-1.991124e+00,-1.996053e+00,-1.999013e+00,-2.000000e+00,-1.999013e+00,-1.996053e+00,-1.991124e+00,-1.984229e+00,-1.975377e+00,-1.964574e+00,-1.951833e+00,-1.937166e+00,-1.920587e+00,-1.902113e+00,-1.881761e+00,-1.859553e+00,-1.835509e+00,-1.809654e+00,-1.782013e+00,-1.752614e+00,-1.721484e+00,-1.688656e+00,-1.654161e+00,-1.618034e+00,-1.580310e+00,-1.541026e+00,-1.500222e+00,-1.457937e+00,-1.414214e+00,-1.369094e+00,-1.322624e+00,-1.274848e+00,-1.225814e+00,-1.175571e+00,-1.124167e+00,-1.071653e+00,-1.018083e+00,-9.635074e-01,-9.079810e-01,-8.515586e-01,-7.942958e-01,-7.362491e-01,-6.774758e-01,-6.180339e-01,-5.579821e-01,-4.973796e-01,-4.362863e-01,-3.747624e-01,-3.128687e-01,-2.506662e-01,-1.882164e-01,-1.255807e-01,-6.282119e-02,3.496911e-07,6.282189e-02,1.255814e-01,1.882161e-01,2.506660e-01,3.128684e-01,3.747622e-01,4.362870e-01,4.973803e-01,5.579827e-01,6.180345e-01,6.774764e-01,7.362489e-01,7.942955e-01,8.515584e-01,9.079808e-01,9.635072e-01,1.018083e+00,1.07165Line truncated
title = 'Task cosine'
interval = 1e-5
xlabel = 't'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package cosine_data is
constant expected : real_array( 0 to 1023 ) := (2.000000e+00,1.999013e+00,1.996053e+00,1.991124e+00,1.984229e+00,1.975377e+00,1.964574e+00,1.951833e+00,1.937166e+00,1.920587e+00,1.902113e+00,1.881762e+00,1.859553e+00,1.835509e+00,1.809654e+00,1.782013e+00,1.752613e+00,1.721484e+00,1.688656e+00,1.654161e+00,1.618034e+00,1.580310e+00,1.541026e+00,1.500222e+00,1.457937e+00,1.414214e+00,1.369094e+00,1.322624e+00,1.274848e+00,1.225814e+00,1.175570e+00,1.124167e+00,1.071653e+00,1.018083e+00,9.635071e-01,9.079807e-01,8.515583e-01,7.942955e-01,7.362492e-01,6.774759e-01,6.180341e-01,5.579823e-01,4.973798e-01,4.362865e-01,3.747626e-01,3.128689e-01,2.506664e-01,1.882165e-01,1.255809e-01,6.282137e-02,-1.748456e-07,-6.282172e-02,-1.255808e-01,-1.882164e-01,-2.506667e-01,-3.128692e-01,-3.747630e-01,-4.362864e-01,-4.973797e-01,-5.579821e-01,-6.180344e-01,-6.774758e-01,-7.362491e-01,-7.942958e-01,-8.515586e-01,-9.079811e-01,-9.635074e-01,-1.018083e+00,-1.071654e+00,-1.124167e+00,-1.175571e+00,-1.225814e+00,-1.274848e+00,-1.322624e+00,-1.369094e+00,-1.414213e+00,-1.457937e+00,-1.500222e+00,-1.541026e+00,-1.580310e+00,-1.618034e+00,-1.654161e+00,-1.688656e+00,-1.721484e+00,-1.752613e+00,-1.782013e+00,-1.809654e+00,-1.835509e+00,-1.859553e+00,-1.881761e+00,-1.902113e+00,-1.920587e+00,-1.937166e+00,-1.951833e+00,-1.964574e+00,-1.975377e+00,-1.984229e+00,-1.991124e+00,-1.996053e+00,-1.999013e+00,-2.000000e+00,-1.999013e+00,-1.996053e+00,-1.991124e+00,-1.984229e+00,-1.975377e+00,-1.964574e+00,-1.951833e+00,-1.937166e+00,-1.920587e+00,-1.902113e+00,-1.881761e+00,-1.859553e+00,-1.835509e+00,-1.809654e+00,-1.782013e+00,-1.752614e+00,-1.721484e+00,-1.688656e+00,-1.654161e+00,-1.618034e+00,-1.580310e+00,-1.541026e+00,-1.500222e+00,-1.457937e+00,-1.414214e+00,-1.369094e+00,-1.322624e+00,-1.274848e+00,-1.225814e+00,-1.175571e+00,-1.124167e+00,-1.071653e+00,-1.018083e+00,-9.635074e-01,-9.079810e-01,-8.515586e-01,-7.942958e-01,-7.362491e-01,-6.774758e-01,-6.180339e-01,-5.579821e-01,-4.973796e-01,-4.362863e-01,-3.747624e-01,-3.128687e-01,-2.506662e-01,-1.882164e-01,-1.255807e-01,-6.282119e-02,3.496911e-07,6.282189e-02,1.255814e-01,1.882161e-01,2.506660e-01,3.128684e-01,3.747622e-01,4.362870e-01,4.973803e-01,5.579827e-01,6.180345e-01,6.774764e-01,7.362489e-01,7.942955e-01,8.515584e-01,9.079808e-01,9.635072e-01,1.018083e+00,1.071653e+00,1.124167e+00,1.175571e+00,1.225814e+00,1.274848e+00,1.322624e+00,1.369094e+00,1.414214e+00,1.457937e+00,1.500222e+00,1.541027e+00,1.580310e+00,1.618034e+00,1.654161e+00,1.688656e+00,1.721484e+00,1.752614e+00,1.782013e+00,1.809654e+00,1.835509e+00,1.859553e+00,1.881762e+00,1.902113e+00,1.920587e+00,1.937166e+00,1.951833e+00,1.964575e+00,1.975377e+00,1.984229e+00,1.991124e+00,1.996053e+00,1.999013e+00,2.000000e+00,1.999013e+00,1.996053e+00,1.991124e+00,1.984229e+00,1.975377e+00,1.964574e+00,1.951833e+00,1.937166e+00,1.920587e+00,1.902113e+00,1.881762e+00,1.859553e+00,1.835509e+00,1.809654e+00,1.782013e+00,1.752613e+00,1.721484e+00,1.688656e+00,1.654161e+00,1.618034e+00,1.580310e+00,1.541026e+00,1.500222e+00,1.457937e+00,1.414214e+00,1.369094e+00,1.322624e+00,1.274848e+00,1.225814e+00,1.175570e+00,1.124167e+00,1.071653e+00,1.018083e+00,9.635071e-01,9.079807e-01,8.515583e-01,7.942955e-01,7.362492e-01,6.774759e-01,6.180341e-01,5.579823e-01,4.973798e-01,4.362865e-01,3.747626e-01,3.128689e-01,2.506664e-01,1.882165e-01,1.255809e-01,6.282137e-02,-1.748456e-07,-6.282172e-02,-1.255808e-01,-1.882164e-01,-2.506667e-01,-3.128692e-01,-3.747630e-01,-4.362864e-01,-4.973797e-01,-5.579821e-01,-6.180344e-01,-6.774758e-01,-7.362491e-01,-7.942958e-01,-8.515586e-01,-9.079811e-01,-9.635074e-01,-1.018083e+00,-1.071654e+00,-1.124167e+00,-1.175571e+00,-1.225814e+00,-1.274848e+00,-1.322624e+00,-1.369094e+00,-1.414213e+00,-1.457937e+00,-1.500222e+00,-1.541026e+00,-1.580310e+00,-1.618034e+00,-1.654161e+00,-1.688656e+00,-1.721484e+00,-1.752613e+00,-1.782013e+00,-1.809654e+00,-1.835509e+00,-1.859553e+00,-1.881761e+00,-1.902113e+00,-1.920587e+00,-1.937166e+00,-1.951833e+00,-1.964574e+00,-1.975377e+00,-1.984229e+00,-1.991124e+00,-1.996053e+00,-1.999013e+00,-2.000000e+00,-1.999013e+00,-1.996053e+00,-1.991124e+00,-1.984229e+00,-1.975377e+00,-1.964574e+00,-1.951833e+00,-1.937166e+00,-1.920587e+00,-1.902113e+00,-1.881761e+00,-1.859553e+00,-1.835509e+00,-1.809654e+00,-1.782013e+00,-1.752614e+00,-1.721484e+00,-1.688656e+00,-1.654161e+00,-1.618034e+00,-1.580310e+00,-1.541026e+00,-1.500222e+00,-1.457937e+00,-1.414214e+00,-1.369094e+00,-1.322624e+00,-1.274848e+00,-1.225814e+00,-1.175571e+00,-1.124167e+00,-1.071653e+00,-1.018083e+00,-9.635074e-01,-9.079810e-01,-8.515586e-01,-7.942958e-01,-7.362491e-01,-6.774758e-01,-6.180339e-01,-5.579821e-01,-4.973796e-01,-4.362863e-01,-3.747624e-01,-3.128687e-01,-2.506662e-01,-1.882164e-01,-1.255807e-01,-6.282119e-02,3.496911e-07,6.282189e-02,1.255814e-01,1.882161e-01,2.506660e-01,3.128684e-01,3.747622e-01,4.362870e-01,4.973803e-01,5.579827e-01,6.180345e-01,6.774764e-01,7.362489e-01,7.942955e-01,8.515584e-01,9.Line truncated
end package cosine_data;
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include <inttypes.h>
uint32_t expected_crc = 0x4d540e72;
+4
View File
@@ -0,0 +1,4 @@
data = [0x4d540e72]
title = 'Task sine'
interval = 1e-5
xlabel = 't'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package crc_data is
constant expected : std_logic_vector( 31 downto 0 ) := x"4d540e72";
end package crc_data;
+2
View File
@@ -0,0 +1,2 @@
#pragma once
float expected_fft[] = {1.400077e-01,1.631006e-01,4.579161e-02,1.638744e-01,2.014323e-01,1.751627e+00,3.725031e-01,1.321073e-01,4.345959e-01,3.126748e-01,2.921721e-01,4.182611e-01,9.186539e-02,2.316879e-01,2.063257e-01,2.443818e-01,3.204013e-01,2.518824e-01,2.490902e-01,2.755829e-01,2.901987e-01,2.310183e-01,1.380682e-01,4.137335e-02,1.821911e-01,3.849657e-01,2.579769e-01,2.075598e-01,2.347006e-01,1.450103e-01,2.185122e-01,2.153282e-01,3.964341e+00,1.729022e-01,7.515065e-02,2.416848e-01,1.749128e-01,3.286295e-01,1.123644e-01,5.713965e-02,1.156537e-01,3.440511e-01,3.383082e-01,1.743206e-01,4.009396e-01,1.929011e-01,2.514783e-01,2.657047e-01,3.455679e-01,1.456240e-01,4.950228e-02,4.646390e-02,1.706572e-02,2.245333e-01,2.159272e-01,1.328469e-01,4.099350e-01,1.301445e-01,2.815202e-01,1.941099e-01,1.202426e-01,1.889600e-01,1.333201e-01,3.542707e-01,2.488066e-01,2.415012e-01,1.691778e-01,2.398767e-02,1.967010e-01,2.317934e-01,1.942473e-01,2.842496e-01,3.335730e-01,2.037441e-01,2.120339e-01,2.574666e-01,1.888043e-01,2.684270e-01,3.135189e-01,1.810302e-01,1.955532e-01,4.859236e-01,1.246064e-01,1.411959e-01,6.945253e-02,4.573855e-01,2.333594e-01,2.861014e-01,3.180932e-01,2.867535e-01,3.144628e-01,1.446351e-01,1.830697e-01,9.428367e-02,2.420044e-01,1.902588e-01,1.910852e-01,2.007655e-01,4.003132e-01,1.042668e-01,3.420224e-01,4.631629e-01,2.279680e-01,2.682562e-01,3.255370e-01,2.960867e-01,8.137213e-02,2.539533e-01,1.511125e-01,3.123292e-01,3.883526e-01,8.820713e-02,2.827073e-01,1.359767e-01,5.766666e-01,5.554063e-02,8.886527e-02,2.480626e-01,2.649462e-01,3.140529e-01,2.933081e-01,2.897829e-01,3.955528e-01,2.541061e-01,2.607835e-01,3.614890e-01,7.783117e-02,9.103174e-02,3.709492e-01,2.940106e-01,2.130100e-01,2.496498e-01,9.191309e-02,3.533632e-02,1.805623e-01,8.928566e-02,2.380424e-01,1.907064e-01,2.697022e-01,1.430689e-01,3.490459e-01,2.992451e-01,6.800354e-02,2.244534e-02,7.743893e-02,1.741521e-01,7.360994e-02,1.593922e-01,1.465899e-01,1.719157e-01,4.485097e-01,3.098611e-01,1.349618e-01,3.341462e-01,1.425298e-01,2.875902e-01,8.426153e-02,3.288285e-01,2.145013e-01,8.162631e-02,1.674171e-01,1.592194e-01,1.685525e-01,3.440325e-01,1.469657e-01,1.376795e-01,1.735331e-01,1.711099e-01,5.260750e-02,3.700888e-01,1.360041e-01,1.230156e-01,1.053979e-01,3.539028e-01,2.806161e-01,2.221132e-01,3.672347e-01,1.339912e-01,1.195079e-01,2.571085e-01,2.199113e-01,7.953332e-02,1.690346e-01,1.203663e-01,2.221095e-01,2.012171e-01,1.270380e-01,8.900518e-02,2.025151e-01,1.914574e-01,1.459286e-01,9.652802e-02,3.075261e-01,7.239375e-02,1.135965e-01,2.084964e-01,2.755392e-01,1.252988e-01,3.073075e-01,6.053112e-02,3.553204e-01,2.459441e-01,1.033225e-01,5.226908e-02,3.245927e-01,1.159644e-01,2.152760e-01,1.555173e-01,1.855022e-01,2.659614e-01,8.466729e-02,2.707186e-02,1.980485e-01,1.328685e-01,1.775677e-01,3.187793e-01,1.672417e-01,2.179600e-01,2.258015e-01,2.917109e-01,1.549580e-01,2.101620e-01,3.088741e-01,2.448144e-01,1.225766e-01,1.224377e-01,2.486137e-01,1.989210e-01,3.487260e-01,1.115108e-01,3.017660e-01,2.739770e-01,2.921598e-01,4.401497e-01,1.167351e-01,2.877316e-01,3.210582e-01,2.372447e-01,2.083751e-01,4.352092e-01,2.652424e-01,3.971176e-01,8.233179e-02,3.019593e-01,3.607931e-02,1.257835e-01,1.740972e-01,1.983701e-01,2.049058e-01,3.620155e-01,2.495642e-01,9.517803e-02,2.263584e-01,1.810629e-01,2.911930e-01,2.530651e-01,2.327204e-01,3.575457e-01,1.279376e-01,2.846593e-01,1.975898e-01,1.317701e-01,1.248586e-01,2.603230e-01,1.531465e-01,2.142851e-01,2.460313e-01,1.011628e-01,2.743606e-02,9.798534e-02,2.598632e-01,2.272824e-01,2.918966e-01,2.798742e-01,1.158270e-01,1.984987e-01,7.667792e-02,2.586592e-01,1.252270e-01,7.540244e-03,3.438416e-01,1.685521e-01,5.040530e-02,3.481922e-01,9.636129e-02,3.185849e-01,9.104028e-02,1.825642e-01,7.228275e-02,2.163923e-01,3.058604e-01,8.656666e-02,1.414090e-01,9.473977e-02,2.447495e-01,1.840448e-01,1.416565e-01,1.309659e-01,1.916810e-01,2.661250e-01,2.531486e-01,5.928098e-02,2.545844e-01,2.603267e-01,6.143219e-02,4.629719e-02,2.879857e-01,2.880686e-01,2.532247e-01,1.193916e-01,2.020878e-01,1.140908e-01,1.050417e-01,2.798772e-01,4.201054e-02,5.210670e-02,2.238559e-01,1.203570e-01,2.209939e-01,1.510058e-01,9.476274e-02,1.791161e-01,2.099509e-01,1.931393e-01,2.549953e-01,1.458509e-01,4.574895e-02,2.720677e-01,2.541411e-01,3.180994e-01,1.762382e-01,1.313164e-01,1.409390e-01,1.347537e-01,1.688052e-01,1.575773e-01,7.693820e-02,2.413943e-01,2.250850e-01,2.442751e-01,2.493840e-01,2.388378e-01,3.496171e-01,1.566967e-01,1.596259e-01,1.375277e-01,1.056590e-01,1.290449e-01,4.179420e-02,3.033647e-01,2.293904e-01,9.110396e-02,2.403690e-02,2.712335e-01,3.602684e-01,3.402961e-01,6.989443e-02,1.108020e-01,1.569847e-01,3.553422e-01,1.233466e-01,9.721116e-02,1.696935e-01,3.640107e-02,3.218429e-01,3.337425e-01,3.058794e-01,2.716095e-02,6.699575e-02,3.461188e-01,6.029394e-02,8.938456e-02,1.363983e-01,1.131106e-01,1.183942e-01,2.789734e-01,3.389439e-01,1.383525e-01,1.478976e-01,2.187950e-01,1.095712e-01,1.658192e-01,2.306195eLine truncated
+4
View File
@@ -0,0 +1,4 @@
data = [1.400077e-01,1.631006e-01,4.579161e-02,1.638744e-01,2.014323e-01,1.751627e+00,3.725031e-01,1.321073e-01,4.345959e-01,3.126748e-01,2.921721e-01,4.182611e-01,9.186539e-02,2.316879e-01,2.063257e-01,2.443818e-01,3.204013e-01,2.518824e-01,2.490902e-01,2.755829e-01,2.901987e-01,2.310183e-01,1.380682e-01,4.137335e-02,1.821911e-01,3.849657e-01,2.579769e-01,2.075598e-01,2.347006e-01,1.450103e-01,2.185122e-01,2.153282e-01,3.964341e+00,1.729022e-01,7.515065e-02,2.416848e-01,1.749128e-01,3.286295e-01,1.123644e-01,5.713965e-02,1.156537e-01,3.440511e-01,3.383082e-01,1.743206e-01,4.009396e-01,1.929011e-01,2.514783e-01,2.657047e-01,3.455679e-01,1.456240e-01,4.950228e-02,4.646390e-02,1.706572e-02,2.245333e-01,2.159272e-01,1.328469e-01,4.099350e-01,1.301445e-01,2.815202e-01,1.941099e-01,1.202426e-01,1.889600e-01,1.333201e-01,3.542707e-01,2.488066e-01,2.415012e-01,1.691778e-01,2.398767e-02,1.967010e-01,2.317934e-01,1.942473e-01,2.842496e-01,3.335730e-01,2.037441e-01,2.120339e-01,2.574666e-01,1.888043e-01,2.684270e-01,3.135189e-01,1.810302e-01,1.955532e-01,4.859236e-01,1.246064e-01,1.411959e-01,6.945253e-02,4.573855e-01,2.333594e-01,2.861014e-01,3.180932e-01,2.867535e-01,3.144628e-01,1.446351e-01,1.830697e-01,9.428367e-02,2.420044e-01,1.902588e-01,1.910852e-01,2.007655e-01,4.003132e-01,1.042668e-01,3.420224e-01,4.631629e-01,2.279680e-01,2.682562e-01,3.255370e-01,2.960867e-01,8.137213e-02,2.539533e-01,1.511125e-01,3.123292e-01,3.883526e-01,8.820713e-02,2.827073e-01,1.359767e-01,5.766666e-01,5.554063e-02,8.886527e-02,2.480626e-01,2.649462e-01,3.140529e-01,2.933081e-01,2.897829e-01,3.955528e-01,2.541061e-01,2.607835e-01,3.614890e-01,7.783117e-02,9.103174e-02,3.709492e-01,2.940106e-01,2.130100e-01,2.496498e-01,9.191309e-02,3.533632e-02,1.805623e-01,8.928566e-02,2.380424e-01,1.907064e-01,2.697022e-01,1.430689e-01,3.490459e-01,2.992451e-01,6.800354e-02,2.244534e-02,7.743893e-02,1.741521e-01,7.360994e-02,1.593922e-01,1.465899e-01,1.719157e-01,4.485097e-01,3.098611e-01,1.349618e-01,3.341462e-01,1.425298e-01,2.875902e-01,8.426153e-02,3.288285e-01,2.145013e-01,8.162631e-02,1.674171e-01,1.592194e-01,1.685525e-01,3.440325e-01,1.469657e-01,1.376795e-01,1.735331e-01,1.711099e-01,5.260750e-02,3.700888e-01,1.360041e-01,1.230156e-01,1.053979e-01,3.539028e-01,2.806161e-01,2.221132e-01,3.672347e-01,1.339912e-01,1.195079e-01,2.571085e-01,2.199113e-01,7.953332e-02,1.690346e-01,1.203663e-01,2.221095e-01,2.012171e-01,1.270380e-01,8.900518e-02,2.025151e-01,1.914574e-01,1.459286e-01,9.652802e-02,3.075261e-01,7.239375e-02,1.135965e-01,2.084964e-01,2.755392e-01,1.252988e-01,3.073075e-01,6.053112e-02,3.553204e-01,2.459441e-01,1.033225e-01,5.226908e-02,3.245927e-01,1.159644e-01,2.152760e-01,1.555173e-01,1.855022e-01,2.659614e-01,8.466729e-02,2.707186e-02,1.980485e-01,1.328685e-01,1.775677e-01,3.187793e-01,1.672417e-01,2.179600e-01,2.258015e-01,2.917109e-01,1.549580e-01,2.101620e-01,3.088741e-01,2.448144e-01,1.225766e-01,1.224377e-01,2.486137e-01,1.989210e-01,3.487260e-01,1.115108e-01,3.017660e-01,2.739770e-01,2.921598e-01,4.401497e-01,1.167351e-01,2.877316e-01,3.210582e-01,2.372447e-01,2.083751e-01,4.352092e-01,2.652424e-01,3.971176e-01,8.233179e-02,3.019593e-01,3.607931e-02,1.257835e-01,1.740972e-01,1.983701e-01,2.049058e-01,3.620155e-01,2.495642e-01,9.517803e-02,2.263584e-01,1.810629e-01,2.911930e-01,2.530651e-01,2.327204e-01,3.575457e-01,1.279376e-01,2.846593e-01,1.975898e-01,1.317701e-01,1.248586e-01,2.603230e-01,1.531465e-01,2.142851e-01,2.460313e-01,1.011628e-01,2.743606e-02,9.798534e-02,2.598632e-01,2.272824e-01,2.918966e-01,2.798742e-01,1.158270e-01,1.984987e-01,7.667792e-02,2.586592e-01,1.252270e-01,7.540244e-03,3.438416e-01,1.685521e-01,5.040530e-02,3.481922e-01,9.636129e-02,3.185849e-01,9.104028e-02,1.825642e-01,7.228275e-02,2.163923e-01,3.058604e-01,8.656666e-02,1.414090e-01,9.473977e-02,2.447495e-01,1.840448e-01,1.416565e-01,1.309659e-01,1.916810e-01,2.661250e-01,2.531486e-01,5.928098e-02,2.545844e-01,2.603267e-01,6.143219e-02,4.629719e-02,2.879857e-01,2.880686e-01,2.532247e-01,1.193916e-01,2.020878e-01,1.140908e-01,1.050417e-01,2.798772e-01,4.201054e-02,5.210670e-02,2.238559e-01,1.203570e-01,2.209939e-01,1.510058e-01,9.476274e-02,1.791161e-01,2.099509e-01,1.931393e-01,2.549953e-01,1.458509e-01,4.574895e-02,2.720677e-01,2.541411e-01,3.180994e-01,1.762382e-01,1.313164e-01,1.409390e-01,1.347537e-01,1.688052e-01,1.575773e-01,7.693820e-02,2.413943e-01,2.250850e-01,2.442751e-01,2.493840e-01,2.388378e-01,3.496171e-01,1.566967e-01,1.596259e-01,1.375277e-01,1.056590e-01,1.290449e-01,4.179420e-02,3.033647e-01,2.293904e-01,9.110396e-02,2.403690e-02,2.712335e-01,3.602684e-01,3.402961e-01,6.989443e-02,1.108020e-01,1.569847e-01,3.553422e-01,1.233466e-01,9.721116e-02,1.696935e-01,3.640107e-02,3.218429e-01,3.337425e-01,3.058794e-01,2.716095e-02,6.699575e-02,3.461188e-01,6.029394e-02,8.938456e-02,1.363983e-01,1.131106e-01,1.183942e-01,2.789734e-01,3.389439e-01,1.383525e-01,1.478976e-01,2.187950e-01,1.095712e-01,1.658192e-01,2.306195e-01,2.253823e-01Line truncated
title = 'Task fft'
interval = 1e5
xlabel = 'f'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package fft_data is
constant expected : real_array( 0 to 1023 ) := (1.400077e-01,1.631006e-01,4.579161e-02,1.638744e-01,2.014323e-01,1.751627e+00,3.725031e-01,1.321073e-01,4.345959e-01,3.126748e-01,2.921721e-01,4.182611e-01,9.186539e-02,2.316879e-01,2.063257e-01,2.443818e-01,3.204013e-01,2.518824e-01,2.490902e-01,2.755829e-01,2.901987e-01,2.310183e-01,1.380682e-01,4.137335e-02,1.821911e-01,3.849657e-01,2.579769e-01,2.075598e-01,2.347006e-01,1.450103e-01,2.185122e-01,2.153282e-01,3.964341e+00,1.729022e-01,7.515065e-02,2.416848e-01,1.749128e-01,3.286295e-01,1.123644e-01,5.713965e-02,1.156537e-01,3.440511e-01,3.383082e-01,1.743206e-01,4.009396e-01,1.929011e-01,2.514783e-01,2.657047e-01,3.455679e-01,1.456240e-01,4.950228e-02,4.646390e-02,1.706572e-02,2.245333e-01,2.159272e-01,1.328469e-01,4.099350e-01,1.301445e-01,2.815202e-01,1.941099e-01,1.202426e-01,1.889600e-01,1.333201e-01,3.542707e-01,2.488066e-01,2.415012e-01,1.691778e-01,2.398767e-02,1.967010e-01,2.317934e-01,1.942473e-01,2.842496e-01,3.335730e-01,2.037441e-01,2.120339e-01,2.574666e-01,1.888043e-01,2.684270e-01,3.135189e-01,1.810302e-01,1.955532e-01,4.859236e-01,1.246064e-01,1.411959e-01,6.945253e-02,4.573855e-01,2.333594e-01,2.861014e-01,3.180932e-01,2.867535e-01,3.144628e-01,1.446351e-01,1.830697e-01,9.428367e-02,2.420044e-01,1.902588e-01,1.910852e-01,2.007655e-01,4.003132e-01,1.042668e-01,3.420224e-01,4.631629e-01,2.279680e-01,2.682562e-01,3.255370e-01,2.960867e-01,8.137213e-02,2.539533e-01,1.511125e-01,3.123292e-01,3.883526e-01,8.820713e-02,2.827073e-01,1.359767e-01,5.766666e-01,5.554063e-02,8.886527e-02,2.480626e-01,2.649462e-01,3.140529e-01,2.933081e-01,2.897829e-01,3.955528e-01,2.541061e-01,2.607835e-01,3.614890e-01,7.783117e-02,9.103174e-02,3.709492e-01,2.940106e-01,2.130100e-01,2.496498e-01,9.191309e-02,3.533632e-02,1.805623e-01,8.928566e-02,2.380424e-01,1.907064e-01,2.697022e-01,1.430689e-01,3.490459e-01,2.992451e-01,6.800354e-02,2.244534e-02,7.743893e-02,1.741521e-01,7.360994e-02,1.593922e-01,1.465899e-01,1.719157e-01,4.485097e-01,3.098611e-01,1.349618e-01,3.341462e-01,1.425298e-01,2.875902e-01,8.426153e-02,3.288285e-01,2.145013e-01,8.162631e-02,1.674171e-01,1.592194e-01,1.685525e-01,3.440325e-01,1.469657e-01,1.376795e-01,1.735331e-01,1.711099e-01,5.260750e-02,3.700888e-01,1.360041e-01,1.230156e-01,1.053979e-01,3.539028e-01,2.806161e-01,2.221132e-01,3.672347e-01,1.339912e-01,1.195079e-01,2.571085e-01,2.199113e-01,7.953332e-02,1.690346e-01,1.203663e-01,2.221095e-01,2.012171e-01,1.270380e-01,8.900518e-02,2.025151e-01,1.914574e-01,1.459286e-01,9.652802e-02,3.075261e-01,7.239375e-02,1.135965e-01,2.084964e-01,2.755392e-01,1.252988e-01,3.073075e-01,6.053112e-02,3.553204e-01,2.459441e-01,1.033225e-01,5.226908e-02,3.245927e-01,1.159644e-01,2.152760e-01,1.555173e-01,1.855022e-01,2.659614e-01,8.466729e-02,2.707186e-02,1.980485e-01,1.328685e-01,1.775677e-01,3.187793e-01,1.672417e-01,2.179600e-01,2.258015e-01,2.917109e-01,1.549580e-01,2.101620e-01,3.088741e-01,2.448144e-01,1.225766e-01,1.224377e-01,2.486137e-01,1.989210e-01,3.487260e-01,1.115108e-01,3.017660e-01,2.739770e-01,2.921598e-01,4.401497e-01,1.167351e-01,2.877316e-01,3.210582e-01,2.372447e-01,2.083751e-01,4.352092e-01,2.652424e-01,3.971176e-01,8.233179e-02,3.019593e-01,3.607931e-02,1.257835e-01,1.740972e-01,1.983701e-01,2.049058e-01,3.620155e-01,2.495642e-01,9.517803e-02,2.263584e-01,1.810629e-01,2.911930e-01,2.530651e-01,2.327204e-01,3.575457e-01,1.279376e-01,2.846593e-01,1.975898e-01,1.317701e-01,1.248586e-01,2.603230e-01,1.531465e-01,2.142851e-01,2.460313e-01,1.011628e-01,2.743606e-02,9.798534e-02,2.598632e-01,2.272824e-01,2.918966e-01,2.798742e-01,1.158270e-01,1.984987e-01,7.667792e-02,2.586592e-01,1.252270e-01,7.540244e-03,3.438416e-01,1.685521e-01,5.040530e-02,3.481922e-01,9.636129e-02,3.185849e-01,9.104028e-02,1.825642e-01,7.228275e-02,2.163923e-01,3.058604e-01,8.656666e-02,1.414090e-01,9.473977e-02,2.447495e-01,1.840448e-01,1.416565e-01,1.309659e-01,1.916810e-01,2.661250e-01,2.531486e-01,5.928098e-02,2.545844e-01,2.603267e-01,6.143219e-02,4.629719e-02,2.879857e-01,2.880686e-01,2.532247e-01,1.193916e-01,2.020878e-01,1.140908e-01,1.050417e-01,2.798772e-01,4.201054e-02,5.210670e-02,2.238559e-01,1.203570e-01,2.209939e-01,1.510058e-01,9.476274e-02,1.791161e-01,2.099509e-01,1.931393e-01,2.549953e-01,1.458509e-01,4.574895e-02,2.720677e-01,2.541411e-01,3.180994e-01,1.762382e-01,1.313164e-01,1.409390e-01,1.347537e-01,1.688052e-01,1.575773e-01,7.693820e-02,2.413943e-01,2.250850e-01,2.442751e-01,2.493840e-01,2.388378e-01,3.496171e-01,1.566967e-01,1.596259e-01,1.375277e-01,1.056590e-01,1.290449e-01,4.179420e-02,3.033647e-01,2.293904e-01,9.110396e-02,2.403690e-02,2.712335e-01,3.602684e-01,3.402961e-01,6.989443e-02,1.108020e-01,1.569847e-01,3.553422e-01,1.233466e-01,9.721116e-02,1.696935e-01,3.640107e-02,3.218429e-01,3.337425e-01,3.058794e-01,2.716095e-02,6.699575e-02,3.461188e-01,6.029394e-02,8.938456e-02,1.363983e-01,1.131106e-01,1.183942e-01,2.789734e-01,3.389439e-01,1.383525e-01,1.478976e-01,2.187950e-01,1.09571Line truncated
end package fft_data;
+2
View File
@@ -0,0 +1,2 @@
#pragma once
float expected_rand [] = {1.300000e+00,3.200000e+00,-4.799999e+00,-2.799999e+00,-3.599999e+00,-6.399997e+00,-4.799994e+00,-2.799994e+00,-2.249992e-01,6.399951e+00,-1.199976e+00,6.999756e-01,3.599805e+00,-6.399220e+00,-1.199610e+00,6.996100e-01,3.596880e+00,-6.387521e+00,-1.193760e+00,6.937605e-01,3.550084e+00,-6.200335e+00,-1.100167e+00,6.001674e-01,2.801339e+00,-3.602679e+00,-4.006697e-01,1.205358e+00,2.821431e+00,-3.642863e+00,-4.107157e-01,1.285726e+00,7.857258e-01,4.571613e+00,-2.571613e+00,-1.964517e-01,2.858067e-01,2.572907e+00,-3.145815e+00,-2.864537e-01,2.583259e+00,-1.979074e-01,2.916298e-01,2.666076e+00,-2.082595e-01,3.330381e-01,3.328610e+00,-3.321525e-01,8.286101e-01,5.257762e+00,-8.144405e-01,3.144405e-01,3.031048e+00,-2.577621e-01,2.124194e+00,-1.405242e-01,2.496775e+00,-1.870969e-01,3.987101e+00,-4.967754e-01,7.896811e+00,-1.948406e+00,1.896811e+00,1.793623e+00,1.587246e+00,1.174492e+00,2.697970e+00,-3.395941e+00,-5.583763e+00,-3.583763e+00,-6.335051e+00,-4.670102e+00,-2.670102e+00,-2.087628e-01,3.350511e-01,3.360817e+00,-3.402044e-01,3.443270e+00,-5.773082e+00,-9.432705e-01,4.432705e-01,6.184658e+00,-1.092329e+00,2.369315e+00,-1.711644e-01,3.477261e+00,-3.693151e-01,3.909042e+00,-7.636170e+00,-7.272340e+00,-1.636170e+00,1.272340e+00,7.723404e-01,4.357446e+00,-5.893615e-01,2.714892e+00,-3.429785e+00,-5.719140e+00,-3.719140e+00,-4.297851e-01,5.753124e+00,-9.382810e-01,4.382810e-01,1.506248e+00,4.049984e+00,-5.124960e-01,2.099968e+00,-2.199937e+00,-1.499921e-01,2.799747e+00,-3.599495e+00,-6.397979e+00,-1.198989e+00,6.989895e-01,2.244947e-01,3.979789e-01,1.183831e+00,6.838312e-01,3.470650e+00,-5.882600e+00,-9.706501e-01,4.706501e-01,7.060803e+00,-6.121607e+00,-1.060804e+00,5.608035e-01,2.486428e+00,-1.858036e-01,3.945714e+00,-7.782858e+00,-7.565716e+00,-7.131432e+00,-1.565716e+00,1.131432e+00,6.314318e-01,1.907159e-01,4.205817e+00,-2.205817e+00,-2.411635e+00,-2.823270e+00,-3.646540e+00,-4.116349e-01,1.293079e+00,3.172318e+00,-2.930795e-01,6.723181e-01,2.111591e-01,3.446362e-01,3.514179e+00,-6.056718e+00,-1.028359e+00,2.113436e+00,-1.391795e-01,1.533590e-01,2.907489e+00,-2.384362e-01,7.259914e+00,-6.519829e+00,-1.259915e+00,7.599147e-01,2.599147e-01,5.396589e-01,1.448295e-01,2.634543e+00,-3.269087e+00,-5.076347e+00,-7.690867e-01,4.305387e+00,-5.763469e-01,1.631735e-01,2.013469e-01,3.053876e-01,2.886203e+00,-2.357753e-01,7.089622e+00,-1.544811e+00,1.089622e+00,5.896217e-01,2.716974e+00,-2.146217e-01,3.584869e-01,3.735791e+00,-6.943163e+00,-5.886326e+00,-9.715816e-01,4.715816e-01,1.772653e+00,6.181225e+00,-1.090613e+00,2.362451e+00,-2.724903e+00,-2.156128e-01,5.799222e+00,-3.799222e+00,-7.196888e+00,-6.393776e+00,-1.196888e+00,6.968881e-01,2.234440e-01,6.300419e+00,-1.150210e+00,2.600839e+00,-3.201679e+00,-4.806716e+00,-7.016792e-01,2.258396e-01,6.453733e+00,-4.907467e+00,-7.268668e-01,2.384334e-01,7.259738e+00,-1.629869e+00,1.259739e+00,3.038955e+00,-4.155822e+00,-5.389555e-01,1.444777e-01,2.623288e+00,-3.246576e+00,-4.986305e+00,-7.465762e-01,3.972610e+00,-4.931525e-01,1.945220e+00,1.890440e+00,1.780880e+00,6.247042e+00,-1.123521e+00,6.235209e-01,2.988168e+00,-3.976335e+00,-7.905341e+00,-7.810683e+00,-7.621366e+00,-7.242732e+00,-1.621366e+00,1.242732e+00,7.427323e-01,3.941859e+00,-7.767435e+00,-7.534870e+00,-7.069740e+00,-6.139481e+00,-4.278962e+00,-5.697404e-01,1.598702e-01,3.115847e+00,-4.463388e+00,-2.463388e+00,-2.926777e+00,-3.853553e+00,-4.633884e-01,1.707107e+00,1.414214e+00,3.656856e+00,-4.142139e-01,1.313711e+00,8.137114e-01,5.019382e+00,-3.019383e+00,-4.077531e+00,-5.193827e-01,2.155062e+00,-2.310124e+00,-1.637655e-01,3.240497e+00,-3.101243e-01,2.961989e+00,-2.452486e-01,4.809945e-01,1.847956e+00,1.695912e+00,1.391823e+00,3.567294e+00,-3.918234e-01,1.134587e+00,2.538350e+00,-3.076700e+00,-4.306800e+00,-2.306801e+00,-1.633501e-01,3.227203e+00,-4.908812e+00,-7.272030e-01,2.386015e-01,7.270497e+00,-1.635249e+00,1.270497e+00,7.704974e-01,4.327960e+00,-5.819899e-01,1.659950e-01,3.311840e+00,-5.247359e+00,-3.247360e+00,-3.118399e-01,2.989438e+00,-2.486798e-01,4.947191e-01,1.957753e+00,7.662025e+00,-1.831013e+00,6.648101e+00,-1.324051e+00,8.240506e-01,5.184810e+00,-3.184810e+00,-4.739239e+00,-2.739239e+00,-3.478479e+00,-5.913915e+00,-9.784787e-01,7.655660e+00,-1.827830e+00,6.622642e+00,-1.311321e+00,8.113210e-01,4.981135e+00,-7.452839e-01,3.962271e+00,-7.849086e+00,-7.698173e+00,-7.396346e+00,-1.698173e+00,5.585384e+00,-8.963460e-01,3.963460e-01,4.683074e+00,-2.683074e+00,-3.366148e+00,-5.464590e+00,-3.464590e+00,-3.661475e-01,3.858361e+00,-7.433444e+00,-1.716722e+00,1.433444e+00,3.733778e+00,-4.334446e-01,5.870226e+00,-9.675565e-01,7.480905e+00,-6.961811e+00,-5.923622e+00,-9.809054e-01,7.694487e+00,-7.388974e+00,-1.694487e+00,5.555898e+00,-3.555898e+00,-6.223591e+00,-1.111796e+00,2.447182e+00,-2.894365e+00,-3.788729e+00,-7.154918e+00,-1.577459e+00,4.619672e+00,-2.619672e+00,-2.024590e-01,3.098361e-01,7.393445e-01,3.914756e+00,-7.659024e+00,-7.318048e+00,-1.659024e+00,1.318048e+00,3.272192e+0Line truncated
+4
View File
@@ -0,0 +1,4 @@
data = [1.300000e+00,3.200000e+00,-4.799999e+00,-2.799999e+00,-3.599999e+00,-6.399997e+00,-4.799994e+00,-2.799994e+00,-2.249992e-01,6.399951e+00,-1.199976e+00,6.999756e-01,3.599805e+00,-6.399220e+00,-1.199610e+00,6.996100e-01,3.596880e+00,-6.387521e+00,-1.193760e+00,6.937605e-01,3.550084e+00,-6.200335e+00,-1.100167e+00,6.001674e-01,2.801339e+00,-3.602679e+00,-4.006697e-01,1.205358e+00,2.821431e+00,-3.642863e+00,-4.107157e-01,1.285726e+00,7.857258e-01,4.571613e+00,-2.571613e+00,-1.964517e-01,2.858067e-01,2.572907e+00,-3.145815e+00,-2.864537e-01,2.583259e+00,-1.979074e-01,2.916298e-01,2.666076e+00,-2.082595e-01,3.330381e-01,3.328610e+00,-3.321525e-01,8.286101e-01,5.257762e+00,-8.144405e-01,3.144405e-01,3.031048e+00,-2.577621e-01,2.124194e+00,-1.405242e-01,2.496775e+00,-1.870969e-01,3.987101e+00,-4.967754e-01,7.896811e+00,-1.948406e+00,1.896811e+00,1.793623e+00,1.587246e+00,1.174492e+00,2.697970e+00,-3.395941e+00,-5.583763e+00,-3.583763e+00,-6.335051e+00,-4.670102e+00,-2.670102e+00,-2.087628e-01,3.350511e-01,3.360817e+00,-3.402044e-01,3.443270e+00,-5.773082e+00,-9.432705e-01,4.432705e-01,6.184658e+00,-1.092329e+00,2.369315e+00,-1.711644e-01,3.477261e+00,-3.693151e-01,3.909042e+00,-7.636170e+00,-7.272340e+00,-1.636170e+00,1.272340e+00,7.723404e-01,4.357446e+00,-5.893615e-01,2.714892e+00,-3.429785e+00,-5.719140e+00,-3.719140e+00,-4.297851e-01,5.753124e+00,-9.382810e-01,4.382810e-01,1.506248e+00,4.049984e+00,-5.124960e-01,2.099968e+00,-2.199937e+00,-1.499921e-01,2.799747e+00,-3.599495e+00,-6.397979e+00,-1.198989e+00,6.989895e-01,2.244947e-01,3.979789e-01,1.183831e+00,6.838312e-01,3.470650e+00,-5.882600e+00,-9.706501e-01,4.706501e-01,7.060803e+00,-6.121607e+00,-1.060804e+00,5.608035e-01,2.486428e+00,-1.858036e-01,3.945714e+00,-7.782858e+00,-7.565716e+00,-7.131432e+00,-1.565716e+00,1.131432e+00,6.314318e-01,1.907159e-01,4.205817e+00,-2.205817e+00,-2.411635e+00,-2.823270e+00,-3.646540e+00,-4.116349e-01,1.293079e+00,3.172318e+00,-2.930795e-01,6.723181e-01,2.111591e-01,3.446362e-01,3.514179e+00,-6.056718e+00,-1.028359e+00,2.113436e+00,-1.391795e-01,1.533590e-01,2.907489e+00,-2.384362e-01,7.259914e+00,-6.519829e+00,-1.259915e+00,7.599147e-01,2.599147e-01,5.396589e-01,1.448295e-01,2.634543e+00,-3.269087e+00,-5.076347e+00,-7.690867e-01,4.305387e+00,-5.763469e-01,1.631735e-01,2.013469e-01,3.053876e-01,2.886203e+00,-2.357753e-01,7.089622e+00,-1.544811e+00,1.089622e+00,5.896217e-01,2.716974e+00,-2.146217e-01,3.584869e-01,3.735791e+00,-6.943163e+00,-5.886326e+00,-9.715816e-01,4.715816e-01,1.772653e+00,6.181225e+00,-1.090613e+00,2.362451e+00,-2.724903e+00,-2.156128e-01,5.799222e+00,-3.799222e+00,-7.196888e+00,-6.393776e+00,-1.196888e+00,6.968881e-01,2.234440e-01,6.300419e+00,-1.150210e+00,2.600839e+00,-3.201679e+00,-4.806716e+00,-7.016792e-01,2.258396e-01,6.453733e+00,-4.907467e+00,-7.268668e-01,2.384334e-01,7.259738e+00,-1.629869e+00,1.259739e+00,3.038955e+00,-4.155822e+00,-5.389555e-01,1.444777e-01,2.623288e+00,-3.246576e+00,-4.986305e+00,-7.465762e-01,3.972610e+00,-4.931525e-01,1.945220e+00,1.890440e+00,1.780880e+00,6.247042e+00,-1.123521e+00,6.235209e-01,2.988168e+00,-3.976335e+00,-7.905341e+00,-7.810683e+00,-7.621366e+00,-7.242732e+00,-1.621366e+00,1.242732e+00,7.427323e-01,3.941859e+00,-7.767435e+00,-7.534870e+00,-7.069740e+00,-6.139481e+00,-4.278962e+00,-5.697404e-01,1.598702e-01,3.115847e+00,-4.463388e+00,-2.463388e+00,-2.926777e+00,-3.853553e+00,-4.633884e-01,1.707107e+00,1.414214e+00,3.656856e+00,-4.142139e-01,1.313711e+00,8.137114e-01,5.019382e+00,-3.019383e+00,-4.077531e+00,-5.193827e-01,2.155062e+00,-2.310124e+00,-1.637655e-01,3.240497e+00,-3.101243e-01,2.961989e+00,-2.452486e-01,4.809945e-01,1.847956e+00,1.695912e+00,1.391823e+00,3.567294e+00,-3.918234e-01,1.134587e+00,2.538350e+00,-3.076700e+00,-4.306800e+00,-2.306801e+00,-1.633501e-01,3.227203e+00,-4.908812e+00,-7.272030e-01,2.386015e-01,7.270497e+00,-1.635249e+00,1.270497e+00,7.704974e-01,4.327960e+00,-5.819899e-01,1.659950e-01,3.311840e+00,-5.247359e+00,-3.247360e+00,-3.118399e-01,2.989438e+00,-2.486798e-01,4.947191e-01,1.957753e+00,7.662025e+00,-1.831013e+00,6.648101e+00,-1.324051e+00,8.240506e-01,5.184810e+00,-3.184810e+00,-4.739239e+00,-2.739239e+00,-3.478479e+00,-5.913915e+00,-9.784787e-01,7.655660e+00,-1.827830e+00,6.622642e+00,-1.311321e+00,8.113210e-01,4.981135e+00,-7.452839e-01,3.962271e+00,-7.849086e+00,-7.698173e+00,-7.396346e+00,-1.698173e+00,5.585384e+00,-8.963460e-01,3.963460e-01,4.683074e+00,-2.683074e+00,-3.366148e+00,-5.464590e+00,-3.464590e+00,-3.661475e-01,3.858361e+00,-7.433444e+00,-1.716722e+00,1.433444e+00,3.733778e+00,-4.334446e-01,5.870226e+00,-9.675565e-01,7.480905e+00,-6.961811e+00,-5.923622e+00,-9.809054e-01,7.694487e+00,-7.388974e+00,-1.694487e+00,5.555898e+00,-3.555898e+00,-6.223591e+00,-1.111796e+00,2.447182e+00,-2.894365e+00,-3.788729e+00,-7.154918e+00,-1.577459e+00,4.619672e+00,-2.619672e+00,-2.024590e-01,3.098361e-01,7.393445e-01,3.914756e+00,-7.659024e+00,-7.318048e+00,-1.659024e+00,1.318048e+00,3.272192e+00,-3.180481e-01,7.Line truncated
title = 'Task rand'
interval = 1e-5
xlabel = 't'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package rand_data is
constant expected : real_array( 0 to 1023 ) := (1.300000e+00,3.200000e+00,-4.799999e+00,-2.799999e+00,-3.599999e+00,-6.399997e+00,-4.799994e+00,-2.799994e+00,-2.249992e-01,6.399951e+00,-1.199976e+00,6.999756e-01,3.599805e+00,-6.399220e+00,-1.199610e+00,6.996100e-01,3.596880e+00,-6.387521e+00,-1.193760e+00,6.937605e-01,3.550084e+00,-6.200335e+00,-1.100167e+00,6.001674e-01,2.801339e+00,-3.602679e+00,-4.006697e-01,1.205358e+00,2.821431e+00,-3.642863e+00,-4.107157e-01,1.285726e+00,7.857258e-01,4.571613e+00,-2.571613e+00,-1.964517e-01,2.858067e-01,2.572907e+00,-3.145815e+00,-2.864537e-01,2.583259e+00,-1.979074e-01,2.916298e-01,2.666076e+00,-2.082595e-01,3.330381e-01,3.328610e+00,-3.321525e-01,8.286101e-01,5.257762e+00,-8.144405e-01,3.144405e-01,3.031048e+00,-2.577621e-01,2.124194e+00,-1.405242e-01,2.496775e+00,-1.870969e-01,3.987101e+00,-4.967754e-01,7.896811e+00,-1.948406e+00,1.896811e+00,1.793623e+00,1.587246e+00,1.174492e+00,2.697970e+00,-3.395941e+00,-5.583763e+00,-3.583763e+00,-6.335051e+00,-4.670102e+00,-2.670102e+00,-2.087628e-01,3.350511e-01,3.360817e+00,-3.402044e-01,3.443270e+00,-5.773082e+00,-9.432705e-01,4.432705e-01,6.184658e+00,-1.092329e+00,2.369315e+00,-1.711644e-01,3.477261e+00,-3.693151e-01,3.909042e+00,-7.636170e+00,-7.272340e+00,-1.636170e+00,1.272340e+00,7.723404e-01,4.357446e+00,-5.893615e-01,2.714892e+00,-3.429785e+00,-5.719140e+00,-3.719140e+00,-4.297851e-01,5.753124e+00,-9.382810e-01,4.382810e-01,1.506248e+00,4.049984e+00,-5.124960e-01,2.099968e+00,-2.199937e+00,-1.499921e-01,2.799747e+00,-3.599495e+00,-6.397979e+00,-1.198989e+00,6.989895e-01,2.244947e-01,3.979789e-01,1.183831e+00,6.838312e-01,3.470650e+00,-5.882600e+00,-9.706501e-01,4.706501e-01,7.060803e+00,-6.121607e+00,-1.060804e+00,5.608035e-01,2.486428e+00,-1.858036e-01,3.945714e+00,-7.782858e+00,-7.565716e+00,-7.131432e+00,-1.565716e+00,1.131432e+00,6.314318e-01,1.907159e-01,4.205817e+00,-2.205817e+00,-2.411635e+00,-2.823270e+00,-3.646540e+00,-4.116349e-01,1.293079e+00,3.172318e+00,-2.930795e-01,6.723181e-01,2.111591e-01,3.446362e-01,3.514179e+00,-6.056718e+00,-1.028359e+00,2.113436e+00,-1.391795e-01,1.533590e-01,2.907489e+00,-2.384362e-01,7.259914e+00,-6.519829e+00,-1.259915e+00,7.599147e-01,2.599147e-01,5.396589e-01,1.448295e-01,2.634543e+00,-3.269087e+00,-5.076347e+00,-7.690867e-01,4.305387e+00,-5.763469e-01,1.631735e-01,2.013469e-01,3.053876e-01,2.886203e+00,-2.357753e-01,7.089622e+00,-1.544811e+00,1.089622e+00,5.896217e-01,2.716974e+00,-2.146217e-01,3.584869e-01,3.735791e+00,-6.943163e+00,-5.886326e+00,-9.715816e-01,4.715816e-01,1.772653e+00,6.181225e+00,-1.090613e+00,2.362451e+00,-2.724903e+00,-2.156128e-01,5.799222e+00,-3.799222e+00,-7.196888e+00,-6.393776e+00,-1.196888e+00,6.968881e-01,2.234440e-01,6.300419e+00,-1.150210e+00,2.600839e+00,-3.201679e+00,-4.806716e+00,-7.016792e-01,2.258396e-01,6.453733e+00,-4.907467e+00,-7.268668e-01,2.384334e-01,7.259738e+00,-1.629869e+00,1.259739e+00,3.038955e+00,-4.155822e+00,-5.389555e-01,1.444777e-01,2.623288e+00,-3.246576e+00,-4.986305e+00,-7.465762e-01,3.972610e+00,-4.931525e-01,1.945220e+00,1.890440e+00,1.780880e+00,6.247042e+00,-1.123521e+00,6.235209e-01,2.988168e+00,-3.976335e+00,-7.905341e+00,-7.810683e+00,-7.621366e+00,-7.242732e+00,-1.621366e+00,1.242732e+00,7.427323e-01,3.941859e+00,-7.767435e+00,-7.534870e+00,-7.069740e+00,-6.139481e+00,-4.278962e+00,-5.697404e-01,1.598702e-01,3.115847e+00,-4.463388e+00,-2.463388e+00,-2.926777e+00,-3.853553e+00,-4.633884e-01,1.707107e+00,1.414214e+00,3.656856e+00,-4.142139e-01,1.313711e+00,8.137114e-01,5.019382e+00,-3.019383e+00,-4.077531e+00,-5.193827e-01,2.155062e+00,-2.310124e+00,-1.637655e-01,3.240497e+00,-3.101243e-01,2.961989e+00,-2.452486e-01,4.809945e-01,1.847956e+00,1.695912e+00,1.391823e+00,3.567294e+00,-3.918234e-01,1.134587e+00,2.538350e+00,-3.076700e+00,-4.306800e+00,-2.306801e+00,-1.633501e-01,3.227203e+00,-4.908812e+00,-7.272030e-01,2.386015e-01,7.270497e+00,-1.635249e+00,1.270497e+00,7.704974e-01,4.327960e+00,-5.819899e-01,1.659950e-01,3.311840e+00,-5.247359e+00,-3.247360e+00,-3.118399e-01,2.989438e+00,-2.486798e-01,4.947191e-01,1.957753e+00,7.662025e+00,-1.831013e+00,6.648101e+00,-1.324051e+00,8.240506e-01,5.184810e+00,-3.184810e+00,-4.739239e+00,-2.739239e+00,-3.478479e+00,-5.913915e+00,-9.784787e-01,7.655660e+00,-1.827830e+00,6.622642e+00,-1.311321e+00,8.113210e-01,4.981135e+00,-7.452839e-01,3.962271e+00,-7.849086e+00,-7.698173e+00,-7.396346e+00,-1.698173e+00,5.585384e+00,-8.963460e-01,3.963460e-01,4.683074e+00,-2.683074e+00,-3.366148e+00,-5.464590e+00,-3.464590e+00,-3.661475e-01,3.858361e+00,-7.433444e+00,-1.716722e+00,1.433444e+00,3.733778e+00,-4.334446e-01,5.870226e+00,-9.675565e-01,7.480905e+00,-6.961811e+00,-5.923622e+00,-9.809054e-01,7.694487e+00,-7.388974e+00,-1.694487e+00,5.555898e+00,-3.555898e+00,-6.223591e+00,-1.111796e+00,2.447182e+00,-2.894365e+00,-3.788729e+00,-7.154918e+00,-1.577459e+00,4.619672e+00,-2.619672e+00,-2.024590e-01,3.098361e-01,7.393445e-01,3.914756e+00,-7.659024e+00,-7.318048e+00,-1.659024e+0Line truncated
end package rand_data;
+3
View File
@@ -0,0 +1,3 @@
#pragma once
float expected_sine [] = {0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07Line truncated
+4
View File
@@ -0,0 +1,4 @@
data = [0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.Line truncated
title = 'Task sine'
interval = 1e-5
xlabel = 't'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package sine_data is
constant expected : real_array( 0 to 1023 ) := (0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,7.803612e-01,-3.496911e-07,-7.803610e-01,-1.530734e+00,-2.222281e+00,-2.828427e+00,-3.325878e+00,-3.695518e+00,-3.923141e+00,-4.000000e+00,-3.923141e+00,-3.695518e+00,-3.325879e+00,-2.828428e+00,-2.222281e+00,-1.530734e+00,-7.803609e-01,0.000000e+00,7.803613e-01,1.530734e+00,2.222281e+00,2.828427e+00,3.325878e+00,3.695518e+00,3.923141e+00,4.000000e+00,3.923141e+00,3.695518e+00,3.325879e+00,2.828427e+00,2.222281e+00,1.530734e+00,Line truncated
end package sine_data;
+3
View File
@@ -0,0 +1,3 @@
#pragma once
float expected_add_sine_cosine [] = {2.000000e+00,2.779374e+00,3.526787e+00,4.213405e+00,4.812656e+00,5.301255e+00,5.660092e+00,5.874974e+00,5.937166e+00,5.843728e+00,5.597631e+00,5.207640e+00,4.687980e+00,4.057790e+00,3.340388e+00,2.562374e+00,1.752613e+00,9.411229e-01,1.579220e-01,-5.681200e-01,-1.210393e+00,-1.745568e+00,-2.154491e+00,-2.422919e+00,-2.542063e+00,-2.508927e+00,-2.326424e+00,-2.003255e+00,-1.553580e+00,-9.964672e-01,-3.551633e-01,3.438057e-01,1.071653e+00,1.798444e+00,2.494241e+00,3.130262e+00,3.679986e+00,4.120174e+00,4.431767e+00,4.600617e+00,4.618034e+00,4.481123e+00,4.192898e+00,3.762165e+00,3.203190e+00,2.535150e+00,1.781400e+00,9.685777e-01,1.255806e-01,-7.175396e-01,-1.530734e+00,-2.285103e+00,-2.954008e+00,-3.514094e+00,-3.946185e+00,-4.236010e+00,-4.374763e+00,-4.359427e+00,-4.192897e+00,-3.883861e+00,-3.446462e+00,-2.899757e+00,-2.266983e+00,-1.574657e+00,-8.515586e-01,-1.276198e-01,5.672264e-01,1.204198e+00,1.756773e+00,2.201711e+00,2.519947e+00,2.697327e+00,2.725152e+00,2.600517e+00,2.326424e+00,1.911665e+00,1.370490e+00,7.220587e-01,-1.029217e-02,-7.999491e-01,-1.618035e+00,-2.434522e+00,-3.219390e+00,-3.943765e+00,-4.581040e+00,-5.107891e+00,-5.505172e+00,-5.758650e+00,-5.859553e+00,-5.804903e+00,-5.597631e+00,-5.246466e+00,-4.765594e+00,-4.174115e+00,-3.495308e+00,-2.755738e+00,-1.984229e+00,-1.210763e+00,-4.653196e-01,2.232679e-01,8.284271e-01,1.326865e+00,1.699465e+00,1.932017e+00,2.015770e+00,1.947764e+00,1.730944e+00,1.374045e+00,8.912609e-01,3.016934e-01,-3.713790e-01,-1.101400e+00,-1.859553e+00,-2.615870e+00,-3.340388e+00,-4.004294e+00,-4.581040e+00,-5.047362e+00,-5.384174e+00,-5.577302e+00,-5.618033e+00,-5.503450e+00,-5.236544e+00,-4.826100e+00,-4.286365e+00,-3.636495e+00,-2.899828e+00,-2.102985e+00,-1.274848e+00,-4.454529e-01,3.551632e-01,1.098114e+00,1.756774e+00,2.307796e+00,2.732011e+00,3.015160e+00,3.148441e+00,3.128845e+00,2.959269e+00,2.648403e+00,2.210393e+00,1.664299e+00,1.033354e+00,3.440749e-01,-3.747628e-01,-1.093230e+00,-1.781400e+00,-2.410498e+00,-2.954008e+00,-3.388699e+00,-3.695518e+00,-3.860319e+00,-3.874418e+00,-3.734925e+00,-3.444852e+00,-3.013011e+00,-2.453665e+00,-1.785994e+00,-1.033353e+00,-2.223782e-01,6.180345e-01,1.457838e+00,2.266983e+00,3.016577e+00,3.679986e+00,4.233859e+00,4.659025e+00,4.941224e+00,5.071653e+00,5.047308e+00,4.871089e+00,4.551693e+00,4.103275e+00,3.544904e+00,2.899828e+00,2.194575e+00,1.457937e+00,7.198612e-01,1.029289e-02,-6.419711e-01,-1.210393e+00,-1.671717e+00,-2.006862e+00,-2.201657e+00,-2.247386e+00,-2.141128e+00,-1.885864e+00,-1.490369e+00,-9.688745e-01,-3.405195e-01,3.713791e-01,1.140226e+00,1.937166e+00,2.732195e+00,3.495308e+00,4.197658e+00,4.812656e+00,5.317002e+00,5.691571e+00,5.922154e+00,6.000000e+00,5.922154e+00,5.691572e+00,5.317002e+00,4.812656e+00,4.197658e+00,3.495308e+00,2.732195e+00,1.937166e+00,1.140226e+00,3.713793e-01,-3.405197e-01,-9.688740e-01,-1.490369e+00,-1.885864e+00,-2.141128e+00,-2.247387e+00,-2.201657e+00,-2.006862e+00,-1.671718e+00,-1.210394e+00,-6.419711e-01,1.029277e-02,7.198613e-01,1.457937e+00,2.194575e+00,2.899828e+00,3.544905e+00,4.103275e+00,4.551692e+00,4.871089e+00,5.047307e+00,5.071653e+00,4.941224e+00,4.659025e+00,4.233860e+00,3.679986e+00,3.016576e+00,2.266983e+00,1.457837e+00,6.180337e-01,-2.223787e-01,-1.033354e+00,-1.785995e+00,-2.453664e+00,-3.013009e+00,-3.444852e+00,-3.734925e+00,-3.874419e+00,-3.860320e+00,-3.695518e+00,-3.388700e+00,-2.954008e+00,-2.410498e+00,-1.781400e+00,-1.093230e+00,-3.747630e-01,3.440749e-01,1.033354e+00,1.664299e+00,2.210393e+00,2.648403e+00,2.959269e+00,3.128845e+00,3.148441e+00,3.015160e+00,2.732011e+00,2.307796e+00,1.756773e+00,1.098114e+00,3.551632e-01,-4.454526e-01,-1.274849e+00,-2.102985e+00,-2.899828e+00,-3.636495e+00,-4.286364e+00,-4.826100e+00,-5.236544e+00,-5.503451e+00,-5.618034e+00,-5.577302e+00,-5.384174e+00,-5.047363e+00,-4.581041e+00,-4.004294e+00,-3.340388e+00,-2.615870e+00,-1.859553e+00,-1.101400e+00,-3.713791e-01,3.016937e-01,8.912607e-01,1.374045e+00,1.730944e+00,1.947764e+00,2.015770e+00,1.932017e+00,1.699465e+00,1.326866e+00,8.284271e-01,2.232677e-01,-4.653195e-01,-1.210763e+00,-1.984230e+00,-2.755738e+00,-3.495308e+00,-4.174115e+00,-4.765593e+00,-5.246465e+00,-5.597631e+00,-5.804903e+00,-5.859553e+00,-5.758650e+00,-5.505172e+00,-5.107892e+00,-4.581041e+00,-3.943766e+00,-3.219390e+00,-2.434522e+00,-1.618034e+00,-7.999483e-01,-1.029229e-02,7.220592e-01,1.370490e+00,1.911665e+00,2.326424e+00,2.600517e+00,2.725152e+00,2.697327e+00,2.519948e+00,2.201712e+00,1.756774e+00,1.204198e+00,5.672265e-01,-1.276198e-01,-8.515589e-01,-1.574657e+00,-2.266983e+00,-2.899757e+00,-3.446461e+00,-3.883860e+00,-4.192898e+00,-4.359427e+00,-4.374763e+00,-4.236010e+00,-3.946184e+00,-3.514095e+00,-2.954008e+00,-2.285102e+00,-1.530733e+00,-7.175391e-01,1.255814e-01,9.685774e-01,1.781400e+00,2.535149e+00,3.203189e+00,3.762165e+00,4.192898e+00,4.481124e+00,4.618034e+00,4.600617e+00,4.431767e+00,4.120174e+00,3.679986e+00,3.130261e+00,2.494241e+00,1.798444eLine truncated
+4
View File
@@ -0,0 +1,4 @@
data = [2.000000e+00,2.779374e+00,3.526787e+00,4.213405e+00,4.812656e+00,5.301255e+00,5.660092e+00,5.874974e+00,5.937166e+00,5.843728e+00,5.597631e+00,5.207640e+00,4.687980e+00,4.057790e+00,3.340388e+00,2.562374e+00,1.752613e+00,9.411229e-01,1.579220e-01,-5.681200e-01,-1.210393e+00,-1.745568e+00,-2.154491e+00,-2.422919e+00,-2.542063e+00,-2.508927e+00,-2.326424e+00,-2.003255e+00,-1.553580e+00,-9.964672e-01,-3.551633e-01,3.438057e-01,1.071653e+00,1.798444e+00,2.494241e+00,3.130262e+00,3.679986e+00,4.120174e+00,4.431767e+00,4.600617e+00,4.618034e+00,4.481123e+00,4.192898e+00,3.762165e+00,3.203190e+00,2.535150e+00,1.781400e+00,9.685777e-01,1.255806e-01,-7.175396e-01,-1.530734e+00,-2.285103e+00,-2.954008e+00,-3.514094e+00,-3.946185e+00,-4.236010e+00,-4.374763e+00,-4.359427e+00,-4.192897e+00,-3.883861e+00,-3.446462e+00,-2.899757e+00,-2.266983e+00,-1.574657e+00,-8.515586e-01,-1.276198e-01,5.672264e-01,1.204198e+00,1.756773e+00,2.201711e+00,2.519947e+00,2.697327e+00,2.725152e+00,2.600517e+00,2.326424e+00,1.911665e+00,1.370490e+00,7.220587e-01,-1.029217e-02,-7.999491e-01,-1.618035e+00,-2.434522e+00,-3.219390e+00,-3.943765e+00,-4.581040e+00,-5.107891e+00,-5.505172e+00,-5.758650e+00,-5.859553e+00,-5.804903e+00,-5.597631e+00,-5.246466e+00,-4.765594e+00,-4.174115e+00,-3.495308e+00,-2.755738e+00,-1.984229e+00,-1.210763e+00,-4.653196e-01,2.232679e-01,8.284271e-01,1.326865e+00,1.699465e+00,1.932017e+00,2.015770e+00,1.947764e+00,1.730944e+00,1.374045e+00,8.912609e-01,3.016934e-01,-3.713790e-01,-1.101400e+00,-1.859553e+00,-2.615870e+00,-3.340388e+00,-4.004294e+00,-4.581040e+00,-5.047362e+00,-5.384174e+00,-5.577302e+00,-5.618033e+00,-5.503450e+00,-5.236544e+00,-4.826100e+00,-4.286365e+00,-3.636495e+00,-2.899828e+00,-2.102985e+00,-1.274848e+00,-4.454529e-01,3.551632e-01,1.098114e+00,1.756774e+00,2.307796e+00,2.732011e+00,3.015160e+00,3.148441e+00,3.128845e+00,2.959269e+00,2.648403e+00,2.210393e+00,1.664299e+00,1.033354e+00,3.440749e-01,-3.747628e-01,-1.093230e+00,-1.781400e+00,-2.410498e+00,-2.954008e+00,-3.388699e+00,-3.695518e+00,-3.860319e+00,-3.874418e+00,-3.734925e+00,-3.444852e+00,-3.013011e+00,-2.453665e+00,-1.785994e+00,-1.033353e+00,-2.223782e-01,6.180345e-01,1.457838e+00,2.266983e+00,3.016577e+00,3.679986e+00,4.233859e+00,4.659025e+00,4.941224e+00,5.071653e+00,5.047308e+00,4.871089e+00,4.551693e+00,4.103275e+00,3.544904e+00,2.899828e+00,2.194575e+00,1.457937e+00,7.198612e-01,1.029289e-02,-6.419711e-01,-1.210393e+00,-1.671717e+00,-2.006862e+00,-2.201657e+00,-2.247386e+00,-2.141128e+00,-1.885864e+00,-1.490369e+00,-9.688745e-01,-3.405195e-01,3.713791e-01,1.140226e+00,1.937166e+00,2.732195e+00,3.495308e+00,4.197658e+00,4.812656e+00,5.317002e+00,5.691571e+00,5.922154e+00,6.000000e+00,5.922154e+00,5.691572e+00,5.317002e+00,4.812656e+00,4.197658e+00,3.495308e+00,2.732195e+00,1.937166e+00,1.140226e+00,3.713793e-01,-3.405197e-01,-9.688740e-01,-1.490369e+00,-1.885864e+00,-2.141128e+00,-2.247387e+00,-2.201657e+00,-2.006862e+00,-1.671718e+00,-1.210394e+00,-6.419711e-01,1.029277e-02,7.198613e-01,1.457937e+00,2.194575e+00,2.899828e+00,3.544905e+00,4.103275e+00,4.551692e+00,4.871089e+00,5.047307e+00,5.071653e+00,4.941224e+00,4.659025e+00,4.233860e+00,3.679986e+00,3.016576e+00,2.266983e+00,1.457837e+00,6.180337e-01,-2.223787e-01,-1.033354e+00,-1.785995e+00,-2.453664e+00,-3.013009e+00,-3.444852e+00,-3.734925e+00,-3.874419e+00,-3.860320e+00,-3.695518e+00,-3.388700e+00,-2.954008e+00,-2.410498e+00,-1.781400e+00,-1.093230e+00,-3.747630e-01,3.440749e-01,1.033354e+00,1.664299e+00,2.210393e+00,2.648403e+00,2.959269e+00,3.128845e+00,3.148441e+00,3.015160e+00,2.732011e+00,2.307796e+00,1.756773e+00,1.098114e+00,3.551632e-01,-4.454526e-01,-1.274849e+00,-2.102985e+00,-2.899828e+00,-3.636495e+00,-4.286364e+00,-4.826100e+00,-5.236544e+00,-5.503451e+00,-5.618034e+00,-5.577302e+00,-5.384174e+00,-5.047363e+00,-4.581041e+00,-4.004294e+00,-3.340388e+00,-2.615870e+00,-1.859553e+00,-1.101400e+00,-3.713791e-01,3.016937e-01,8.912607e-01,1.374045e+00,1.730944e+00,1.947764e+00,2.015770e+00,1.932017e+00,1.699465e+00,1.326866e+00,8.284271e-01,2.232677e-01,-4.653195e-01,-1.210763e+00,-1.984230e+00,-2.755738e+00,-3.495308e+00,-4.174115e+00,-4.765593e+00,-5.246465e+00,-5.597631e+00,-5.804903e+00,-5.859553e+00,-5.758650e+00,-5.505172e+00,-5.107892e+00,-4.581041e+00,-3.943766e+00,-3.219390e+00,-2.434522e+00,-1.618034e+00,-7.999483e-01,-1.029229e-02,7.220592e-01,1.370490e+00,1.911665e+00,2.326424e+00,2.600517e+00,2.725152e+00,2.697327e+00,2.519948e+00,2.201712e+00,1.756774e+00,1.204198e+00,5.672265e-01,-1.276198e-01,-8.515589e-01,-1.574657e+00,-2.266983e+00,-2.899757e+00,-3.446461e+00,-3.883860e+00,-4.192898e+00,-4.359427e+00,-4.374763e+00,-4.236010e+00,-3.946184e+00,-3.514095e+00,-2.954008e+00,-2.285102e+00,-1.530733e+00,-7.175391e-01,1.255814e-01,9.685774e-01,1.781400e+00,2.535149e+00,3.203189e+00,3.762165e+00,4.192898e+00,4.481124e+00,4.618034e+00,4.600617e+00,4.431767e+00,4.120174e+00,3.679986e+00,3.130261e+00,2.494241e+00,1.798444e+00,1.071653e+00,3.438064e-01Line truncated
title = 'Task add_sine_cosine'
interval = 1e-5
xlabel = 't'
+9
View File
@@ -0,0 +1,9 @@
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.test_utility.all;
package sine_cosine_data is
constant expected : real_array( 0 to 1023 ) := (2.000000e+00,2.779374e+00,3.526787e+00,4.213405e+00,4.812656e+00,5.301255e+00,5.660092e+00,5.874974e+00,5.937166e+00,5.843728e+00,5.597631e+00,5.207640e+00,4.687980e+00,4.057790e+00,3.340388e+00,2.562374e+00,1.752613e+00,9.411229e-01,1.579220e-01,-5.681200e-01,-1.210393e+00,-1.745568e+00,-2.154491e+00,-2.422919e+00,-2.542063e+00,-2.508927e+00,-2.326424e+00,-2.003255e+00,-1.553580e+00,-9.964672e-01,-3.551633e-01,3.438057e-01,1.071653e+00,1.798444e+00,2.494241e+00,3.130262e+00,3.679986e+00,4.120174e+00,4.431767e+00,4.600617e+00,4.618034e+00,4.481123e+00,4.192898e+00,3.762165e+00,3.203190e+00,2.535150e+00,1.781400e+00,9.685777e-01,1.255806e-01,-7.175396e-01,-1.530734e+00,-2.285103e+00,-2.954008e+00,-3.514094e+00,-3.946185e+00,-4.236010e+00,-4.374763e+00,-4.359427e+00,-4.192897e+00,-3.883861e+00,-3.446462e+00,-2.899757e+00,-2.266983e+00,-1.574657e+00,-8.515586e-01,-1.276198e-01,5.672264e-01,1.204198e+00,1.756773e+00,2.201711e+00,2.519947e+00,2.697327e+00,2.725152e+00,2.600517e+00,2.326424e+00,1.911665e+00,1.370490e+00,7.220587e-01,-1.029217e-02,-7.999491e-01,-1.618035e+00,-2.434522e+00,-3.219390e+00,-3.943765e+00,-4.581040e+00,-5.107891e+00,-5.505172e+00,-5.758650e+00,-5.859553e+00,-5.804903e+00,-5.597631e+00,-5.246466e+00,-4.765594e+00,-4.174115e+00,-3.495308e+00,-2.755738e+00,-1.984229e+00,-1.210763e+00,-4.653196e-01,2.232679e-01,8.284271e-01,1.326865e+00,1.699465e+00,1.932017e+00,2.015770e+00,1.947764e+00,1.730944e+00,1.374045e+00,8.912609e-01,3.016934e-01,-3.713790e-01,-1.101400e+00,-1.859553e+00,-2.615870e+00,-3.340388e+00,-4.004294e+00,-4.581040e+00,-5.047362e+00,-5.384174e+00,-5.577302e+00,-5.618033e+00,-5.503450e+00,-5.236544e+00,-4.826100e+00,-4.286365e+00,-3.636495e+00,-2.899828e+00,-2.102985e+00,-1.274848e+00,-4.454529e-01,3.551632e-01,1.098114e+00,1.756774e+00,2.307796e+00,2.732011e+00,3.015160e+00,3.148441e+00,3.128845e+00,2.959269e+00,2.648403e+00,2.210393e+00,1.664299e+00,1.033354e+00,3.440749e-01,-3.747628e-01,-1.093230e+00,-1.781400e+00,-2.410498e+00,-2.954008e+00,-3.388699e+00,-3.695518e+00,-3.860319e+00,-3.874418e+00,-3.734925e+00,-3.444852e+00,-3.013011e+00,-2.453665e+00,-1.785994e+00,-1.033353e+00,-2.223782e-01,6.180345e-01,1.457838e+00,2.266983e+00,3.016577e+00,3.679986e+00,4.233859e+00,4.659025e+00,4.941224e+00,5.071653e+00,5.047308e+00,4.871089e+00,4.551693e+00,4.103275e+00,3.544904e+00,2.899828e+00,2.194575e+00,1.457937e+00,7.198612e-01,1.029289e-02,-6.419711e-01,-1.210393e+00,-1.671717e+00,-2.006862e+00,-2.201657e+00,-2.247386e+00,-2.141128e+00,-1.885864e+00,-1.490369e+00,-9.688745e-01,-3.405195e-01,3.713791e-01,1.140226e+00,1.937166e+00,2.732195e+00,3.495308e+00,4.197658e+00,4.812656e+00,5.317002e+00,5.691571e+00,5.922154e+00,6.000000e+00,5.922154e+00,5.691572e+00,5.317002e+00,4.812656e+00,4.197658e+00,3.495308e+00,2.732195e+00,1.937166e+00,1.140226e+00,3.713793e-01,-3.405197e-01,-9.688740e-01,-1.490369e+00,-1.885864e+00,-2.141128e+00,-2.247387e+00,-2.201657e+00,-2.006862e+00,-1.671718e+00,-1.210394e+00,-6.419711e-01,1.029277e-02,7.198613e-01,1.457937e+00,2.194575e+00,2.899828e+00,3.544905e+00,4.103275e+00,4.551692e+00,4.871089e+00,5.047307e+00,5.071653e+00,4.941224e+00,4.659025e+00,4.233860e+00,3.679986e+00,3.016576e+00,2.266983e+00,1.457837e+00,6.180337e-01,-2.223787e-01,-1.033354e+00,-1.785995e+00,-2.453664e+00,-3.013009e+00,-3.444852e+00,-3.734925e+00,-3.874419e+00,-3.860320e+00,-3.695518e+00,-3.388700e+00,-2.954008e+00,-2.410498e+00,-1.781400e+00,-1.093230e+00,-3.747630e-01,3.440749e-01,1.033354e+00,1.664299e+00,2.210393e+00,2.648403e+00,2.959269e+00,3.128845e+00,3.148441e+00,3.015160e+00,2.732011e+00,2.307796e+00,1.756773e+00,1.098114e+00,3.551632e-01,-4.454526e-01,-1.274849e+00,-2.102985e+00,-2.899828e+00,-3.636495e+00,-4.286364e+00,-4.826100e+00,-5.236544e+00,-5.503451e+00,-5.618034e+00,-5.577302e+00,-5.384174e+00,-5.047363e+00,-4.581041e+00,-4.004294e+00,-3.340388e+00,-2.615870e+00,-1.859553e+00,-1.101400e+00,-3.713791e-01,3.016937e-01,8.912607e-01,1.374045e+00,1.730944e+00,1.947764e+00,2.015770e+00,1.932017e+00,1.699465e+00,1.326866e+00,8.284271e-01,2.232677e-01,-4.653195e-01,-1.210763e+00,-1.984230e+00,-2.755738e+00,-3.495308e+00,-4.174115e+00,-4.765593e+00,-5.246465e+00,-5.597631e+00,-5.804903e+00,-5.859553e+00,-5.758650e+00,-5.505172e+00,-5.107892e+00,-4.581041e+00,-3.943766e+00,-3.219390e+00,-2.434522e+00,-1.618034e+00,-7.999483e-01,-1.029229e-02,7.220592e-01,1.370490e+00,1.911665e+00,2.326424e+00,2.600517e+00,2.725152e+00,2.697327e+00,2.519948e+00,2.201712e+00,1.756774e+00,1.204198e+00,5.672265e-01,-1.276198e-01,-8.515589e-01,-1.574657e+00,-2.266983e+00,-2.899757e+00,-3.446461e+00,-3.883860e+00,-4.192898e+00,-4.359427e+00,-4.374763e+00,-4.236010e+00,-3.946184e+00,-3.514095e+00,-2.954008e+00,-2.285102e+00,-1.530733e+00,-7.175391e-01,1.255814e-01,9.685774e-01,1.781400e+00,2.535149e+00,3.203189e+00,3.762165e+00,4.192898e+00,4.481124e+00,4.618034e+00,4.600617e+00,4.431767e+00,4.120174e+00,3.679986e+00,3.130261e+00,2.49424Line truncated
end package sine_cosine_data;
+11
View File
@@ -0,0 +1,11 @@
test = test_data_channel
bsp_root_dir = ../../../software/signal_processing_bsp
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/data_channel.c \
test_data_channel.c \
main.c \
include ../device_test.mk
+12
View File
@@ -0,0 +1,12 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "test_data_channel.h"
int main() {
test_data_channels();
return 0;
}
@@ -0,0 +1,232 @@
#include "test_data_channel.h"
#include "../device_test.h"
#include "../../software/signal_processing/system/data_channel.h"
#include <system.h>
#include <stdio.h>
#include <inttypes.h>
int assert_data_channel_binding_eq( uint32_t base, uint32_t expected ) {
uint32_t binding = data_channel_get_binding( base );
if ( binding != expected ) {
printf( TEST_FAIL " assert_data_channel_binding_eq %" PRIu32 " != %" PRIu32 "\n", expected, binding );
}
return binding;
}
int assert_data_channel_empty( uint32_t base ) {
uint32_t empty = data_channel_is_empty( base );
if ( ! empty ) {
printf( TEST_FAIL " assert_data_channel_empty\n" );
}
return empty;
}
int assert_not_empty( uint32_t base ) {
uint32_t empty = data_channel_is_empty( base );
if ( empty ) {
printf( TEST_FAIL " assert_not_empty\n" );
}
return ! empty;
}
int assert_data_channel_full( uint32_t base ) {
uint32_t full = data_channel_is_full( base );
if ( ! full ) {
printf( TEST_FAIL " assert_data_channel_full\n" );
}
return full;
}
int assert_not_full( uint32_t base ) {
uint32_t full = data_channel_is_full( base );
if ( full ) {
printf( TEST_FAIL " assert_not_full\n" );
}
return ! full;
}
int assert_data_channel_level_eq( uint32_t base, uint32_t expected ) {
uint32_t level = data_channel_level( base );
if ( level != expected ) {
printf( TEST_FAIL " assert_data_channel_level_eq %" PRIu32 " != %" PRIu32 "\n", expected, level );
}
return level == expected;
}
int assert_data_channel_read_eq( uint32_t base, uint32_t expected ) {
uint32_t readdata;
int ret = data_channel_read( base, & readdata );
if ( ret ) {
printf( TEST_FAIL " %s data_channel empty\n", __func__ );
return 0;
}
if ( readdata != expected ) {
printf( TEST_FAIL " %s %" PRIu32 " != %" PRIu32 "\n", __func__, expected, readdata );
return 0;
}
return 1;
}
int test_data_channel_reset_values( uint32_t channel ) {
printf( " %s %" PRIu32 " ...", __func__, channel );
uint32_t base = data_channel_base_from_number( channel );
data_channel_clear( base );
if ( ! assert_data_channel_empty( base ) ) {
return 1;
}
if ( ! assert_not_full( base ) ) {
return 1;
}
if ( ! assert_data_channel_level_eq( base, 0 ) ) {
return 1;
}
printf( TEST_OK "\n" );
return 0;
}
int test_data_channel_sw_single_write_read( uint32_t channel ) {
printf( " %s %" PRIu32 " ...", __func__, channel );
uint32_t base = data_channel_base_from_number( channel );
DataChannelBinding binding = { BINDING_SW, BINDING_SW };
data_channel_bind( base, & binding );
uint32_t value = 0xa5a5f00f;
data_channel_write( base, value );
if ( ! assert_data_channel_level_eq( base, 1 ) ) {
return 1;
}
if ( ! assert_data_channel_read_eq( base, value ) ) {
return 1;
}
printf( TEST_OK "\n" );
return 0;
}
int test_data_channel_sw_fill_read( uint32_t channel ) {
printf( " %s ...", __func__ );
uint32_t base = data_channel_base_from_number( channel );
DataChannelBinding binding = { BINDING_SW, BINDING_SW };
data_channel_bind( base, & binding );
data_channel_clear( base );
if ( ! assert_data_channel_empty( base ) ) {
return 1;
}
printf( " write ..." );
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) {
if ( ! assert_data_channel_level_eq( base, i ) ) {
return 1;
}
data_channel_write( base, i );
}
if ( ! assert_data_channel_full( base ) ) {
return 1;
}
if ( ! assert_data_channel_level_eq( base, 0 ) ) {
return 1;
}
printf( " read ..." );
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) {
assert_data_channel_read_eq( base, i );
if ( ! assert_data_channel_level_eq( base, DATA_CHANNEL_DEPTH - i - 1 ) ) {
return 1;
}
}
if ( ! assert_data_channel_empty( base ) ) {
return 1;
}
if ( ! assert_data_channel_level_eq( base, 0 ) ) {
return 1;
}
printf( TEST_OK "\n" );
return 0;
}
int test_data_channel_sw_fill_clear( uint32_t channel ) {
printf( " %s ...", __func__ );
uint32_t base = data_channel_base_from_number( channel );
DataChannelBinding binding = { BINDING_SW, BINDING_SW };
data_channel_bind( base, & binding );
if ( ! assert_data_channel_empty( base ) ) {
return 1;
}
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) {
if ( ! assert_data_channel_level_eq( base, i ) ) {
return 1;
}
data_channel_write( base, i );
}
if ( ! assert_data_channel_full( base ) ) {
return 1;
}
if ( ! assert_data_channel_level_eq( base, 0 ) ) {
return 1;
}
data_channel_clear( base );
if ( ! assert_data_channel_empty( base ) ) {
return 1;
}
if ( ! assert_data_channel_level_eq( base, 0 ) ) {
return 1;
}
printf( TEST_OK "\n" );
return 0;
}
int test_data_channel( uint32_t channel ) {
int ret = 0;
ret |= test_data_channel_reset_values( channel );
ret |= test_data_channel_sw_single_write_read( channel );
ret |= test_data_channel_sw_fill_read( channel );
ret |= test_data_channel_sw_fill_clear( channel );
return ret;
}
int test_data_channels( void ) {
printf( "%s\n", __func__ );
int ret = 0;
for ( uint32_t i = 0; i < DATA_CHANNEL_COUNT; ++i ) {
ret |= test_data_channel( i );
}
printf( TEST_DONE );
return ret;
}
@@ -0,0 +1,11 @@
#pragma once
#include <inttypes.h>
int test_data_channels( void );
int assert_data_channel_binding_eq( uint32_t base, uint32_t expected );
int assert_data_channel_empty( uint32_t base );
int assert_data_channel_full( uint32_t base );
int assert_data_channel_level_eq( uint32_t base, uint32_t expected );
int assert_data_channel_read_eq( uint32_t base, uint32_t expected );
+9
View File
@@ -0,0 +1,9 @@
extract_python_data = ${scripts}/extract_python_data.sh
plot_data = data.py
artifacts += ${plot_data}
artifacts += __pycache__
include ../device_test.mk
plot: _plot
@${scripts}/plot.py $(expected_data)
+53
View File
@@ -0,0 +1,53 @@
#include "device_test.h"
#include <stdio.h>
#include <math.h>
int device_test( test_function test, uint32_t binding, void * task, void * input_a, void * input_b, void * expected, float epsilon ) {
int ret = test( binding, task, input_a, input_b, expected, epsilon );
printf( TEST_DONE );
return ret;
}
int assert_float_near( float expected, float value, float abs_err ) {
float abs_diff = fabs( expected - value );
int pass = abs_diff <= abs_err;
if ( ! pass ) {
printf( TEST_FAIL " assert_float_near |%e - %e| = %e < %e\n", expected, value, abs_diff, abs_err );
}
return pass;
}
int assert_eq( uint32_t expected, uint32_t value ) {
int pass = expected == value;
if ( ! pass ) {
printf( TEST_FAIL " assert_eq %" PRIx32" = %" PRIx32, expected, value );
}
return pass;
}
void print_float_data_for_python( const float_word * data, uint32_t len ) {
printf( "py_float_data=[%e", data[ 0 ].value );
for ( uint32_t i = 1; i < len; ++i ) {
printf( ",%e", data[ i ].value );
}
printf( "]\n" );
}
void print_hex_data_for_python( const float_word * data, uint32_t len ) {
printf( "py_hex_data=[0x%"PRIx32, data[ 0 ].word );
for ( uint32_t i = 1; i < len; ++i ) {
printf( ",0x%"PRIx32, data[ i ].word );
}
printf( "]\n" );
}
void print_results_for_python( uint32_t cycle_count, const float_word * data, uint32_t len ) {
printf( "py_cycle_count=%"PRIu32"\n", cycle_count );
print_float_data_for_python( data, len );
print_hex_data_for_python( data, len );
}
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include <inttypes.h>
#include "test_function.h"
#include "../../software/signal_processing/system/float_word.h"
#define TEST_OK " [ OK ]"
#define TEST_FAIL " [ FAIL ]"
#define TEST_DONE "test done\n"
int device_test( test_function test, uint32_t binding, void * task, void * input_a, void * input_b, void * expected, float epsilon );
int assert_float_near( float expected, float value, float abs_err );
int assert_eq( uint32_t expected, uint32_t value );
void print_float_data_for_python( const float_word * data, uint32_t len );
void print_hex_data_for_python( const float_word * data, uint32_t len );
void print_results_for_python( uint32_t cycle_count, const float_word * data, uint32_t len );
+92
View File
@@ -0,0 +1,92 @@
elf = $(test).elf
map = $(test).map
ALT_LIBRARY_ROOT_DIR := $(bsp_root_dir)
ABS_BSP_ROOT_DIR := $(shell realpath $(bsp_root_dir))
BSP_INCLUDE_FILE := $(bsp_root_dir)/public.mk
include $(BSP_INCLUDE_FILE)
libbsp = $(bsp_root_dir)/${BSP_LIB}
cross_compile := nios2-elf-
ECHO = echo
LD := $(cross_compile)g++
CC := $(cross_compile)gcc
CXX := $(cross_compile)g++
ldflags += -T$(BSP_LINKER_SCRIPT)
ldflags += -msys-crt0=$(BSP_CRT0)
ldflags += -msys-lib=$(BSP_SYS_LIB)
ldflags += $(addprefix -L,$(ALT_LIBRARY_DIRS))
ldflags += -O2
ldflags += -Wall
ldflags += $(ALT_CFLAGS)
cflags += -O2
cflags += -Wall
cflags += $(ALT_CFLAGS)
include_dirs += $(addprefix -I, $(ALT_INCLUDE_DIRS))
c_objects = $(patsubst %.c,%.o, ${c_sources})
cc_objects = $(patsubst %.cc,%.oo, $(cc_sources))
objects = ${c_objects} ${cc_objects}
execute_on_device_and_read_output = ${scripts}/execute_on_device_and_read_output.sh
check_test_results = ${scripts}/check_test_results.sh
execute_and_highlight = ${scripts}/execute_and_highlight.sh
device_output=device.out
artifacts += ${device_output}
.PHONY: all
all: test remove_device_output
.PHONY: remove_device_output
remove_device_output:
@${RM} -rf ${device_output}
ifdef plot_data
.PHONY: _plot
_plot: ${plot_data} remove_device_output
${plot_data}: ${device_output}
@cat $< | ${extract_python_data} > $@
endif
.PHONY: test
test: ${device_output}
@$(ECHO) Checking test results
@${check_test_results} $<
${device_output}: ${elf} ${execute_on_device_and_read_output}
@$(ECHO) Executing $<
@${execute_and_highlight} ${execute_on_device_and_read_output} ${elf} ${device_output}
${elf}: ${objects} ${linker_script} ${libbsp}
@$(ECHO) Linking $@
@${LD} ${ldflags} ${objects} -o $@
%.oo:%.cc
@$(ECHO) Compiling $<
@${CXX} --std=c++14 ${include_dirs} -c $< -o $@
%.o:%.c
@$(ECHO) Compiling $<
@${CC} $(cflags) ${include_dirs} -c $< -o $@
${libbsp}:
@$(ECHO) Building $(bsp_root_dir)
@$(MAKE) --no-print-directory -C $(bsp_root_dir)
.PHONY: clean
clean:
@$(ECHO) Cleaning test
@${RM} -rf ${objects} ${elf} ${artifacts}
.PHONY: download
download: $(elf)
@nios2-download -r -g $(elf)
+20
View File
@@ -0,0 +1,20 @@
test = test_task_add_sine_cosine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/sine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_add.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/add.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+17
View File
@@ -0,0 +1,17 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_add.h"
#include "../../data/rand.h"
#include "../../data/sine_cosine.h"
#include "../../data/add_rand.h"
int main() {
device_test( test_task, BINDING_HW, & ADD_RAND_CONFIG, expected_rand, expected_add_sine_cosine, expected_add_rand, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_add_sine_cosine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/sine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_add.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/add.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+17
View File
@@ -0,0 +1,17 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_add.h"
#include "../../data/rand.h"
#include "../../data/sine_cosine.h"
#include "../../data/add_rand.h"
int main() {
device_test( test_task, BINDING_SW, & ADD_RAND_CONFIG, expected_rand, expected_add_sine_cosine, expected_add_rand, 5e-2 );
return 0;
}
@@ -0,0 +1,20 @@
test = test_task_add_sine_cosine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/sine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_add.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/add.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
@@ -0,0 +1,17 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_add.h"
#include "../../data/sine.h"
#include "../../data/cosine.h"
#include "../../data/sine_cosine.h"
int main() {
device_test( test_task, BINDING_HW, & ADD_SINE_COSINE_CONFIG, expected_sine, expected_cosine, expected_add_sine_cosine, 5e-2 );
return 0;
}
@@ -0,0 +1,20 @@
test = test_task_add_sine_cosine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/sine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_add.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/add.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
@@ -0,0 +1,17 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_add.h"
#include "../../data/sine.h"
#include "../../data/cosine.h"
#include "../../data/sine_cosine.h"
int main() {
device_test( test_task, BINDING_SW, & ADD_SINE_COSINE_CONFIG, expected_sine, expected_cosine, expected_add_sine_cosine, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_cosine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/cosine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_sine.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/sine.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../software/signal_processing/system/task_sine.h"
#include "../../data/cosine.h"
int main()
{
device_test( test_task, BINDING_HW, & COSINE_CONFIG, NULL, NULL, expected_cosine, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_cosine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/cosine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_sine.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/sine.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../software/signal_processing/system/task_sine.h"
#include "../../data/cosine.h"
int main()
{
device_test( test_task, BINDING_SW, & COSINE_CONFIG, NULL, NULL, expected_cosine, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_crc
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/crc.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_crc.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/crc.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_crc.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_crc.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_crc.h"
#include "../../data/fft.h"
#include "../../data/crc.h"
int main() {
device_test( test_task, BINDING_HW, & CRC_CONFIG, expected_fft, NULL, & expected_crc, 0.0 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_crc
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/crc.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_crc.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/crc.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_crc.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_crc.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_crc.h"
#include "../../data/fft.h"
#include "../../data/crc.h"
int main() {
device_test( test_task, BINDING_SW, & CRC_CONFIG, expected_fft, NULL, & expected_crc, 0.0 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_fft
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/fft.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_fft.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/fft.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_fft.h"
#include "../../data/add_rand.h"
#include "../../data/fft.h"
int main() {
device_test( test_task, BINDING_HW, & FFT_CONFIG, expected_add_rand, NULL, expected_fft, 2e-1 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_fft
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/fft.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_fft.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/fft.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_fft.h"
#include "../../data/add_rand.h"
#include "../../data/fft.h"
int main() {
device_test( test_task, BINDING_SW, & FFT_CONFIG, expected_add_rand, NULL, expected_fft, 2e-1 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_rand
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/rand.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_rand.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/rand.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_rand.h"
#include "../../data/rand.h"
int main()
{
device_test( test_task, BINDING_HW, & RAND_CONFIG, NULL, NULL, expected_rand, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_rand
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/rand.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_rand.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/rand.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_rand.h"
#include "../../data/rand.h"
int main()
{
device_test( test_task, BINDING_SW, & RAND_CONFIG, NULL, NULL, expected_rand, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_sine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/sine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_sine.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/sine.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_sine.h"
#include "../../data/sine.h"
int main()
{
device_test( test_task, BINDING_HW, & SINE_CONFIG, NULL, NULL, expected_sine, 5e-2 );
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
test = test_task_sine
bsp_root_dir = ../../../software/signal_processing_bsp
expected_data = ../../data/sine.py
scripts = ../../scripts
c_sources += \
../../../software/signal_processing/system/task.c \
../../../software/signal_processing/system/hardware_task.c \
../../../software/signal_processing/system/data_channel.c \
../../../software/signal_processing/system/hardware_timestamp.c \
../../../software/signal_processing/system/task_sine.c \
../../../software/signal_processing/system/binding.c \
../../../software/signal_processing/sine.c \
../data_channel/test_data_channel.c \
../device_test.c \
../test_task.c \
main.c \
include ../device_data_test.mk
+15
View File
@@ -0,0 +1,15 @@
#include <stdio.h>
#include <system.h>
#include <inttypes.h>
#include "../device_test.h"
#include "../test_task.h"
#include "../../../software/signal_processing/system/binding.h"
#include "../../../software/signal_processing/system/task_sine.h"
#include "../../data/sine.h"
int main() {
device_test( test_task, BINDING_SW, & SINE_CONFIG, NULL, NULL, expected_sine, 5e-2 );
return 0;
}
+64
View File
@@ -0,0 +1,64 @@
#include "test_crc.h"
#include "../../software/signal_processing/system/task.h"
#include "../../software/signal_processing/system/task_sine.h"
#include "../../software/signal_processing/system/binding.h"
#include "../../software/signal_processing/system/data_channel.h"
#include "../../software/signal_processing/system/float_word.h"
#include "data_channel/test_data_channel.h"
#include "device_test.h"
#include <stdio.h>
#include <system.h>
void write_input_data( uint32_t base, uint32_t binding, void * data ) {
if ( data == NULL ) return;
DataChannelBinding data_channel_binding = { .sink = BINDING_SW, .source = binding };
data_channel_clear( base );
data_channel_bind( base, & data_channel_binding );
data_channel_write_all( base, data, DATA_CHANNEL_DEPTH );
}
int test_task( uint32_t binding, void * task, void * input_a, void * input_b, void * expected, float epsilon ) {
task_base_config * base = ( task_base_config * ) task;
printf( " %s %s %s ...", __func__, base->name, binding_to_string( binding ) );
uint32_t output_channel_base = base->sink;
write_input_data( base->sources[ 0 ], binding, input_a );
write_input_data( base->sources[ 1 ], binding, input_b );
task_bind( task, binding );
DataChannelBinding channel_binding = { .sink = binding, .source = BINDING_SW };
data_channel_clear( output_channel_base );
data_channel_bind( output_channel_base, & channel_binding );
if ( ! assert_data_channel_empty( output_channel_base ) ) {
return 1;
}
task_run( task );
uint32_t cycle_count = task_get_cycle_count( task );
if ( ! assert_data_channel_level_eq( output_channel_base, 1 ) ) {
return 1;
}
uint32_t output = 0;
data_channel_read( output_channel_base, & output );
uint32_t * expected_crc = ( uint32_t * ) expected;
if ( ! assert_eq( expected_crc[ 0 ], output ) ) {
return 1;
}
printf( TEST_OK "\n" );
printf( " cycles: %" PRIu32 "\n", cycle_count );
return 0;
}
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include <inttypes.h>
int test_task( uint32_t binding, void * task, void *, void *, void * expected, float epsilon );
+5
View File
@@ -0,0 +1,5 @@
#pragma once
typedef int ( * test_function )( uint32_t, void * config, void * input_a,
void * input_b, void * expected, float epsilon );
+74
View File
@@ -0,0 +1,74 @@
#include "test_task.h"
#include "../../software/signal_processing/system/task.h"
#include "../../software/signal_processing/system/task_sine.h"
#include "../../software/signal_processing/system/binding.h"
#include "../../software/signal_processing/system/data_channel.h"
#include "../../software/signal_processing/system/float_word.h"
#include "data_channel/test_data_channel.h"
#include "device_test.h"
#include <stdio.h>
#include <system.h>
void write_input_data( uint32_t base, uint32_t binding, void * data ) {
if ( data == NULL ) return;
DataChannelBinding data_channel_binding = { .sink = BINDING_SW, .source = binding };
data_channel_clear( base );
data_channel_bind( base, & data_channel_binding );
data_channel_write_all( base, data, DATA_CHANNEL_DEPTH );
}
int test_task( uint32_t binding, void * task, void * input_a, void * input_b, void * expected, float epsilon ) {
printf( " %s %s ...", __func__, binding_to_string( binding ) );
task_base_config * base = ( task_base_config * ) task;
uint32_t output_channel_base = base->sink;
write_input_data( base->sources[ 0 ], binding, input_a );
write_input_data( base->sources[ 1 ], binding, input_b );
task_bind( task, binding );
DataChannelBinding channel_binding = { .sink = binding, .source = BINDING_SW };
data_channel_clear( output_channel_base );
data_channel_bind( output_channel_base, & channel_binding );
if ( ! assert_data_channel_empty( output_channel_base ) ) {
return 1;
}
task_run( task );
uint32_t cycle_count = task_get_cycle_count( task );
if ( ! assert_data_channel_full( output_channel_base ) ) {
return 1;
}
if ( ! assert_data_channel_level_eq( output_channel_base, 0 ) ) {
return 1;
}
float_word output[ DATA_CHANNEL_DEPTH ];
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) {
data_channel_read( output_channel_base, & output[ i ].word );
}
print_results_for_python( cycle_count, output, DATA_CHANNEL_DEPTH );
float * expected_sine = ( float * ) expected;
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) {
if ( ! assert_float_near( expected_sine[ i ], output[ i ].value, epsilon ) ) {
return 1;
}
}
printf( TEST_OK "\n" );
printf( " cycles: %" PRIu32 "\n", cycle_count );
return 0;
}
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include <inttypes.h>
int test_task( uint32_t binding, void * task, void *, void *, void * expected, float epsilon );
+9
View File
@@ -0,0 +1,9 @@
artifacts += data.py __pycache__
CHECK_RESULTS = true
include ../vhdl.mk
plot: CHECK_RESULTS = false
plot: sim
@echo Plotting resulting signal vs. expected signal ...
@../../scripts/plot.py ${expected_data} 2> /dev/null
+59
View File
@@ -0,0 +1,59 @@
#
#
#
#
# Make sure that the top level is assigned to main
$(if $(main),,\
$(error Assign top level entity name to variable "main"))
# Make sure that at least on vhdl source is assigned
$(if $(vhdl_srcs),,\
$(error Assign at least on vhdl source to variable "vhdl_srcs"))
# Append prefix -d to all generics
generics = $(addprefix -g,$(generics))
# Add VHDL 2008 as default build standard
vhdl_flags += --std=08
vhdl_objs = $(vhdl_srcs:.vhd=.o)
assert_level := error
.PHONY: sim clean
sim: ${main}
@../../scripts/execute_and_highlight.sh ghdl -r ${vhdl_flags} ${main} -gCHECK_RESULTS=${CHECK_RESULTS} \
--read-wave-opt=${main}.wave \
--assert-level=${assert_level}
gui: ${main}.ghw
@echo "Viewing $<"
@gtkwave $< --script=gtkwave.view
${main}.ghw: ${main} ${main}.wave
@ghdl -r ${vhdl_flags} ${main} \
--read-wave-opt=${main}.wave \
--wave=$@
${main}: $(vhdl_objs)
@echo "Elaborating ${main}"
@ghdl -e ${vhdl_flags} ${main}
%.o: %.vhd
@echo "Analysing $<"
@ghdl -a ${vhdl_flags} $<
clean:
@ghdl --clean
@rm -rf ${main}.ghw work-obj08.cf ${vhdl_objs} ${main} ${artifacts}
help:
@echo Use ghdl to simulate and synthesis a vhdl design.
@echo
@echo Build configuration variables:
@echo main main entity
@echo vhdl_flags
@echo generics
+63
View File
@@ -0,0 +1,63 @@
#
#
#
#
# Make sure that the top level is assigned to main
$(if $(main),,\
$(error Assign top level entity name to variable "main"))
# Make sure that at least on vhdl source is assigned
$(if $(vhdl_srcs),,\
$(error Assign at least on vhdl source to variable "vhdl_srcs"))
# Append prefix -d to all generics
generics = $(addprefix -g,$(generics))
# Add VHDL 2008 as default build standard
vhdl_flags += -2008
vhdl_objs = $(vhdl_srcs:.vhd=.vhdo)
verilog_objs = $(verilog_srcs:.v=.vo)
assert_level := error
.PHONY: sim clean
sim: ${verilog_objs} ${vhdl_objs}
@vsim -gCHECK_RESULTS=${CHECK_RESULTS} -voptargs=+acc -c work.${main} -do "set StdArithNoWarnings 1; set NumericStdNoWarnings 1; run -all" \
| ../../scripts/highlight_test_results.sh
gui: ${verilog_objs} ${vhdl_objs}
@vsim -gCHECK_RESULTS=${CHECK_RESULTS} -gGUI_MODE=true -voptargs=+acc work.${main} -do "do vsim.wave; set StdArithNoWarnings 1; set NumericStdNoWarnings 1; run -all"
%.vo: %.v .libwork
@echo "Analysing $<"
@vlog -work work ${verilog_flags} $<
%.vhdo: %.vhd .libwork
@echo "Analysing $<"
@vcom -work work ${vhdl_flags} $<
.libwork:
@vlib work && vmap work work && touch $@
clean:
@rm -rf work \
.libwork \
transcript \
modelsim.ini \
vlog.opt \
vsim.wlf \
data.py \
data.pyc \
help:
@echo Use ghdl to simulate and synthesis a vhdl design.
@echo
@echo Build configuration variables:
@echo main main entity
@echo vhdl_flags
@echo generics
+28
View File
@@ -0,0 +1,28 @@
vhdl_srcs = ../../../hardware/system/reg32.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/avalon_slave.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/float_add.vhd \
../../../hardware/signal_processing/add.vhd \
../../../hardware/system/task_add.vhd \
../../../hardware/system/data_channel_control.vhd \
../../../hardware/system/data_sink_mux.vhd \
../../../hardware/system/data_source_mux.vhd \
../../../hardware/system/fifo.vhd \
../../../hardware/system/data_channel.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../test_data_channel.vhd \
../../data/sine_cosine.vhd \
../../data/rand.vhd \
../../data/add_rand.vhd \
test_task_add_rand.vhd \
main = test_task_add_rand
expected_data = ../../data/add_rand.py
include ../data_tests.mk
@@ -0,0 +1,184 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
use work.test_hardware_task.all;
use work.test_data_channel_pkg.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_add_rand is
generic( CHECK_RESULTS : boolean; GUI_MODE : boolean := false );
end entity test_task_add_rand;
architecture test of test_task_add_rand is
procedure test_configure( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable writedata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_configure ... " );
index := 0;
writedata := x"08000000"; -- 2^32 / 32
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 1;
writedata := x"00000000";
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 2;
writedata := x"40800000"; -- 2 ** 2 = 4 float
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_configure;
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal data_channel_req : work.avalon_slave.Request;
signal data_channel_rsp : work.avalon_slave.Response;
signal signal_a_read : std_logic;
signal signal_a_readdata : std_logic_vector( 31 downto 0 );
signal signal_b_read : std_logic;
signal signal_b_readdata : std_logic_vector( 31 downto 0 );
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
signal data_channel_read : std_logic;
signal data_channel_readdata : std_logic_vector( 31 downto 0 );
begin
dut : entity work.task_add
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_a_read => signal_a_read,
signal_a_readdata => signal_a_readdata,
signal_b_read => signal_b_read,
signal_b_readdata => signal_b_readdata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
u_data_channel : entity work.data_channel
port map (
clk => clk,
reset => reset,
ctrl_address => data_channel_req.address,
ctrl_read => data_channel_req.read,
ctrl_readdata => data_channel_rsp.readdata,
ctrl_write => data_channel_req.write,
ctrl_writedata => data_channel_req.writedata,
hw_sink_write => signal_write,
hw_sink_writedata => signal_writedata,
hw_source_read => data_channel_read,
hw_source_readdata => data_channel_readdata
);
clk <= not clk after 10 ns;
reset_release : process is
begin
wait for 35 ns;
reset <= '0';
wait;
end process reset_release;
input_data_a_simulus: process is
variable index : integer := 0;
begin
while true loop
signal_a_readdata <= to_std_logic_vector( to_float( work.sine_cosine_data.expected( index ) ) );
wait until rising_edge( signal_a_read );
if ( index < 1023 ) then
index := index + 1;
end if;
end loop;
end process input_data_a_simulus;
input_data_b_simulus: process is
variable index : integer := 0;
begin
while true loop
signal_b_readdata <= to_std_logic_vector( to_float( work.rand_data.expected( index ) ) );
wait until rising_edge( signal_b_read );
if ( index < 1023 ) then
index := index + 1;
end if;
end loop;
end process input_data_b_simulus;
stimulus: process is
variable data_channel_config : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
std.textio.write( std.textio.OUTPUT, "--------------------------------------------------------------------------------" & LF );
std.textio.write( std.textio.OUTPUT, "Starting test_task_add_rand" & LF );
wait until falling_edge( reset );
wait until falling_edge( clk );
work.test_data_channel_pkg.write_and_assert_config( clk => clk,
req => data_channel_req,
rsp => data_channel_rsp,
config => data_channel_config );
test_configure( clk => clk, req => req, rsp => rsp );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
for i in 0 to 10 loop
wait until falling_edge( clk );
end loop;
if ( CHECK_RESULTS ) then
check_and_write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp,
expected => work.add_rand_data.expected );
else
write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp );
end if;
if ( GUI_MODE ) then
std.env.stop;
else
std.env.finish;
end if;
end process stimulus;
end architecture test;
@@ -0,0 +1,5 @@
$ version 1.1
/test_task_add_sine_cosine/*
/test_task_add_sine_cosine/dut/*
/test_task_add_sine_cosine/dut/u_add/*
/test_task_add_sine_cosine/dut/u_add/u_float_add/*
+2
View File
@@ -0,0 +1,2 @@
add wave -position end sim:/test_task_add_rand/dut/u_add/*
@@ -0,0 +1,28 @@
vhdl_srcs = ../../../hardware/system/reg32.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/avalon_slave.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/float_add.vhd \
../../../hardware/signal_processing/add.vhd \
../../../hardware/system/task_add.vhd \
../../../hardware/system/data_channel_control.vhd \
../../../hardware/system/data_sink_mux.vhd \
../../../hardware/system/data_source_mux.vhd \
../../../hardware/system/fifo.vhd \
../../../hardware/system/data_channel.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../test_data_channel.vhd \
../../data/sine.vhd \
../../data/cosine.vhd \
../../data/sine_cosine.vhd \
test_task_add_sine_cosine.vhd \
main = test_task_add_sine_cosine
expected_data = ../../data/sine_cosine.py
include ../data_tests.mk
@@ -0,0 +1,185 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
use work.sine_data.all;
use work.test_hardware_task.all;
use work.test_data_channel_pkg.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_add_sine_cosine is
generic( CHECK_RESULTS : boolean; GUI_MODE : boolean := false );
end entity test_task_add_sine_cosine;
architecture test of test_task_add_sine_cosine is
procedure test_configure( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable writedata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_configure ... " );
index := 0;
writedata := x"08000000"; -- 2^32 / 32
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 1;
writedata := x"00000000";
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 2;
writedata := x"40800000"; -- 2 ** 2 = 4 float
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_configure;
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal data_channel_req : work.avalon_slave.Request;
signal data_channel_rsp : work.avalon_slave.Response;
signal signal_a_read : std_logic;
signal signal_a_readdata : std_logic_vector( 31 downto 0 );
signal signal_b_read : std_logic;
signal signal_b_readdata : std_logic_vector( 31 downto 0 );
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
signal data_channel_read : std_logic;
signal data_channel_readdata : std_logic_vector( 31 downto 0 );
begin
dut : entity work.task_add
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_a_read => signal_a_read,
signal_a_readdata => signal_a_readdata,
signal_b_read => signal_b_read,
signal_b_readdata => signal_b_readdata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
u_data_channel : entity work.data_channel
port map (
clk => clk,
reset => reset,
ctrl_address => data_channel_req.address,
ctrl_read => data_channel_req.read,
ctrl_readdata => data_channel_rsp.readdata,
ctrl_write => data_channel_req.write,
ctrl_writedata => data_channel_req.writedata,
hw_sink_write => signal_write,
hw_sink_writedata => signal_writedata,
hw_source_read => data_channel_read,
hw_source_readdata => data_channel_readdata
);
clk <= not clk after 10 ns;
reset_release : process is
begin
wait for 35 ns;
reset <= '0';
wait;
end process reset_release;
input_data_a_simulus: process is
variable index : integer := 0;
begin
while true loop
signal_a_readdata <= to_std_logic_vector( to_float( work.sine_data.expected( index ) ) );
wait until rising_edge( signal_a_read );
if ( index < 1023 ) then
index := index + 1;
end if;
end loop;
end process input_data_a_simulus;
input_data_b_simulus: process is
variable index : integer := 0;
begin
while true loop
signal_b_readdata <= to_std_logic_vector( to_float( work.cosine_data.expected( index ) ) );
wait until rising_edge( signal_b_read );
if ( index < 1023 ) then
index := index + 1;
end if;
end loop;
end process input_data_b_simulus;
stimulus: process is
variable data_channel_config : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
std.textio.write( std.textio.OUTPUT, "--------------------------------------------------------------------------------" & LF );
std.textio.write( std.textio.OUTPUT, "Starting test_task_add_sine_cosine" & LF );
wait until falling_edge( reset );
wait until falling_edge( clk );
work.test_data_channel_pkg.write_and_assert_config( clk => clk,
req => data_channel_req,
rsp => data_channel_rsp,
config => data_channel_config );
test_configure( clk => clk, req => req, rsp => rsp );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
for i in 0 to 10 loop
wait until falling_edge( clk );
end loop;
if ( CHECK_RESULTS ) then
check_and_write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp,
expected => work.sine_cosine_data.expected );
else
write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp );
end if;
if ( GUI_MODE ) then
std.env.stop;
else
std.env.finish;
end if;
end process stimulus;
end architecture test;
@@ -0,0 +1,6 @@
$ version 1.1
/test_task_add_sine_cosine/*
/test_task_add_sine_cosine/dut/*
/test_task_add_sine_cosine/dut/u_add/*
/test_task_add_sine_cosine/dut/u_add/u_float_add/*
/test_task_add_sine_cosine/u_data_channel/**
@@ -0,0 +1,2 @@
add wave -position end sim:/test_task_add_sine_cosine/dut/u_add/*
+30
View File
@@ -0,0 +1,30 @@
vhdl_srcs = ../../../hardware/system/reg32.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/avalon_slave.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/float.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/data_channel_control.vhd \
../../../hardware/system/data_sink_mux.vhd \
../../../hardware/system/data_source_mux.vhd \
../../../hardware/system/fifo.vhd \
../../../hardware/system/data_channel.vhd \
../../../hardware/system/cordic_pkg.vhd \
../../../hardware/system/cordic.vhd \
../../../hardware/system/fixed_sine.vhd \
../../../hardware/system/float_sine.vhd \
../../../hardware/signal_processing/sine.vhd \
../../../hardware/system/task_sine.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../test_data_channel.vhd \
../../data/cosine.vhd \
test_task_cosine.vhd \
main = test_task_cosine
expected_data = ../../data/cosine.py
include ../data_tests.mk
@@ -0,0 +1,142 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
use work.cosine_data.all;
use work.test_hardware_task.all;
use work.test_data_channel_pkg.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_cosine is
generic( CHECK_RESULTS : boolean; GUI_MODE : boolean := false );
end entity test_task_cosine;
architecture test of test_task_cosine is
procedure test_configure( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable writedata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_configure ... " );
index := 0;
writedata := x"0147ae14"; -- 2^32 / 32
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 1;
writedata := x"40000000";
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 2;
writedata := x"40000000"; -- 2 ** 2 = 4 float
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_configure;
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal data_channel_req : work.avalon_slave.Request;
signal data_channel_rsp : work.avalon_slave.Response;
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
signal data_channel_read : std_logic;
signal data_channel_readdata : std_logic_vector( 31 downto 0 );
begin
dut : entity work.task_sine
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
u_data_channel : entity work.data_channel
port map (
clk => clk,
reset => reset,
ctrl_address => data_channel_req.address,
ctrl_read => data_channel_req.read,
ctrl_readdata => data_channel_rsp.readdata,
ctrl_write => data_channel_req.write,
ctrl_writedata => data_channel_req.writedata,
hw_sink_write => signal_write,
hw_sink_writedata => signal_writedata,
hw_source_read => data_channel_read,
hw_source_readdata => data_channel_readdata
);
clk <= not clk after 10 ns;
reset_release : process is
begin
wait for 35 ns;
reset <= '0';
wait;
end process reset_release;
stimulus: process is
variable data_channel_config : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( reset );
work.test_data_channel_pkg.write_and_assert_config( clk => clk,
req => data_channel_req,
rsp => data_channel_rsp,
config => data_channel_config );
test_configure( clk => clk, req => req, rsp => rsp );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
if ( CHECK_RESULTS ) then
check_and_write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp,
expected => work.cosine_data.expected );
else
write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp );
end if;
if ( GUI_MODE ) then
std.env.stop;
else
std.env.finish;
end if;
end process stimulus;
end architecture test;
@@ -0,0 +1,6 @@
$ version 1.1
/test_task_sine/*
/test_task_sine/dut/*
/test_task_sine/dut/u_sine/*
/test_task_sine/dut/u_sine/u_float_sine/*
/test_task_sine/dut/u_sine/u_float_sine/u_fixed_sine/*
+1
View File
@@ -0,0 +1 @@
add wave -position end sim:/test_task_cosine/dut/u_sine/*
+29
View File
@@ -0,0 +1,29 @@
vhdl_srcs = ../../../hardware/system/reg32.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/avalon_slave.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/float.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/data_channel_control.vhd \
../../../hardware/system/data_sink_mux.vhd \
../../../hardware/system/data_source_mux.vhd \
../../../hardware/system/fifo.vhd \
../../../hardware/system/data_channel.vhd \
../../../hardware/signal_processing/crc.vhd \
../../../hardware/system/task_crc.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../test_data_channel.vhd \
../../data/fft.vhd \
../../data/crc.vhd \
test_task_crc.vhd \
main = test_task_crc
expected_data = ../../data/crc.py
CHECK_RESULTS = true
include ../vhdl.mk
+134
View File
@@ -0,0 +1,134 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
use work.crc_data.all;
use work.fft_data.all;
use work.test_hardware_task.all;
use work.test_data_channel_pkg.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_crc is
generic( CHECK_RESULTS : boolean );
end entity test_task_crc;
architecture test of test_task_crc is
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal data_channel_req : work.avalon_slave.Request;
signal data_channel_rsp : work.avalon_slave.Response;
signal signal_read : std_logic;
signal signal_readdata : std_logic_vector( 31 downto 0 );
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
signal data_channel_read : std_logic;
signal data_channel_readdata : std_logic_vector( 31 downto 0 );
signal index_output : integer range 0 to 1023;
begin
dut : entity work.task_crc
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_read => signal_read,
signal_readdata => signal_readdata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
u_data_channel : entity work.data_channel
port map (
clk => clk,
reset => reset,
ctrl_address => data_channel_req.address,
ctrl_read => data_channel_req.read,
ctrl_readdata => data_channel_rsp.readdata,
ctrl_write => data_channel_req.write,
ctrl_writedata => data_channel_req.writedata,
hw_sink_write => signal_write,
hw_sink_writedata => signal_writedata,
hw_source_read => data_channel_read,
hw_source_readdata => data_channel_readdata
);
clk <= not clk after 10 ns;
reset_release : process is
begin
wait for 35 ns;
reset <= '0';
wait;
end process reset_release;
p_number_input_sample: process ( clk, reset ) is
begin
if ( reset = '1' ) then
index_output <= 1;
signal_readdata <= to_std_logic_vector( to_float( work.fft_data.expected( 0 ) ) );
elsif ( rising_edge( clk ) ) then
if signal_read = '1' then
if index_output /= 1023 then
index_output <= index_output + 1;
end if;
signal_readdata <= to_std_logic_vector( to_float( work.fft_data.expected( index_output ) ) );
end if;
end if;
end process p_number_input_sample;
stimulus: process is
variable data_channel_config : std_logic_vector( 31 downto 0 ) := x"00000001";
variable expected_crc_value : std_logic_vector( 31 downto 0 ) := work.crc_data.expected;
begin
wait until falling_edge( reset );
work.test_data_channel_pkg.write_and_assert_config( clk => clk,
req => data_channel_req,
rsp => data_channel_rsp,
config => data_channel_config );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
std.textio.write( std.textio.OUTPUT, " test_crc_value ... " );
assert_read_sw_source_eq( clk => clk,
req => data_channel_req, rsp => data_channel_rsp,
expected => expected_crc_value );
std.textio.write( std.textio.OUTPUT, TEST_OK );
finish;
end process stimulus;
end architecture test;
@@ -0,0 +1,3 @@
$ version 1.1
/test_task_crc/*
/test_task_crc/dut/*
+2
View File
@@ -0,0 +1,2 @@
add wave -position end sim:/test_task_crc/dut/u_crc/*
+36
View File
@@ -0,0 +1,36 @@
verilog_srcs = \
../../../hardware/system/Butterfly.v \
../../../hardware/system/DelayBuffer.v \
../../../hardware/system/FFT1024_32B.v \
../../../hardware/system/Multiply.v \
../../../hardware/system/SdfUnit2.v \
../../../hardware/system/SdfUnit.v \
../../../hardware/system/Twiddle1024_32B.v \
vhdl_srcs = \
../../../hardware/system/reg32.vhd \
../../../hardware/system/avalon_slave.vhd \
../../hardware/test_data_channel.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/hardware_task.vhd \
../../../hardware/system/float.vhd \
../../../hardware/system/squareRoot_pipe.vhd \
../../../hardware/system/fft_magnitude_calc.vhd \
../../../hardware/signal_processing/fft.vhd \
../../../hardware/system/task_fft.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../../data/add_rand.vhd \
../../data/sine.vhd \
../../data/fft.vhd \
test_task_fft.vhd \
main = test_task_fft
expected_data = ../../data/fft.py
include ../data_tests.mk
+233
View File
@@ -0,0 +1,233 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
use work.fft_data.all;
use work.test_hardware_task.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_fft is
end entity test_task_fft;
architecture test of test_task_fft is
procedure test_configure( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable writedata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_configure ... " );
index := 0;
writedata := x"08000000"; -- 2^32 / 32
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 1;
writedata := x"00000000";
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 2;
writedata := x"40800000"; -- 2 ** 2 = 4 float
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_configure;
procedure test_execute( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
signal write : in std_logic;
signal writedata : in std_logic_vector ) is
type data_array is array ( natural range <> ) of std_logic_vector( writedata'range );
variable expected_readdata : std_logic_vector( 31 downto 0 );
variable index : integer := 0;
variable writedata_fft : integer;
variable writedata_float : float32;
variable writedata_real : real;
variable expected_real : real;
variable abs_err : real := 0.5e-1;
variable result : data_array( 0 to work.task.STREAM_LEN - 1 );
variable result_fft : data_array( 0 to work.task.STREAM_LEN - 1 );
file data_file : text;
file data_file_fft : text;
file data_file_fft_bit_reversed : text;
variable index_bit_reversed : std_logic_vector( 9 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_execute ... " );
expected_readdata := to_std_logic_vector( TASK_IDLE, expected_readdata'length );
assert_state_eq( clk => clk, req => req, rsp => rsp, state => expected_readdata );
write_start( clk => clk, req => req );
expected_readdata := to_std_logic_vector( TASK_RUNNING, expected_readdata'length );
assert_state_eq( clk => clk, req => req, rsp => rsp, state => expected_readdata );
file_open( data_file, "data.py", write_mode );
std.textio.write( data_file, "float_data = [" );
file_open( data_file_fft, "fft_out.py", write_mode );
std.textio.write( data_file_fft, "ftt_out_data = [" );
while index < STREAM_LEN loop
wait until falling_edge( clk );
if ( write = '1' ) then
result( index ) := writedata;
writedata_float := to_float( result( index ) );
writedata_real := to_real( writedata_float );
std.textio.write( data_file, to_string( writedata_real ) & "," );
result_fft( index ) := writedata;
writedata_fft := to_integer(signed(result_fft( index )));
std.textio.write( data_file_fft, to_string( writedata_fft ) & "," );
index := index + 1;
end if;
end loop;
std.textio.write( data_file, "]" & LF );
file_close( data_file );
std.textio.write( data_file_fft, "]" & LF );
file_close( data_file_fft );
while index < STREAM_LEN loop
writedata_float := to_float( result( index ) );
writedata_real := to_real( writedata_float );
expected_real := work.fft_data.expected( index );
assert_near( writedata_real, expected_real, abs_err );
end loop;
file_open( data_file_fft_bit_reversed, "fft_out_bit_reversed.py", write_mode );
std.textio.write( data_file_fft_bit_reversed, "ftt_out_data = [" );
index := 0;
index_bit_reversed := "0000000000";
while index < STREAM_LEN loop
index_bit_reversed := std_logic_vector(to_unsigned(index, index_bit_reversed'length));
index_bit_reversed := index_bit_reversed(0)&index_bit_reversed(1)&index_bit_reversed(2)&index_bit_reversed(3)&index_bit_reversed(4)&index_bit_reversed(5)&index_bit_reversed(6)&index_bit_reversed(7)&index_bit_reversed(8)&index_bit_reversed(9);
index := to_integer(unsigned(index_bit_reversed));
writedata_fft := to_integer(signed(result_fft( index )));
std.textio.write( data_file_fft_bit_reversed, to_string( writedata_fft ) & "," );
index_bit_reversed := index_bit_reversed(0)&index_bit_reversed(1)&index_bit_reversed(2)&index_bit_reversed(3)&index_bit_reversed(4)&index_bit_reversed(5)&index_bit_reversed(6)&index_bit_reversed(7)&index_bit_reversed(8)&index_bit_reversed(9);
index := to_integer(unsigned(index_bit_reversed));
index := index + 1;
end loop;
std.textio.write( data_file_fft_bit_reversed, "]" & LF );
file_close( data_file_fft_bit_reversed );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_execute;
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal signal_read : std_logic;
signal signal_readdata : std_logic_vector( 31 downto 0 );
signal index_output : integer range 0 to 1023;
type input_data_array is array ( natural range <> ) of std_logic_vector(31 downto 0);
constant input_data: input_data_array (0 to 1023) := (x"40daf8d9",x"400464d6",x"40707518",x"412f4d86",x"bf2c6338",x"3fe858d0",x"40a93c0d",x"411d1b42",x"40ae6f95",x"40f76d48",x"414b45bb",x"bf80c95c",x"40653088",x"40cf8814",x"404a5d41",x"40c8b99e",x"c0a2d52e",x"c097b780",x"c0618ef7",x"c0e982c7",x"c024cbd1",x"bf618a97",x"bfe51ce1",x"3fb47578",x"c11df822",x"c08594f9",x"403fd955",x"c0aa7966",x"bff13a72",x"40132fc6",x"bf2de1e2",x"4061d87f",x"c06ac864",x"bf711298",x"4011b5da",x"4110d242",x"402cc82f",x"413cdf10",x"4025bc6a",x"41356772",x"404ff73c",x"40ab30ae",x"412170aa",x"40326cc2",x"412caa7b",x"c09488ea",x"c092507c",x"c06f49b3",x"bf0d20d4",x"402ca19a",x"bff135fa",x"3fafefe8",x"c1197ab4",x"c10ca7e7",x"c0e7237f",x"c091c47c",x"c066436a",x"3d914c40",x"c0999d9d",x"bf82f570",x"c0e55fe3",x"c05520da",x"40605138",x"c021210c",x"40c78efa",x"bfd5f3be",x"3fd3d6b1",x"3fe55ef8",x"408eaf1a",x"bf99eb4a",x"400acf31",x"40ca0d76",x"c06f7ec0",x"c0156063",x"3fcbe0a0",x"4009d2a1",x"3feb3b7c",x"40f5953d",x"bfbe458a",x"4046b62c",x"c113cc05",x"c087d026",x"bfccd099",x"3f8155a6",x"c0f1209c",x"c11042a8",x"c0bf6ebc",x"3fc1136c",x"c1464c70",x"c12df84f",x"c10aa752",x"c0b06ec4",x"c08650e5",x"bfd06e2c",x"c0d2c72e",x"c0e3e57a",x"c08b3546",x"bfb0d585",x"403febfc",x"be122ec9",x"3fe57176",x"3fe53e46",x"4108cf43",x"3f01a6a4",x"403c3ee3",x"4017e4ad",x"40eb2c13",x"3ef0621c",x"40eba5ee",x"c09499f7",x"c054478c",x"bfac1b65",x"40b68a12",x"c11be620",x"c09ceffc",x"3f01c820",x"c0e2f412",x"c0a78f83",x"c0a41d0e",x"c05f2f6a",x"c0f98a04",x"c0fba274",x"c0fe9e26",x"c0a150f5",x"c07b476d",x"3e009bf0",x"c055c84d",x"bf142c8e",x"be67ec78",x"3dd2c0cc",x"3f011ca1",x"4077ccb8",x"3fc47cab",x"4107f727",x"bfd2f436",x"3f229404",x"403e75a3",x"405653d7",x"4055b80b",x"406c1a7a",x"408bf1a0",x"bf2951d8",x"3f5e1db9",x"3f0ceda0",x"bd48f1c8",x"40078de7",x"c0d40bfe",x"c047cafb",x"c02e4bc7",x"c03dd5ae",x"c0142d40",x"beadb830",x"c088264a",x"3eddd418",x"c07f2957",x"c0377cbb",x"3e6054b0",x"c0a43500",x"bfaf530d",x"404a35ab",x"c09d1b4d",x"3f137065",x"4029875f",x"40824c49",x"408786ed",x"40d59fa1",x"408f5241",x"410b56f8",x"40942720",x"4132ff7d",x"3f1748c0",x"407ed381",x"40886ce3",x"406f5b24",x"404b8482",x"4095a7c8",x"bfc0d0ee",x"c04d5c67",x"bef1981b",x"3f9b8e53",x"3f010d6c",x"40816b01",x"c03be548",x"bfe2e631",x"bf50b956",x"3fcb2630",x"c10cc7d7",x"c0ea1e79",x"c0996e64",x"bf4c0708",x"40df4d51",x"c082593a",x"3f911f18",x"40f2c5fe",x"3f240db0",x"407dd077",x"413a600e",x"beb58cb0",x"40014757",x"40b022de",x"4135f6b6",x"40a286ee",x"40c11cb7",x"410ced4a",x"bf935600",x"404d3b0a",x"41359a58",x"c09f481d",x"3da888b0",x"40ff55c1",x"bf8628b1",x"40559908",x"bfb1b61e",x"407bbeaa",x"c0a9e96e",x"c0fac5df",x"c0be2c58",x"c10fbd7b",x"c059776c",x"3ff23d0b",x"c0eef375",x"bfe29bf2",x"4021884b",x"3f07d900",x"40b22610",x"3daed460",x"4030b71f",x"40bf6a6e",x"3f9d6390",x"408a28d2",x"40a9da87",x"41306adc",x"40827670",x"40adf30d",x"40d3bb17",x"40c4c47c",x"40b053dc",x"411a898e",x"c041170a",x"3f230783",x"40b82185",x"c056f0a5",x"c0b27b9c",x"c08a913e",x"c0b1592a",x"c0ebbd8e",x"c08110fa",x"bf837a24",x"c082cffd",x"3fe6a02c",x"c0938da1",x"c03e4892",x"4015ee20",x"c04f04bf",x"bfba869f",x"be97d71c",x"408be6b0",x"beaf6864",x"4090daba",x"c089e406",x"3f9bc832",x"4128abc9",x"3f81999a",x"412b3f77",x"3fae413e",x"4092db9f",x"40ea6812",x"3fd46a6c",x"409e2e5c",x"c0696f7e",x"c018fc04",x"c07bf051",x"c0e7a797",x"c0c227ae",x"c05904cc",x"bfda9871",x"40492d22",x"c0d14fa4",x"c073a299",x"bfe46994",x"c0c18767",x"3e32b7c0",x"c1122d14",x"c140dffe",x"c12987f0",x"c1008994",x"c07640e8",x"bf0eaa08",x"c07e82be",x"bf9edaa2",x"40063aa3",x"c028afad",x"c03ef2d1",x"3f67c42c",x"405ec244",x"405c9d20",x"4040f756",x"401b9b21",x"406c6bbe",x"40543aca",x"410be00e",x"c0f35646",x"c101ed3c",x"c04273b8",x"40945b7d",x"c0ffe39e",x"c0d78e2c",x"c1123262",x"c0f7522a",x"c112c3f2",x"c154d998",x"c1537448",x"c14ae788",x"c0e56daa",x"bfee3c9e",x"c0b09aa8",x"c052c2eb",x"bf4acce8",x"c0fa6c22",x"c0a14e7e",x"c09a94ba",x"bf8d327f",x"4035c5b3",x"c03ea671",x"3f71fbc5",x"40f09f04",x"3fb6559a",x"40402833",x"40f2c9b0",x"3ffdacc4",x"40302c24",x"41118f2c",x"c0811c5a",x"3e833d44",x"40f77617",x"c0ceb437",x"c0011eb4",x"bf68a1b3",x"3f87bf94",x"c1035b72",x"c088c46d",x"3fad9ee0",x"c0eddc85",x"c11520cf",x"c0a3ae5c",x"c07f6a7e",x"406f84db",x"c0ab7840",x"40733e14",x"c06a6562",x"3ffd4321",x"bf8c24dd",x"3f927763",x"4042c5e0",x"bebc7778",x"3e71d150",x"3f1aedcc",x"4063fe9d",x"410fa150",x"3fd93bda",x"408ca422",x"409fc375",x"40b22aa6",x"40983215",x"4077de82",x"40ef5ece",x"3ff40f95",x"3ffbcd45",x"408f19d2",x"c0a83ae8",x"bfa0b156",x"bf18a1bb",x"40504818",x"c02d22cb",x"c0066d63",x"c006b74c",x"4018adb5",x"c049e8d2",x"3fd9b518",x"c112ab95",x"c03af28c",x"3f5a6b62",x"4075f720",x"c0b999c4",x"3ec39b04",x"405bb566",x"41145003",x"3e03bb30",x"c041d4aa",x"40565bb8",x"41476c6c",x"3de36dc0",x"40a020bd",x"414ce41b",x"40863b44",x"41129a5f",x"c028844a",x"c02b6540",x"c010647f",x"3feab4d4",x"41121b63",x"c0a16e58",x"bf2a96f9",x"4012eae9",x"c07973bb",x"c0b21017",x"c012342e",x"3ee9c9d8",x"c09d65e0",x"c0b6db34",x"c00e2a4a",x"bca9a3c0",xLine truncated
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
begin
dut : entity work.task_fft
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_read => signal_read,
signal_readdata => signal_readdata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
clk <= not clk after 10 ns;
p_number_input_sample: process ( clk, reset ) is
begin
if ( reset = '1' ) then
index_output <= 1;
signal_readdata <= input_data(0);
elsif ( rising_edge( clk ) ) then
if signal_read = '1' then
if index_output /= 1023 then
index_output <= index_output + 1;
end if;
signal_readdata <= input_data(index_output);
end if;
end if;
end process p_number_input_sample;
reset_release : process is
begin
wait for 435 ns;
reset <= '0';
wait;
end process reset_release;
stimulus: process is
variable address : std_logic_vector( 3 downto 0 );
variable level : std_logic_vector( 31 downto 0 );
variable readdata : std_logic_vector( 31 downto 0 );
variable writedata : std_logic_vector( 31 downto 0 );
variable expected_readdata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, "--------------------------------------------------------------------------------" & LF );
std.textio.write( std.textio.OUTPUT, "Starting test_task_fft" & LF );
wait until falling_edge( reset );
wait until falling_edge( clk );
test_configure( clk => clk, req => req, rsp => rsp );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
wait until falling_edge( signal_write );
wait for 200 ns;
std.textio.write( std.textio.OUTPUT, "Finished test_task_fft" & LF );
std.textio.write( std.textio.OUTPUT, "--------------------------------------------------------------------------------" & LF );
std.env.finish( 0 );
end process stimulus;
end architecture test;
@@ -0,0 +1,5 @@
$ version 1.1
/test_task_add_sine_cosine/*
/test_task_add_sine_cosine/dut/*
/test_task_add_sine_cosine/dut/u_add/*
/test_task_add_sine_cosine/dut/u_add/u_float_add/*
+1
View File
@@ -0,0 +1 @@
add wave -position end sim:/test_task_fft/dut/*
+25
View File
@@ -0,0 +1,25 @@
vhdl_srcs = ../../../hardware/system/reg32.vhd \
../../../hardware/system/avalon_slave.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/data_channel_control.vhd \
../../../hardware/system/data_sink_mux.vhd \
../../../hardware/system/data_source_mux.vhd \
../../../hardware/system/fifo.vhd \
../../../hardware/system/data_channel.vhd \
../../../hardware/signal_processing/rand.vhd \
../../../hardware/system/task_rand.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../test_data_channel.vhd \
../../data/rand.vhd \
test_task_rand.vhd \
main = test_task_rand
expected_data = ../../data/rand.py
include ../data_tests.mk
+172
View File
@@ -0,0 +1,172 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.test_hardware_task.all;
use work.task.all;
use work.rand_data.all;
use work.test_utility.all;
use work.test_data_channel_pkg.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_rand is
generic( CHECK_RESULTS : boolean; GUI_MODE : boolean := false );
end entity test_task_rand;
architecture test of test_task_rand is
procedure test_configure( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable writedata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_configure ... " );
writedata := to_std_logic_vector( to_float( 1.3 ) );
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_configure;
procedure test_execute( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
signal write : in std_logic;
signal writedata : in std_logic_vector( 31 downto 0 )) is
variable expected_readdata : std_logic_vector( 31 downto 0 );
variable state : std_logic_vector( 31 downto 0 );
variable index : integer := 0;
begin
std.textio.write( std.textio.OUTPUT, " test_execute ... " );
expected_readdata := to_std_logic_vector( TASK_IDLE, expected_readdata'length );
assert_state_eq( clk => clk, req => req, rsp => rsp, state => expected_readdata );
write_start( clk => clk, req => req );
expected_readdata := to_std_logic_vector( TASK_RUNNING, expected_readdata'length );
assert_state_eq( clk => clk, req => req, rsp => rsp, state => expected_readdata );
while true loop
work.test_hardware_task.read_state( clk => clk, req => req, rsp => rsp, state => state );
if ( state = to_std_logic_vector( TASK_DONE, expected_readdata'length ) ) then
exit;
end if;
end loop;
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_execute;
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal data_channel_req : work.avalon_slave.Request;
signal data_channel_rsp : work.avalon_slave.Response;
signal address : std_logic_vector( 3 downto 0 );
signal read : std_logic := '0';
signal readdata : std_logic_vector( 31 downto 0 );
signal write : std_logic := '0';
signal writedata : std_logic_vector( 31 downto 0 );
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
signal results : work.reg32.RegArray( 0 to 1023 );
signal data_channel_read : std_logic;
signal data_channel_readdata : std_logic_vector( 31 downto 0 );
begin
dut : entity work.task_rand
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
u_data_channel : entity work.data_channel
port map (
clk => clk,
reset => reset,
ctrl_address => data_channel_req.address,
ctrl_read => data_channel_req.read,
ctrl_readdata => data_channel_rsp.readdata,
ctrl_write => data_channel_req.write,
ctrl_writedata => data_channel_req.writedata,
hw_sink_write => signal_write,
hw_sink_writedata => signal_writedata,
hw_source_read => data_channel_read,
hw_source_readdata => data_channel_readdata
);
clk <= not clk after 10 ns;
reset_release : process is
begin
wait for 35 ns;
reset <= '0';
wait;
end process reset_release;
stimulus: process is
constant expected : work.reg32.RegArray( 0 to 3 )
:= ( 0 => ( others => 'U' ), 2 => ( others => 'U' ),
others => ( others => '0' ) );
variable data_channel_config : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( reset );
work.test_data_channel_pkg.write_and_assert_config( clk => clk,
req => data_channel_req,
rsp => data_channel_rsp,
config => data_channel_config );
test_configure( clk => clk, req => req, rsp => rsp );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
if ( CHECK_RESULTS ) then
check_and_write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp,
expected => work.rand_data.expected );
else
write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp );
end if;
if ( GUI_MODE ) then
std.env.stop;
else
std.env.finish;
end if;
end process stimulus;
end architecture test;
@@ -0,0 +1,4 @@
$ version 1.1
/test_task_rand/*
/test_task_rand/dut/**
/test_task_rand/u_data_channel/**
+1
View File
@@ -0,0 +1 @@
add wave -position end sim:/test_task_rand/dut/u_rand/*
+30
View File
@@ -0,0 +1,30 @@
vhdl_srcs = ../../../hardware/system/reg32.vhd \
../../../hardware/system/task.vhd \
../../../hardware/system/avalon_slave.vhd \
../../../hardware/system/avalon_slave_transitions.vhd \
../../../hardware/system/float.vhd \
../../../hardware/system/hardware_task_control.vhd \
../../../hardware/system/data_channel_control.vhd \
../../../hardware/system/data_sink_mux.vhd \
../../../hardware/system/data_source_mux.vhd \
../../../hardware/system/fifo.vhd \
../../../hardware/system/data_channel.vhd \
../../../hardware/system/cordic_pkg.vhd \
../../../hardware/system/cordic.vhd \
../../../hardware/system/fixed_sine.vhd \
../../../hardware/system/float_sine.vhd \
../../../hardware/signal_processing/sine.vhd \
../../../hardware/system/task_sine.vhd \
../test_utility.vhd \
../test_avalon_slave.vhd \
../test_hardware_task.vhd \
../test_data_channel.vhd \
../../data/sine.vhd \
test_task_sine.vhd \
main = test_task_sine
expected_data = ../../data/sine.py
include ../data_tests.mk
+142
View File
@@ -0,0 +1,142 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
use work.sine_data.all;
use work.test_hardware_task.all;
use work.test_data_channel_pkg.all;
library std;
use std.env.all;
use std.textio.all;
entity test_task_sine is
generic( CHECK_RESULTS : boolean; GUI_MODE : boolean := false );
end entity test_task_sine;
architecture test of test_task_sine is
procedure test_configure( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable writedata : std_logic_vector( 31 downto 0 );
begin
std.textio.write( std.textio.OUTPUT, " test_configure ... " );
index := 0;
writedata := x"08000000"; -- 2^32 / 32
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 1;
writedata := x"00000000";
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
index := 2;
writedata := x"40800000"; -- 2 ** 2 = 4 float
write_and_assert_config_eq( clk => clk, req => req, rsp => rsp,
index => index, config => writedata );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_configure;
signal clk : std_logic := '0';
signal reset : std_logic := '1';
signal req : work.avalon_slave.Request;
signal rsp : work.avalon_slave.Response;
signal data_channel_req : work.avalon_slave.Request;
signal data_channel_rsp : work.avalon_slave.Response;
signal signal_write : std_logic;
signal signal_writedata : std_logic_vector( 31 downto 0 );
signal data_channel_read : std_logic;
signal data_channel_readdata : std_logic_vector( 31 downto 0 );
begin
dut : entity work.task_sine
port map (
clk => clk,
reset => reset,
address => req.address,
read => req.read,
readdata => rsp.readdata,
write => req.write,
writedata => req.writedata,
signal_write => signal_write,
signal_writedata => signal_writedata
);
u_data_channel : entity work.data_channel
port map (
clk => clk,
reset => reset,
ctrl_address => data_channel_req.address,
ctrl_read => data_channel_req.read,
ctrl_readdata => data_channel_rsp.readdata,
ctrl_write => data_channel_req.write,
ctrl_writedata => data_channel_req.writedata,
hw_sink_write => signal_write,
hw_sink_writedata => signal_writedata,
hw_source_read => data_channel_read,
hw_source_readdata => data_channel_readdata
);
clk <= not clk after 10 ns;
reset_release : process
begin
wait for 35 ns;
reset <= '0';
wait;
end process reset_release;
stimulus : process
variable data_channel_config : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( reset );
work.test_data_channel_pkg.write_and_assert_config( clk => clk,
req => data_channel_req,
rsp => data_channel_rsp,
config => data_channel_config );
test_configure( clk => clk, req => req, rsp => rsp );
test_execute( clk => clk, req => req, rsp => rsp,
write => signal_write, writedata => signal_writedata );
if ( CHECK_RESULTS ) then
check_and_write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp,
expected => work.sine_data.expected );
else
write_content( clk => clk,
req => data_channel_req, rsp => data_channel_rsp );
end if;
if ( GUI_MODE ) then
std.env.stop;
else
std.env.finish;
end if;
end process stimulus;
end architecture test;
@@ -0,0 +1,7 @@
$ version 1.1
/test_task_sine/*
/test_task_sine/dut/*
/test_task_sine/dut/u_sine/*
/test_task_sine/dut/u_sine/u_float_sine/*
/test_task_sine/dut/u_sine/u_float_sine/u_fixed_sine/*
/test_task_sine/u_data_channel/**
+24
View File
@@ -0,0 +1,24 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /test_task_sine/*
add wave -noupdate /test_task_sine/dut/*
add wave -noupdate /test_task_sine/dut/u_sine/*
add wave -noupdate /test_task_sine/dut/u_sine/u_float_sine/*
add wave -noupdate /test_task_sine/dut/u_sine/u_float_sine/u_fixed_sine/*
add wave -noupdate /test_task_sine/u_data_channel/**
TreeUpdate [SetDefaultTree]
quietly wave cursor active 1
configure wave -namecolwidth 150
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
+89
View File
@@ -0,0 +1,89 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
package test_avalon_slave is
procedure read( signal clk : in std_logic;
variable address : in std_logic_vector;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable data : out std_logic_vector );
procedure assert_readdata_eq( signal clk : in std_logic;
variable address : in std_logic_vector;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable expected : in std_logic_vector;
constant message : in string );
procedure write( signal clk : in std_logic;
variable address : in std_logic_vector;
signal req : out work.avalon_slave.Request;
variable data : in std_logic_vector );
end package test_avalon_slave;
package body test_avalon_slave is
procedure read( signal clk : in std_logic;
variable address : in std_logic_vector;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable data : out std_logic_vector ) is
begin
req.read <= '1';
req.write <= '0';
req.address <= address;
wait until falling_edge( clk );
wait until falling_edge( clk );
req.read <= '0';
data := rsp.readdata;
wait until falling_edge( clk );
end procedure read;
procedure assert_readdata_eq( signal clk : in std_logic;
variable address : in std_logic_vector;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable expected :in std_logic_vector;
constant message : in string ) is
variable readdata : std_logic_vector( expected'range );
begin
read( clk => clk,
address => address,
req => req,
rsp => rsp,
data => readdata );
assert( readdata = expected )
report message & LF &
" expected: " & to_string( expected ) & LF &
" actual: " & to_string( readdata ) & LF
severity error;
end procedure assert_readdata_eq;
procedure write( signal clk : in std_logic;
variable address : in std_logic_vector;
signal req : out work.avalon_slave.Request;
variable data : in std_logic_vector ) is
begin
req.read <= '0';
req.write <= '1';
req.address <= address;
req.writedata <= data;
wait until falling_edge( clk );
req.write <= '0';
end procedure write;
end package body test_avalon_slave;
+436
View File
@@ -0,0 +1,436 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library work;
use work.avalon_slave.all;
use work.test_utility.all;
library std;
use std.textio.all;
package test_data_channel_pkg is
procedure is_empty( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable res : out boolean );
procedure assert_empty( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response );
procedure assert_not_empty( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response );
procedure assert_full( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response );
procedure assert_not_full( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response );
procedure assert_level( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable level : in std_logic_vector );
procedure assert_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable config : in std_logic_vector );
procedure write_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
variable config : in std_logic_vector );
procedure write_and_assert_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable config : in std_logic_vector );
procedure write_clear( signal clk : in std_logic;
signal req : out work.avalon_slave.Request );
procedure write_sw_sink( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
variable data : in std_logic_vector );
procedure read_sw_source( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable data : out std_logic_vector );
procedure assert_read_sw_source_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable expected : in std_logic_vector );
procedure write_hw_sink( signal clk : in std_logic;
signal write : out std_logic;
signal writedata : out std_logic_vector;
variable data : in std_logic_vector );
procedure assert_read_hw_source_eq( signal clk : in std_logic;
signal read : out std_logic;
signal readdata : in std_logic_vector;
variable expected : in std_logic_vector );
procedure write_content( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response );
procedure check_and_write_content( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
constant expected : real_array );
end package test_data_channel_pkg;
package body test_data_channel_pkg is
procedure is_empty( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable res : out boolean ) is
variable address : std_logic_vector( 3 downto 0 );
variable data : std_logic_vector( 31 downto 0 );
constant EMPTY : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 1, address'length ) );
work.test_avalon_slave.read( clk => clk,
address => address,
req => req,
rsp => rsp,
data => data );
res := data = EMPTY;
end procedure is_empty;
procedure assert_empty( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable address : std_logic_vector( 3 downto 0 );
variable expected_readdata : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 1, address'length ) );
expected_readdata := x"00000001";
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => expected_readdata,
message => TEST_FAIL & " assert_empty" );
end procedure assert_empty;
procedure assert_not_empty( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable address : std_logic_vector( 3 downto 0 );
variable expected_readdata : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 1, address'length ) );
expected_readdata := x"00000000";
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => expected_readdata,
message => TEST_FAIL & " assert_not_empty" );
end procedure assert_not_empty;
procedure assert_full( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable address : std_logic_vector( 3 downto 0 );
variable expected_readdata : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 2, address'length ) );
expected_readdata := x"00000001";
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => expected_readdata,
message => TEST_FAIL & " assert_full" );
end procedure assert_full;
procedure assert_not_full( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable address : std_logic_vector( 3 downto 0 );
variable expected_readdata : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 2, address'length ) );
expected_readdata := x"00000000";
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => expected_readdata,
message => TEST_FAIL & " assert_not_full" );
end procedure assert_not_full;
procedure assert_level( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable level : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 3, address'length ) );
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => level,
message => TEST_FAIL & " assert_level" );
end procedure assert_level;
procedure assert_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable config : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 0, address'length ) );
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => config,
message => TEST_FAIL & " assert_config" );
end procedure assert_config;
procedure write_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
variable config : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 0, address'length ) );
work.test_avalon_slave.write( clk => clk,
address => address,
req => req,
data => config );
end procedure write_config;
procedure write_and_assert_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable config : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
write_config( clk => clk, req => req, config => config );
assert_config( clk => clk, req => req, rsp => rsp, config => config );
end procedure write_and_assert_config;
procedure write_clear( signal clk : in std_logic;
signal req : out work.avalon_slave.Request ) is
variable address : std_logic_vector( 3 downto 0 );
variable clear : std_logic_vector( 31 downto 0 ) := x"00000001";
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 6, address'length ) );
work.test_avalon_slave.write( clk => clk,
address => address,
req => req,
data => clear );
end procedure write_clear;
procedure write_sw_sink( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
variable data : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 4, address'length ) );
work.test_avalon_slave.write( clk => clk,
address => address,
req => req,
data => data );
end procedure write_sw_sink;
procedure read_sw_source( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable data : out std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 5, address'length ) );
work.test_avalon_slave.read( clk => clk,
address => address,
req => req,
rsp => rsp,
data => data );
end procedure read_sw_source;
procedure assert_read_sw_source_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable expected : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 5, address'length ) );
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => expected,
message => TEST_FAIL & " assert_readdata_eq" );
end procedure assert_read_sw_source_eq;
procedure write_hw_sink( signal clk : in std_logic;
signal write : out std_logic;
signal writedata : out std_logic_vector;
variable data : in std_logic_vector ) is
begin
wait until falling_edge( clk );
write <= '1';
writedata <= data;
wait until falling_edge( clk );
write <= '0';
end procedure write_hw_sink;
procedure assert_read_hw_source_eq( signal clk : in std_logic;
signal read : out std_logic;
signal readdata : in std_logic_vector;
variable expected : in std_logic_vector ) is
begin
wait until falling_edge( clk );
assert( readdata = expected )
report TEST_FAIL & " assert_read_hw_source_eq" & LF &
" expected: " & to_string( expected ) & LF &
" actual: " & to_string( readdata ) & LF
severity error;
wait until falling_edge( clk );
read <= '1';
wait until falling_edge( clk );
read <= '0';
end procedure assert_read_hw_source_eq;
procedure write_content( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response ) is
variable index : integer := 0;
variable empty : boolean;
variable value : std_logic_vector( 31 downto 0 );
variable float_value : float32;
variable real_value : real;
file data_file : text;
begin
std.textio.write( std.textio.OUTPUT, " write_content ... " );
file_open( data_file, "data.py", write_mode );
std.textio.write( data_file, "float_data = [" );
while true loop
is_empty( clk => clk, req => req, rsp => rsp, res => empty );
if ( empty ) then
exit;
end if;
read_sw_source( clk => clk, req => req, rsp => rsp,
data => value );
float_value := to_float( value );
real_value := to_real( float_value );
std.textio.write( data_file, to_string( real_value ) & "," );
index := index + 1;
end loop;
while index < 1024 loop
std.textio.write( data_file, "0.0 ," );
index := index + 1;
end loop;
std.textio.write( data_file, "]" & LF );
file_close( data_file );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure write_content;
procedure check_and_write_content( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
constant expected : real_array ) is
variable expected_readdata : std_logic_vector( 31 downto 0 );
variable index : integer := 0;
variable empty : boolean;
variable value : std_logic_vector( 31 downto 0 );
variable float_value : float32;
variable real_value : real;
variable expected_value : real;
variable abs_err : real := 0.5e-1;
file data_file : text;
begin
std.textio.write( std.textio.OUTPUT, " check_and_write_content ... " );
assert_full( clk => clk, req => req, rsp => rsp );
expected_readdata := std_logic_vector( to_unsigned( 0, expected_readdata'length ) );
assert_level( clk => clk, req => req, rsp => rsp,
level => expected_readdata );
file_open( data_file, "data.py", write_mode );
std.textio.write( data_file, "float_data = [" );
while true loop
is_empty( clk => clk, req => req, rsp => rsp, res => empty );
if ( empty ) then
exit;
end if;
read_sw_source( clk => clk, req => req, rsp => rsp,
data => value );
float_value := to_float( value );
real_value := to_real( float_value );
std.textio.write( data_file, to_string( real_value ) & "," );
expected_value := expected( index );
assert_element_near( real_value, expected_value, abs_err, index );
index := index + 1;
end loop;
std.textio.write( data_file, "]" & LF );
file_close( data_file );
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure check_and_write_content;
end package body test_data_channel_pkg;
+217
View File
@@ -0,0 +1,217 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.reg32.all;
use work.avalon_slave.all;
use work.test_utility.all;
use work.test_avalon_slave.all;
use work.task.all;
package test_hardware_task is
procedure read_state( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable state : out std_logic_vector );
procedure assert_state_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable state : std_logic_vector );
procedure assert_cycle_count_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable cycle_count : std_logic_vector );
procedure write_start( signal clk : in std_logic;
signal req : out work.avalon_slave.Request );
procedure write_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
variable index : in integer;
variable config : in std_logic_vector );
procedure assert_config_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable index : in integer;
variable config : in std_logic_vector );
procedure write_and_assert_config_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable index : in integer;
variable config : in std_logic_vector );
procedure assert_output_steam_data_eq( signal clk : in std_logic;
signal write : std_logic;
signal writedata : std_logic_vector;
signal expected : work.reg32.RegArray );
procedure test_execute( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
signal write : in std_logic;
signal writedata : in std_logic_vector );
end package test_hardware_task;
package body test_hardware_task is
procedure read_state( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable state : out std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 1, address'length ) );
work.test_avalon_slave.read( clk => clk,
address => address,
req => req,
rsp => rsp,
data => state );
end procedure read_state;
procedure assert_state_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable state : std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 1, address'length ) );
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => state,
message => TEST_FAIL & " assert_state_eq" );
end procedure assert_state_eq;
procedure assert_cycle_count_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable cycle_count : std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 2, address'length ) );
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => cycle_count,
message => TEST_FAIL & " assert_cycle_count_eq" );
end procedure assert_cycle_count_eq;
procedure write_start( signal clk : in std_logic;
signal req : out work.avalon_slave.Request ) is
variable address : std_logic_vector( 3 downto 0 );
variable start : std_logic_vector( 31 downto 0 ) := ( others => '0' );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 0, address'length ) );
work.test_avalon_slave.write( clk => clk,
address => address,
req => req,
data => START );
end procedure write_start;
procedure write_config( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
variable index : in integer;
variable config : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 3 + index, address'length ) );
work.test_avalon_slave.write( clk => clk,
address => address,
req => req,
data => config );
end procedure write_config;
procedure assert_config_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable index : in integer;
variable config : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
wait until falling_edge( clk );
address := std_logic_vector( to_unsigned( 3 + index, address'length ) );
work.test_avalon_slave.assert_readdata_eq( clk => clk,
address => address,
req => req,
rsp => rsp,
expected => config,
message => TEST_FAIL & " assert_config_eq" );
end procedure assert_config_eq;
procedure write_and_assert_config_eq( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
variable index : in integer;
variable config : in std_logic_vector ) is
variable address : std_logic_vector( 3 downto 0 );
begin
write_config( clk => clk, req => req, index => index, config => config );
assert_config_eq( clk => clk, req => req, rsp => rsp, index => index, config => config );
end procedure write_and_assert_config_eq;
procedure assert_output_steam_data_eq( signal clk : in std_logic;
signal write : std_logic;
signal writedata : std_logic_vector;
signal expected : work.reg32.RegArray ) is
begin
end procedure assert_output_steam_data_eq;
procedure test_execute( signal clk : in std_logic;
signal req : out work.avalon_slave.Request;
signal rsp : in work.avalon_slave.Response;
signal write : in std_logic;
signal writedata : in std_logic_vector ) is
variable expected_readdata : std_logic_vector( 31 downto 0 );
variable state : std_logic_vector( 31 downto 0 );
variable index : integer := 0;
begin
std.textio.write( std.textio.OUTPUT, " test_execute ... " );
expected_readdata := to_std_logic_vector( TASK_IDLE, expected_readdata'length );
assert_state_eq( clk => clk, req => req, rsp => rsp, state => expected_readdata );
write_start( clk => clk, req => req );
expected_readdata := to_std_logic_vector( TASK_RUNNING, expected_readdata'length );
assert_state_eq( clk => clk, req => req, rsp => rsp, state => expected_readdata );
while true loop
work.test_hardware_task.read_state( clk => clk, req => req, rsp => rsp, state => state );
if ( state = to_std_logic_vector( TASK_DONE, expected_readdata'length ) ) then
exit;
end if;
end loop;
std.textio.write( std.textio.OUTPUT, TEST_OK );
end procedure test_execute;
end package body test_hardware_task;
+71
View File
@@ -0,0 +1,71 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.float_pkg.all;
library std;
use std.textio.all;
package test_utility is
constant TEST_FAIL : string := "[ FAIL ]";
constant TEST_OK : string := "[ OK ]" & LF;
type real_array is array ( natural range <> ) of real;
procedure assert_eq( variable a : in std_logic_vector; variable b : in std_logic_vector );
procedure assert_near( variable a : in real;
variable b : in real;
variable abs_err : in real );
procedure assert_element_near( variable a : in real;
variable b : in real;
variable abs_err : in real;
variable index : in integer );
end package test_utility;
package body test_utility is
procedure assert_eq( variable a : in std_logic_vector; variable b : in std_logic_vector ) is
begin
assert( a = b )
report TEST_FAIL & "assert_eq" & LF &
" a: " & to_string( a ) & LF &
" b: " & to_string( b ) & LF
severity error;
end procedure assert_eq;
procedure assert_near( variable a : in real;
variable b : in real;
variable abs_err : in real ) is
variable abs_diff : real;
begin
abs_diff := abs( a - b );
assert( abs_diff <= abs_err )
report TEST_FAIL & "assert_near" & LF &
" a: " & to_string( a ) & LF &
" b: " & to_string( b ) & LF &
" " & to_string( abs_diff ) & " > " & to_string( abs_err ) & LF
severity error;
end procedure assert_near;
procedure assert_element_near( variable a : in real;
variable b : in real;
variable abs_err : in real;
variable index : in integer ) is
variable abs_diff : real;
begin
abs_diff := abs( a - b );
assert( abs_diff <= abs_err )
report TEST_FAIL & "assert_element_near" & LF &
" element: " & integer'image( index ) & LF &
" a: " & to_string( a ) & LF &
" b: " & to_string( b ) & LF &
" " & to_string( abs_diff ) & " > " & to_string( abs_err ) & LF
severity error;
end procedure assert_element_near;
end package body test_utility;
+23
View File
@@ -0,0 +1,23 @@
ghdl_version = $(shell ghdl --version 2> /dev/null)
vsim_version = $(shell vsim -version 2> /dev/null)
# in case verilog is part of the build a verilog capable simulator is required
ifdef verilog_srcs
ifneq (${vsim_version},)
include ../questa-sim.mk
else
$(error No HDL simulation tool found for verilog!)
endif
else
ifneq (${vsim_version},)
include ../questa-sim.mk
else
ifneq (${ghdl_version},)
include ../ghdl.mk
else
$(error No HDL simulation tool found!)
endif
endif
endif
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
script_dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
if [ $# -ne 1 ]
then
echo Usage $0 test-output-file
exit 1
fi
cat $1 | sed -z -e 's/\(py_.* \[\)/ \[/g' | ${script_dir}/highlight_test_results.sh
if grep -q FAIL $1
then
exit 1
fi
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env python3
import os
import sys
import pathlib
from importlib.machinery import SourceFileLoader
def get_test_and_filename( extension ):
filename = sys.argv[ 1 ].replace( '.py', extension )
testname = os.path.basename( sys.argv[ 1 ].replace( '.py', '' ) )
return testname, filename
def convert_to_c( data ):
testname, filename = get_test_and_filename( '.h' )
with open( filename, 'w' ) as f:
f.write( '#pragma once\n' )
f.write( 'float expected_' + testname +'[] = {' )
f.write( '{:e}'.format( data[ 0 ] ) )
for i in data[ 1 : ]:
f.write( ',{:e}'.format( i ) )
f.write( '};\n' )
def convert_to_vhdl( data ):
testname, filename = get_test_and_filename( '.vhd' )
with open( filename, 'w' ) as f:
f.write( 'library ieee;\n' )
f.write( ' use ieee.std_logic_1164.all;\n' )
f.write( '\n' )
f.write( 'library work;\n' )
f.write( ' use work.test_utility.all;\n' )
f.write( '\n' )
f.write( 'package ' + testname + '_data is\n' )
f.write( ' constant expected : real_array( 0 to 1023 ) := (' )
f.write( '{:e}'.format( data[ 0 ] ) )
for i in data[ 1 : ]:
f.write( ',{:e}'.format( i ) )
f.write( ');\n' )
f.write( 'end package ' + testname + '_data;\n' )
def convert():
if ( len( sys.argv ) != 2 ):
raise( Exception( "Usage: {} expected_data.py" ) )
cwd = pathlib.Path( os.getcwd() )
expected_path = cwd.joinpath( sys.argv[ 1 ] )
expected = SourceFileLoader( 'expected', str( expected_path ) ).load_module()
convert_to_c( expected.data )
convert_to_vhdl( expected.data )
def main():
try:
convert()
except Exception as e:
print( e )
if ( __name__ == '__main__' ):
main()
Loaded 100 of 255 files, more files were not shown because too many files have changed in this diff. Show more