Skip to content

Conversation

@xiulipan
Copy link
Contributor

@xiulipan xiulipan commented Oct 30, 2019

Fix xcc build for BYT/CHT/HSW/BDW/SUE
Improve the optimization level to reduce TEXT size in FW.
Fix void pointer arithmetic in hifi2 build.
Update xcc build config for all existing platforms.

@xiulipan xiulipan requested a review from jajanusz as a code owner October 30, 2019 04:11
@xiulipan
Copy link
Contributor Author

@jajanusz @tlauda Could you help to check the build fail for the BYT, CHT, BDW, HSW and SUE.
Error for BYT, CHT

/home/pxl/xcc/install/tools/RD-2012.5-linux/XtensaTools/bin/xt-ld: sof section `.text' will not fit in region `sof_text_start'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'

BDW, HSW

CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'
/home/pxl/work/sof/sof/build_bdw_xcc/haswell.x:140: undefined symbol `XCHAL_VECBASE_RESET_PADDR' referenced in expression

SUE

/home/pxl/xcc/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: bootloader section `.text' will not fit in region `sof_text'

@jajanusz
Copy link
Contributor

@jajanusz @tlauda Could you help to check the build fail for the BYT, CHT, BDW, HSW and SUE.
Error for BYT, CHT

/home/pxl/xcc/install/tools/RD-2012.5-linux/XtensaTools/bin/xt-ld: sof section `.text' will not fit in region `sof_text_start'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'

BDW, HSW

CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memset':
/home/pxl/work/sof/sof/src/lib/lib.c:56: undefined reference to `__vec_memcpy'
CMakeFiles/sof.dir/src/lib/lib.c.o: In function `memcpy_s':
/home/pxl/work/sof/sof/src/arch/xtensa/include/arch/string.h:58: undefined reference to `__vec_memcpy'
/home/pxl/work/sof/sof/build_bdw_xcc/haswell.x:140: undefined symbol `XCHAL_VECBASE_RESET_PADDR' referenced in expression

SUE

/home/pxl/xcc/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: bootloader section `.text' will not fit in region `sof_text'

Error says pretty much what problem is, .text section is too small to fit generated binary code. You need to tune memory.h in platform/{baytrail,haswell}.

@tlauda
Copy link
Contributor

tlauda commented Oct 30, 2019

@xiulipan And also __vec_memcpy is probably not supported on HIFI2, so you need to add additional check in string.h in xtensa arch.

@xiulipan
Copy link
Contributor Author

@jajanusz @tlauda Thanks for hint.
Can we merge this PR first so that we can have unify test env for the fix?

@tlauda
Copy link
Contributor

tlauda commented Oct 31, 2019

@xiulipan Don't you want to add fixes into this PR first?

@xiulipan
Copy link
Contributor Author

@tlauda @jajanusz And some fix and pass the test locally.
Please check.

@xiulipan xiulipan changed the title scripts: update xcc build for all platform Enable xcc build for all platform Oct 31, 2019
@xiulipan
Copy link
Contributor Author

xiulipan commented Nov 5, 2019

@tlauda @jajanusz @macchian @lbetlej
Update the PR with optimization level change and hifi2 fix for void pointer arithmetic

@plbossart
Copy link
Member

@xiulipan the IRAM sizes look wrong to me. we've always used 14000

e.g.

#define SST_BYT_IRAM_PHY_START	0xff2c0000
#define SST_BYT_IRAM_PHY_END	0xff2d4000
#define SST_BYT_DRAM_PHY_START	0xff300000
#define SST_BYT_DRAM_PHY_END	0xff320000

@xiulipan
Copy link
Contributor Author

xiulipan commented Nov 6, 2019

@xiulipan the IRAM sizes look wrong to me. we've always used 14000

e.g.

#define SST_BYT_IRAM_PHY_START	0xff2c0000
#define SST_BYT_IRAM_PHY_END	0xff2d4000
#define SST_BYT_DRAM_PHY_START	0xff300000
#define SST_BYT_DRAM_PHY_END	0xff320000

@plbossart @tlauda already correct me here, so we try to use -Os flag to avoid the issue.

@lgirdwood The -Os is just a test for my build test. I think I got @jajanusz help to have different optimization level with #2054
Will try to tune the default value for different build and compiler.

@xiulipan xiulipan changed the title Enable xcc build for all platform [WIP]Enable xcc build for all platform Nov 6, 2019
@libinyang
Copy link
Contributor

@xiulipan I saw your patches changes some default value in common file. Will it impact on gcc build?

@jajanusz
Copy link
Contributor

jajanusz commented Nov 12, 2019

@xiulipan I saw your patches changes some default value in common file. Will it impact on gcc build?

These XTENSA_* variables are not used by GCC, only XCC toolchain is controlled by env variables

@lgirdwood
Copy link
Member

@xiulipan any ETA for landing this ?

@xiulipan
Copy link
Contributor Author

@lrgirdwo Hope I can do that in this week. Still need to figure out how to switch the optimization level by default.

@jajanusz
Copy link
Contributor

@lrgirdwo Hope I can do that in this week. Still need to figure out how to switch the optimization level by default.

Just add CONFIG_OPTIMIZE_FOR_SIZE=y in baytrail_defconfig ;)

xcc HIFI2 do not vec_memcpy, we can only use vec_memcpy on HIFI3 supported
platforms.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Use SOF_MEM_VECBASE_TEXT_BASE to repalce unset variable.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
xcc build will have bigger TEXT.
Need to keep the total block size unchange as the block need to be
4k align.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
bay cht and sue xcc build has bigger size, need to use -Os to reduce size.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Update xcc build config for all existing platforms.
xcc build with byt, cht and sue need special defconfig.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@xiulipan xiulipan changed the title [WIP]Enable xcc build for all platform Enable xcc build for all platform Nov 14, 2019
@xiulipan
Copy link
Contributor Author

@lrgirdwo @jajanusz updated to add CONFIG_OPTIMIZE_FOR_SIZE=y in baytrail_xcc_defconfig

All xcc build pass on byt cht bdw hsw apl skl kbl cnl icl jsl with local test.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we roll this now int CI so that it builds using XCC and has download links for binaries (using community key) and ldc files.

@tlauda
Copy link
Contributor

tlauda commented Nov 26, 2019

@xiulipan @lgirdwood Is this ready to be merged?

@lgirdwood
Copy link
Member

@tlauda yep, if you approve it. We only have 1 approver atm. me.

@tlauda tlauda dismissed jajanusz’s stale review November 26, 2019 11:52

Changes applied.

@tlauda tlauda merged commit 7d52bb6 into thesofproject:master Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants