Normally compiling and running Dhrystone wouldn't cause me a headache,
but the combination of "thou must use these sources" and "thou must use
this SDK" makes this an annoying distraction.
I tried following Antti's helpful suggestions [1] (which I can't tell are ok by the rules,
but at least it's something). Unfortunately I ran into some issues:
- sysutils.c doesn't exist, but syscall.c does
- you also need encoding.h from riscv-tools
- there's no HZ macro in util.h
If I try compiling with the horrific Zephyr SDK, it can't find libraries:
$ riscv32-zephyr-elf-gcc -I/opt/zephyr-sdk/sysroots/riscv32-zephyr-elf/usr/include -march=RV32I -O3 -fno-inline *.S *.c
...
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/riscv32-zephyr-elf/../../libexec/riscv32-zephyr-elf/gcc/riscv32-zephyr-elf/6.1.0/real-ld: cannot find crt0.o: No such file or directory
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/riscv32-zephyr-elf/../../libexec/riscv32-zephyr-elf/gcc/riscv32-zephyr-elf/6.1.0/real-ld: cannot find crtbegin.o: No such file or directory
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/riscv32-zephyr-elf/../../libexec/riscv32-zephyr-elf/gcc/riscv32-zephyr-elf/6.1.0/real-ld: cannot find -lgcc
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/riscv32-zephyr-elf/../../libexec/riscv32-zephyr-elf/gcc/riscv32-zephyr-elf/6.1.0/real-ld: cannot find -lc
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/riscv32-zephyr-elf/../../libexec/riscv32-zephyr-elf/gcc/riscv32-zephyr-elf/6.1.0/real-ld: cannot find -lgloss
collect2: error: ld returned 1 exit status
and indeed none appear to be supplied. It seems to me that the Zephyr SDK can't be use standalone as regular compilers. Surely I'm missing something.
I'm very tempted to screw these rules as they don't make sense and they are ridiculous.
Tommy
[1] https://github.com/micro-FPGA/riscv-contest-2018/wiki/Dhrystone
--
You received this message because you are subscribed to the Google Groups "RISC-V Soft CPU Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to softcpu-discu...@riscv.org.
To post to this group, send email to softcpu...@riscv.org.
Visit this group at https://groups.google.com/a/riscv.org/group/softcpu-discuss/.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/softcpu-discuss/f116d954-5f4c-4c4a-a493-2e9ef80f143f%40riscv.org.
For more options, visit https://groups.google.com/a/riscv.org/d/optout.
Don't know if it is OK or not for the contest (my common sense tells me that it is OK), but you may use Charles's implementation as reference for Dhrystones:With this Makefile you are able to compile Dhrystones with Zephyr GCC correctly (with isa=rv32im)Nelson
--
You received this message because you are subscribed to the Google Groups "RISC-V Soft CPU Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to softcpu-discu...@riscv.org.
To post to this group, send email to softcpu...@riscv.org.
Visit this group at https://groups.google.com/a/riscv.org/group/softcpu-discuss/.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/softcpu-discuss/48959775-d356-408f-95a8-f46aab8c4821%40riscv.org.
For the area metric it is OK to use that very ugly syscall.c (implementation), but for the performance metric that files are not good.
How do you would compare a performance implementation with https://www.sifive.com/cores/e34 which it is reported to have 1.61DMIPS/MHz? (I find this value a bit suspicious for a 32-bit implementation, but it may be achievable depending of several factors; but still suspicious considering the Coremark score, but I am giving the benefit of the doubt...)
Using custom library and *.S is common practice on running Dhrystones.
Function in-lining and file merging are not allowed as per Dhrystones rules, but unfortunately are sometimes used by companies that want market their soft CPU cores, given the illusion that their soft CPU's have better performance than the one that they actually have.
--
You received this message because you are subscribed to the Google Groups "RISC-V Soft CPU Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to softcpu-discu...@riscv.org.
To post to this group, send email to softcpu...@riscv.org.
Visit this group at https://groups.google.com/a/riscv.org/group/softcpu-discuss/.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/softcpu-discuss/f492f354-4b94-49e3-bf8e-11efc8137e72%40riscv.org.
With the following rv32im simulator (which has a CPI=1)running a slight modified version of your implementation of Dhrystones I get 1.71 DMIPS/MHz.So I know that the reported value is achievable. That is why I am given the benefit of the doubt.For single issue processors, I see values of ~1.6 DMIPS/MHz for some MIPS targets (f32c achieves that value without an actual hardware divider!), but that is achieved by having pipeline models of the CPU architecture in the Machine Description files inside GCC, for which we have none for RISC-V (I am aware of the mbranch-cost=N switch, which in some cases may help decreasing the penalty for branches) and by using some other interesting optimization flags, which I don't know if they can be used for the contest (-fselective-scheduling; -fno-crossjumping; -fipa-pta; -fira-algorithm=priority), but for sure could be used by SiFive in their benchmark runs.By the way, Rocket is a 64-bit implementation which has a big advantage in the strcpy function: it can load 64 bits per clock cycle and store the 64 bits some clock cycles later to avoid RAW hazards. That is why it can score 1.72 DMIPS/MHz!Nelson
--
You received this message because you are subscribed to the Google Groups "RISC-V Soft CPU Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to softcpu-discu...@riscv.org.
To post to this group, send email to softcpu...@riscv.org.
Visit this group at https://groups.google.com/a/riscv.org/group/softcpu-discuss/.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/softcpu-discuss/2dc0bf4a-a971-42cb-a7a9-125345ab5b00%40riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V Soft CPU Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to softcpu-discu...@riscv.org.
To post to this group, send email to softcpu...@riscv.org.
Visit this group at https://groups.google.com/a/riscv.org/group/softcpu-discuss/.
To view this discussion on the web visit https://groups.google.com/a/riscv.org/d/msgid/softcpu-discuss/f57f3208-572c-4c8f-bfa7-ba5f379d4c0c%40riscv.org.
I hope so because that’s what I want to do.Tommy
I hope so because that’s what I want to do.
from serial import Serialser = Serial("COM8", 115200)filename = "test.bin"with open(filename, "rb") as f:b = f.read(1)while b:ser.write(b)b = f.read(1)ser.close()
3) use PLL to deliver lowest possible clock for uart baudrate divider, if possible select output frequency that allows divide by power of divider