亲爱的先生,
我是EDK的新手,我想在ISim(在ise设计中包含elf文件)中使用以下C代码和VHDL测试台来模拟MicroBlaze项目,但我总是得到结果零,所以请帮助解决它?
我附上了我的入门项目的截图
=================== SDK C程序============================
===========
##包括包括
int main(void){XGpio led,button;
int状态;
Status = XGpio_Ini
tialize(& led,XPAR_LED_DEVICE_ID);
if(Status!= XST_SUCCESS){return XST_FAILURE;
}
XGpio_SetDataDirection(安培; LED,1,0);
XGpio_Initialize(& button,XPAR_BUTTON_DEVICE_ID); XGpio_SetDataDirection(& button,1,1);
而(1){
if(XGpio_DiscreteRead(& button,1)== 1){
XGpio_DiscreteWrite(& led,1,255);} else {
XGpio_DiscreteWrite(& led,1,100);}
返回XST_SUCCESS;
}
===================== VHDL Testbench =============================
=========
--------------------------------------------------
------------------------------ LIBRARY ieee; USE ieee.std_logic_1164.ALL;
ENTITY tb ISEND tb;
tb IS的体系结构行为 - 被测单元的组件声明(UUT)COMPONENT ssmb_top PORT(
FPGA_0_clk_1_sys_clk_pin:IN std_logic; fpga_0_rst_1_sys_rst_pin:IN std_logic; button_GPIO_IO_I_pin:IN std_logic; led_GPIO_IO_O_pin:OUT std_logic_vector(0 to 7));
结束组成部分;
- 输入信号fpga_0_clk_1_sys_clk_pin:std_logic:='0';
signal fpga_0_rst_1_sys_rst_pin:std_logic:='0';
signal button_GPIO_IO_I_pin:std_logic:='0';
- 输出信号led_GPIO_IO_O_pin:std_logic_vector(0到7);
- 端口列表中未检测到时钟。
替换为 - 适当的端口名称BEGIN - 实例化被测单元(UUT)uut:ssmb_top PORT MAP(fpga_0_clk_1_sys_clk_pin => fpga_0_clk_1_sys_clk_pin,fpga_0_rst_1_sys_rst_pin => fpga_0_rst_1_sys_rst_pin,button_GPIO_IO_I_pin => button_GPIO_IO_I_pin,led_GPIO_IO_O_pin => led_GPIO_IO_O_pin);
fpga_0_clk_1_sys_clk_pin fpga_0_rst_1_sys_rst_pin button_GPIO_IO_I_pin