一、FPGA硬件部分配置
1、使用Quartus开发软件打开厂商提供的模板工程,使用platform designer
2、设置外设(从设备)的输入输出,进行IP的封装
3、对外设进行时钟、复位线路设置,设置输出,Generate HDL,
4、等待10分钟左右,实例化的结果如下
5、添加完刚刚生成的结果,返回工程,对顶层文件进行一定修改,设置FPGA端的硬件资源
//====================FPGA===================================
CLOCK //
input FPGA_CLK1_50,
/ Buttons / //KEY is Low-Active
input [ 2: 0] KEY,
/ Swtiches /
input [ 2: 0] SW,
// LED //LED is High-Active
output [ 9: 0] LED // [ 9: 8] >> CB_LED ; [ 7: 0] >> TB_LED
这里注释掉我们不需要的
//FPGA Partion
//.led_pio_external_connection_export (debug_tool_led), // .led_pio_external_connection
.dipsw_pio_external_connection_export (debug_tool_sw), // .dipsw_pio_external_connection
.button_pio_external_connection_export (debug_tool_key), // .button_pio_external_connection
添加需要的输出部分代码
.led_export(LED[7:0])
注意事项:在编译过程中,注意模板芯片的选型和引脚的分配情况。引脚反映硬件连接,如果引脚连接错误,那么即使软件正确,我们也很难得到实验结果。
二、Eclipse 软件开发过程
1、使用SoC EDS开发工具,电脑搜索栏输入EDS,点击EDS
注意:SoC EDS必须安装在Quatus相同的目录下面,否则运行会报错
2、继续进行下面的操作
$ cd C:/Users/Lenovo/Desktop/C5TB_GHRD
$ ./generate_hps