[gem5-users] Running a pthread on Gem5 SE x86

2017-12-14 Thread Nidhi Kamath
Hello,

I am trying to run a simple pthread program in gem5 SE x86 mode but it
errors out. the program is as below

#include 
#include 

int result;

void *sum(void *threadid) {
   int a=5;
   int b=5;
   result = a+b;
   printf("result from 1st thread is %d\n",result);
   pthread_exit(NULL);
}

void *diff(void *threadid) {
   int a=5;
   int b=5;
   result = a-b;
   printf("result from 2nd thread is %d\n",result);
   pthread_exit(NULL);
}


int main () {
   pthread_t thread1 , thread2;
   int rc;
   int i;

  rc = pthread_create(, NULL, sum, (void *)(i));
  rc = pthread_create(, NULL, diff, (void *)(i));

  pthread_join(thread1, NULL);
  pthread_join(thread2, NULL);


  if (rc) {
 printf("Error:unable to create thread");
  }

   pthread_exit(NULL);
   return 0;
}

And also when I run in SE mode I get the below output.

lap318@lap318-HP-Compaq-6730b-KE717AV ~/gem5 $ build/X86/gem5.opt
configs/example/se.py -n 4 -c thread
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Nov 28 2017 12:18:46
gem5 started Dec 14 2017 15:46:43
gem5 executing on lap318-HP-Compaq-6730b-KE717AV, pid 2871
command line: build/X86/gem5.opt configs/example/se.py -n 4 -c thread

Global frequency set at 1 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range
assigned (512 Mbytes)
0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000
0: system.remote_gdb.listener: listening for remote gdb #1 on port 7001
0: system.remote_gdb.listener: listening for remote gdb #2 on port 7002
0: system.remote_gdb.listener: listening for remote gdb #3 on port 7003
 REAL SIMULATION 
MODIFIED_GEM5 is disabled.
info: Entering event queue @ 0.  Starting simulation...
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall set_robust_list(...)
fatal: syscall futex (#240) unimplemented.
Memory Usage: 583416 KBytes


Could anybody please help me with this issue.

Regards
Nidhi
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Implementing tag-less cache architecture only for the last level cache

2017-12-14 Thread Jason Lowe-Power
Hi Varun,

The SimpleCache is just a starting point. It isn't at all a realistic
model! It's an example to show you how to use gem5 ports. It will not be
able to handle most realistic situations (e.g., being used as anything
other than a single core L1 cache).

You can take this code as a starting point to understand how gem5 works.
You will have to develop your own C++ model from scratch to model new kinds
of architectural widgets.

Jason

On Wed, Dec 13, 2017 at 10:41 PM Saivarun R  wrote:

> Hi Jason,
>
> I went through the tutorial and understood quite a bit of it. What I
> understood is that, there is no usage of tags in the implementation, just
> an unordered map. So I thought with some changes in the latencies, I can
> create a tagless blocking cache. Is this a correct starting point in
> implementing tagless cache? or is there some thing more to it??
>
> In order to try the idea out, I just changed the vector ports of the
> SimpleCache and tried to plug it as a second-level cache. The simulation
> stopped because of this reason, Exiting @ tick 18446744073709551615 because
> simulate() limit reached.
>
> To check out the I also used the simple cache, as it is, as a second-level
> cache in http://learning.gem5.org/book/part1/cache_config.html. And when
> I ran the simulation, this is what I encountered,
> info: Entering event queue @ 0.  Starting simulation...
> panic: Unknown packet type!
>  @ tick 934
> [accessFunctional:build/X86/learning_gem5/simple_cache.cc, line 358]
> Memory Usage: 655584 KBytes
> Program aborted at tick 934
>
> Kindly help me in this regard. Sorry for this long mail.
>
> Thank you
> Varun
> ___
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Help with application installing on linux x86

2017-12-14 Thread Rana Elnaggar
Hi Jasmin,


Thanks a lot for yoyr reply. I have tried chroot, however, I cannot apt-get 
install any application, any suggestion onn how to make apt-get work to install 
the required packages to get lib/modules ?

Best Regards,

Rana


From: Rana Elnaggar
Sent: Monday, December 11, 2017 11:09:45 AM
To: gem5-users@gem5.org
Subject: Help with application installing on linux x86


Hi,

I am trying to install applications on a linux image kernel 2.6.x downloaded 
from here  http://www.gem5.org/Download . I first mount the image, next, I copy 
the source code of the application that I need to install. and then unmount the 
image and boot the system and from inside the booted image I try to do make. 
However, an error in compilation is always related to missing lib/modules. 
Could you help me with this issue ? . Also, I thought that booting an image 
with a newer kernel could be a solution. Did any one successfully booted kernel 
3.x on x86 gem5? If yes, can you share the built image and kernel files ?

Download - gem5
www.gem5.org
Getting gem5. The latest gem5 source code (including the encumbered files) is 
available via our Git repository host at https://gem5.googlesource.com.




Best Regards,

Rana



___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Problem with running apk on gem5-android

2017-12-14 Thread Rana Elnaggar
Hi,


As a follow up to my question, I have finally managed to run apk activities 
correctly.


For future reference, to run apk in gem5


we need todo the following:

1) get the package_name and activity_name

