Skip to content

Support configurable RISC-V chip extension #773

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

Merged
merged 27 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b451f97
Support configurable RISC-V chip extension
jbenczarski Sep 1, 2023
db10cc4
Merge branch 'main' into main
chinglee-iot Sep 4, 2023
61234a1
Add port GCC_RISC_V_GENERIC and IAR_RISC_V_GENERIC
chinglee-iot Sep 4, 2023
4fada64
Merge branch 'main' into main
chinglee-iot Sep 5, 2023
44b6a7a
Merge branch 'main' into main
chinglee-iot Sep 6, 2023
ee0d86b
Merge branch 'main' into main
chinglee-iot Sep 7, 2023
69b70ad
Merge pull request #1 from chinglee-iot/joe-riscv-cmake-support
JoeBenczarski Sep 11, 2023
f609676
Merge branch 'main' into main
chinglee-iot Sep 13, 2023
218a08a
Merge branch 'main' into main
chinglee-iot Sep 18, 2023
8b72359
Merge branch 'main' into main
chinglee-iot Sep 19, 2023
b6c023f
Merge branch 'main' into main
chinglee-iot Sep 20, 2023
45ec87d
Merge branch 'main' into main
chinglee-iot Sep 21, 2023
5786804
Merge branch 'main' into main
chinglee-iot Sep 25, 2023
dd61eb9
Merge branch 'main' into main
kar-rahul-aws Sep 26, 2023
c5fddfe
Merge branch 'main' into main
kar-rahul-aws Sep 27, 2023
85f5c22
Merge branch 'main' into main
chinglee-iot Oct 3, 2023
caa50bd
Merge branch 'main' into main
chinglee-iot Oct 4, 2023
63f26aa
Merge branch 'main' into main
Skptak Oct 4, 2023
e9d51aa
Merge branch 'main' into main
chinglee-iot Oct 6, 2023
6ed7488
Merge branch 'main' into main
kar-rahul-aws Oct 12, 2023
67ac906
Merge branch 'main' into main
kar-rahul-aws Oct 13, 2023
a24f1f8
Merge branch 'main' into main
kar-rahul-aws Oct 16, 2023
73a0f38
Merge branch 'main' into main
kar-rahul-aws Oct 17, 2023
d961aa6
Merge branch 'main' into main
kar-rahul-aws Oct 18, 2023
079329e
Merge branch 'main' into main
Skptak Oct 19, 2023
edec328
Merge branch 'main' into main
chinglee-iot Oct 26, 2023
24cbfa2
Merge branch 'main' into main
chinglee-iot Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ if(NOT FREERTOS_PORT)
" GCC_PPC440_XILINX - Compiler: GCC Target: Xilinx PPC440\n"
" GCC_RISC_V - Compiler: GCC Target: RISC-V\n"
" GCC_RISC_V_PULPINO_VEGA_RV32M1RM - Compiler: GCC Target: RISC-V Pulpino Vega RV32M1RM\n"
" GCC_RISC_V_GENERIC - Compiler: GCC Target: RISC-V with FREERTOS_RISCV_EXTENSION\n"
" GCC_RL78 - Compiler: GCC Target: Renesas RL78\n"
" GCC_RX100 - Compiler: GCC Target: Renesas RX100\n"
" GCC_RX200 - Compiler: GCC Target: Renesas RX200\n"
Expand Down Expand Up @@ -156,6 +157,7 @@ if(NOT FREERTOS_PORT)
" IAR_MSP430 - Compiler: IAR Target: MSP430\n"
" IAR_MSP430X - Compiler: IAR Target: MSP430X\n"
" IAR_RISC_V - Compiler: IAR Target: RISC-V\n"
" IAR_RISC_V_GENERIC - Compiler: IAR Target: RISC-V with FREERTOS_RISCV_EXTENSION\n"
" IAR_RL78 - Compiler: IAR Target: Renesas RL78\n"
" IAR_RX100 - Compiler: IAR Target: Renesas RX100\n"
" IAR_RX600 - Compiler: IAR Target: Renesas RX600\n"
Expand Down
24 changes: 24 additions & 0 deletions portable/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
if( FREERTOS_PORT STREQUAL "GCC_RISC_V_GENERIC" )
include( GCC/RISC-V/chip_extensions.cmake )
endif()

if( FREERTOS_PORT STREQUAL "IAR_RISC_V_GENERIC" )
include( IAR/RISC-V/chip_extensions.cmake )
endif()

# FreeRTOS internal cmake file. Do not use it in user top-level project

