npk.yml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  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. nuclei_cache:
  337. default_value: []
  338. type: multicheckbox_v2
  339. global: true
  340. tips: "Click to enable I/D Cache and CCM to override default settings defined in cpufeature.h"
  341. description: Nuclei Cache Extensions
  342. param:
  343. name:
  344. [ic, dc, ccm]
  345. description:
  346. [ICache, DCache, CCM]
  347. nuclei_eclic:
  348. default_value: v1
  349. type: choice
  350. global: true
  351. tips: "Select your CPU's ECLIC version"
  352. description: ECLIC Version
  353. choices:
  354. - name: v1
  355. description: "v1, no hardware context save/restore feature"
  356. - name: v2
  357. description: "v2, with hardware context save/restore feature and enabled"
  358. nuclei_smp:
  359. default_value: 0
  360. type: spinner
  361. global: true
  362. tips: "SMP CPU Number, if above 1, you should set proper heap and stack size"
  363. description: Nuclei SMP Count
  364. param:
  365. range: >-
  366. [0, 16, 1]
  367. boothartid:
  368. default_value: 0
  369. type: spinner
  370. global: true
  371. tips: "Select which hart chosen by hartid is the boot hart"
  372. description: Boot HartID
  373. param:
  374. range: >-
  375. [0, 15, 1]
  376. heapsz:
  377. value: ""
  378. type: text
  379. # hints and tips are introduced in Nuclei Studio 2023.10
  380. # used to show tool tips and input hints
  381. tips: "Heap size in bytes, eg. 4K or 4096, leave it blank for default linker script settings"
  382. hints: "4K"
  383. description: Heap Size
  384. stacksz:
  385. value: ""
  386. type: text
  387. # hints and tips are introduced in Nuclei Studio 2023.10
  388. # used to show tool tips and input hints
  389. tips: "Stack size in bytes for each cpu, eg. 4K or 4096, leave it blank for default linker script settings"
  390. hints: "4K"
  391. description: Stack Size Per CPU
  392. semihost:
  393. default_value: 0
  394. type: checkbox
  395. tips: "If semihosting is enabled, c library stub source files will not be copied"
  396. description: Enable Semihosting
  397. autovec:
  398. default_value: 1
  399. type: checkbox
  400. 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"
  401. description: Enable Compiler Auto Vectorization
  402. stdclib:
  403. default_value: newlib_nano
  404. type: choice
  405. global: true
  406. tips: "Select proper c library, code size usage newlib_full > nuclei_nano > libncrt, libncrt only works for rv32"
  407. description: Standard C Library(STDCLIB=)
  408. choices:
  409. - name: newlib_full
  410. description: "newlib_full: newlib with full feature"
  411. - name: newlib_fast
  412. description: "newlib_fast: newlib nano with printf/scanf float"
  413. - name: newlib_small
  414. description: "newlib_small: newlib nano with printf float"
  415. - name: newlib_nano
  416. description: "newlib_nano: newlib nano without printf/scanf float"
  417. - name: libncrt_fast
  418. description: "libncrt_fast: nuclei c runtime library, optimized for speed"
  419. - name: libncrt_balanced
  420. description: "libncrt_balanced: nuclei c runtime library, balanced, full feature"
  421. - name: libncrt_small
  422. description: "libncrt_small: nuclei c runtime library, optimized for size, full feature"
  423. - name: libncrt_nano
  424. description: "libncrt_nano: nuclei c runtime library, optimized for size, no float support"
  425. - name: libncrt_pico
  426. description: "libncrt_pico: nuclei c runtime library, optimized for size, no long/long long support"
  427. - name: nostd
  428. description: "nostd: no std c library will be used, and don't search the standard system directories for header files"
  429. - name: nospec
  430. description: "nospec: no std c library will be used, not pass any --specs options"
  431. linker_script:
  432. default_value: ""
  433. type: text
  434. # used as npk pass variable, not a global configuration
  435. global: false
  436. description: Alternative linker script
  437. ## Source Code Management
  438. codemanage:
  439. installdir: evalsoc
  440. copyfiles:
  441. - path: ["Source/*.c", "Source/Drivers/*.c", "Source/GCC/", "Include/", "evalsoc.svd"]
  442. - path: ["Source/Stubs/newlib"]
  443. condition: $( startswith(${stdclib}, "newlib") && ${semihost} == 0 )
  444. - path: ["Source/Stubs/libncrt"]
  445. condition: $( startswith(${stdclib}, "libncrt") && ${buildconfig.type} != "zcc" )
  446. - path: ["Source/Stubs/newlib"]
  447. condition: $( startswith(${stdclib}, "libncrt") && ${buildconfig.type} == "zcc" )
  448. incdirs:
  449. - path: ["Include/"]
  450. ## Set Configuration for other packages
  451. setconfig:
  452. - config: nuclei_arch
  453. value: $(subst(${nuclei_core.arch},c,))${nuclei_archext}
  454. condition: $( contains(${nuclei_archext}, "zc"))
  455. - config: nuclei_arch
  456. value: ${nuclei_core.arch}${nuclei_archext}
  457. condition: $( ! contains(${nuclei_archext}, "zc"))
  458. - config: nmsislibarch
  459. value: ${nuclei_arch}
  460. - config: cpu_series
  461. value: 100
  462. condition: $( contains(${nuclei_core}, "n100"))
  463. - config: cpu_series
  464. value: 200
  465. condition: $( contains(${nuclei_core}, "20"))
  466. - config: cpu_series
  467. value: 300
  468. condition: $( contains(${nuclei_core}, "30"))
  469. - config: cpu_series
  470. value: 600
  471. condition: $( contains(${nuclei_core}, "60"))
  472. - config: cpu_series
  473. value: 900
  474. condition: $( contains(${nuclei_core}, "90"))
  475. - config: cpu_series
  476. value: 1000
  477. condition: $( contains(${nuclei_core}, "1000"))
  478. ## Debug Configuration for this SoC
  479. debugconfig:
  480. - type: openocd
  481. description: Nuclei OpenOCD
  482. svd: evalsoc.svd
  483. - type: qemu
  484. description: Nuclei QEMU
  485. svd: evalsoc.svd
  486. - type: nucleimodel
  487. description: Nuclei CPU Model
  488. svd: evalsoc.svd
  489. - type: jlink
  490. description: Segger Jlink
  491. svd: evalsoc.svd
  492. ## Build Configuration
  493. buildconfig:
  494. - type: common
  495. common_flags: # flags need to be combined together across all packages
  496. - flags: -g -fno-common -ffunction-sections -fdata-sections
  497. - flags: -march=${nuclei_arch} -mabi=${nuclei_core.abi}
  498. - flags: -mcmodel=${nuclei_core.cmodel}
  499. # For N100, access must be strict alignment, unaligned access is not supported
  500. - flags: -mstrict-align
  501. condition: $( ${cpu_series} == 100 )
  502. - flags: -nostdinc
  503. condition: $( ${stdclib} == "nostd" )
  504. - flags:
  505. condition: $( ${stdclib} == "nospec" )
  506. # For newlib nano, use system include newlib-nano
  507. - flags: -isystem =/include/newlib-nano
  508. condition: $( startswith(${stdclib}, "newlib") && ${stdclib} != "newlib_full" )
  509. ldflags:
  510. - flags: -nostartfiles -nodefaultlibs
  511. - flags: -Wl,--gc-sections -Wl,--check-sections
  512. - flags: -Wl,--defsym=__SMP_CPU_CNT=${nuclei_smp}
  513. condition: $( ${nuclei_smp} > 1 )
  514. - flags: -Wl,--defsym=__HEAP_SIZE=${heapsz}
  515. condition: $( ${heapsz} != "" )
  516. - flags: -Wl,--defsym=__STACK_SIZE=${stacksz}
  517. condition: $( ${stacksz} != "" )
  518. cflags:
  519. asmflags:
  520. - flags: -x assembler-with-cpp
  521. cxxflags:
  522. common_defines:
  523. - defines: SMP_CPU_CNT=${nuclei_smp}
  524. condition: $( ${nuclei_smp} > 1 )
  525. - defines: CFG_HAS_ECLICV2
  526. condition: $( ${nuclei_eclic} == "v2" )
  527. - defines: ECLIC_HW_CTX_AUTO
  528. condition: $( ${nuclei_eclic} == "v2" )
  529. - defines: CPU_SERIES=${cpu_series}
  530. condition: $( ${cpu_series} != "" )
  531. - defines: BOOT_HARTID=${boothartid}
  532. - defines: RUNMODE_IC_EN=1
  533. condition: $( contains(${nuclei_cache}, "ic"))
  534. - defines: RUNMODE_DC_EN=1
  535. condition: $( contains(${nuclei_cache}, "dc"))
  536. - defines: RUNMODE_CCM_EN=1
  537. condition: $( contains(${nuclei_cache}, "ccm"))
  538. prebuild_steps: # could be override by app/bsp type
  539. command:
  540. description:
  541. postbuild_steps: # could be override by app/bsp type
  542. command:
  543. description:
  544. - type: gcc
  545. description: Nuclei GNU Toolchain
  546. toolchain_name: RISC-V GCC/Newlib
  547. cross_prefix: riscv64-unknown-elf- # optional
  548. common_flags: # flags need to be combined together across all packages
  549. - flags: -mtune=${nuclei_core.tune}
  550. condition: $( ${nuclei_core.tune} != "" )
  551. # pass extra flags when zc extension enabled
  552. - flags: -fomit-frame-pointer -fno-shrink-wrap-separate
  553. condition: $( contains(${nuclei_archext}, "zc"))
  554. - flags: -isystem =/include/libncrt
  555. condition: $( startswith(${stdclib}, "libncrt") )
  556. - flags: -fno-tree-vectorize -fno-tree-loop-vectorize -fno-tree-slp-vectorize
  557. condition: $( ${autovec} == 0)
  558. ldflags:
  559. - flags: -lstdc++
  560. condition: $( startswith(${stdclib}, "newlib") )
  561. - flags: -lc -lgcc
  562. condition: $( ${stdclib} == "newlib_full" )
  563. - flags: -lc_nano -lgcc -u _printf_float -u _scanf_float
  564. condition: $( ${stdclib} == "newlib_fast" )
  565. - flags: -lc_nano -lgcc -u _printf_float
  566. condition: $( ${stdclib} == "newlib_small" )
  567. - flags: -l$(subst(${stdclib},lib,)) -lheapops_basic
  568. condition: $( startswith(${stdclib}, "libncrt") )
  569. - flags: -lfileops_semi
  570. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 1 )
  571. - flags: -lfileops_uart
  572. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 0 )
  573. # Workaround for libncrt possible linking error since ide dont support wrap search library
  574. # Require Nuclei Studio Plugin released in 2024
  575. - flags: -l$(subst(${stdclib},lib,))
  576. condition: $( startswith(${stdclib}, "libncrt") )
  577. - flags: -Wl,--no-warn-rwx-segments
  578. - flags: -lc_nano -lgcc
  579. condition: $( ${stdclib} == "newlib_nano" )
  580. - flags: -lsemihost
  581. condition: $( startswith(${stdclib}, "newlib") && ${semihost} == 1 )
  582. - flags: -u _isatty -u _write -u _sbrk -u _read -u _close -u _fstat -u _lseek -u errno
  583. condition: $( startswith(${stdclib}, "newlib") )
  584. - type: clang
  585. description: Nuclei LLVM Toolchain
  586. toolchain_name: RISC-V Clang/Newlib
  587. cross_prefix: riscv64-unknown-elf- # optional
  588. common_flags: # flags need to be combined together across all packages
  589. # Enable experimental extensions for clang
  590. - flags: -menable-experimental-extensions
  591. - flags: -isystem =/include/libncrt
  592. condition: $( startswith(${stdclib}, "libncrt") )
  593. - flags: -fno-vectorize -fno-slp-vectorize
  594. condition: $( ${autovec} == 0)
  595. ldflags:
  596. - flags: -lstdc++
  597. condition: $( startswith(${stdclib}, "newlib") )
  598. - flags: -lc -lgcc
  599. condition: $( ${stdclib} == "newlib_full" )
  600. - flags: -lc_nano -lgcc -u _printf_float -u _scanf_float
  601. condition: $( ${stdclib} == "newlib_fast" )
  602. - flags: -lc_nano -lgcc -u _printf_float
  603. condition: $( ${stdclib} == "newlib_small" )
  604. - flags: -l$(subst(${stdclib},lib,)) -lheapops_basic
  605. condition: $( startswith(${stdclib}, "libncrt") )
  606. - flags: -lfileops_semi
  607. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 1 )
  608. - flags: -lfileops_uart
  609. condition: $( startswith(${stdclib}, "libncrt") && ${semihost} == 0 )
  610. # Workaround for libncrt possible linking error since ide dont support wrap search library
  611. # Require Nuclei Studio Plugin released in 2024
  612. - flags: -l$(subst(${stdclib},lib,))
  613. condition: $( startswith(${stdclib}, "libncrt") )
  614. - flags: -fuse-ld=lld
  615. - flags: -u __on_exit_args
  616. condition: $( startswith(${stdclib}, "newlib") )
  617. # workaround for call exit function
  618. - flags: -u __call_exitprocs
  619. condition: $( startswith(${stdclib}, "newlib") )
  620. # for clang, newlib_nano still need to define symbol _printf_float to make link pass
  621. - flags: -lc_nano -lgcc -u _printf_float
  622. condition: $( ${stdclib} == "newlib_nano" )
  623. - flags: -lsemihost
  624. condition: $( startswith(${stdclib}, "newlib") && ${semihost} == 1 )
  625. - type: zcc
  626. description: Terapines ZCC Toolchain # Required Version: ZCC Toolchain Version >= 4.1.2
  627. toolchain_name: Terapines ZCC
  628. common_flags: # flags need to be combined together across all packages
  629. # Enable experimental extensions for zcc
  630. - flags: -menable-experimental-extensions
  631. - flags: -mtune=${nuclei_core.tune}
  632. condition: $( ${nuclei_core.tune} != "" )
  633. - flags: -fno-vectorize -fno-slp-vectorize
  634. condition: $( ${autovec} == 0)
  635. ldflags:
  636. - flags: -lc++ -lunwind
  637. condition: $( startswith(${stdclib}, "newlib") )
  638. - flags: -lc -lclang_rt.builtins
  639. condition: $( ${stdclib} == "newlib_full" )
  640. - flags: -lc_small -lclang_rt.builtins_small
  641. condition: $( ${stdclib} == "newlib_fast" )
  642. - flags: -lc_small -lclang_rt.builtins_small
  643. condition: $( ${stdclib} == "newlib_small" )
  644. - flags: -lc_small -lclang_rt.builtins_small
  645. condition: $( startswith(${stdclib}, "libncrt") )
  646. - flags: -fuse-ld=lld
  647. - flags: -u __on_exit_args
  648. condition: $( startswith(${stdclib}, "newlib") )
  649. - flags: -lc_nano -lclang_rt.builtins_nano
  650. condition: $( ${stdclib} == "newlib_nano" )
  651. - flags: -lsemihost
  652. condition: $( ${semihost} == 1 )