npk.yml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. ## Package Base Information
  2. ## This npk.yml only works with Nuclei Studio 2023.10 or later
  3. name: ssp-nsdk_evalsoc
  4. owner: nuclei
  5. description: Nuclei EvalSoC Support Package
  6. type: ssp
  7. keywords:
  8. - soc
  9. - risc-v
  10. - nuclei
  11. license: Apache-2.0
  12. homepage: https://nucleisys.com/developboard.php#ddr200t
  13. packinfo:
  14. core_vendor: Nuclei
  15. vendor: Nuclei
  16. name: Nuclei FPGA Evaluation SoC
  17. doc:
  18. website: https://nucleisys.com/developboard.php#ddr200t # Website
  19. datasheet: https://nucleisys.com/developboard.php#ddr200t # SoC datasheet
  20. usermanual: https://nucleisys.com/developboard.php#ddr200t # User Manual
  21. extra:
  22. - uri: # file path or web link
  23. description: # description
  24. ## Package Dependency
  25. dependencies:
  26. - name: csp-nsdk_nmsis
  27. version:
  28. ## Package Configurations
  29. configuration:
  30. nuclei_core:
  31. default_value: n300fd
  32. type: choice
  33. global: true
  34. description: Nuclei RISC-V Core
  35. # tips introduced in Nuclei Studio 2023.10
  36. tips: "Select Nuclei Core to match basic RISC-V ARCH and ABI, used together with below Nuclei ARCH Extensions"
  37. choices:
  38. # N100 support limitation: https://doc.nucleisys.com/nuclei_sdk/develop/buildsystem.html#n100-support-limitation
  39. - name: n100
  40. arch: rv32ic
  41. abi: ilp32
  42. cmodel: medlow
  43. tune: nuclei-100-series
  44. description: N100 Core with ECLIC(ARCH=rv32ic, ABI=ilp32)
  45. - name: n100m
  46. arch: rv32imc
  47. abi: ilp32
  48. cmodel: medlow
  49. tune: nuclei-100-series
  50. description: N100M Core with ECLIC(ARCH=rv32imc, ABI=ilp32)
  51. - name: n100zmmul
  52. arch: rv32ic_zmmul
  53. abi: ilp32
  54. cmodel: medlow
  55. tune: nuclei-100-series
  56. description: N100ZMMUL Core with ECLIC(ARCH=rv32ic_zmmul, ABI=ilp32)
  57. - name: n100e
  58. arch: rv32ec
  59. abi: ilp32e
  60. cmodel: medlow
  61. tune: nuclei-100-series
  62. description: N100E Core with ECLIC(ARCH=rv32ec, ABI=ilp32e)
  63. - name: n100em
  64. arch: rv32emc
  65. abi: ilp32e
  66. cmodel: medlow
  67. tune: nuclei-100-series
  68. description: N100EM Core with ECLIC(ARCH=rv32emc, ABI=ilp32e)
  69. - name: n100ezmmul
  70. arch: rv32ec_zmmul
  71. abi: ilp32e
  72. cmodel: medlow
  73. tune: nuclei-100-series
  74. description: N100EZMMUL Core with ECLIC(ARCH=rv32ec_zmmul, ABI=ilp32e)
  75. - name: n200
  76. arch: rv32imc
  77. abi: ilp32
  78. cmodel: medlow
  79. tune: nuclei-200-series
  80. description: N200 Core(ARCH=rv32imc, ABI=ilp32)
  81. - name: n200e
  82. arch: rv32emc
  83. abi: ilp32e
  84. cmodel: medlow
  85. tune: nuclei-200-series
  86. description: N200E Core(ARCH=rv32emc, ABI=ilp32e)
  87. - name: n201
  88. arch: rv32iac
  89. abi: ilp32
  90. cmodel: medlow
  91. tune: nuclei-200-series
  92. description: N201 Core(ARCH=rv32iac, ABI=ilp32)
  93. - name: n201e
  94. arch: rv32eac
  95. abi: ilp32e
  96. cmodel: medlow
  97. tune: nuclei-200-series
  98. description: N201E Core(ARCH=rv32eac, ABI=ilp32e)
  99. - name: n202
  100. arch: rv32ic
  101. abi: ilp32
  102. cmodel: medlow
  103. tune: nuclei-200-series
  104. description: N202 Core(ARCH=rv32ic, ABI=ilp32)
  105. - name: n202e
  106. arch: rv32ec
  107. abi: ilp32e
  108. cmodel: medlow
  109. tune: nuclei-200-series
  110. description: N202E Core(ARCH=rv32ec, ABI=ilp32e)
  111. - name: n203
  112. arch: rv32imac
  113. abi: ilp32
  114. cmodel: medlow
  115. tune: nuclei-200-series
  116. description: N203 Core(ARCH=rv32imac, ABI=ilp32)
  117. - name: n203e
  118. arch: rv32emac
  119. abi: ilp32e
  120. cmodel: medlow
  121. tune: nuclei-200-series
  122. description: N203E Core(ARCH=rv32emac, ABI=ilp32e)
  123. - name: n300
  124. arch: rv32imac
  125. abi: ilp32
  126. cmodel: medlow
  127. tune: nuclei-300-series
  128. description: N300 Core(ARCH=rv32imac, ABI=ilp32)
  129. - name: n300e
  130. arch: rv32emac
  131. abi: ilp32e
  132. cmodel: medlow
  133. tune: nuclei-300-series
  134. description: N300E Core(ARCH=rv32emac, ABI=ilp32e)
  135. - name: n300f
  136. arch: rv32imafc
  137. abi: ilp32f
  138. cmodel: medlow
  139. tune: nuclei-300-series
  140. description: N300F Core(ARCH=rv32imafc, ABI=ilp32f)
  141. - name: n300fd
  142. arch: rv32imafdc
  143. abi: ilp32d
  144. cmodel: medlow
  145. tune: nuclei-300-series
  146. description: N300FD Core(ARCH=rv32imafdc, ABI=ilp32d)
  147. - name: n600
  148. arch: rv32imac
  149. abi: ilp32
  150. cmodel: medlow
  151. tune: nuclei-600-series
  152. description: N600 Core(ARCH=rv32imac, ABI=ilp32)
  153. - name: n600f
  154. arch: rv32imafc
  155. abi: ilp32f
  156. cmodel: medlow
  157. tune: nuclei-600-series
  158. description: N600F Core(ARCH=rv32imafc, ABI=ilp32f)
  159. - name: n600fd
  160. arch: rv32imafdc
  161. abi: ilp32d
  162. cmodel: medlow
  163. tune: nuclei-600-series
  164. description: N600FD Core(ARCH=rv32imafdc, ABI=ilp32d)
  165. - name: u600
  166. arch: rv32imac
  167. abi: ilp32
  168. cmodel: medlow
  169. tune: nuclei-600-series
  170. description: U600 Core(ARCH=rv32imac, ABI=ilp32)
  171. - name: u600f
  172. arch: rv32imafc
  173. abi: ilp32f
  174. cmodel: medlow
  175. tune: nuclei-600-series
  176. description: U600F Core(ARCH=rv32imafc, ABI=ilp32f)
  177. - name: u600fd
  178. arch: rv32imafdc
  179. abi: ilp32d
  180. cmodel: medlow
  181. tune: nuclei-600-series
  182. description: U600FD Core(ARCH=rv32imafdc, ABI=ilp32d)
  183. - name: nx600
  184. arch: rv64imac
  185. abi: lp64
  186. cmodel: medany
  187. tune: nuclei-600-series
  188. description: NX600 Core(ARCH=rv64imac, ABI=lp64)
  189. - name: nx600f
  190. arch: rv64imafc
  191. abi: lp64f
  192. cmodel: medany
  193. tune: nuclei-600-series
  194. description: NX600F Core(ARCH=rv64imafc, ABI=lp64f)
  195. - name: nx600fd
  196. arch: rv64imafdc
  197. abi: lp64d
  198. cmodel: medany
  199. tune: nuclei-600-series
  200. description: NX600FD Core(ARCH=rv64imafdc, ABI=lp64d)
  201. - name: ux600
  202. arch: rv64imac
  203. abi: lp64
  204. cmodel: medany
  205. tune: nuclei-600-series
  206. description: UX600 Core(ARCH=rv64imac, ABI=lp64)
  207. - name: ux600f
  208. arch: rv64imafc
  209. abi: lp64f
  210. cmodel: medany
  211. tune: nuclei-600-series
  212. description: UX600F Core(ARCH=rv64imafc, ABI=lp64f)
  213. - name: ux600fd
  214. arch: rv64imafdc
  215. abi: lp64d
  216. cmodel: medany
  217. tune: nuclei-600-series
  218. description: UX600FD Core(ARCH=rv64imafdc, ABI=lp64d)
  219. - name: n900
  220. arch: rv32imac
  221. abi: ilp32
  222. cmodel: medlow
  223. tune: nuclei-900-series
  224. description: N900 Core(ARCH=rv32imac, ABI=ilp32)
  225. - name: n900f
  226. arch: rv32imafc
  227. abi: ilp32f
  228. cmodel: medlow
  229. tune: nuclei-900-series
  230. description: N900F Core(ARCH=rv32imafc, ABI=ilp32f)
  231. - name: n900fd
  232. arch: rv32imafdc
  233. abi: ilp32d
  234. cmodel: medlow
  235. tune: nuclei-900-series
  236. description: N900FD Core(ARCH=rv32imafdc, ABI=ilp32d)
  237. - name: nx900
  238. arch: rv64imac
  239. abi: lp64
  240. cmodel: medany
  241. tune: nuclei-900-series
  242. description: NX900 Core(ARCH=rv64imac, ABI=lp64)
  243. - name: nx900f
  244. arch: rv64imafc
  245. abi: lp64f
  246. cmodel: medany
  247. tune: nuclei-900-series
  248. description: NX900F Core(ARCH=rv64imafc, ABI=lp64f)
  249. - name: nx900fd
  250. arch: rv64imafdc
  251. abi: lp64d
  252. cmodel: medany
  253. tune: nuclei-900-series
  254. description: NX900FD Core(ARCH=rv64imafdc, ABI=lp64d)
  255. - name: u900
  256. arch: rv32imac
  257. abi: ilp32
  258. cmodel: medlow
  259. tune: nuclei-900-series
  260. description: U900 Core(ARCH=rv32imac, ABI=ilp32)
  261. - name: u900f
  262. arch: rv32imafc
  263. abi: ilp32f
  264. cmodel: medlow
  265. tune: nuclei-900-series
  266. description: U900F Core(ARCH=rv32imafc, ABI=ilp32f)
  267. - name: u900fd
  268. arch: rv32imafdc
  269. abi: ilp32d
  270. cmodel: medlow
  271. tune: nuclei-900-series
  272. description: U900FD Core(ARCH=rv32imafdc, ABI=ilp32d)
  273. - name: ux900
  274. arch: rv64imac
  275. abi: lp64
  276. cmodel: medany
  277. tune: nuclei-900-series
  278. description: UX900 Core(ARCH=rv64imac, ABI=lp64)
  279. - name: ux900f
  280. arch: rv64imafc
  281. abi: lp64f
  282. cmodel: medany
  283. tune: nuclei-900-series
  284. description: UX900F Core(ARCH=rv64imafc, ABI=lp64f)
  285. - name: ux900fd
  286. arch: rv64imafdc
  287. abi: lp64d
  288. cmodel: medany
  289. tune: nuclei-900-series
  290. description: UX900FD Core(ARCH=rv64imafdc, ABI=lp64d)
  291. - name: nx1000
  292. arch: rv64imac
  293. abi: lp64
  294. cmodel: medany
  295. tune: nuclei-1000-series
  296. description: NX1000 Core(ARCH=rv64imac, ABI=lp64)
  297. - name: nx1000f
  298. arch: rv64imafc
  299. abi: lp64f
  300. cmodel: medany
  301. tune: nuclei-1000-series
  302. description: NX1000F Core(ARCH=rv64imafc, ABI=lp64f)
  303. - name: nx1000fd
  304. arch: rv64imafdc
  305. abi: lp64d
  306. cmodel: medany
  307. tune: nuclei-1000-series
  308. description: NX1000FD Core(ARCH=rv64imafdc, ABI=lp64d)
  309. - name: ux1000
  310. arch: rv64imac
  311. abi: lp64
  312. cmodel: medany
  313. tune: nuclei-1000-series
  314. description: UX1000 Core(ARCH=rv64imac, ABI=lp64)
  315. - name: ux1000f
  316. arch: rv64imafc
  317. abi: lp64f
  318. cmodel: medany
  319. tune: nuclei-1000-series
  320. description: UX1000F Core(ARCH=rv64imafc, ABI=lp64f)
  321. - name: ux1000fd
  322. arch: rv64imafdc
  323. abi: lp64d
  324. cmodel: medany
  325. tune: nuclei-1000-series
  326. description: UX1000FD Core(ARCH=rv64imafdc, ABI=lp64d)
  327. nuclei_archext:
  328. default_value: ""
  329. type: text
  330. # hints and tips are introduced in Nuclei Studio 2023.10
  331. # used to show tool tips and input hints
  332. tips: "Possible other ISA extensions, seperated by underscores, like '_zba_zbb_zbc_zbs_xxldspn1x'"
  333. hints: "_zba_zbb_zbc_zbs_xxldsp"
  334. global: true
  335. description: ARCH Extensions(ARCH_EXT=)
  336. # NOTE: nuclei_cache configuration removed from 0.9.0 release, it will not be effective, now L1/L2 Cache will be enabled by default when present,
  337. # and CCM feature by default not present, to force enable it for evalsoc with not nuclei_gen generated cpufeature.h,
  338. # you need to pass macro -DXLCFG_CCM=1 in your c/asm/cpp compiler options
  339. nuclei_eclic:
  340. default_value: v1
  341. type: choice
  342. global: true
  343. tips: "Select your CPU's ECLIC version"
  344. description: ECLIC Version
  345. choices:
  346. - name: v1
  347. description: "v1, no hardware context save/restore feature"
  348. - name: v2
  349. description: "v2, with hardware context save/restore feature and enabled"
  350. eclic_hwctx:
  351. default_value: 1
  352. global: false
  353. type: checkbox
  354. description: ECLIC v2 HW Context Auto Save/Restore
  355. nuclei_smp:
  356. default_value: 0
  357. type: spinner
  358. global: true
  359. tips: "SMP CPU Number, if above 1, you should set proper heap and stack size"
  360. description: Nuclei SMP Count
  361. param:
  362. range: >-
  363. [0, 16, 1]
  364. boothartid:
  365. default_value: 0
  366. type: spinner
  367. global: true
  368. tips: "Select which hart chosen by hartid is the boot hart"
  369. description: Boot HartID
  370. param:
  371. range: >-
  372. [0, 15, 1]
  373. heapsz:
  374. value: ""
  375. type: text
  376. # hints and tips are introduced in Nuclei Studio 2023.10
  377. # used to show tool tips and input hints
  378. tips: "Heap size in bytes, eg. 4K or 4096, leave it blank for default linker script settings"
  379. hints: "4K"
  380. description: Heap Size
  381. stacksz:
  382. value: ""
  383. type: text
  384. # hints and tips are introduced in Nuclei Studio 2023.10
  385. # used to show tool tips and input hints
  386. tips: "Stack size in bytes for each cpu, eg. 4K or 4096, leave it blank for default linker script settings"
  387. hints: "4K"
  388. description: Stack Size Per CPU
  389. semihost:
  390. default_value: 0
  391. type: checkbox
  392. tips: "If semihosting is enabled, c library stub source files will not be copied"
  393. description: Enable Semihosting
  394. autovec:
  395. default_value: 1
  396. type: checkbox
  397. tips: "It autovec is enabled, compiler will enable auto vectorization according to compiler options, otherwise, it will try to disable auto vectorization as much as possible"
  398. description: Enable Compiler Auto Vectorization
  399. stdclib:
  400. default_value: newlib_nano
  401. type: choice
  402. global: true
  403. tips: "Select proper c library, code size usage newlib_full > nuclei_nano > libncrt, libncrt only works for rv32"
  404. description: Standard C Library(STDCLIB=)
  405. choices:
  406. - name: newlib_full
  407. description: "newlib_full: newlib with full feature"
  408. - name: newlib_fast
  409. description: "newlib_fast: newlib nano with printf/scanf float"
  410. - name: newlib_small
  411. description: "newlib_small: newlib nano with printf float"
  412. - name: newlib_nano
  413. description: "newlib_nano: newlib nano without printf/scanf float"
  414. - name: libncrt_fast
  415. description: "libncrt_fast: nuclei c runtime library, optimized for speed"
  416. - name: libncrt_balanced
  417. description: "libncrt_balanced: nuclei c runtime library, balanced, full feature"
  418. - name: libncrt_small
  419. description: "libncrt_small: nuclei c runtime library, optimized for size, full feature"
  420. - name: libncrt_nano
  421. description: "libncrt_nano: nuclei c runtime library, optimized for size, no float support"
  422. - name: libncrt_pico
  423. description: "libncrt_pico: nuclei c runtime library, optimized for size, no long/long long support"
  424. - name: nostd
  425. description: "nostd: no std c library will be used, and don't search the standard system directories for header files"
  426. - name: nospec
  427. description: "nospec: no std c library will be used, not pass any --specs options"
  428. linker_script:
  429. default_value: ""
  430. type: text
  431. # used as npk pass variable, not a global configuration
  432. global: false
  433. description: Alternative linker script
  434. ## Source Code Management
  435. codemanage:
  436. installdir: evalsoc
  437. copyfiles:
  438. - path: ["Source/*.c", "Source/Drivers/*.c", "Source/GCC/", "Include/", "evalsoc.svd"]
  439. - path: ["Source/Stubs/newlib"]
  440. condition: $( startswith(${stdclib}, "newlib") && ${semihost} == 0 )
  441. - path: ["Source/Stubs/libncrt"]
  442. condition: $( startswith(${stdclib}, "libncrt") && ${buildconfig.type} != "zcc" )
  443. - path: ["Source/Stubs/newlib"]
  444. condition: $( startswith(${stdclib}, "libncrt") && ${buildconfig.type} == "zcc" )
  445. incdirs:
  446. - path: ["Include/"]
  447. ## Set Configuration for other packages
  448. setconfig:
  449. - config: nuclei_arch
  450. value: $(subst(${nuclei_core.arch},c,))${nuclei_archext}
  451. condition: $( contains(${nuclei_archext}, "zc"))
  452. - config: nuclei_arch
  453. value: ${nuclei_core.arch}${nuclei_archext}
  454. condition: $( ! contains(${nuclei_archext}, "zc"))
  455. - config: nmsislibarch
  456. value: ${nuclei_arch}
  457. - config: cpu_series
  458. value: 100
  459. condition: $( contains(${nuclei_core}, "n100"))
  460. - config: cpu_series
  461. value: 200
  462. condition: $( contains(${nuclei_core}, "20"))
  463. - config: cpu_series
  464. value: 300
  465. condition: $( contains(${nuclei_core}, "30"))
  466. - config: cpu_series
  467. value: 600
  468. condition: $( contains(${nuclei_core}, "60"))
  469. - config: cpu_series
  470. value: 900
  471. condition: $( contains(${nuclei_core}, "90"))
  472. - config: cpu_series
  473. value: 1000
  474. condition: $( contains(${nuclei_core}, "1000"))
  475. ## Debug Configuration for this SoC
  476. debugconfig:
  477. - type: openocd
  478. description: Nuclei OpenOCD
  479. svd: evalsoc.svd
  480. - type: qemu
  481. description: Nuclei QEMU
  482. svd: evalsoc.svd
  483. - type: nucleimodel
  484. description: Nuclei CPU Model
  485. svd: evalsoc.svd
  486. - type: jlink
  487. description: Segger Jlink
  488. svd: evalsoc.svd
  489. ## Build Configuration
  490. buildconfig:
  491. - type: common
  492. common_flags: # flags need to be combined together across all packages
  493. - flags: -g -fno-common -ffunction-sections -fdata-sections
  494. - flags: -march=${nuclei_arch} -mabi=${nuclei_core.abi}
  495. - flags: -mcmodel=${nuclei_core.cmodel}
  496. # For N100, access must be strict alignment, unaligned access is not supported
  497. - flags: -mstrict-align
  498. condition: $( ${cpu_series} == 100 )
  499. - flags: -nostdinc
  500. condition: $( ${stdclib} == "nostd" )
  501. - flags:
  502. condition: $( ${stdclib} == "nospec" )
  503. # For newlib nano, use system include newlib-nano
  504. - flags: -isystem =/include/newlib-nano
  505. condition: $( startswith(${stdclib}, "newlib") && ${stdclib} != "newlib_full" )
  506. ldflags:
  507. - flags: -nostartfiles -nodefaultlibs
  508. - flags: -Wl,--gc-sections -Wl,--check-sections
  509. - flags: -Wl,--defsym=__SMP_CPU_CNT=${nuclei_smp}
  510. condition: $( ${nuclei_smp} > 1 )
  511. - flags: -Wl,--defsym=__HEAP_SIZE=${heapsz}
  512. condition: $( ${heapsz} != "" )
  513. - flags: -Wl,--defsym=__STACK_SIZE=${stacksz}
  514. condition: $( ${stacksz} != "" )
  515. cflags:
  516. asmflags:
  517. - flags: -x assembler-with-cpp
  518. cxxflags:
  519. common_defines:
  520. - defines: SMP_CPU_CNT=${nuclei_smp}
  521. condition: $( ${nuclei_smp} > 1 )
  522. - defines: CFG_HAS_ECLICV2
  523. condition: $( ${nuclei_eclic} == "v2" )
  524. - defines: ECLIC_HW_CTX_AUTO
  525. condition: $( ${nuclei_eclic} == "v2" && ${eclic_hwctx} == 1 )
  526. - defines: CPU_SERIES=${cpu_series}
  527. condition: $( ${cpu_series} != "" )
  528. - defines: BOOT_HARTID=${boothartid}
  529. prebuild_steps: # could be override by app/bsp type
  530. command:
  531. description:
  532. postbuild_steps: # could be override by app/bsp type
  533. command:
  534. description:
  535. - type: gcc
  536. description: Nuclei GNU Toolchain
  537. toolchain_name: RISC-V GCC/Newlib
  538. cross_prefix: riscv64-unknown-elf- # optional
  539. common_flags: # flags need to be combined together across all packages
  540. - flags: -mtune=${nuclei_core.tune}
  541. condition: $( ${nuclei_core.tune} != "" )
  542. # pass extra flags when zc extension enabled
  543. - flags: -fomit-frame-pointer -fno-shrink-wrap-separate
  544. condition: $( contains(${nuclei_archext}, "zc"))
  545. - flags: -isystem =/include/libncrt
  546. condition: $( startswith(${stdclib}, "libncrt") )
  547. - flags: -fno-tree-vectorize -fno-tree-loop-vectorize -fno-tree-slp-vectorize
  548. condition: $( ${autovec} == 0)
  549. ldflags:
  550. - flags: -lstdc++
  551. condition: $( startswith(${stdclib}, "newlib") )
  552. - flags: -lc -lgcc
  553. condition: $( ${stdclib} == "newlib_full" )
  554. - flags: -lc_nano -lgcc -u _printf_float -u _scanf_float
  555. condition: $( ${stdclib} == "newlib_fast" )
  556. - flags: -lc_nano -lgcc -u _printf_float
  557. condition: $( ${stdclib} == "newlib_small" )
  558. - flags: -l$(subst(${stdclib},lib,)) -lheapops_basic
  559. condition: $( startswith(${stdclib}, "libncrt") )
  560. - flags: -lfileops_semi
  561. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 1 )
  562. - flags: -lfileops_uart
  563. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 0 )
  564. # Workaround for libncrt possible linking error since ide dont support wrap search library
  565. # Require Nuclei Studio Plugin released in 2024
  566. - flags: -l$(subst(${stdclib},lib,))
  567. condition: $( startswith(${stdclib}, "libncrt") )
  568. - flags: -Wl,--no-warn-rwx-segments
  569. - flags: -lc_nano -lgcc
  570. condition: $( ${stdclib} == "newlib_nano" )
  571. - flags: -lsemihost
  572. condition: $( startswith(${stdclib}, "newlib") && ${semihost} == 1 )
  573. - flags: -u _isatty -u _write -u _sbrk -u _read -u _close -u _fstat -u _lseek -u errno
  574. condition: $( startswith(${stdclib}, "newlib") )
  575. - type: clang
  576. description: Nuclei LLVM Toolchain
  577. toolchain_name: RISC-V Clang/Newlib
  578. cross_prefix: riscv64-unknown-elf- # optional
  579. common_flags: # flags need to be combined together across all packages
  580. # Enable experimental extensions for clang
  581. - flags: -menable-experimental-extensions
  582. - flags: -isystem =/include/libncrt
  583. condition: $( startswith(${stdclib}, "libncrt") )
  584. - flags: -fno-vectorize -fno-slp-vectorize
  585. condition: $( ${autovec} == 0)
  586. ldflags:
  587. - flags: -lstdc++
  588. condition: $( startswith(${stdclib}, "newlib") )
  589. - flags: -lc -lgcc
  590. condition: $( ${stdclib} == "newlib_full" )
  591. - flags: -lc_nano -lgcc -u _printf_float -u _scanf_float
  592. condition: $( ${stdclib} == "newlib_fast" )
  593. - flags: -lc_nano -lgcc -u _printf_float
  594. condition: $( ${stdclib} == "newlib_small" )
  595. - flags: -l$(subst(${stdclib},lib,)) -lheapops_basic
  596. condition: $( startswith(${stdclib}, "libncrt") )
  597. - flags: -lfileops_semi
  598. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 1 )
  599. - flags: -lfileops_uart
  600. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 0 )
  601. # Workaround for libncrt possible linking error since ide dont support wrap search library
  602. # Require Nuclei Studio Plugin released in 2024
  603. - flags: -l$(subst(${stdclib},lib,))
  604. condition: $( startswith(${stdclib}, "libncrt") )
  605. - flags: -fuse-ld=lld
  606. - flags: -u __on_exit_args
  607. condition: $( startswith(${stdclib}, "newlib") )
  608. # workaround for call exit function
  609. - flags: -u __call_exitprocs
  610. condition: $( startswith(${stdclib}, "newlib") )
  611. # for clang, newlib_nano still need to define symbol _printf_float to make link pass
  612. - flags: -lc_nano -lgcc -u _printf_float
  613. condition: $( ${stdclib} == "newlib_nano" )
  614. - flags: -lsemihost
  615. condition: $( startswith(${stdclib}, "newlib") && ${semihost} == 1 )
  616. - type: zcc
  617. description: Terapines ZCC Toolchain # Required Version: ZCC Toolchain Version >= 4.1.2
  618. toolchain_name: Terapines ZCC
  619. common_flags: # flags need to be combined together across all packages
  620. # Enable experimental extensions for zcc
  621. - flags: -menable-experimental-extensions
  622. - flags: -mtune=${nuclei_core.tune}
  623. condition: $( ${nuclei_core.tune} != "" )
  624. - flags: -fno-vectorize -fno-slp-vectorize
  625. condition: $( ${autovec} == 0)
  626. ldflags:
  627. - flags: -lc++ -lunwind
  628. condition: $( startswith(${stdclib}, "newlib") )
  629. - flags: -lc -lclang_rt.builtins
  630. condition: $( ${stdclib} == "newlib_full" )
  631. - flags: -lc_small -lclang_rt.builtins_small
  632. condition: $( ${stdclib} == "newlib_fast" )
  633. - flags: -lc_small -lclang_rt.builtins_small
  634. condition: $( ${stdclib} == "newlib_small" )
  635. - flags: -lc_small -lclang_rt.builtins_small
  636. condition: $( startswith(${stdclib}, "libncrt") )
  637. - flags: -fuse-ld=lld
  638. - flags: -u __on_exit_args
  639. condition: $( startswith(${stdclib}, "newlib") )
  640. - flags: -lc_nano -lclang_rt.builtins_nano
  641. condition: $( ${stdclib} == "newlib_nano" )
  642. - flags: -lsemihost
  643. condition: $( ${semihost} == 1 )