if (FREERTOS_PORT STREQUAL "A_CUSTOM_PORT")
Expand Down Expand Up @@ -292,6 +300,10 @@ add_library(freertos_kernel_port STATIC
GCC/RISC-V/port.c
GCC/RISC-V/portASM.S>

$<$<STREQUAL:${FREERTOS_PORT},GCC_RISC_V_GENERIC>:
GCC/RISC-V/port.c
GCC/RISC-V/portASM.S>

# Renesas RL78 port for GCC
$<$<STREQUAL:${FREERTOS_PORT},GCC_RL78>:
GCC/RL78/port.c
Expand Down Expand Up @@ -497,6 +509,10 @@ add_library(freertos_kernel_port STATIC
IAR/RISC-V/port.c
IAR/RISC-V/portASM.s>

$<$<STREQUAL:${FREERTOS_PORT},IAR_RISC_V_GENERIC>:
IAR/RISC-V/port.c
IAR/RISC-V/portASM.s>

# Renesas RL78 port for IAR EWRL78
$<$<STREQUAL:${FREERTOS_PORT},IAR_RL78>:
IAR/RL78/port.c
Expand Down Expand Up @@ -845,6 +861,10 @@ target_include_directories(freertos_kernel_port PUBLIC
${CMAKE_CURRENT_LIST_DIR}/GCC/RISC-V
${CMAKE_CURRENT_LIST_DIR}/GCC/RISC-V/chip_specific_extensions/Pulpino_Vega_RV32M1RM>

$<$<STREQUAL:${FREERTOS_PORT},GCC_RISC_V_GENERIC>:
${CMAKE_CURRENT_LIST_DIR}/GCC/RISC-V
${CMAKE_CURRENT_LIST_DIR}/GCC/RISC-V/chip_specific_extensions/${FREERTOS_RISCV_EXTENSION}>

# Renesas RL78 port for GCC
$<$<STREQUAL:${FREERTOS_PORT},GCC_RL78>:${CMAKE_CURRENT_LIST_DIR}/GCC/RL78>

Expand Down Expand Up @@ -942,6 +962,10 @@ target_include_directories(freertos_kernel_port PUBLIC
${CMAKE_CURRENT_LIST_DIR}/IAR/RISC-V
${CMAKE_CURRENT_LIST_DIR}/IAR/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions>

$<$<STREQUAL:${FREERTOS_PORT},IAR_RISC_V_GENERIC>:
${CMAKE_CURRENT_LIST_DIR}/IAR/RISC-V
${CMAKE_CURRENT_LIST_DIR}/IAR/RISC-V/chip_specific_extensions/${FREERTOS_RISCV_EXTENSION}>

# Renesas RL78 port for IAR EWRL78
$<$<STREQUAL:${FREERTOS_PORT},IAR_RL78>:${CMAKE_CURRENT_LIST_DIR}/IAR/RL78>

Expand Down
19 changes: 19 additions & 0 deletions portable/GCC/RISC-V/chip_extensions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if( FREERTOS_PORT STREQUAL "GCC_RISC_V_GENERIC" )
set( VALID_CHIP_EXTENSIONS
"Pulpino_Vega_RV32M1RM"
"RISCV_MTIME_CLINT_no_extensions"
"RISCV_no_extensions"
"RV32I_CLINT_no_extensions" )

if( ( NOT FREERTOS_RISCV_EXTENSION ) OR ( NOT ( ${FREERTOS_RISCV_EXTENSION} IN_LIST VALID_CHIP_EXTENSIONS ) ) )
message(FATAL_ERROR
"FREERTOS_RISCV_EXTENSION \"${FREERTOS_RISCV_EXTENSION}\" is not set or unsupported.\n"
"Please specify it from top-level CMake file (example):\n"
" set(FREERTOS_RISCV_EXTENSION RISCV_MTIME_CLINT_no_extensions CACHE STRING \"\")\n"
" or from CMake command line option:\n"
" -DFREERTOS_RISCV_EXTENSION=RISCV_MTIME_CLINT_no_extensions\n"
"\n"
" Available extension options:\n"
" ${VALID_CHIP_EXTENSIONS} \n")
endif()
endif()
16 changes: 16 additions & 0 deletions portable/IAR/RISC-V/chip_extensions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if( FREERTOS_PORT STREQUAL "IAR_RISC_V_GENERIC" )
set( VALID_CHIP_EXTENSIONS
"RV32I_CLINT_no_extensions" )

if( ( NOT FREERTOS_RISCV_EXTENSION ) OR ( NOT ( ${FREERTOS_RISCV_EXTENSION} IN_LIST VALID_CHIP_EXTENSIONS ) ) )
message(FATAL_ERROR
"FREERTOS_RISCV_EXTENSION \"${FREERTOS_RISCV_EXTENSION}\" is not set or unsupported.\n"
"Please specify it from top-level CMake file (example):\n"
" set(FREERTOS_RISCV_EXTENSION RISCV_MTIME_CLINT_no_extensions CACHE STRING \"\")\n"
" or from CMake command line option:\n"
" -DFREERTOS_RISCV_EXTENSION=RISCV_MTIME_CLINT_no_extensions\n"
"\n"
" Available extension options:\n"
" ${VALID_CHIP_EXTENSIONS} \n")
endif()
endif()