zoukankan      html  css  js  c++  java
  • Rocket

    https://mp.weixin.qq.com/s/on1LugO9fTFJstMes3T2Xg

     

    介绍riscv-debug的使用实例:使用三种方法写内存。

     

    1. Using System Bus Access

     

    1) Write a word to memory

     

    A. 写sbaddress0寄存器:写入目标内存地址;

    B. 写sbdata0寄存器:写入要写入目标内存地址处的值;触发写内存动作:

     

    2) Write a block of memory

     

    A. 写sbcs寄存器:

    a. sbaccess=2:访问大小是32bit;

    b. sbautoincrement=1:sbaddress is incremented by the access size (in bytes) selected in sbaccess after every system bus access;

     

    B. 写sbaddress0寄存器:写入目标内存地址;

    C. 写sbdata0寄存器:写入要写入目标内存地址处的值;触发写内存动作;

    D. 写sbdata0寄存器:写入要写入目标内存地址处的值;触发写内存动作;

    E. 如此即可逐个把数据写入内存;

     

    2. Using Program Buffer

     

    1) Write a word to memory

     

    A. 准备好Program Buffer:把寄存器s1中的数据写入寄存器s0中的内存地址中;

    B. 写data0寄存器:写入目标内存地址;

    C. 写command寄存器:写入要执行的抽象命令:把data0寄存器的值拷贝到寄存器s0中;

    D. 写data0寄存器:写入待存数据;

    E. 写command寄存器:写入要执行的抽象命令:

    a. 把data0中的值拷贝到s1中;

    b. postexec=1:执行完抽象命令之后,触发Program Buffer的执行;

     

    2) Write a block of memory

     

    A. 准备好Program Buffer:把寄存器s1中的数据写入寄存器s0中的内存地址中,然后把s0中的地址加4;

    B. 写data0寄存器:写入目标内存地址;

    C. 写command寄存器:写入要执行的抽象命令:把data0寄存器的值拷贝到寄存器s0中;

    D. 写data0寄存器:写入待写数据;

    E. 写command寄存器:写入要执行的抽象命令:

    a. 把data0中的值拷贝到s1中;

    b. postexec=1:执行完抽象命令之后,触发Program Buffer的执行;

     

    F. 写abstractauto寄存器:读data0寄存器触发抽象命令的执行;

    a. autoexecdata=1: When a bit in this field is 1, read or write accesses to the corresponding data word cause the command in command to be executed again.

     

    G. 写data0寄存器:写入待写数据;触发抽象命令的执行;进而触发Program Buffer的执行;如此循环即可写入全部数据;

     

    H. 最后清除abstractauto寄存器中的autoexecdata位;

     

    3. Using Abstract Memory Access

     

    1) Write a word to memory

     

    A. 写data1寄存器:存入目标内存地址;

    B. 写data0寄存器:写入待存数据;

    C. 写command寄存器:存入要执行的抽象命令:

    a. cmdtype=2:表示命令的类型为Access Memory;

    b. aamsize=2:Access the lowest 32 bits of the memory location.

    c. aamvirtual=0:Addresses are physical (to the hart they are performed on).

    d. write=1:Copy data from arg0 portion of data into the memory location specified in arg1.

     

    这条命令的效果是:把data0寄存器中的数据,写入data1中的地址中;

     

    2) Write a block of memory

     

    这里只介绍一下要点:

    a. aampostincrement=1:每次访问完内存之后,都把data1寄存器中的地址加4;

    b. abstractauto.autoexecdata=1:读写data0寄存器会触发抽象命令的执行;

  • 相关阅读:
    win10新特性,ubuntu子系统(安装及配置)
    excel计算后列填充
    word中利用宏替换标点标点全角与半角
    CFD-post的奇技淫巧
    mfix模拟流化床燃烧帮助收敛的方法
    cygwin下配置alias
    endnote 使用方法
    win8系统换win7系统
    python中的函数以及递归
    01python算法--算法和数据结构是什么鬼?
  • 原文地址:https://www.cnblogs.com/wjcdx/p/11878997.html
Copyright © 2011-2022 走看看