我使用 SOPC 选择 CPU,片上内存 4096Bytes,LED,开关,然后它会自动生成以下文件,然后我在 test_bench 中注释一些代码,
写到板子上,它只开灯,我不能用开关关掉然后我用SOPC打开eclipse,然后用genarte BSP,然后在eclipse中构建项目并打开flash编程器,开始按钮被禁用,不知道在哪里是编译和加载按钮
module test_bench
;
wire clk;
reg clk_0;
wire [ 7: 0] in_port_to_the_Switches;
wire jtag_uart_0_avalon_jtag_slave_dataavailable_from_sa;
wire jtag_uart_0_avalon_jtag_slave_readyfordata_from_sa;
wire [ 7: 0] out_port_from_the_LEDs;
reg reset_n;
// <ALTERA_NOTE> CODE INSERTED BETWEEN HERE
// add your signals and additional architecture here
// AND HERE WILL BE PRESERVED </ALTERA_NOTE>
//Set us up the Dut
testsopc1 DUT
(
.clk_0 (clk_0),
.in_port_to_the_Switches (in_port_to_the_Switches),
.out_port_from_the_LEDs (out_port_from_the_LEDs),
.reset_n (reset_n)
);
/*
initial
clk_0 = 1'b0;
always
#10 clk_0 <= ~clk_0;
initial
begin
reset_n <= 0;
#200 reset_n <= 1;
end
*/
endmodule
#define Switches (volatile char *) 0x0003000
#define LEDs (char *) 0x0003010
int main()
{
while (1)
{
*LEDs = *Switches;
}
return 0;
}
更新项目链接
https://skydrive.live.com/redir?resid=E0ED7271C68BE47C!361
当我再次打开项目以构建项目时,它说 RUN_ON_HDL_SIMULAGTOR_ONLY xxxx.elf 错误 1
然后我再次构建BSP并再次构建项目,它变得全部完成然后我记得清理,它再次出现错误然后再次构建
但是,无论我做什么,我打开或关闭开关,它只会亮,永远不会熄灭