Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TI-CGT compiler like cmake and meson #5163

Open
Freed-Wu opened this issue May 28, 2024 · 13 comments
Open

Support TI-CGT compiler like cmake and meson #5163

Freed-Wu opened this issue May 28, 2024 · 13 comments

Comments

@Freed-Wu
Copy link
Contributor

Is your feature request related to a problem? Please describe.

TI CGT (code generate tool) are TI's compilers for TI C2000 DSP, TI C6000 DSP, TI Arm board.

Refer https://mesonbuild.com/Reference-tables.html#compiler-ids

Describe the solution you'd like

Support more compliers.

Describe alternatives you've considered

No response

Additional context

No response

@waruqi
Copy link
Member

waruqi commented May 29, 2024

Can you provide compiler download links?

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Jun 7, 2024

@waruqi
Copy link
Member

waruqi commented Jun 8, 2024

Can you provide an example project with cmake or meson? or provide verbose build commands?

@modulo-medito
Copy link

Can you provide an example project with cmake or meson? or provide verbose build commands?

Example project with CMake: ti-c2000-cmake

@Freed-Wu
Copy link
Contributor Author

Release.zip

A makefile project generated by ccstudio maybe helpful.

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Sep 12, 2024

I use C6000-CGT 7.4.24 because some old chips are not supported by latest version.

@Freed-Wu
Copy link
Contributor Author

7.4.24 has some incompatible command line option, such as --gcc, which enable some gcc extension feature, which is unnecessary for > 8.0.0.

@Freed-Wu
Copy link
Contributor Author

For different chip, we should add a *.cmd file in last command line of cl6x.

@star-hengxing
Copy link
Contributor

