How to run Gem5 system emulation with Golang program - go

I am trying to run Gem5 system emulation with a binary I compiled from a Golang program. I am using X86 O3CPU and classic memory. However, I have to launch the same process on 3 cpus to have the system emulation set up. Otherwise I will receive error: fail to create new OS thread. I try to set the GOMAXPROCS to 1 or MAXTHREADS to 1. Neither of them solve this problem.
But even if i run the binary with 3 cpu. I still might receive error:
wirep: p->m=824633877504(2) p->status=1
fatal error: wirep: invalid p state
after many hours of emulation. Does anyone have experience with running Gem5 with Golang?

Related

LLDB crashes on raspberry pi

I have a c++ program running "fine" but when I try to debug it with LLDB, LLDB just quits on me.
Process ... launching
Segmentation fault
Even if I set a breakpoint on the very first line in main I just get these two lines. Googling yields the typical memory leak errors in user code. I don't think that's the case here since my program runs outside of LLDB.
I am not experiencing any issues under ubuntu. Could it be related to ARM (raspberry pi)?
You might have more luck sending a query about the state of the lldb port to raspberry pi on the lldb-dev mailing list. Details here:
http://lists.llvm.org/mailman/listinfo/lldb-dev

UHD error with REDHAWK

I made a node which contains a USRP_UHD and a GPP (and make sure the ip_address is correct for USRP_UHD). I launched the domain based on this node. However, I got the following error:
UHD Error:
Device discovery error: AssertionError: libusb_init(&_context) == 0
in libusb_session_impl::libusb_session_impl()
at /builddir/build/BUILD/uhd-release_003_005_003/host/lib/transport/libusb1_base.cpp:37
UHD Error:
Device discovery error: AssertionError: libusb_init(&_context) == 0
in libusb_session_impl::libusb_session_impl()
at /builddir/build/BUILD/uhd-release_003_005_003/host/lib/transport/libusb1_base.cpp:37
...
-- Opening a USRP2/N-Series device...
-- Current recv frame size: 1472 bytes
-- Current send frame size: 1472 bytes
UHD Warning:
Unable to set the thread priority. Performance may be negatively affected.
Please see the general application notes in the manual for instructions.
EnvironmentError: OSError: error in pthread_setschedparam
I did get two unallocated (TX/RX for each) tuners, but it is not easy to allocate these two tuners for use for any parameters.
Besides, if I just launch the domain and launch the single device USRP_UHD, or simply run the discover USRP_UHD command via the command line window, I got the same error:
UHD Error:
Device discovery error: AssertionError: libusb_init(&_context) == 0
in libusb_session_impl::libusb_session_impl()
at /builddir/build/BUILD/uhd-release_003_005_003/host/lib/transport/libusb1_base.cpp:37
2016-02-01 16:59:20 WARN USRP_UHD_i:943 - WARNING: NO UHD (USRP) DEVICES FOUND!
Could anybody figure out where this problem is? Thanks in advance!
So, first of all, the good news is that this is happening during autodetection of USB devices, so your N2xx is not inherently affected, but:
UHD 3.5.3 is not only old, it's ancient. You should really uninstall it (If you've got Debian or a derived one [Ubuntu], it'd be sudo apt-get remove uhd-host libuhd003 libuhd-dev), install a new version directly from Ettus (can help you with that, if necessary) and rebuild Redhawk against that version.
Really, really do that. There's been so much improvement in behaviour like failure handling that fixing this without updating isn't really worth it.
Now, if you explicitly specify a device address that allows you to cancel USB-based USRP detection completely, you should be fine. As device address, use type=usrp2 for USRP2, N200 and N210.
I ran into this issue trying to install UHD v3.9.3 in a CentOS 7 Docker container - the error message points to a usb issue, not related to Redhawk. The Redhawk Device, USRP_UHD, is just an abstraction layer on top of the Ettus UHD drivers, so the easiest way to tell whether the problem is Redhawk or something else is to try one of the UHD commands directly from a terminal to generate the same error, like uhd_usrp_probe.
To check if the problem is directly related to the usb drivers try the command lsusb. This should list all usb devices connected to your OS. These are good debug tips to isolate where the problem is.
If you happen to be doing this using Linux containers or Docker you have to give the proper privileges, see docker-any-way-to-give-access-to-host-usb-or-serial-device. Otherwise, assuming you built UHD from source, check the output of make test step - if all the tests passed there shouldn't be anything wrong with the UHD library.
Edit: Also if you're running this inside a VM you have to make sure your host has given network/USB/etc privileges to the hypervisor (ex. VirtualBox) during installation, or that you've attached the correct virtual hardware in the VM configuration.

lldb set maximum watchpoint count

I am facing a little problem with lldb, whenever I want to watch an expression, I get this error:
error: Watchpoint creation failed (addr=0x61f2e70, size=4).
error: number of supported hardware watchpoints (0) has been reached
And when I do
watchpoint list -b
it tells me
Number of supported hardware watchpoints: 0
No watchpoints currently set.
Is there any command in lldb to set the maximum count of possible watchpoints / supported watchpoints?
Thanks
I ran into this problem on macOS with LLDB version "lldb-900.0.64" (part of Xcode 9.2). I believe that hardware watchpoints require superuser privileges: attaching to a running program would not let me set any watchpoints unless I ran the LLDB process with sudo. The process I was attaching to did not require sudo.
The platform you're debugging does not support hardware breakpoints, or if it does, support was not configured into the version of lldb you're using.

