Skip to content

为 EIDE 添加 MIPS 支持#238

Merged
github0null merged 1 commit intogithub0null:devfrom
mips-studio:cip/mips-toolchain-support
May 4, 2023
Merged

为 EIDE 添加 MIPS 支持#238
github0null merged 1 commit intogithub0null:devfrom
mips-studio:cip/mips-toolchain-support

Conversation

@eatradish
Copy link
Copy Markdown
Contributor

此 PR 为 EIDE 添加 MIPS 架构项目类型的支持,其内容包括:

  • MTI_GCC(MIPS MTI GCC 编译器)项目类型
  • MIPS 编译器的默认参数
  • MIPS GCC Model 数据(本次提交的数据仅包含可以保障功能的基本内容,我们计划在后续 PR 中提交具体的参数开关等)

@eatradish eatradish force-pushed the cip/mips-toolchain-support branch from 4f2ba33 to 02347e0 Compare April 23, 2023 08:12
Copy link
Copy Markdown
Owner

@github0null github0null left a comment

Choose a reason for hiding this comment

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

明显的问题都指出来了,其他地方可能需要多建几个项目操作一下 ui 仔细测测

新的项目类型,可以补充一个内置的项目模板,几个文件的能跑起来的就行(模板不要太大了)

Comment thread package.json Outdated
"type": "string",
"scope": "resource",
"markdownDescription": "%settings.mips.gcc.install.folder%",
"default": "${userRoot}/.eide/tools/mti"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

如果有 win32 版本编译器,建议改成 "${userRoot}/.eide/tools/mips_mti",同时请在 https://github.com/github0null/eide_default_external_tools_index/blob/master/index.json 中注册编译器资源,id 就是 mips_mti

如果只有 Linux 版本,请将 "default" 的值设置为空

Comment thread src/EIDETypeDefine.ts Outdated
Comment thread src/ToolchainManager.ts Outdated
Comment thread src/ToolchainManager.ts Outdated
"warnings": "all-warnings",
"one-elf-section-per-function": false,
"one-elf-section-per-data": false,
"C_FLAGS": "-fmessage-length=0 -fno-common -EL -msoft-float -mno-mips16 -mno-micromips -mmcu -G 0",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

-msoft-float

浮点类型较常用,建议放到 models 里制作成下拉列表,用来选是软浮点还是硬浮点

-EL -mno-mips16 -mno-micromips -mmcu

对于某些选项,如果所有的 mcu 都是这样定死了的话,需要直接放到 model 里面的 $default 数组里

C_FLAGS 用来给用户自己加选项的,如果放太多重要的且必选的选项进去,又时候可能会被误删

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

下面的 asm 的 和 linker 的也一样

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这里的问题是,我是否能把 C_FLAGS 和 ASM 的选项留空,然后交给模板的默认参数来设置?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

要确保,不用模板建的空项目,添加完源文件后,也能正常编译出能用的程序

Comment thread src/ToolchainManager.ts
Comment thread package.json Outdated
Comment thread src/SettingManager.ts Outdated
@eatradish eatradish force-pushed the cip/mips-toolchain-support branch 2 times, most recently from e964291 to 85f4bcf Compare April 25, 2023 07:49
- Implement MIPS (MTI) toolchain support for *nix and MinGW64 platforms as the
  MTI_GCC (MIPS MTI GCC Compiler) project type.
- Default to a baseline set of MIPS compiler flags.
- Add barebones GCC Model data in /res/data/models/*/mips.gcc.model.json.

Co-authored-by: Yu Shen <yu.shen@oss.cipunited.com>
Signed-off-by: Mingcong Bai <jeffbai@oss.cipunited.com>
@eatradish eatradish force-pushed the cip/mips-toolchain-support branch from 85f4bcf to cfa484b Compare April 26, 2023 08:43
@github0null
Copy link
Copy Markdown
Owner

还有你用强推只会显示一个 commit,无法对比更改

导致我只能把每个文件再看一遍

@eatradish
Copy link
Copy Markdown
Contributor Author

还有你用强推只会显示一个 commit,无法对比更改

导致我只能把每个文件再看一遍

啊抱歉,之前没注意到这个问题

@github0null
Copy link
Copy Markdown
Owner

还有其他要改的吗?没有的话我要合并了

@github0null github0null merged commit 80213d1 into github0null:dev May 4, 2023
@MingcongBai
Copy link
Copy Markdown
Contributor

@github0null 作者您好,我是芯联芯方面的负责人。

由于之前是五一假期,所以没有及时跟进这个 PR,抱歉!目前模板参数方面还有待改善(目前无参数构建不出目标),我们会尽快发一个 PR 跟进修复。

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.

3 participants