Giter Site home page Giter Site logo

Comments (1)

MarWit avatar MarWit commented on July 18, 2024

Hey @nandojve!

You are right about relevance of sysbus GetSymbolAddress <symbol-name> — you can use that method to acquire address of any symbol located in the .symtab section (pretty much any global symbol for that matter).

$myVarAddress=`sysbus GetSymbolAddress "my_var"`

Now you can read contents of this using appropriate sysbus method, e.g. assuming that variable in question is unsigned int, you could do:

sysbus ReadDoubleWord $myVarAddress

Other methods you would want to use are:

sysbus ReadByte <address> # reads single byte, returns as byte
sysbus ReadWord <address> # reads two bytes, returns as unsigned short
sysbus ReadDoubleWord <address> # reads four bytes, returns as unsigned int
sysbus ReadQuadWord <address> # reads four bytes, returns as unsigned long
sysbus ReadBytes <address> <count> # reads <count> bytes, returns as array of bytes

There are also dual sysbus methods for writes:

sysbus ReadByte <address> <value>
sysbus ReadWord <address> <value>
sysbus ReadDoubleWord <address> <value>
sysbus ReadQuadWord <address> <value>

So, lets assume that my_var is global, unsigned int; the robot test would look something like this:

*** Test Cases ***
Check If my_var Is Equal To Zero
                 Prepare Platform
                 # Store my_var address in Robot variable
${MY_VAR_ADDR}=  Execute Command    sysbus GetSymbolAddress "my_var"
                 # Move simulation by one second forward
                 Execute Command    emulation RunFor "00:00:01"
${MY_VAR}=       Execute Command    sysbus ReadDoubleWord ${MY_VAR_ADDR}
                 Should Be Equal    ${MY_VAR}    0    my_var should be equal to zero

from renode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.