Error while trying to debug CUDA code using TOTALVIEW

I am trying to fix some error related to a SEGMENTATION FAULT. So when I try to fix the error using by step by step debugging of the code, I got couple of errors:
ERROR: cuda_trace_obj::initialize_cuda_library: Cuda initialize() returned CUDBG_ERROR_INITIALIZATION_FAILURE(20)!
ERROR: cuda_system_status_t::initialize: Error CUDBG_ERROR_UNINITIALIZED(5) getting device count
Any help or pointers regarding the above mentioned errors is appreciated.
This error often occurs when you debug a CUDA application on a computer with a single GPU and an X11 server running.
In a single GPU system, CUDA applications can be used debugged only if no X11 server (on Linux) or no Aqua desktop manager (on Mac OS X) is running on that system.
As far as I know, only the command line debugger CUDA-GDB is able to override this restriction setting software preemption as described in the cuda-gdb documentation, but works only for devices with SM3.5 compute capability and higher.

What is run time environment?

Can some one explain what it means in simple terms. Does it mean the environment (DOS, Windows, Linux, etc) where the application codes are run?
Distinguish this from Development Environments and Build Environments.
You will tend to find a hierarchy here.
Run time environment - Everything you need to execute a program, but no tools to change it.
Build environment- Given some code written by someone, everything you need to compile it or otherwise prepare an executable that you put into a Run time environment. Build environments are pretty useless unless you can see tests what you have built, so they often include Run too. In Build you can't actually modify the code.
Development environment - Everything you need to write code, build it and test it. Code Editors and other such tools. Typically also includes Build and Run.
Yes, including all the settings (like environment variables), common libraries(!), directory structure, network neighbors e.t.c
The runtime environment can also be a virtual machine, such as the JRE (Java Runtime Environment) or CLR (Common Language Runtime) for .NET framework.
What is the target of your program? Does the program run on top of the JRE, CLR? Or are you compiling into a binary file that is run by your operating system?
The main question is what is that target of your program. How will your program be executed?
As soon as a software program is executed, it is in a run-time state. In this state, the program can send instructions to the computer's processor and access the computer's memory (RAM) and other system resources.
RTE allows the program to be run in an environment where the programmer can track the instructions being processed by the program and debug any errors that may arise.
While developers use RTE software to build programs, RTE programs are available to everyday computer users as well,e.g software such as Adobe Flash Player
Source
To add to the other answers given, I would say that Runtime environment is an environment, which supports the execution of a program/process. A program, for being able to execute, requires runtime environment. Runtime environment provides following services to the program/process :-
Resident Memory
Resources such as File, Sockets, etc.
Environment variables
Proper initialization
Proper disposal.
In short, Runtime environment is for the program, what physical environment is to us. Program/process can't sustain without runtime environment.
I am working on compilers and the Runtime environment means ,it is the structure of the target computers registers and memory that serves to manage memory and maintain information needed to guide the execution process.
infact, almost all programming languages use one of three kinds of runtime environment,whose essential structure does not depend on the specific details of the target machine.
These three kind of runtime environmenta are
fully static environment( example FORTRAN77)
stack-based environment(C,C++)
Fully dynamic environment(LISP)
It refers to the collection of software and hardware resources that enable a software program to be executed on a computer system. The runtime system is a composite mechanism designed to provide program execution services, regardless of the programming language being used
Simple and Generic definition
Let's not make it so complicated, in context of software engineering a runtime environment is simply an environment that a piece of software needs to run.
For example you might have Googled PC Requirements for GTA-V and you found the following answer:
Minimum System Requirements:
OS: Windows 8.1 64 Bit, Windows 8 64 Bit, Windows 7 64 Bit Service Pack 1
Processor: Intel Core 2 Quad CPU Q6600 # 2.40GHz (4 CPUs) / AMD Phenom 9850 Quad-Core Processor (4 CPUs) # 2.5GHz
Memory: 4GB
Video Card: NVIDIA 9800 GT 1GB / AMD HD 4870 1GB (DX 10, 10.1, 11)
Sound Card: 100% DirectX 10 compatible
HDD Space: 65GB
What are these? These are the environment variables which you need to run GTA-V, another way to say the same thing is:
This is runtime environment for GTA-V.
Take example of Node.js, when you say Node.js is JavaScript runtime environment you simply mean that Node.js provides everything (from software perspective) to run JavaScriptic code on the hardware (Mobiles, Laptops, etc). That everything includes interfaces to the Operating Systems of that particular hardwares.
Note: Both of the below statements are correct:
Node.js is JavaScript runtime environment (RTE).
Node.js and OS on which Node.js is installed makes Runtime Environment for JavaScript.
Technical definition
Runtime environment, primarily implements portions of an execution model.
The execution model specifies the behavior of elements of the language. By applying the execution model, one can derive the behavior of a program that was written in terms of that programming language.
Ok I know that console.log("Hi") shows me hi on the console, but how this behaviour of that particular string (console.log) is achieved?
Some or all the underlying steps which were taken between the execution of code and logging of the output constitue runtime environment.

Resources