This is an archive of the discontinued LLVM Phabricator instance.

XCore target: use TEST_TARGET_FLAGS to override target's memory size.
ClosedPublic

Authored by robertlytton on Mar 11 2014, 12:31 PM.

Details

Summary

The tests build XCore-image's with a default memory map of 32MB - passed in the target flags.
It should be noted that the XCore emulator's speed is affected by the size of memory.
Also the amount of host memory required is several times the XCore-image memory size.
Thus running several large xcore-images in parallel may result in thrashing!

The RUNTIMELIMIT=7200 is passed in on the commandline.
Make sure only tests that need longer over-write it.

Diff Detail

Event Timeline

It's annoying to have the same fragment in a bunch of places, but I
understand the problem.

Would it be possible to make a new variable for this (XCORE_MEMORY_SIZE or
something), and then put all the extra shared bits of the fragment in a
common location?

  • Daniel

Hi Daniel,

The default memory map for the xcore tools is 64KB - but it is over-ridden from the command line.
Initially I gave all the tests more than enough memory from the command line - but this requires a lot of memory for the emulator's tables etc,
the tests take a little longer to run due to the need to initialize the tables for memory that will never be used and
this extra initialization of tables would cause thrashing on a machine with only a few GB of memory.
Hence, the default of 32MB (~500MB emulator memory) that I pass in from the command line.

The 32 tests that require more than 32MB have the command line default overwritten individually using TEST_TARGET_FLAGS (one test has the 32MB reduced).
I could reduce the granularity by using 256MB for all of the 'SingleSource/Benchmarks/Polybench/linear-algebra/kernels' tests but this will add substantial overheads to the tests.
An alternative approach would be to add a shim layer between test-suite and the XCore compiler which will have knowledge of the tests it is building... seems a bad idea.

I could add multiple environment variables for various memory sizes and then pick the size required - removing the noise viz:

ifeq ($(ARCH),XCore)
TEST_TARGET_FLAGS += "$(XCORE_256MB)"
endif

I await your thoughts as it is not clear to me the best way forward.

Robert

What I meant was can't you set a variable like

XCORE_TARGET_NEEDS_MEMORY := 32

for individual tests, and then if that variable is defined add the custom
linker logic (in one of the common Makefile fragments)?

  • Daniel
robertlytton updated this revision to Unknown Object (????).Apr 3 2014, 1:56 AM

Hi Daniel,
Here are the changes.

XCore target: Add target specific flags to root Makefiles.

The default value of XCORE_TARGET_NEEDS_MEMORY is 32 (MB).
It should be noted that the XCore emulator's speed is affected by the size of memory.
Also the amount of host memory required is several times XCore-image memory size.
Thus running several large xcore-images in parallel may result in thrashing!
The default of 32 will require ~300MB of host memory.

As Makefile.config.in is included multiple times (viz: include $(LEVEL)/Makefile.config),
the addition of XCORE_TARGET_FLAGS to X_TARGET_FLAGS is done in Makefile.test

RUNTIMELIMIT is set to a default of 1 hour for the XCore emulator.
Test that take around or more than 1 hour to run have their RUNTIMELIMIT extended.

Robert

Hi
Are these changes OK
Robert

Yes, looks fine to me, sorry for the slow review.

  • Daniel
This revision is now accepted and ready to land.May 12 2014, 11:49 PM
robertlytton closed this revision.May 13 2014, 12:47 AM