Closed michael-platzer closed 2 years ago
That is an artifact of flattening arrays in the generated Verilog/C code. We need to manually enumerate the cores in Patmos-harness.cpp
. And that enumeration is hardcoded to 8 cores. Feel free to copy that code to extend it to 16 cores and make a pull request.
That is an artifact of flattening arrays in the generated Verilog/C code. We need to manually enumerate the cores in
Patmos-harness.cpp
. And that enumeration is hardcoded to 8 cores. Feel free to copy that code to extend it to 16 cores and make a pull request.
Thanks for pointing me to this, I extended the code to support 16 cores and created a pull request. Also added a warning in case someone wants to use even more cores.
Steps to reproduce:
patmos/hardware/config/altde2-115.xml
and uncomment lines 7 and 8 and change the core count to 16 as follows to build a multicore system (note that Argo is not used since it produces an error, see #104 ):misc/build.sh
, save the following code to a file calledtest.c
:void work(void* arg) { }
int main() { int i; for (i = 1; i < 16; i++) { corethread_create(i, &work, NULL); printf("started thread on core %d\n", i); } return 0; }
$ patmos-clang test.c libcorethread/corethread.c $ patemu a.out started thread on core 1 started thread on core 2 started thread on core 3 started thread on core 4 started thread on core 5 started thread on core 6 started thread on core 7 ^C