【Sipeed 高云GW2A FPGA开发板】——ARM Cortex-M0软核处理器_LED点灯
[复制链接]
本帖最后由 mars4zhu 于 2022-11-23 19:47 编辑
4. 在高云半导体GW2A系列FPGA平台上运行ARM Cortex-M0软核处理器
4.1. ARMSOC_2
在原有代码基础上做细微修改,主要在于:
-
ClockDiv模块中,分频参数根据板载时钟频率,将其改为27分频的合适频率。
AHBLITE_SYS.v:
// ClockDiv #(.CLOCK_DIV(8'd50)) uClockDiv (
ClockDiv #(.CLOCK_DIV(8'd27)) uClockDiv (
-
AHB2MEM模块中,之前使用的FPGA容量较大,因此采用了32KB的配置,但该配置在GW2A-18芯片上综合不通过,报错信息显示BRAM容量超出最大容量限制,因此修改为1KB配置,综合通过。
AHBLITE_SYS.v:
// AHB2MEM #(.MEMWIDTH(15)) uAHB2MEM (
AHB2MEM #(.MEMWIDTH(10)) uAHB2MEM (
-
对应的IO引脚配置,如下:
IO_LOC "LED[7]" P6;
IO_PORT "LED[7]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[6]" T6;
IO_PORT "LED[6]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[5]" L16;
IO_PORT "LED[5]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[4]" L14;
IO_PORT "LED[4]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[3]" N14;
IO_PORT "LED[3]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[2]" N16;
IO_PORT "LED[2]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[1]" A13;
IO_PORT "LED[1]" PULL_MODE=UP DRIVE=8;
IO_LOC "LED[0]" C13;
IO_PORT "LED[0]" PULL_MODE=UP DRIVE=8;
IO_LOC "RESETn" T10;
IO_PORT "RESETn" PULL_MODE=UP;
IO_LOC "CLK" H11;
IO_PORT "CLK" PULL_MODE=UP;
综合之后整体的鸟瞰图如下:
其综合过程对RAM的推断识别,并自动转换为FPGA的内部BRAM资源及其初始化内容过程如下:
Extracting RAM for identifier 'memory'("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":140)
WARN (EX3858) : System task 'display' is ignored for synthesis("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":143)
WARN (EX3858) : System task 'display' is ignored for synthesis("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":145)
测试时特意将code.hex文件路径移动,则会报错如下:
Extracting RAM for identifier 'memory'("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":140)
WARN (EX3858) : System task 'display' is ignored for synthesis("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":143)
WARN (EX3988) : Cannot open file '..\Software\code.hex'("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":144)
WARN (EX3858) : System task 'display' is ignored for synthesis("E:\myApp\Z3_IC\CPU\ARM\FPGA\DesignStart\myApp\CM0DS-DesignKit\AHB_Peripherals\AHBL_MEM\AHB2MEM_V2.v":145)
最终下载运行后的效果为LED交叉闪烁(每隔一段时间0x55切换到0xAA),如图:
|