8

Tang Nano 20K PicoRV32 + SimpleUART

 9 months ago
source link: https://www.taterli.com/9628/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Tang Nano 20K PicoRV32 + SimpleUART

Tang Nano 20K PicoRV32 + SimpleUART

前面早就移植过PicoRV32,这个内核相当简单,当然它也可以像其他内核一样搞一个Wishbone或者AXI的总线,之前总有人觉得,通过GAO看不到Message,不知道是不是正常运行,行吧,那就把官方的SimpleUART也拿来用.

由于我不想改hex文件,所以那就改逻辑,让他上电时候执行到位置就开始给串口打东西.


wire uart_wait;

simpleuart #(
.DEFAULT_DIV(234)
) simpleuart_inst (
   .clk(clk),
   .resetn(!resetn),
   .ser_tx(ser_tx),
   .reg_dat_we(mem_valid && !mem_ready && |mem_wstrb && mem_addr == 32'h1000_0000),
   .reg_dat_di(mem_wdata),
   .reg_dat_wait(uart_wait)
);

分频系数是27MHz / 115200 ≈ 234,再把mem_ready条件修改一下.

    mem_ready <= (mem_valid && !mem_ready && m_read_en) || 
                 (mem_valid && !mem_ready && |mem_wstrb && mem_addr == 32'h1000_0000 && !uart_wait);

最后约束并烧录.

image-15.png

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK