应该写一个vga_data模块,用来从rom读取给vga_driver的数据

因为以后的流水线操作涉及到读取ram缓存条的图像数据,先解决从rom读图片,接下来再解决从sd和ram读图片

查看该芯片的rom

5,140 Kbits embedded memory

640*480的RGB888图像是900k

demosaic3.0_数据


板子上的SD卡是连ARM的,就很蛋疼

要求规格如下(因为该SD卡也可以用来boot linux)

demosaic3.0_直方图_02

SD協會定義了四種速度規格,協助使用者更輕易的區分不同SD卡的傳輸速率。此四種規格指讀寫速率至少必須符合的標準 ( Class 2: 2 MB/s; Class 4: 4 MB/s; Class 6: 6 MB/s; Class 10: 10 MB/s )

demosaic3.0_直方图_03


TF卡即是T-Flash卡,又叫micro SD卡

demosaic3.0_sed_04


demosaic3.0_数据_05


将图片转成mif

demosaic3.0_sed_06


设置rom ip核,图像深度为25万rom的ip核设成3w深度

demosaic3.0_数据_07


demosaic3.0_直方图_08

突然发现原来640480的vga不够用了,改成12801024。修改PLL输出时钟和vga的一些模块参数和位宽即可

demosaic3.0_直方图_09


测试后正常

demosaic3.0_数据_10


demosaic3.0_sed_11


等下全部改clk_25

编译报错说rom ip核太小

Error (170040): Can’t place all RAM cells in design

Info (170034): Selected device has 553 memory locations of type M10K block. The current design requires 744 memory locations of type M10K block to successfully fit.

Info (170033): Memory usage required for the design in the current device: 135% M10K block memory block locations required

Info (170043): The Fitter setting for Equivalent RAM and MLAB Paused Read Capabilities is currently set to Care. More RAMs may be placed in MLAB locations if a different paused read behaviour is allowed.

把图片改成100*100的,然后图片的存储另做考虑

显示正常

demosaic3.0_sed_12


fpga可以倍频

vh-vv的直方图

demosaic3.0_直方图_13


wh的直方图

demosaic3.0_直方图_14


matlabs是四位小数,

查sigmod函数在FPGA上实现(感觉非线性在FPGA上的实现一直是个有意思的话题)

这个函数全称是Log-sigmoid function, also known as a logistic function,

关键词是FPGA,Non-linear Approximation ,Symmetric Table Lookup Addition Method(STAM)
Taylor series expansion
the look-up tables
CORDIC(Coordinated Rotation Digital Computer)
分段然后用一次,二次多项式拟合:A Non-linear Approximation of the Sigmoid Function based on FPGA


阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6