Hi Mahesh, I think you probably need to call createThreads() on the core you're adding, but it's hard for me to say for certain without fully understanding everything you're trying to do. I would just try some things and use debug flags to understand what's going on. My solution with gem5 is often just to use trial and error.
Jason On Mon, Dec 19, 2016 at 12:52 PM Mahesh Balasubramanian <[email protected]> wrote: > Hi Jason, > > I tried looking at createThreads() in BaseCPU.py and tried to create a > thread for my other process as well in modified se.py. I am adding my cpu > as tempCPU = [CPUClass(cpu_id = i) for i in xrange(np)] and then I do > tempCPU.append(myCPU(cpu_id=i)). > > Should I create a new loop for my cpu and do mycpu.createThreads()? My > only criteria is whenever I do a pthread_create that function should run on > my_cpu. > > Thank you in advance! > > Mahesh > On Thu, Dec 15, 2016 at 12:55 PM, Jason Lowe-Power <[email protected]> > wrote: > > Hi Mahesh, > > The problem is exactly what the fatal says: the sys_clone syscall > implementation assumes there is one thread context per process. You need to > either modify this implementation to understand your coprocessor or add a > thread context for the coprocessor in the config script. > > See createThreads() in src/cpu/BaseCPU.py. > > Jason > > On Tue, Dec 13, 2016 at 4:16 PM Mahesh Balasubramanian <[email protected]> > wrote: > > Hi everybody, > > I have built my own ARM CPU in gem5 atomic, which works like a > coprocessor. Whenever there is a pthread_create call, that function runs on > mycpu and after pthread_join the progran executes on the main cpu. > > I am trying out multiple pthread_create-pthread_join pairs (2 pairs to > start with) for the only one function. When I compile my program using > -lpthread flag the program runs fine for the first create-join pair, but > when when it comes to second pthread_create, I get "*fatal: Called > sys_clone, but no unallocated thread contexts found!" *message. > > So then I compile my program by linking pthread.o from m5threads and ran > it. Now, in the first pthread_create my program does not exit and is stuck > (freezes with a blinking cursor) after executing mycpu, meaning it is not > exiting properly from mycpu. > > Surprisingly, I do not get any error when I run a function with hello > world. It runs perfectly when I use pthread.o to link. > > It would be great if someone could guide me in this problem. > > Best, > Mahesh > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > > -- > > Jason > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users -- Jason
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
