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寄存器会触发抽象命令的执行;

  • 相关阅读:
    [笔记]: 树链剖分 2017-06-05 16:57 35人阅读 评论(0) 收藏
    [笔记]: 最小生成树Kruska 2017-06-05 16:52 34人阅读 评论(0) 收藏
    [笔记]: 并查集 2017-06-05 16:49 58人阅读 评论(0) 收藏
    [bzoj2144]: 跳跳棋 2017-06-02 15:53 42人阅读 评论(0) 收藏
    [noip2013] 货车运输(最大生成树+并查集+LCA) 2017-06-02 15:18 56人阅读 评论(0) 收藏
    [练习] LCA练习1(最基础) 2017-06-02 11:54 39人阅读 评论(0) 收藏
    [笔记]: RMQ算法(区间查询) 2017-06-01 18:06 44人阅读 评论(0) 收藏
    [笔记]: LCA最近公共祖先 2017-06-01 11:38 38人阅读 评论(0) 收藏
    [hdu&poj&洛谷] 经典线段树练习题 2017-06-01 08:10 56人阅读 评论(0) 收藏
    保留X位小数(Double) swift
  • 原文地址:https://www.cnblogs.com/wjcdx/p/11878997.html
Copyright © 2011-2022 走看看