Unfortunately this gives no protection for different alignment requirements
of the different types, making the program incorrect.
I'm using v1.01 and wonder if a fix is available?
Best wishes,
Liam
--
Liam Fitzpatrick, Software Engineer, Associated Compiler Experts bv,
De Ruyterkade 113, 1011 AB Amsterdam, The Netherlands.
Tel: +31 20 6646416, Fax: +31 20 6750389
mailto:li...@ace.nl, http://www.ace.nl.
Please use a compiler switch to force alignment on an 8 byte boundary.
For example, with gcc, you can add to the core_portme.h the line:
#pragma pack(n)
Other compilers may use command line switches, or linkers can take as a
command line or in a map file specific address to put a symbol.
Thanks,
- Shay Gal-On
Dr. Software Engineering, EEMBC
www.eembc.org/contact
--
You received this message because you are subscribed to the Google Groups
"CoreMark" group.
To post to this group, send email to core...@googlegroups.com.
To unsubscribe from this group, send email to
coremark+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/coremark?hl=en.
This is not a bug in the benchmark and there will be no correction. This is
a platform specific issues that should be dealt with using the core_portme
(either .mak if using flags to the toolchain, or .h if passing pragma
directives).
If you have alignment issues on the platform you selected, the procedure
below should alleviate the concerns. There is a reason you can modify the
core_portme files - to deal with platform specific issues.
If your toolchain does not have any way to define alignment, please use one
of the other methods for allocating memory. Which toolchain are you using
and what is the target platform btw? Can you share your port folder?
There is more than one way to make sure the data is aligned. Many compilers
will align arrays and structures on cache line or pointer size boundary
unless you specifically tell them not to.
CoreMark allows multiple methods for dealing with different embedded system
- passing parameters, allocating memory, and even executing in a multicore
environment in a standard manner.
Some platforms do not have malloc - CoreMark allows you to use a static
memory block and still generate a compliant result. The fact you need to
make sure the memory aligns correctly does not make it a portability bug, it
simply means you need to deal with it in the portability section of the
benchmark and not in the generic code. For a platform that needs to write
directly to a UART, you need to adjust the core_portme code to tell it how
to do that. Similarly in this case for a platform that must use static
memory allocation and does by default align memory on a pointer or cache
line block, you need to adjust the toolchain parameters to allocate the
memory the way this platform needs it.
Can you please share your platform details?
Requirements are as follows:
- For MEM_MALLOC your platform needs to provide a function that will return
a buffer (malloc functionality).
- For MEM_STACK your platform needs to be able to allocate 2K on the stack.
- For MEM_STATIC your platform needs to be able to allocate the buffer on an
aligned address, or be able to load/store to unaligned addresses.
In fact, you can even implement a static buffer with MEM_MALLOC - in the
function portable_malloc() use a static array, and have it aligned via a
union, or allocate a slightly bigger array and return a pointer to the first
aligned address. That would not require you to use any compiler flags,
linker maps, or pragmas. Does this ANSI solution work for you?
If you find that MEM_STATIC is not portable for you, simply use another
method.
I can post a port folder with such an implementation if that works for you.
I do not see this as an issue that requires creating a new version of
CoreMark. A new CoreMark version will only be issued if there is a flaw
found in the benchmark that would make results on different platforms
non-comparable (e.g. platforms able to avoid executing statements at run
time), or a portability issue is found that cannot be addressed using the
mechanisms in the port folder. Any portability issue that can be dealt with
using the port folder SHOULD be dealt with in the port folder.
EEMBC may create other standard free benchmarks that target different
functionality from time to time, but there should be only one CoreMark :)
Hopefully you can use one of the methods suggested to create an appropriate
port folder for your toolchain.
Thanks,
- Shay Gal-On
Hi Shay,
--