[英]Number of cores rocket-chip
I am operating Linux on top of spike and the rocket-chip. 我在峰值和火箭芯片上运行Linux。 In order to evaluate a program I am trying to get the # of cores configured in spike and the rocket-chip.
为了评估程序,我试图获取在穗状结构和火箭芯片中配置的核数。 I already tried to get the information threw proc/cpuinfo with now success.
我已经尝试将信息扔到proc / cpuinfo,现在成功了。 I also wrote a little program:
我还写了一个小程序:
#include <stdio.h>
#include <unistd.h>
int main()
{
int numofcores = sysconf(_SC_NPROCESSORS_ONLN);
printf("Core(s) : %d\n", numofcores);
return 0;
}
The problem with this program is that it returns 1, which cannot be the correct value, because I configured 2 cores. 该程序的问题在于它返回1,该值不能是正确的值,因为我配置了2个内核。 Is there another possibility to get the # of cores?
还有其他获得内核数量的可能性吗?
Are you sure linux can see both cores? 您确定linux可以同时看到两个内核吗? You can check this with something like:
cat /proc/cpuinfo
. 您可以使用以下命令进行检查:
cat /proc/cpuinfo
。 To support multicore, you will need to turn on SMP support when building riscv-linux. 为了支持多核,在构建riscv-linux时需要打开SMP支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.