From the course: Getting Started with RISC-V

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Step simulation demo

Step simulation demo

- [Instructor] We saw the previous example in continuous simulation mode, but Venus also allows for stepwise simulation with all the usual perks of a debugger, like a memory view, breakpoints, watches, and so on. This example implements my version of the widely-known strlen() function from the C programming language. Okay, it's not the exact function, but a program that counts the characters in a string. The opening comment describes this algorithm starting at line 12. So let's suppose we have an integer variable that acts as a counter initialized at zero. Then we have a string called str in line 13. Technically, this is a pointer to a character initialized to point to a hard-coded string constant that reads, "RISC-V is the bomb!!!" The program will count the characters in that string. So take a minute to look at the string and verify that the count should be 21. So the program starts at line 15 and it's very simple. In…

Contents