7.4.24 requires account login to download :(

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Dec 8, 2024

@star-hengxing
Copy link
Contributor

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Dec 9, 2024

Can you provide an example project with cmake or meson? or provide verbose build commands?

here:

  • Download TI-CGT C6000 7.4.24 from here and put its bin/ to $PATH.
  • Download DM6467.cmd. Put it into project root.
    It comes from ccstudio's /opt/ccstudio/ccs/ccs_base/c6000/include/DM6467.cmd
  • Install direnv or source .envrc by yourself to set some environment variables which TI-CGT needs.
  • Install meson, ninja. Temporarily, you need a patch for TI linear assmeble.

BTW, TI-CGT contains tools (compilers,assmebler,...) and C runtime (TI RTS). the latter is open source in BSD. here

$ meson setup --cross-file=meson/ti-c6000.txt build
$ meson compile -Cbuild --verbose
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /nix/store/s2lws03pga0vyq84kfa6h041n8csbg4p-ninja-1.12.1/bin/ninja -C /home/wzy/Desktop/x264-dsp/build -v
ninja: Entering directory `/home/wzy/Desktop/x264-dsp/build'
[1/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/output.c.o.d --output_file=x264.out.p/output.c.o ../output.c
[2/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_lookahead.c.o.d --output_file=x264.out.p/encoder_lookahead.c.o ../encoder/lookahead.c
[3/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/input.c.o.d --output_file=x264.out.p/input.c.o ../input.c
[4/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/downsample.c.o.d --output_file=x264.out.p/downsample.c.o ../downsample.c
[5/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/x264.c.o.d --output_file=x264.out.p/x264.c.o ../x264.c
[6/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_cavlc.c.o.d --output_file=x264.out.p/encoder_cavlc.c.o ../encoder/cavlc.c
[7/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_cabac.c.o.d --output_file=x264.out.p/encoder_cabac.c.o ../encoder/cabac.c
[8/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_bitstream.c.o.d --output_file=x264.out.p/common_bitstream.c.o ../common/bitstream.c
[9/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_macroblock.c.o.d --output_file=x264.out.p/encoder_macroblock.c.o ../encoder/macroblock.c
[10/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_slicetype.c.o.d --output_file=x264.out.p/encoder_slicetype.c.o ../encoder/slicetype.c
[11/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_cabac.c.o.d --output_file=x264.out.p/common_cabac.c.o ../common/cabac.c
[12/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_me.c.o.d --output_file=x264.out.p/encoder_me.c.o ../encoder/me.c
[13/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_dct.c.o.d --output_file=x264.out.p/common_dct.c.o ../common/dct.c
[14/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_analyse.c.o.d --output_file=x264.out.p/encoder_analyse.c.o ../encoder/analyse.c
[15/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_common.c.o.d --output_file=x264.out.p/common_common.c.o ../common/common.c
[16/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_mc.c.o.d --output_file=x264.out.p/common_mc.c.o ../common/mc.c
[17/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_mvpred.c.o.d --output_file=x264.out.p/common_mvpred.c.o ../common/mvpred.c
[18/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_deblock.c.o.d --output_file=x264.out.p/common_deblock.c.o ../common/deblock.c
[19/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_set.c.o.d --output_file=x264.out.p/common_set.c.o ../common/set.c
[20/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_quant.c.o.d --output_file=x264.out.p/common_quant.c.o ../common/quant.c
[21/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_bitstream-a.sa.o.d --output_file=x264.out.p/common_bitstream-a.sa.o ../common/bitstream-a.sa
[22/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_vlc.c.o.d --output_file=x264.out.p/common_vlc.c.o ../common/vlc.c
[23/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_frame.c.o.d --output_file=x264.out.p/common_frame.c.o ../common/frame.c
[24/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_predict.c.o.d --output_file=x264.out.p/common_predict.c.o ../common/predict.c
[25/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_set.c.o.d --output_file=x264.out.p/encoder_set.c.o ../encoder/set.c
[26/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_quant-a.sa.o.d --output_file=x264.out.p/common_quant-a.sa.o ../common/quant-a.sa
[27/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_predict-a.sa.o.d --output_file=x264.out.p/common_predict-a.sa.o ../common/predict-a.sa
[28/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_macroblock.c.o.d --output_file=x264.out.p/common_macroblock.c.o ../common/macroblock.c
[29/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/common_pixel.c.o.d --output_file=x264.out.p/common_pixel.c.o ../common/pixel.c
[30/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_dct-a.sa.o.d --output_file=x264.out.p/common_dct-a.sa.o ../common/dct-a.sa
[31/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_deblock-a.sa.o.d --output_file=x264.out.p/common_deblock-a.sa.o ../common/deblock-a.sa
[32/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_mc-a.sa.o.d --output_file=x264.out.p/common_mc-a.sa.o ../common/mc-a.sa
[33/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_ratecontrol.c.o.d --output_file=x264.out.p/encoder_ratecontrol.c.o ../encoder/ratecontrol.c
[34/36] cl6x -I=x264.out.p -I=. -I=.. -O0 -g --gcc -mv64+ --preproc_with_compile --preproc_dependency=x264.out.p/encoder_encoder.c.o.d --output_file=x264.out.p/encoder_encoder.c.o ../encoder/encoder.c
[35/36] cl6x -I=x264.out.p -O0 -g --gcc -mv64+ -I=.. -I=. -I=x264.out.p --preproc_with_compile --preproc_dependency=x264.out.p/common_pixel-a.sa.o.d --output_file=x264.out.p/common_pixel-a.sa.o ../common/pixel-a.sa
[36/36] cl6x -O0 -g --gcc -mv64+ -z --output_file=x264.out x264.out.p/downsample.c.o x264.out.p/input.c.o x264.out.p/output.c.o x264.out.p/x264.c.o x264.out.p/encoder_analyse.c.o x264.out.p/encoder_cabac.c.o x264.out.p/encoder_cavlc.c.o x264.out.p/encoder_encoder.c.o x264.out.p/encoder_lookahead.c.o x264.out.p/encoder_macroblock.c.o x264.out.p/encoder_me.c.o x264.out.p/encoder_ratecontrol.c.o x264.out.p/encoder_set.c.o x264.out.p/encoder_slicetype.c.o x264.out.p/common_bitstream.c.o x264.out.p/common_cabac.c.o x264.out.p/common_common.c.o x264.out.p/common_dct.c.o x264.out.p/common_deblock.c.o x264.out.p/common_frame.c.o x264.out.p/common_macroblock.c.o x264.out.p/common_mc.c.o x264.out.p/common_mvpred.c.o x264.out.p/common_pixel.c.o x264.out.p/common_predict.c.o x264.out.p/common_quant.c.o x264.out.p/common_set.c.o x264.out.p/common_vlc.c.o x264.out.p/common_bitstream-a.sa.o x264.out.p/common_dct-a.sa.o x264.out.p/common_deblock-a.sa.o x264.out.p/common_mc-a.sa.o x264.out.p/common_pixel-a.sa.o x264.out.p/common_predict-a.sa.o x264.out.p/common_quant-a.sa.o --issue_remarks --rom_model --heap_size=0x1000000 --stack_size=0x1000000 /home/wzy/Desktop/x264-dsp/DM6467.cmd
<Linking>
remark: automatic RTS selection:  linking in index library "libc.a"
remark: automatic RTS selection:  linking in "rts64plus.lib" in place of index
   library "libc.a"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants