GithubHelp home page GithubHelp logo

renode / renode Goto Github PK

View Code? Open in Web Editor NEW
1.4K 1.4K 254.0 13.08 MB

Renode - Antmicro's open source simulation and virtual development framework for complex embedded systems

Home Page: https://renode.io

License: Other

Shell 2.92% C# 31.96% RobotFramework 46.42% Python 10.68% PowerShell 0.04% C++ 4.40% C 0.73% Batchfile 0.12% CMake 0.01% SystemVerilog 2.73%
arm embedded-systems iot renode risc-v simulation x86

renode's People

Contributors

ajelinski avatar franciszekpin avatar fzdobylak avatar jakubjatczak avatar jan-malek avatar janolencki avatar joannabrozek avatar kamilgalik avatar kamilrakoczy avatar kartben avatar mars-low avatar marwit avatar mateusz-holenko avatar mateuszkarlic avatar mgielda avatar mgorzkowski avatar mmurach avatar msobkowski avatar mszprejda avatar nrabulinski avatar p-woj avatar pgielda avatar piotrzierhoffer avatar pkaszubski avatar pkoscik avatar robertszczepanski avatar tgorochowik avatar wkkuna avatar wojciechowskidawid avatar wojmel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

renode's Issues

RV64G: Possibly fcvt.lu.d not working correctly

Made small replicator, enable double floating point abi and add the math library -lm

C code:

#include <stdint.h>
#include <float.h>

void test(void) {
	double   input   = 1.23456;
	uint64_t result1 = input;
	int64_t  result2 = input;

	while(1) {
	}
}

