You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/26 16:27:01 UTC

[GitHub] [incubator-nuttx] no1wudi opened a new pull request #5076: arch/risc-v: Refine Toolchain.defs

no1wudi opened a new pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076


   ## Summary
   Refine risc-v Toolchain.defs firstly, and it tested on qemu-rv32.
   And then:
   1. Apply new Toolchain.defs to all risc-v based chips 
   2. Merge the common src for rv32/rv64 (riscv_syscall.S/riscv_fpu.S etc, in rv32im and rv64gc)
   3. Apply new common src to qemu-rv32 and qemu-rv64
   4. Migrate all risc-v based chips to new implementation and remove old
   ## Impact
   Refactor only.
   ## Testing
   Tested on qemu-rv32


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001948864


   Yes, copy Mak.defs can fix this problem too.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on a change in pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
no1wudi commented on a change in pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#discussion_r775370317



##########
File path: arch/risc-v/Kconfig
##########
@@ -82,13 +106,19 @@ config ARCH_CHIP_MPFS
 
 config ARCH_CHIP_RV32M1
 	bool "NXP RV32M1"
+	select ARCH_RV32
+	select ARCH_RV_ISA_M
+	select ARCH_RV_ISA_C
 	select ARCH_RV32IM
 	---help---
 		NXP RV32M1 processor (RISC-V Core with PULP extensions).
 
 config ARCH_CHIP_QEMU_RV32
 	bool "QEMU RV32"
-	select ARCH_RV32IM
+	select ARCH_RV32
+	select ARCH_RV_ISA_M
+	select ARCH_RV_ISA_C
+	select ARCH_RV32IM # TODO: Remove this old style options

Review comment:
       Done, ARCH_RV32IM and ARCH_RV64GC had been removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001944916


   This patch merge Toolchain.defs from rv32im/rv64gc to common, so you may need make distclean and reconfigure again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001842615


   @no1wudi there are some build error need to fix first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#discussion_r775357614



##########
File path: arch/risc-v/Kconfig
##########
@@ -82,13 +106,19 @@ config ARCH_CHIP_MPFS
 
 config ARCH_CHIP_RV32M1
 	bool "NXP RV32M1"
+	select ARCH_RV32
+	select ARCH_RV_ISA_M
+	select ARCH_RV_ISA_C
 	select ARCH_RV32IM
 	---help---
 		NXP RV32M1 processor (RISC-V Core with PULP extensions).
 
 config ARCH_CHIP_QEMU_RV32
 	bool "QEMU RV32"
-	select ARCH_RV32IM
+	select ARCH_RV32
+	select ARCH_RV_ISA_M
+	select ARCH_RV_ISA_C
+	select ARCH_RV32IM # TODO: Remove this old style options

Review comment:
       why not remove now




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] normanr commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
normanr commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001945693


   I couldn't run `make distclean` because of the same reason, also deleting it broke things worse. I had to re-copy the Make.defs from the arch directory, and that fixed things.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
no1wudi commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001361814


   > Look like we should finish this PR: #2822
   
   This PR will be finished in next phase, I will pick it later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001211251


   Look like we should finish this PR: https://github.com/apache/incubator-nuttx/pull/2822


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
no1wudi commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001371558


   Waiting for #5082 , and this patch will be rebased on it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] no1wudi commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
no1wudi commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001883363


   > @no1wudi there are some build error need to fix first.
   
   Fixed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#discussion_r775527844



##########
File path: boards/risc-v/rv32m1/rv32m1-vega/scripts/Make.defs
##########
@@ -49,17 +49,15 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
   ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
 endif
 
-ARCHCPURV32IM = -march=rv32imc -mabi=ilp32
-
 ifeq ($(CONFIG_RV32M1_OPENISA_TOOLCHAIN),y)
   ifdef CONFIG_ARCH_RISCV_INTXCPT_EXTREGS
     ifeq ($(filter 0 1 2 3 4 5 , $(CONFIG_ARCH_RISCV_INTXCPT_EXTREGS)),)
       ARCHCPURV32IM = -march=rv32imcxpulpv2
+      ARCHCPUFLAGS = $(ARCHCPURV32IM)

Review comment:
       ARCHCPUFLAGS = -march=rv32imcxpulpv2 and remove ARCHCPURV32IM 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#discussion_r775358856



##########
File path: arch/risc-v/src/common/Toolchain.defs
##########
@@ -53,15 +53,66 @@ else
   MAXOPTIMIZATION ?= -Os
 endif
 
-# Generic GNU RVG toolchain
 
 ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
+
+  # Generic GNU RVG toolchain
+
   CROSSDEV ?= riscv64-unknown-elf-
+
+  # Detect cpu ISA support flags
+
+  ifeq ($(CONFIG_ARCH_RV_ISA_M),y)
+    ARCHRVISAM = m
+  endif
+
+  ifeq ($(CONFIG_ARCH_RV_ISA_A),y)
+    ARCHRVISAA = a
+  endif
+  
+  ifeq ($(CONFIG_ARCH_RV_ISA_C),y)
+    ARCHRVISAC = c
+  endif
+
   ifeq ($(CONFIG_ARCH_FPU),y)
-      ARCHCPUFLAGS = -march=rv32imfc -mabi=ilp32f
+
+    ifeq ($(CONFIG_ARCH_RV_ISA_F),y)
+      ARCHRVISAF = f
+    endif
+
+    ifeq ($(CONFIG_ARCH_DPFPU),y)
+
+      ifeq ($(CONFIG_ARCH_RV_ISA_D),y)
+        ARCHRVISAD = d
+      endif
+
+    endif
+  endif
+
+  # Detect abi type
+
+  ifeq ($(CONFIG_ARCH_RV32),y)
+    ARCHTYPE = rv32
+    ARCHABITYPE = ilp32
+  else ifeq ($(CONFIG_ARCH_RV64),y)
+    ARCHTYPE = rv64
+    ARCHABITYPE = lp64
+  endif
+
+  # Construct arch flags
+
+  ARCHCPUFLAGS = -march=$(ARCHTYPE)i$(ARCHRVISAM)$(ARCHRVISAA)$(ARCHRVISAF)$(ARCHRVISAD)$(ARCHRVISAC)
+
+  # Construct arch abi flags
+
+  ifeq ($(CONFIG_ARCH_DPFPU),y)

Review comment:
       why not define ARCHRVISAD correctly at line 83




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] normanr commented on pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
normanr commented on pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076#issuecomment-1001929285


   This is giving me:
   ```
   $ make menuconfig
   /home/normanr/src/nuttx/nuttx/tools/../Make.defs:23: /home/normanr/src/nuttx/nuttx/tools/../arch/risc-v/src/rv32im/Toolchain.defs: No such file or directory
   make: *** No rule to make target '/home/normanr/src/nuttx/nuttx/tools/../arch/risc-v/src/rv32im/Toolchain.defs'.  Stop.
   /home/normanr/src/nuttx/nuttx/Make.defs:23: /home/normanr/src/nuttx/nuttx/arch/risc-v/src/rv32im/Toolchain.defs: No such file or directory
   make: *** No rule to make target '/home/normanr/src/nuttx/nuttx/arch/risc-v/src/rv32im/Toolchain.defs'.  Stop.
   ```
   Is there anything special I need to do to clear out old state? I just tried `make menuconfig` and `make`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5076: arch/risc-v: Refine Toolchain.defs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5076:
URL: https://github.com/apache/incubator-nuttx/pull/5076


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org