RT-Thread / rt-thread

RT-Thread is an open source IoT Real-Time Operating System (RTOS).
https://www.rt-thread.io
Apache License 2.0
10.52k stars 5.03k forks source link

控制libcpu下的risc-v代码 #6726

Closed BernardXiong closed 1 year ago

BernardXiong commented 1 year ago

目前libcpu/risc-v下的代码,基本上接入一家芯片厂商或芯片就会来一份文件夹,后面需要严格控制者部分的代码,尽可能合并。如果需要独立的文件夹,需要给出完善,完整的理由出来,否则不会进行合并。

同时开启libcpu/risc-v下代码的合并,可以是这样的模式:

libcpu
└── risc-v
    ├── common
    └── vendor
        ├── chip
        └── common

尽可能的重用代码,例如rt_hw_stack_init, rt_hw_interrupt_disable/enable

BernardXiong commented 1 year ago

以下这些代码都是需要整理的,这些代码都跳过了common目录下的代码

# add common code files
if   rtconfig.CPU == "e9xx" :
    group = group
elif rtconfig.CPU == "nuclei" :
    group = group
elif rtconfig.CPU == "virt64" :
    group = group
elif rtconfig.CPU == "c906" :
    group = group
elif rtconfig.CPU == "ch32v1" :
    group = group
elif rtconfig.CPU == "ch32v3" :
    group = group
elif rtconfig.CPU == "hpmicro":
    group = group
elif rtconfig.CPU == "cv32e40p":
    group = group
else :
    group = group + SConscript(os.path.join('common', 'SConscript'))
polarvid commented 1 year ago

是否可以用 cpu ISA 的形式组织。riscv ISA 的常用的几个标准比如 2.2, 20190608, 20191213... 可以具体看一下相关的兼容性,然后以文件夹的形式组织起来。比如 qemu-virt64 就可以包括 rv64ima, rv64v_1_0 这些文件夹。c908 就可以包括 rv64ima, rv64v_1_0, xthead_*

BernardXiong commented 1 year ago

这个issue是否可以关闭了?