Jan 8
[Tips]
1. use xil_printf or print, not printf.
xil_printf基本和ANSI printf功能一致,只是没有浮点功能,但是和printf的大小相差比较多。
比较:一个用xil_printf的工程和一个用printf的工程:
引用
            printf            xil_printf
.text      57524         4997
.data     1912           116
.bss       1120           1056
Total      60556         6169


2. 调用XIo_Out32的所有函数,比如xxx_WriteReg(Baseaddr, Offset, Data),要写一个32位的数,此时OFFSET的后两bit是不解码的,也就是说,Offset = 00, 01, 02, 03都是写到00去的,结果就是00-03都被写入了数据,而04则没有改变。

3. xmd.ini
如果工程文件夹目录中有xmd.ini文件,打开XMD时就会自动读取这个文件并且执行其中的命令。

[Common Codes]
1. GPIO - LED
引用
#include "xgpio.h"
 XGpio gpio;
 XGpio_Initialize(&gpio, XPAR_LEDS_4BIT_DEVICE_ID);
 XGpio_SetDataDirection(&gpio,LEDChan, 0); //device channel count from 1
 XGpio_mSetDataReg(XPAR_LEDS_4BIT_DEVICE_ID,LEDChan, count);




Tags:
Jan 3
Partial Reconfiguration

各种方法:
1. Difference based - xapp290
2. Module Based without PlanAhead - xapp208
3. Module Based with PlanAhead - 视频教程


Difference Based非常方便,主要是使用bitgen的开关选项:
引用
bitgen -g ActiveReconfig:Yes -g Persist:yes -r [original.bit] [new.ncd] [new.bit]


xapp290中用了FPGA Editor做了小修改,当然也可以用ISE直接Implement后进行difference比较。在Implement过程中最好用SmartGuide或者Partition技术对没有改变的部分做好保护。

基于ML403的实验工程
Dec 17
如果Custom IP中有一端口要做成双向的该怎么做?

直接在User Logic中写成inout的话在重新import的时候会认不出来这个port。

答案是定义三个端口:IO_I, IO_O, IO_T。这样CIP Wizard就能认出这个端口是inout的了。

参考资料:
psf_rm.pdf --> MPD --> Design Considerations
Tags: ,
Dec 14
目标:GPIO - Button 产生Interrupt。Interrupt处理函数中点亮LED

HW:Spartan 3E BSB + Button + LED + UART
手工添加OPB_INTC 1.00.c
连接Button - Interrupt Port到OPB_INTC - Intr Port
连接OPB_INTC - IRQ Port到 MicroBlaze - Interrupt Port

SW:
引用
Main:
1. Initialize LED, set LED direction
2. Initialize Button, set Button direction
3. Start interrupt controller
4. Enable button interrupt
5. Enable MicroBlaze interrupt
6. Register button ISR handler

button_int_handler:
1. Read GPIO_ISR
2. If GPIO_ISR = 1, read button status and set LED status
3. Clear interrupt


注:
如果在MSS文件中给peripheral driver添加int_handler parameter,就可以不需要在主程序内register ISR handler了。这个过程中要注意int_port的name是peripheral的pin name,不是signal name。
引用
BEGIN DRIVER
PARAMETER DRIVER_NAME = gpio
PARAMETER DRIVER_VER = 2.01.a
PARAMETER HW_INSTANCE = Buttons_4Bit
PARAMETER int_handler = button_int_handler, int_port = IP2INTC_IRPT
END


参考资料:
est_rm.pdf - Appendix B: Interrupt Management
Xapp778
GPIO Datasheet
psf_rm.pdf - Char 6 MSS - INT_HANDLER

附件包含MHS, MSS, BSB,  int1.c, xparameters.h
Tags: ,
Dec 13
ModelSim 6.2 以后默认给vsim, vcom, vlog都加了-vopt选项进行优化。但是算法可能还不是非常完美,经常把以前没问题的project弄得不能仿真。所以有时要给他加-novopt的选项禁止优化。

相关资料:
http://www.xilinx.com/support/answers/25311.htm
http://www.xilinx.com/support/answers/24293.htm
http://www.xilinx.com/support/answers/24776.htm
Tags:
分页: 6/25 第一页 上页 3 4 5 6 7 8 下页 最后页 [ 显示模式: 摘要 | 列表 ]