2) am start -n package_name/.activity_name


package_name and activity_name can be obtained from AndroidMainfest.xml (this 
file is inside the apk file), to decrypt this file, we can use a tool like 
apktool


However,  I still have a problem in deciding which activity to run. Usually, 
most of the apks I am trying to run, has several activities, so which one to 
run? also, there are some activities that require user interaction, how can I 
feed in inputs for these activities knowing that connecting to VNC displays the 
GUI interface but it take too long for a click to be recognized ?


Best Regards,

Rana


From: Rana Elnaggar
Sent: Monday, December 11, 2017 2:06:42 PM
To: gem5-users@gem5.org
Subject: Re: Problem with running apk on gem5-android


Hi,

As a follow up to my previous problem. I tried another command to run apk.  I 
tried the following am start -a android.intent.action.VIEW -n 
/system/app/.Calculator


The error I get this time is as follows:

Starting: Intent {act=android.intent.action.VIEW cmp=/system/app/.Calculator

Error type 3

Error: Activity class {/system/app/.Calculator} does not exist


I found that some one before had the same issue, but the solution was not 
mentioned. I was wondering what is the correct way of calling apks in gem5.


Best Regards,

Rana


From: Rana Elnaggar
Sent: Monday, December 11, 2017 2:48:20 AM
To: gem5-users@gem5.org
Subject: Re: Problem with running apk on gem5-android


Hi,


As a follow up to my previous message, I waited for sometime, and then tried 
again am start -a android.intent.action.VIEW -n Calculator.apk  from inside 
system/app


The error that I get now is : Error Bad component name Calculator.apk


I have tried with other apks that I copied and pasted when I mounted the disk 
image to system/app and the same error appears. Any suggestions on how to run 
the apk correctly ?


Best Regards,

Rana



From: Rana Elnaggar
Sent: Monday, December 11, 2017 12:01:50 AM
To: gem5-users@gem5.org
Subject: Problem with running apk on gem5-android



Hi,

I am trying to run applications.apk on gem5-android on arm.


I used gem5 from this directory:


https://github.com/gem5/gem5


I used the following command to boot android:


./build/ARM/gem5.opt  configs/example/fs.py --os-type=android-ics 
--kernel=./system/binaries/vmlinux.smp.mouse.arm 
--disk-image=./system/disks/ARMv7a-ICS-Android-rgwb.SMP.nolock.img  
--machine-type=RealView_PBX --frame-capture --mem-size=256MB --l2cache --caches


I tried different android images from here:

https://mobilebench.engineering.asu.edu/gem5-images/


Whenever I run an application using e.g

am start -a android.intent.action.VIEW -n Calculator.apk


I get

Error type 2
android.util.AndroidException: Can't connect to activity manager; is the system 
running?


When I searched the previous posts on this error, I found that it is due to 
unloaded background android services and that we have to wait for them to be 
loaded. I was wondering if there is a work around this issue or any updated 
batch to get around this problem or whether I am missing a certain step.


Best Regards,

Rana
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Implementing tag-less cache architecture only for the last level cache

2017-12-14 Thread Saivarun R
Hi jason,

Apologies for a naive understanding of your tutorial, I just thought the
cache that you designed can be the design of tag-less caches, since there
were no tags used in your implementation. Apparently, I'm understanding is
completely wrong.

I need a tagless architecture for the cache to facilitate my project. The
problem that I'm facing is that, I could not comprehend the existing source
code of the cache to design a new cache architecture. Can you possibly,
guide me to a particular aspect of the existing design that I may need to
change, to start with?? Anything that could help me understand the caches
in gem5??

Thank you
Varun.

​
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users