模块串联设计:
https://thedatabus.io/accelerator
cov + relu + pool
软件测试:
img:6*6
![](http://139.9.1.231/wp-content/uploads/2022/05/image-36-1024x669.png)
转浮点数:16bit :1符号位 7bit整数 8bit小数
权重:
![](http://139.9.1.231/wp-content/uploads/2022/05/image-37.png)
convolved output:
![](http://139.9.1.231/wp-content/uploads/2022/05/image-38.png)
硬件仿真:(1,7,8)
![](http://139.9.1.231/wp-content/uploads/2022/05/image-40-1024x202.png)
可以发现软件和 vivado中error误差在 0.01量级
relu部分:
![](http://139.9.1.231/wp-content/uploads/2022/04/image-34-1024x109.png)
池化部分: (4*4矩阵) 2*2的池化
bug:
总会晚一个时钟计数:
+-----------+
|00|01|02|03|
+-----------+
|04|05|06|07|
+-----------+
|08|09|10|11|
+-----------+
|12|13|14|15|
+-----------+
顺序输入 0,1,2,3,4,5,6,…
正确的应该是:
![](http://139.9.1.231/wp-content/uploads/2022/05/image-42.png)
但如果对齐 ce和clk上升沿:
![](http://139.9.1.231/wp-content/uploads/2022/05/image-41.png)
![](http://139.9.1.231/wp-content/uploads/2022/05/image-43-1024x237.png)
![](http://139.9.1.231/wp-content/uploads/2022/05/image-39-1024x429.png)
![](http://139.9.1.231/wp-content/uploads/2022/05/image-63-1024x182.png)
![](http://139.9.1.231/wp-content/uploads/2022/05/image-62-1024x287.png)