Hi Devon,
Have you tried the cross compiler we provide in the cross_compiler/ subdirectory of our download page? We've been using that without any trouble.
Let us know if we have to tweak something to get it working on other systems.
Thanks,
Jon
Hi Devon,
First: Are you compiling your C to assembly, then using that assembly as your .s? I ask as I'm a little confused by the compilation command you showed. I believe you should be able to put your C code directly into our infrastructure, following what factorial.c and factorial.s look like (factorial.s includes directives on how to compile factorial.c and what to link to it). Sims would then call the C compiler for you.
On your compilation error in our system: There is no real libc with what we provide, hence the undefined references. If you have a libc.a, you can include it using the MIDAS_LIB directive in your .s file. However, I'm not sure whether thread-local storage is going to work correctly and I don't know how/if that will affect pthreads. I don't even know that targeting sparc64-linux-gnu is necessarily what you want because we don't have any syscalls implemented. I would assume that something like pthread_create() will try to perform some syscalls. Perhaps you can implement something for threading yourself. It's really unfortunate that Sun didn't release the code for this as it's referenced in one of the other files.
I'm wondering whether it would be better to try to create an ELF file that could then be run on top of the hypervisor on FPGA. An example of this is shown in one of the original OpenSPARC videos (https://youtu.be/ZCX03bU8TSM?t=76). I'm not totally sure what the path is in this direction though as we haven't done anything at all with this.
Sorry this is so littered with uncertainty. You're at a point about as far as I got with playing with running C using the simulation infrastructure so I'm operating more on speculation here.
Jon
--
You received this message because you are subscribed to the Google Groups "OpenPiton Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiton+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/f2c157d4-e40e-47e3-a8b1-caba1114c574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Devon, Chris,
Apologies, I misunderstood from what you were saying. I see now how it works within our infrastructure.
We don't have any examples of multicore C code but there are many examples within our assembly code. The tile1 suite of tests contains many that use multiple hardware threads and every test in tile2, tile4, tile8, etc uses multiple cores. I think you should be able to look at how those tests start other threads, synchronise, and do other operations, and create C wrappers for those. We haven't had any need to do this ourselves, though. It's certainly possible that you will be able to massage a libc to work in the same setting too.
Please let us know how we can help further,
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/2ce8d0f9-2dcc-4487-a5bb-b0467bf86814%40googlegroups.com.
Hi Devon,
As Alexey said, I think the code is executed in user mode (unprivileged mode) so when you try to perform the store instruction, the test will fail as storing to I/O addresses requires you to be in hyperprivileged mode. I think you can get by this by making a hypercall trap that you would call instead. There are examples of how to do this in a number of our assembly tests. You could just add the code to htraps.s and then have your user-mode function invoke the appropriate trap number. I think Alexey has some sort of example of this in the code that prints TT and TPC but I'm not sure if that stuff is already executing in hyperprivileged mode. Alexey, could you clarify on this?
Jon
From: <open...@googlegroups.com> on behalf of Devon White <thedev...@gmail.com>
Date: Thursday, 5 October 2017 at 14:40
To: OpenPiton Discussion <open...@googlegroups.com>
Subject: Re: Compiling Open Sparc Assembly
Hi,
--
You received this message because you are subscribed to the Google Groups "OpenPiton Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiton+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/84a2e22a-a2d9-4e44-ad21-0d1d9734734e%40googlegroups.com.
Hi Devon,
There are a few directives you can make use of. Those are MIDAS_CC, MIDAS_OBJ, and MIDAS_LIB. I think what you want to do is just have multiple MIDAS_CC lines in your single .s file. If that isn't doing it for you, you can create your own static .a file, and you should be able to include that using MIDAS_LIB. If even that fails, then I think that MIDAS_OBJ will work with a precompiled .o file.
Please let me know if these approaches don't solve the problem.
Thanks,
Jon
From: <open...@googlegroups.com> on behalf of Devon White <thedev...@gmail.com>
Date: Sunday, 29 October 2017 at 14:15
To: OpenPiton Discussion <open...@googlegroups.com>
Subject: Re: Compiling Open Sparc Assembly
Alternatively if you could give us some documentation on the assembler we can probably figure it out. The problem appears to be that the assembler doesn't find the file that has the print definitions in it, and we don't know how to fix that.
-Devon
--
You received this message because you are subscribed to the Google Groups "OpenPiton Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiton+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/f2d95e18-1294-4367-8e1c-7c1866ed2aac%40googlegroups.com.
Hi Devon,
Glad you got it to compile. When running multithreaded tests, I believe midas sets the -DCIOP flag, which means the first thread will wake up all others part way through its boot code. This means the other threads will be starting their execution behind the first. Have you tried writing a barrier at the start of the functions to make sure the threads are synchronised? You could also partially verify this by causing the first thread’s loop to run for much longer.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/b33013ca-36f0-48df-844f-49eeef07b900%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "OpenPiton Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiton+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/4552b3bd-caf9-4f60-bf00-5f58a3ebacb0%40googlegroups.com.