Assembly:

 6                void test(void) {
                  test:
0000000008003460:   addi    sp,sp,-48
0000000008003464:   sd      s0,40(sp)
0000000008003468:   addi    s0,sp,48
 7                	double input = 1.23456;
000000000800346c:   auipc   a5,0x1
0000000008003470:   addi    a5,a5,-228 # 0x8004388
0000000008003474:   fld     fa5,0(a5)
0000000008003478:   fsd     fa5,-24(s0)
 8                	uint64_t result1 = input;
000000000800347c:   fld     fa5,-24(s0)
0000000008003480:   fcvt.lu.d       a5,fa5,rtz
0000000008003484:   sd      a5,-32(s0)
 9                	 int64_t result2 = input;
0000000008003488:   fld     fa5,-24(s0)
000000000800348c:   fcvt.l.d        a5,fa5,rtz
0000000008003490:   sd      a5,-40(s0)

For some reason fcvt.lu.d step no matter what it will set the result to 0x8000000000000000. I tried few of other fcvt variants (32-bit to 32-bit and 64-bit to 64-bit) and they seem to work, while the 32-bit to 64-bit and 64-bit to 32-bit misbehave (for example fcvt.lu.d). This might not be the only affected instruction (casting back in the reverse order is affected as well) while casting within the same size (32-bit or 64-bit) between int and float registers works.

Feature request: sifive_e300 board

It would be great if Renode provided emulation support for the sifive_e300 platform. QEMU has good support for the e300, so I expect it wouldn't be too much effort to add support to Renode.

Windows - Renode crashes when closed with "x" button

When renode is closed with the "x" button it creates crash popup window.

renode-crash

This behaviour is not noticed when it's killed by some other mechanism, for example if the renode is launched with eclipse then if eclipse is killing it, it willl shutdown without any popup.

Note: The runtime behaviour or stability of the renode is not affected by this issue. So it's cosmetic problem.

Renode 1.4 UART monitor on Windows 10 not updating in real time on multi-core machines

I noticed the UART writes on Windows are much faster, probably due to buffering?

But now UART is not updating as much, with the mandelbrot example it only updates after everything is done. Because by default every single time the screen is cleared there is nothing else to see for many seconds (no history to scroll) only after it finishes it shows the last image.

Could it be some smart optimization? If something is written to a buffer within last 100ms then delay updating the display by another 100ms as it's probably under heavy updates, but because it's under constant updates it will actually never update.

If I artificially added delays on each frame update then it is updated every single frame, but if I decrease the delay slightly it's never updated again until the whole program finished.

I think it would be better if both implementations would be consistent, on Linux it updates straight away as any changes were made. Or have the buffer/smartness as an optional argument to turn on, but not have it set on by default when the other platform doesn't have it.

libmonoboehm-2.0-1 install issue

I noticed that there's a "-p build binary packages" option in building renode from source, that might be what I need.

So I did it following this page : http://renode.readthedocs.io/en/latest/advanced/building_from_sources.html#building-from-source

When I run this command:
"sudo apt-get install git mono-complete automake autoconf libtool g++ realpath gksu libgtk2.0-dev screen uml-utilities gtk-sharp2 python2.7"

This issue appeared, it says :
"The following packages have unmet dependencies:
mono-utils : Depends: libmonoboehm-2.0-1 (= 5.12.0.226-0xamarin3+ubuntu1604b1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."

I tried 'apt-get -f install' and it looks like works, but have no effect to solve the issue.

Any ideas?

Crash when using already used port

When I redirect the uart to a socket and I use port which was already used for redirection the platform crashes (tested on Windows and Linux):

Only one usage of each socket address (protocol/network address/port) is normally permitted
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Antmicro.Renode.Utilities.SocketServerProvider.Start(Int32 port)
   at Antmicro.Renode.Backends.Terminals.ServerSocketTerminalExtensions.CreateServerSocketTerminal(Emulation emulation, Int32 port, String name, Boolean emitConfig)
   at Dynamitey.Internal.Optimization.InvokeHelper.InvokeMemberAction(CallSite& callsite, Type binderType, Int32 knownType, LazyBinder binder, InvokeMemberName name, Boolean staticContext, Type context, String[] argNames, Object target, Object[] args)
   at Dynamitey.Internal.Optimization.InvokeHelper.InvokeMemberActionCallSite(Object target, InvokeMemberName name, Object[] args, String[] tArgNames, Type tContext, Boolean tStaticContext, CallSite& callSite)
   at Dynamitey.Dynamic.InvokeMemberAction(Object target, String_OR_InvokeMemberName name, Object[] args)
   at Antmicro.Renode.UserInterface.Monitor.InvokeWithContext(InvokeContext context, MethodInfo method, Object[] parameters)
   at Antmicro.Renode.UserInterface.Monitor.ExecuteDeviceAction(Type type, String name, IEnumerable`1 p)
   at Antmicro.Renode.UserInterface.Monitor.ProcessDeviceAction(Type device, String name, IEnumerable`1 p, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ProcessDeviceActionByName(String name, IEnumerable`1 p, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ExecuteCommand(Token[] com, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ParseTokens(IEnumerable`1 tokensToParse, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.Parse(String cmd, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.HandleCommand(String cmd, ICommandInteraction ci)
   at AntShell.Shell.HandleCommand(String cmd, ICommandInteraction ic)
   at AntShell.CommandLine.HandleControlSequence(ControlSequence seq)
   at AntShell.Terminal.NavigableTerminalEmulator.HandleInput(Object input)
   at AntShell.Terminal.NavigableTerminalEmulator.Run(Boolean stopOnError)
   at AntShell.Shell.Start(Boolean stopOnError)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)


Unhandled Exception: System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Antmicro.Renode.Utilities.SocketServerProvider.Start(Int32 port)
   at Antmicro.Renode.Backends.Terminals.ServerSocketTerminalExtensions.CreateServerSocketTerminal(Emulation emulation, Int32 port, String name, Boolean emitConfig)
   at Dynamitey.Internal.Optimization.InvokeHelper.InvokeMemberAction(CallSite& callsite, Type binderType, Int32 knownType, LazyBinder binder, InvokeMemberName name, Boolean staticContext, Type context, String[] argNames, Object target, Object[] args)
   at Dynamitey.Internal.Optimization.InvokeHelper.InvokeMemberActionCallSite(Object target, InvokeMemberName name, Object[] args, String[] tArgNames, Type tContext, Boolean tStaticContext, CallSite& callSite)
   at Dynamitey.Dynamic.InvokeMemberAction(Object target, String_OR_InvokeMemberName name, Object[] args)
   at Antmicro.Renode.UserInterface.Monitor.InvokeWithContext(InvokeContext context, MethodInfo method, Object[] parameters)
   at Antmicro.Renode.UserInterface.Monitor.ExecuteDeviceAction(Type type, String name, IEnumerable`1 p)
   at Antmicro.Renode.UserInterface.Monitor.ProcessDeviceAction(Type device, String name, IEnumerable`1 p, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ProcessDeviceActionByName(String name, IEnumerable`1 p, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ExecuteCommand(Token[] com, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ParseTokens(IEnumerable`1 tokensToParse, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.Parse(String cmd, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.HandleCommand(String cmd, ICommandInteraction ci)
   at AntShell.Shell.HandleCommand(String cmd, ICommandInteraction ic)
   at AntShell.CommandLine.HandleControlSequence(ControlSequence seq)
   at AntShell.Terminal.NavigableTerminalEmulator.HandleInput(Object input)
   at AntShell.Terminal.NavigableTerminalEmulator.Run(Boolean stopOnError)
   at AntShell.Shell.Start(Boolean stopOnError)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

When executing:

emulation CreateServerSocketTerminal 9999 "uart"
emulation CreateServerSocketTerminal 9999 "uart"

It's not important, but probably just an error message displayed on the monitor instead of whole platform crashing would be better.

Unaligned memory accesses on RISC-V are not causing a trap.

Memory accesses should be aligned to with 0x4 bytes, if unaligned access if generated it will cause a trap. Then the trap should in software detect the mcause=4 and then generate aligned accesses to the memory and in the end get the equivalent of the unaligned access done in software.

In Renode I can't cause the trap happening on unaligned accesses and the software happily writes to the memory even if they are not aligned, without the need of the software trap. Is it this case, or did I got something wrong?

I would say the emulation should be close to the hardware as much as possible and trap whenever the real hardware traps even if Renode can get the same final result without the trap.

If needed I could supply a small replicator of this problem.

Which robot module should be added?

I found module robot it needed by renode.
I have tried to use pip install robot to fix it.
But it have another problem.

    1. [ ]
    1. Traceback (most recent call last):
    1. File "/opt/renode/tests/run_tests.py", line 10, in
    1. tests_engine.run()
    1. File "/opt/renode/tests/tests_engine.py", line 96, in run
    1. if not suite.run(options):
    1. File "/opt/renode/tests/robot_tests_provider.py", line 118, in run
    1. _suite = robot.parsing.model.TestData(source=self.path)
    1. AttributeError: 'module' object has no attribute 'parsing'
    1. [ ]

Could you please help me to solve this problem?

Feature request: Video Recording

Renode already has the ability to take screenshots. It would be very handy for showing demonstrations of hardware if Renode also had the ability to record short videos to .gif or .mp4 format, without needing to resort to screen scrapers such as gifine (Linux) or Xbox Center (Windows).

Bad IL Format

I tried using the renode 1.8 deb package on Ubuntu 18.04. Any of the example scripts I try to run give this error:

Bad IL format.
  at Antmicro.Renode.UserInterface.Monitor.RunCommand (AntShell.Commands.ICommandInteraction writer, Antmicro.Renode.UserInterface.Commands.Command command, System.Collections.Generic.IList`1[T] parameters) [0x00429] in <0960209a5fcc4ab78b093e288fdc0e38>:0 
  at Antmicro.Renode.UserInterface.Monitor.ExecuteCommand (Antmicro.Renode.UserInterface.Tokenizer.Token[] com, AntShell.Commands.ICommandInteraction writer) [0x001f3] in <0960209a5fcc4ab78b093e288fdc0e38>:0 
  at Antmicro.Renode.UserInterface.Monitor.ParseTokens (System.Collections.Generic.IEnumerable`1[T] tokensToParse, AntShell.Commands.ICommandInteraction writer) [0x001d5] in <0960209a5fcc4ab78b093e288fdc0e38>:0 
  at Antmicro.Renode.UserInterface.Monitor.Parse (System.String cmd, AntShell.Commands.ICommandInteraction writer) [0x001a7] in <0960209a5fcc4ab78b093e288fdc0e38>:0 
  at Antmicro.Renode.UserInterface.Monitor.ProcessCommand (System.String command, AntShell.Commands.ICommandInteraction writer) [0x00000] in <0960209a5fcc4ab78b093e288fdc0e38>:0 
  at Antmicro.Renode.UserInterface.Monitor.HandleCommand (System.String cmd, AntShell.Commands.ICommandInteraction ci) [0x00000] in <0960209a5fcc4ab78b093e288fdc0e38>:0 
  at AntShell.Shell.HandleCommand (System.String cmd, AntShell.Commands.ICommandInteraction ic) [0x000bd] in <a6fe5939364043ceac8ab1d449585e49>:0 
  at AntShell.CommandLine.HandleControlSequence (AntShell.Helpers.ControlSequence seq) [0x00a45] in <a6fe5939364043ceac8ab1d449585e49>:0 
  at AntShell.Terminal.NavigableTerminalEmulator.HandleInput (System.Object input) [0x0002e] in <a6fe5939364043ceac8ab1d449585e49>:0 
  at AntShell.Terminal.NavigableTerminalEmulator.Run (System.Boolean stopOnError) [0x00017] in <a6fe5939364043ceac8ab1d449585e49>:0 
  at AntShell.Shell.Start (System.Boolean stopOnError) [0x000f9] in <a6fe5939364043ceac8ab1d449585e49>:0 
  at Antmicro.Renode.UI.CommandLineInterface+<>c__DisplayClass0_1.<Run>b__3 (System.Object x) [0x00000] in <13cc38bdc7d14607a8d87be2bcf0d6ab>:0 
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x7f6743898110 + 0x0008f> in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x7f6743895a80 + 0x0014d> in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x7f67438959c0 + 0x00041> in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x7f6743895930 + 0x0004d> in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.ThreadHelper.ThreadStart (System.Object obj) <0x7f67438981f0 + 0x0005b> in <285579f54af44a2ca048dad6be20e190>:0 

My system:
Mono JIT compiler version 6.4.0.198 (tarball Tue Sep 24 01:21:28 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(610)
Suspend: hybrid
GC: sgen (concurrent by default)

Closing the platform directly after it started outputs odd error

I'm wondering if I do something strange with my platform, when I start it I can connect with the GDB and use it as usually. But when I launch, do not do anything (not even connecting with GDB) and I close it straight after I get this error:

11:35:49.7209 [DEBUG] machine-0: Disposing sysbus.e51.
11:35:49.7289 [DEBUG] machine-0: Disposing sysbus.u54_1.
11:35:49.7309 [DEBUG] machine-0: Disposing sysbus.u54_2.
11:35:49.7350 [DEBUG] machine-0: Disposing sysbus.u54_3.
11:35:49.7375 [DEBUG] machine-0: Disposing sysbus.u54_4.
11:35:49.7405 [DEBUG] machine-0: Disposing sysbus.
11:35:49.7415 [DEBUG] machine-0: Disposing sysbus.mmc.
11:35:49.7420 [DEBUG] machine-0: Disposing sysbus.envmData.
11:35:49.7425 [DEBUG] machine-0: Disposing sysbus.lim.
11:35:49.7425 [DEBUG] machine-0: Disposing sysbus.ram.
11:35:49.7425 [DEBUG] machine-0: Disposing sysbus.ddr.
11:35:49.7435 [INFO] machine-0: Disposed.
Fatal error:
An action requiring GUI environment detected, but the XWT provider is not started.
   at Antmicro.Renode.UI.ApplicationExtensions.CheckXwtStatus()
   at Antmicro.Renode.UI.ApplicationExtensions.InvokeInUIThread(Action action)
   at TermSharp.Vt100.ByteUtf8Decoder.Feed(Byte b)
   at AntShell.Terminal.BasicTerminalEmulator.SendControlSequence(Byte[] seq)
   at AntShell.Terminal.BasicTerminalEmulator.SendCSI(Byte[] seq)
   at AntShell.Terminal.NavigableTerminalEmulator.Stop()
   at System.Action.Invoke()
   at Antmicro.Renode.Emulator.Exit()

Possible documentation improvement.

I was trying to build the Renode from scratch on empty machines just to see what exact steps are needed.

I used this document:
https://renode.readthedocs.io/en/latest/advanced/building_from_sources.html

And followed the command line approach to build whole renode packages and including the Robot framework (it was the build.sh -p and not the MonoDevelop/VisualStudio aproach).

For the Linux I started with very lightweight install of Debian 9.5 and had to add the following apt packages before running the python -m pip ....:

sudo apt-get install python-pip python-setuptools python-dev ruby ruby-dev build-essential rpm bsdtar

For Windows I started with freshly installed Windows 10 and had to do the following steps:

  • From cygwin installation menu I installed the openssh, git and a zip package as well. Which is needed for making the package.

  • Wix toolset is needed for making the msi package as well. So got it from their github https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311.exe

    • Because it requires .NET Framework 3.5.1, it didn't want to install on fresh the Windows.

    • Installing it through Control Pannel -> Programs and Features -> Turn Windows features on or off -> .NET Framework 3.5 (includes .NET 2.0 and 3.0) for some reason didn't worked for me.

    • So I run CMD as Administrator and typed: Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess while I had the installation disc in my D drive.

    • After this I was able to install the Wix toolset

  • netifaces needs MS VC++ 9.0 to compile - http://aka.ms/vcpython27

  • As well GTK# for .NET (not mono) is needed https://www.mono-project.com/download/stable -> Windows -> GTK# for .NET

This and the existing steps in your documentation should cover from scratch Linux and Windows building full packages.

disable-xwt option breaks port option

In the older version of renode I needed this to suppress the console:
./renode --disable-xwt --port=3320

In the new version this results in:

socat - tcp:localhost:3320
2018/12/06 09:08:23 socat[6815] E connect(5, AF=2 127.0.0.1:3320, 16): Connection refused

Removing --disable-xwt solves this problem as the port option now disables the console pop-up.
./renode --port=3320
Works as expected

For backwards compatibility it would be nice if the --disable-xwt didn't interfere with the port option.

Cosmetic error when clipboard copy is used

Cosmetic problem cause when clipboard COPY/PASTE feature is used anywhere while Renode is running in the background, it will cause the following error to be displayed:

(Renode:23972): Gdk-CRITICAL **: inner_clipboard_window_procedure: assertion 'success' failed

It could be ignored and that would be fine, but the problem is that when Renode is used from within other UI, such as Eclipse, then it will cause that given tab to catch attention/focus. When there are multiple tools switching between one console tab it will forcefully switch to the Renode's console on any of the Copy events.

Machine learning - renode - EFR32

Hello evone,

i'm trying to use renode on a EFR32 MCU for a machine learning project, apparently renode offers the possibility to do this, unfortunatly there is no documentation about this.
Did anyone manages to do this with renode/ or have any suggestions about this ?

Many thank's for help!

showAnalyzer support for additional arguments

This is minor and cosmetic detail, but would it be possible to give additional arguments to the analyzers? For example in case of UARTs it would be handy to specify their character dimensions and already open 80:24 terminal or 132:43. So if I knew my application requires terminal windows with colums more than 80 characters wide, then it could be specified in the script and the UART window then wouldn't have to be resized on every single start.

Incorrect keyboard mapping in Renode terminal

Currently I assume the Renode terminal has a default keymap of en_US (these are the keys that match that keymap when I type), for example, trying to type the " character (it's Shift + 2, on es_ES) results in the @ character. That happens with other characters too.

Example: should be "

Renode

Platform: Windows 10
Renode version: 1.8.2

Cosmetic minor issue with UART on Windows and the first line

This can be experienced with all Mi-V examples, but the blinkies examples have a new line as the first line so it's not visible. But when the text is modified (so there is a text on the first line):

const char * g_hello_msg =
"System timer Blinky Example         \n\r\n\r\
Observe the LEDs blinking on the board. The LED pattern changes \
every time a system timer interrupt occurs\r\n";

Then even blinkies expierence this problem, it can be observed on the mandelbrot/raytracer as well. Looks like the issue is linked with some event as mouse events (left mouse button clicking or scrolling the wheel) will make it appear for about 0.5second before disappearing away again.

Question - AXI Bus

Hello, I'm trying to test software which uses fpga as coprocessing unit. This development is based in a ZynqMP+ which shares the RAM between the FPGA and multiple CPUs in a common axi bus.

So, the question is: Is posible in Renode to share devices like RAM between the FPGA and CPU during the simulation for testing coprocessing cores with production cores?

Currently i'm using cocotb for this stuff but i need to rewrite a lot of code between simulations and production code.

Thanks you
Andres

GDB: Connection locks up when `continuing` on halted machine

When using the GDB server, the network connection locks up if you try to issue a continue statement without first issuing a mon start.

Steps to reproduce:

  1. Start a gdb server with machine StartGdbServer 3333
  2. Connect through gdb, e.g. riscv64-unknown-elf-gdb -ex 'target remote localhost:3333' target.elf
  3. (optional) set some breakpoints or generally set the DUT up for something
  4. Issue c or continue

At this point, the connection will no longer be responsive. You can enter the Renode console and start emulation, but the gdb connection will not work until you do this:

Remote debugging using localhost:3333
_start () at asm.S:27
27      asm.S: No such file or directory.
(gdb) c
Continuing.
^C^CThe target is not responding to interrupt requests.
Stop debugging it? (y or n)

Awkward macros can crash the platform

When trying to make generic CSR fetcher and avoid code duplication for all the 5 cores:

$core=sysbus.e51
macro CSR
"""
$core MSTATUS
"""
runmacro $CSR

I get to crash the platform consistently:

Fatal error:
Object reference not set to an instance of an object.
   at Antmicro.Renode.UserInterface.Monitor.RunCommand(ICommandInteraction writer, Command command, IList`1 parameters)
   at Antmicro.Renode.UserInterface.Monitor.ExecuteCommand(Token[] com, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ParseTokens(IEnumerable`1 tokensToParse, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.Parse(String cmd, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.HandleCommand(String cmd, ICommandInteraction ci)
   at AntShell.Shell.HandleCommand(String cmd, ICommandInteraction ic)
   at AntShell.CommandLine.HandleControlSequence(ControlSequence seq)
   at AntShell.Terminal.NavigableTerminalEmulator.HandleInput(Object input)
   at AntShell.Terminal.NavigableTerminalEmulator.Run(Boolean stopOnError)
   at AntShell.Shell.Start(Boolean stopOnError)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)


Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Antmicro.Renode.UserInterface.Monitor.RunCommand(ICommandInteraction writer, Command command, IList`1 parameters)
   at Antmicro.Renode.UserInterface.Monitor.ExecuteCommand(Token[] com, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.ParseTokens(IEnumerable`1 tokensToParse, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.Parse(String cmd, ICommandInteraction writer)
   at Antmicro.Renode.UserInterface.Monitor.HandleCommand(String cmd, ICommandInteraction ci)
   at AntShell.Shell.HandleCommand(String cmd, ICommandInteraction ic)
   at AntShell.CommandLine.HandleControlSequence(ControlSequence seq)
   at AntShell.Terminal.NavigableTerminalEmulator.HandleInput(Object input)
   at AntShell.Terminal.NavigableTerminalEmulator.Run(Boolean stopOnError)
   at AntShell.Shell.Start(Boolean stopOnError)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

I would say the macros with errors should be reject, but not cause whole platform to crash.

UART interrupt handling

I am currently using the renode framework for some of my unit testing and i had a question about the UART Interrupt handling. I am using a STM32f4 series controller and from my testing i saw that the UART can only be configured to POLL for data rather than interrupt based. I see that there is a GPIOInterruptManager function which is used in the MIV_CoreGPIO.cs file. I believe this is used by the UART in the example project that is defined in your user guide. Can this same function be used for the STM32 project as well for interrupt handling or are you guys adding any new code to support interrupt handling for STM32 based controller??

GDB: Line length limit is short

It appears as though the line length for GDB commands is rather short -- about 48 characters -- resulting in commands getting cut off:

(gdb) mon sysbus LoadELF @../kernel/target/riscv32i-unknown-none-elf/debug/xous-kernel
There was an error executing command 'sysbus LoadELF @../kernel/target/riscv32i-unkno'
Error while loading ELF: Could not find file '../kernel/target/riscv32i-unkno'..
        Could not find file '../kernel/target/riscv32i-unkno'.
(gdb)

Improving EFM32 support

I'm porting RIOT-OS to the Silicon Labs EFM32 microcontrollers, by generating the required files based on parsing data from their SDK. I've been experimenting with generating Renode platform files, and it turns out that this works great.

My current setup involves parsing SVD files for the peripheral and augment that with SDK/header file information (flash/sram sizes etc).

At this point, I have +/- 400 CPU files, and I'd like to contribute them. I have a few questions:

  • Is there an interest of supporting more EFM32 microcontrollers? I'd like to help!
  • If so, what would be the desired structure? Adding 400 CPU's to the platforms/cpu/ folder won't work out I guess. Putting them remotely?

A few more questions about the platform files:

  • What is the benefit of using ApplySVD over separate Tag instructions? The latter doesn't require an additional 2+MB file.
  • Single-files or inheritance (e.g EFM32GG990F256 inherits from EFM32GG)? So far, only the CPU and NVIC could be inherited, but that's only a few lines per file extra.

Thanks!

Support MDIO with LiteEth

From Wikipedia - MDIO

Management Data Input/Output (MDIO), also known as Serial Management Interface (SMI) or Media Independent Interface Management (MIIM), is a serial bus defined for the Ethernet family of IEEE 802.3 standards for the Media Independent Interface, or MII. The MII connects Media Access Control (MAC) devices with Ethernet physical layer (PHY) circuits. The MAC device controlling the MDIO is called the Station Management Entity (SME).

Currently when Renode is emulating LiteEth it is also not emulating the MDIO interface. This means that the output from the example here -> https://github.com/timvideos/litex-buildenv/wiki/Renode shows the following output;

         built: Jun 14 2019 09:49:25
        uptime: 00:00:00
-----------------------------------------------
MDIO mode: 10Mbps / link: down
uIP init done with ip 192.168.100.50
Etherbone listening on port 1234

The issue being the MDIO mode: 10Mbps / link: down when it should probably 100Mbps / link: up.

The firmware code which talks to the MDIO device can be found here;

There is some code for MDIO emulation in QEmu @ stffrdhrn/qemu@master...mithro:mdio

Best practice to add a board/CPU?

Hello,

I would like to see if there's additional documentation that I can follow to add a "customized" board/CPU.

At this point, I'm specifically interested in WiFi interface, where the underlying WiFi component can be either on-chip or onboard. (WiFi driver is likely vended to us in binary, and data sheet is likely incomplete..) With Renode, the hope is to have as little modification in kernel/OS code as possible, so that the emulation result resembles result running on a real piece of hardware. (In a slightly different approach, I guess we could "mock" WiFi in kernel/OS whenever running on emulator... ) Appreciate any tip!

Windows - Missing font message

Font 'Roboto Mono' not available in the system. Using 'Sans' instead
12:39:59.1273 [WARNING] The font 'Roboto Mono' defined in the config file cannot be loaded.

This is a cosmetic issue, but probably should be addressed, I got few ideas how to address these:

  • bundling the required font with the renode (if it's royalty free and renode depends on it)
  • make the font failure and switching fallback lower log level (I don't like this idea)
  • chose a different mono font which will be universally present on all platform (if there exists any)
  • have predefined default fonts for each platform and only complain if these will not be found (sounds to me as the most reasonable choice)

I have mixed feelings about this issue, because it doesn't really have a proper solution and leaving it as is will probably cause some user to be confusion at some point. And creating log of verbose output can cause catching attention and devaluating the more important warning messages. Lovering the log levels is not solution as well. So i'm not sure how this could be addressed properly.

Bluetooth Low Energy

I have been trying to run the zephyr bluetooth samples but with no luck. Does renode support BLE peripheral?

GDB: CPU locks up when resetting $pc while executing `WFI`

When using gdb, the CPU appears to lock up when attempting a reset by setting $pc.

Steps:

  1. Start a server by running machine StartGdbServer 3333
  2. Attach a debugger. This can be done with e.g. riscv64-unknown-elf-gdb -ex 'target remote localhost:3333' target.elf
  3. Start emulation mon start
  4. Break emulation and reset $pc: set $pc=0x20500000
  5. Attempt to continue execution

From this point onward, the emulated device will be completely unresponsive.

Remote debugging using localhost:3333
_start () at asm.S:27
27      asm.S: No such file or directory.
(gdb) mon start
Starting emulation...
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x20504268 in __wfi ()
(gdb) set $pc=0x20500000
(gdb) stepi
27      in asm.S
(gdb)
27      in asm.S
(gdb)
27      in asm.S
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
_start () at asm.S:27
27      in asm.S
(gdb) stepi
27      in asm.S
(gdb)
27      in asm.S
(gdb)

Feature request: optional autoKill for the gdb server

Now when the renode has the autoStart for GDB:

sysbus.cpu StartGdbServer 5000 true

Connecting with GDB into it will automatically start the cpu/emulation. I'm wondering how viable and difficult it would be to have a separate optional argument (with the default value set to false) to autoKill. AutoKill would stop everything and terminate renode on any gdb connection lost (either by fault/error or by human just regularly disconnecting the gdb)

HiFive Unleashed boot issue.

Both win10 and Mac show the same issue when starting hifive_unleashed.
Starting the resc file...

image

UART window ...
image

userid=root
password=sifive

or password=

Add Wishbone bus support to VerilatorPlugin

Currently the VerilatorPlugin only supports the AXI4-Lite bus. However, many open source cores are actually Wishbone devices.

It would be nice to create a wishbone bus master interface to allow us to simulate verilog-based wishbone buses prior to creating the C# models of them.

Cosmetic minor detail: Icon on Windows 7 is missing.

Using Renode 1.4.1 on Windows 7 64bit and the classic theme (no compositing nor effects). The taskbar and window icons look missing:

icons

It's very minor issue, as the floating point instructions and UART work much better compared to the previous versions.

GDB server doesn't support processor-specific CSRs

Reposted here from https://github.com/renode/renode-infrastructure/issues/10

The built-in gdb server does not appear to expose any CSRs as native registers:

(gdb) info all
zero           0x0      0
ra             0x205017d8       0x205017d8 <xous_kernel_main+24>
sp             0x40ffffd0       0x40ffffd0
gp             0x40000800       0x40000800
tp             0x0      0x0
t0             0x2050013c       542114108
t1             0x0      0
t2             0x0      0
fp             0x40fffff0       0x40fffff0
s1             0x0      0
a0             0x40000000       1073741824
a1             0x40000000       1073741824
a2             0x205053ac       542135212
a3             0x0      0
a4             0x0      0
a5             0x0      0
a6             0x0      0
a7             0x0      0
s2             0x0      0
s3             0x0      0
s4             0x0      0
s5             0x0      0
s6             0x0      0
s7             0x0      0
s8             0x0      0
s9             0x0      0
s10            0x0      0
s11            0x0      0
t3             0x0      0
t4             0x0      0
t5             0x0      0
t6             0x0      0
pc             0x20500f70       0x20500f70 <xous_riscv::register::mstatus::set_mie>
(gdb)

As a result, it isn't possible to use native gdb commands to inspect registers such as $mtvec or $mie.

Renode does properly respond to the "target.xml" query, however it does not report any registers.

In wishbone-tool we add 65 to all CSRs and dynamically adjust the xml that gets returned based on configured registers: https://github.com/xobs/wishbone-utils/blob/2f8a44db8d9421efe453be4c4481f0549f4c8fc8/wishbone-tool/src/riscv/mod.rs#L542-L585

A workaround is to use mon cpu MTVEC or mon cpu MIE, which is nonstandard and doesn't do e.g. $mie decoding.

Create an emulation model for the Tomu.im board

Tomu is an open source, tiny little ARM microcontroller that fits inside your USB port.

The Tomu uses an SiLabs EFM32HG309 part. It looks like there is already quite a bit of support for the SiLabs EFM32 series.

The closest platform I found was for the EFM32HG350.

I think that means it would be as simple as;

  • Copying the efm32hg350.repl file to efm32hg309.repl and tweaking some values
  • Adding the efm32hg USB device interface.
  • Creating a board configuration.

The USB device is described as;

3.1.10 Low Energy USB

The unique Low Energy USB peripheral provides a full-speed USB 2.0 compliant device controller and PHY with ultra-low current consumption.
The device supports both full-speed (12 MBit/s) and low speed (1.5 MBit/s) operation, and includes a dedicated USB oscillator
with clock recovery mechanism for crystal-free operation. No external components are required. The Low Energy Mode ensures the
current consumption is optimized and enables USB communication on a strict power budget. The USB device includes an internal dedicated
descriptor-based Scatter/Gather DMA and supports up to 3 OUT endpoints and 3 IN endpoints, in addition to endpoint 0. The onchip
PHY includes software controllable pull-up and pull-down resistors.

I believe this USB controller is very similar to others in the EFM32HG series. It says

The features of the EFM32HG309 is a subset of the feature set described in the EFM32HG reference Manual.
| USB | Full configuration | USB_VREGI, USB_VREGO, USB_DM, USB_DMPU, USB_DP |

The schematic of the Tomu board can be found here.

Renode locks up when printing very long lines to serial console

I'm looking at using Renode to develop for RISC-V, however it seems to be locking up.

renode-init.resc

using sysbus
mach create
machine LoadPlatformDescription $ORIGIN/base.repl
showAnalyzer uart
sysbus LoadELF "C:/Users/smc/Code/renode-test/target/riscv32i-unknown-none-elf/debug/renode-test"
start

base.repl:

rom: Memory.MappedMemory @ sysbus 0x20000000
    size: 0x00800000

sram: Memory.MappedMemory @ sysbus 0x10000000
    size: 0x00008000

cpu: CPU.VexRiscv @ sysbus
    timeProvider: cpu_timer
    cpuType: "rv32ima"
    privilegeArchitecture: PrivilegeArchitecture.Priv1_10

timer0: Timers.LiteX_Timer @ sysbus 0xe0002800
    frequency: 100000000
    -> cpu@1

uart: UART.LiteX_UART @ sysbus 0xe0001800
    -> cpu@0

cpu_timer: Timers.LiteX_CPUTimer @ sysbus 0xe0000800
    // Run the clock at 12 MHz
    frequency: 12000000
    // IRQ #100 is Machine Timer Interrupt
    -> cpu@100

renode-test.zip -- compressed version of the elf file

This is an experiment to get Rust working with this system, so I'm unsure of where the problem lies. However, I do know for a fact that renode is locking up, and Windows marks it as "Not Responding".

Windows 10, version 1.8.1.30148 (db38fa8-201910091635)

Gtk# is required to run the application in a windows environment

Running application on Windows 10 system, using version 1.3 from zip file, results in program crash if Gtk# is not instaled. In the documentation from which I read, I did not find any information about this requirement. Gtk# it is only listed as required when compiling.

Copy feature creates exception on Windows platforms

How to replicate:

  1. Downloaded windows ZIP package of the renode_1.8.2 release and extracted it.
  2. Running it on Windows 7 64-bit OS
  3. In the Renode's monitor window, selecting something (for example the "Renode, version 1.8.2.24846 (dc338ac-201911131318)" text)
  4. Right-click and then left-click on the "Copy" context menu will cause an unhandled exception, this will show in the Renode.exe window and in a separate popup as well. Note: The selected content actually gets copied into the clipboard.
OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Windows.Clipboard.Flush()
   at System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
   at System.Windows.Clipboard.SetDataInternal(String format, Object data)
   at Xwt.WPFBackend.WpfClipboardBackend.SetData(TransferDataType type, Func`1 dataSource)
   at Xwt.Button.OnClicked(EventArgs e)
   at Xwt.Toolkit.Invoke(Action a)

Fedora package fails transaction check

I don't know if this is an fpm issue, but dnf on Fedora 30 detects packaging conflicts when attempting to install. A lot of other packages install icons into these folders without conflicts.

Error: Transaction check error:
file /usr/share/icons/hicolor from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/128x128 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/128x128/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/16x16 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/16x16/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/24x24 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/24x24/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/32x32 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/32x32/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/48x48 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/48x48/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/64x64 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/64x64/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/scalable from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor/scalable/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package hicolor-icon-theme-0.17-5.fc30.noarch
file /usr/share/icons/hicolor from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/16x16 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/16x16/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/24x24 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/24x24/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/32x32 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/32x32/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/48x48 from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/48x48/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/scalable from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64
file /usr/share/icons/hicolor/scalable/apps from install of renode-1.8.0+20190902git20754cd-1.f23.x86_64 conflicts with file from package fedora-logos-30.0.2-1.fc30.x86_64

Feature request - print command

Add the equivalent of a "print/printf" command. At the moment something similar can be achived with:

log "text I want to output" 3

setting the priority to 3 will make it into a error and will be output even when logLevel will not be verbose, but using a logger means that a error logger text is premented, which might be undesired in some situations

12:40:00.5256 [ERROR] Script: text I want to output

Zephyr DTS and Renode LiteEth address mismatch

I recently started my adventure with Renode and one of my first attempts was to get working samples/net/echo from Zephyr on litex_vexriscv CPU with Renode LiteEth simulation. Unfortunately that was not as straightforward as one could expect.

It turns out that there are different addresses hardcoded for LiteEth in Zephyr DTS and here:

sysbus <0xE0007800, +0x100>; // shadow

It's hard to say it's a bug, but for me, as a newcomer, it was challenging (yet very educational) to figure out what's wrong. Maybe you could make it compatible out-of-the-box?

Bug when responding to qRcmd monitor commands

When connecting to renode with gdb the monitor commands who do not respond anything are recognized as an unsupported command.

Getters works because they return values, but setter which stays quiet will be seen as unsupported command even when it's working. In the example below I change PC with setter and it gave unsupported command error. But reading it back it clearly shows that the value got updated properly.

This might look like a cosmetic issue but causes havoc on other tools which use gdb (for example Eclipse) which interprets this as a failure and stop executing their flow even if they could happily continue.

(gdb) load example.elf
Loading section .text, size 0x2680 lma 0x8000000
Loading section .data, size 0x920 lma 0x8002680
Start address 0x8000000, load size 12192
Transfer rate: 440 KB/sec, 3048 bytes/write.
(gdb) monitor cpu PC
0x8000000
(gdb) monitor cpu PC 0x12345
Target does not support this command.
(gdb) monitor cpu PC
0x12345

I think I found the source of the problem and a quick test showed the fix is working, I will format the description of the problem and submit pull request shortly.

Crash when emulating riscv floating point example

When the first floating point arithemtical C code is going to execute, it will cause the emulation to crash, the line is:

for (float percentage = 0.0f; percentage <= 1.3f; percentage += 0.04f) {

And resulting crash:

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Antmicro.Renode.Peripherals.CPU.TranslationCPU.CpuLoop()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

The code works fine in riscv hardware.

When single stepping the code the crash occurs at the 800018b4 instruction:

147           for (float percentage = 0.0f; percentage <= 1.3f; percentage += 0.04f) {
800018a0:   flw     fa4,-24(s0)
800018a4:   lui     a5,0x8000b
800018a8:   flw     fa5,-1980(a5) # 0x8000a844
800018ac:   fadd.s  fa5,fa4,fa5
800018b0:   fsw     fa5,-24(s0)
800018b4:   flw     fa4,-24(s0)
800018b8:   lui     a5,0x8000b
800018bc:   flw     fa5,-1976(a5) # 0x8000a848
800018c0:   fle.s   a5,fa4,fa5
800018c4:   bnez    a5,0x800016a0 <main+64>
146         for (int i = 0 ; i < (NELEMS(sets) - 1); i++) {
800018c8:   lw      a5,-20(s0)
800018cc:   addi    a5,a5,1
800018d0:   sw      a5,-20(s0)
800018d4:   lw      a4,-20(s0)
800018d8:   li      a5,3
800018dc:   bleu    a4,a5,0x80001698 <main+56>
162         screenClear();
800018e0:   jal     ra,0x80001600 <screenClear>

Content of the registers just before the crash is (the content of these doesn't feel right to me):

zero	0x0 (Hex)	
ra	0x80001690 (Hex)	
sp	0x8000d030 (Hex)	
gp	0x8000b500 (Hex)	
tp	0x0 (Hex)	
t0	0x80004548 (Hex)	
t1	0xf (Hex)	
t2	0x0 (Hex)	
s0	0x8000d070 (Hex)	
s1	0x0 (Hex)	
a0	0x4 (Hex)	
a1	0x4a (Hex)	
a2	0x8000b10c (Hex)	
a3	0x4 (Hex)	
a4	0x0 (Hex)	
a5	0x3 (Hex)	
a6	0x0 (Hex)	
a7	0x0 (Hex)	
s2	0x0 (Hex)	
s3	0x0 (Hex)	
s4	0x0 (Hex)	
s5	0x0 (Hex)	
s6	0x0 (Hex)	
s7	0x0 (Hex)	
s8	0x0 (Hex)	
s9	0x0 (Hex)	
s10	0x0 (Hex)	
s11	0x0 (Hex)	
t3	0x0 (Hex)	
t4	0x0 (Hex)	
t5	0x0 (Hex)	
t6	0x0 (Hex)	
pc	0x800018b4 (Hex)	
f0	0x0 (Hex)	
f1	0x0 (Hex)	
f2	0x0 (Hex)	
f3	0x0 (Hex)	
f4	0x0 (Hex)	
f5	0x0 (Hex)	
f6	0x0 (Hex)	
f7	0x0 (Hex)	
f8	0x0 (Hex)	
f9	0x0 (Hex)	
f10	0x0 (Hex)	
f11	0x0 (Hex)	
f12	0x0 (Hex)	
f13	0x0 (Hex)	
f14	0x0 (Hex)	
f15	0x0 (Hex)	
f16	0x0 (Hex)	
f17	0x0 (Hex)	
f18	0x0 (Hex)	
f19	0x0 (Hex)	
f20	0x0 (Hex)	
f21	0x0 (Hex)	
f22	0x0 (Hex)	
f23	0x0 (Hex)	
f24	0x0 (Hex)	
f25	0x0 (Hex)	
f26	0x0 (Hex)	
f27	0x0 (Hex)	
f28	0x0 (Hex)	
f29	0x0 (Hex)	
f30	0x0 (Hex)	
f31	0x0 (Hex)	

Using it with the miv-board machine:
machine LoadPlatformDescription @platforms/boards/miv-board.repl. And attaching the elf file which is causing this problem:

mandelbrot-uart.zip

Feature request for qL command (and probably some related commands)

When using the Renode with Eclipse I get a lot of the qL messages. In essence the Eclipse tries to query the RTOS information even on baremetal applications, which causes a lot of messages even where they do not matter. Documentation recomendends to use the qfThreadInfo, but for some reason (backward compatibility?) in the Eclipse the qL is used all the time.

15:14:08.9771 [WARNING] cpu: Unsupported GDB command: qL1200000000000000000

https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html

‘qL startflag threadcount nextthread’
Obtain thread information from RTOS. Where: startflag (one hex digit) is one to indicate the first query and zero to indicate a subsequent query; threadcount (two hex digits) is the maximum number of threads the response packet can contain; and nextthread (eight hex digits), for subsequent queries (startflag is zero), is returned in the response as argthread.

Don’t use this packet; use the ‘qfThreadInfo’ query instead (see above).

Reply:

‘qM count done argthread thread…’
Where: count (two hex digits) is the number of threads being returned; done (one hex digit) is zero to indicate more threads and one indicates no further threads; argthreadid (eight hex digits) is nextthread from the request packet; thread… is a sequence of thread IDs, threadid (eight hex digits), from the target. See remote.c:parse_threadlist_response().

And now I'm wondering, how much work it would be to actually implement this command? Probably implementing this command could cause chain of other new unimplemented commands as the eclipse would probably query even more. But it would stop the log polution and when RTOS is emulated it could help seeing present tasks/threads of the RTOS, which would be handy to see from emulation.

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.