change core clock to 25MHZ

Signed-off-by: liangkangnan <liangkangnan@163.com>
pull/4/head
liangkangnan 2021-05-17 16:40:25 +08:00
parent 536d28ede3
commit 136dc45a09
3 changed files with 23 additions and 18 deletions

View File

@ -14,12 +14,12 @@
limitations under the License. limitations under the License.
*/ */
`define CPU_RESET_ADDR 32'h00000000 // CPU复位地址 `define CPU_RESET_ADDR 32'h00000000 // CPU复位地址
`define CPU_CLOCK_HZ 50000000 // CPU时钟(50MHZ) `define CPU_CLOCK_HZ 25000000 // CPU时钟(25MHZ)
`define JTAG_RESET_FF_LEVELS 5 `define JTAG_RESET_FF_LEVELS 5
`define ROM_DEPTH 8192 // 指令存储器深度单位为word(4字节) `define ROM_DEPTH (32 * 1024) // 指令存储器深度单位为word(4字节)
`define RAM_DEPTH 4096 // 数据存储器深度单位为word(4字节) `define RAM_DEPTH ( 8 * 1024) // 数据存储器深度单位为word(4字节)
// 外设地址、大小 // 外设地址、大小
// ROM // ROM
@ -47,17 +47,17 @@
`define SIM_CTRL_ADDR_MASK ~32'hffff `define SIM_CTRL_ADDR_MASK ~32'hffff
`define SIM_CTRL_ADDR_BASE 32'hE0000000 `define SIM_CTRL_ADDR_BASE 32'hE0000000
`define STALL_WIDTH 4 `define STALL_WIDTH 4
`define STALL_PC 2'd0 `define STALL_PC 2'd0
`define STALL_IF 2'd1 `define STALL_IF 2'd1
`define STALL_ID 2'd2 `define STALL_ID 2'd2
`define STALL_EX 2'd3 `define STALL_EX 2'd3
`define INST_NOP 32'h00000013 `define INST_NOP 32'h00000013
`define INST_MRET 32'h30200073 `define INST_MRET 32'h30200073
`define INST_ECALL 32'h00000073 `define INST_ECALL 32'h00000073
`define INST_EBREAK 32'h00100073 `define INST_EBREAK 32'h00100073
`define INST_DRET 32'h7b200073 `define INST_DRET 32'h7b200073
// 指令译码信息 // 指令译码信息
`define DECINFO_GRP_BUS 2:0 `define DECINFO_GRP_BUS 2:0

View File

@ -5,13 +5,13 @@ ENTRY(_start)
MEMORY MEMORY
{ {
flash (wxa!ri) : ORIGIN = 0x00000000, LENGTH = 32K flash (wxa!ri) : ORIGIN = 0x00000000, LENGTH = 32K
ram (wxa!ri) : ORIGIN = 0x20000000, LENGTH = 16K ram (wxa!ri) : ORIGIN = 0x20000000, LENGTH = 8K
} }
SECTIONS SECTIONS
{ {
__stack_size = DEFINED(__stack_size) ? __stack_size : 8K; __stack_size = DEFINED(__stack_size) ? __stack_size : 2K;
.init : .init :
{ {

View File

@ -1,13 +1,18 @@
#include <stdint.h> #include <stdint.h>
#include "../../bsp/include/sim_ctrl.h"
#include "../../bsp/include/xprintf.h"
#include "../../bsp/include/sim_ctrl.h"
#include "../../bsp/include/uart.h"
#include "../../bsp/include/xprintf.h"
int main() int main()
{ {
#ifdef SIMULATION
sim_ctrl_init(); sim_ctrl_init();
#else
uart_init();
#endif
xprintf("hello world\n"); xprintf("hello world\n");