nuclei.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. .. _design_nuclei:
  2. Nuclei Processor
  3. ================
  4. Nuclei processor core are following and compatible to RISC-V standard architecture,
  5. but there might be some additions and enhancements to the original standard spec.
  6. Click `Nuclei Spec`_ to learn more about Nuclei RISC-V Instruction Set Architecture.
  7. .. _design_nuclei_intro:
  8. Introduction
  9. ------------
  10. Nuclei provides the following `RISC-V IP Products`_ for AIoT:
  11. * **N100 series:** Designed for mixed digital and analog, IoT or
  12. other extremely low-power and small area scenarios, which
  13. is the perfect replacement of traditional 8051 cores.
  14. * **N200 series:** Designed for ultra-low power consumption and
  15. embedded scenarios, perfectly replaces the arm Cortex-M series cores.
  16. * **N300 series:** Designed for extreme energy efficiency ratio,
  17. requiring DSP and FPU features, as IoT and industrial control scenarios.
  18. * **600 series and 900 series:** Fully support Linux for high-performance
  19. edge computing and smart AIoT.
  20. .. note::
  21. * **N100 series** is not supported by **NMSIS** and **Nuclei SDK**
  22. .. _design_nuclei_nmsis:
  23. NMSIS in Nuclei SDK
  24. -------------------
  25. This Nuclei SDK is built based on the |NMSIS| framework,
  26. user can access `NMSIS Core API`_, `NMSIS DSP API`_ and `NMSIS NN API`_
  27. provided by |NMSIS|.
  28. These NMSIS APIs are mainly responsible for accessing Nuclei RISC-V Processor
  29. Core.
  30. The prebuilt NMSIS-DSP and NMSIS-NN libraries are also provided in Nuclei SDK,
  31. see ``NMSIS/Library/`` folder.
  32. .. note::
  33. * To support RT-Thread in Nuclei-SDK, we have to modify the **startup_<device>.S**,
  34. to use macro ``RTOS_RTTHREAD`` defined when using RT-Thread as below:
  35. .. code-block:: c
  36. #ifdef RTOS_RTTHREAD
  37. // Call entry function when using RT-Thread
  38. call entry
  39. #else
  40. call main
  41. #endif
  42. * In order to support RT-Thread initialization macros ``INIT_XXX_EXPORT``, we also need
  43. to modify the link script files, add lines after `` *(.rodata .rodata.*)`` as below:
  44. .. code-block::
  45. . = ALIGN(4);
  46. *(.rdata)
  47. *(.rodata .rodata.*)
  48. /* RT-Thread added lines begin */
  49. /* section information for initial. */
  50. . = ALIGN(4);
  51. __rt_init_start = .;
  52. KEEP(*(SORT(.rti_fn*)))
  53. __rt_init_end = .;
  54. /* section information for finsh shell */
  55. . = ALIGN(4);
  56. __fsymtab_start = .;
  57. KEEP(*(FSymTab))
  58. __fsymtab_end = .;
  59. . = ALIGN(4);
  60. __vsymtab_start = .;
  61. KEEP(*(VSymTab))
  62. __vsymtab_end = .;
  63. /* RT-Thread added lines end */
  64. *(.gnu.linkonce.r.*)
  65. .. _design_nuclei_soc:
  66. SoC Resource
  67. ------------
  68. Regarding the SoC Resource exclude the Nuclei RISC-V Processor Core,
  69. it mainly consists of different peripherals such UART, GPIO, I2C, SPI,
  70. CAN, PWM, DMA, USB and etc.
  71. The APIs to access to the SoC resources are usually defined by the SoC
  72. Firmware Library Package provided by SoC Vendor.
  73. In Nuclei SDK, currently we just required developer to provide the following
  74. common resources:
  75. * A UART used to implement several stub functions for ``printf`` function
  76. - When using newlib library, please check stub functions list in ``SoC/evalsoc/Common/Stubs/newlib``
  77. - When using libncrt library, please check stub functions list in ``SoC/evalsoc/Common/Stubs/libncrt``
  78. - When using iar dlib library, please check stub functions list in ``SoC/evalsoc/Common/Stubs/iardlib``
  79. * Common initialization code defined in **System_<Device>.c/h** in each
  80. SoC support package in Nuclei SDK.
  81. * Before enter to main function, these resources must be initialized:
  82. - The UART used to print must be initialized as
  83. ``115200 bps, 8bit data, none parity check, 1 stop bit``
  84. - ECLIC MTH set to 0 using ``ECLIC_SetMth``, means don't mask any interrupt
  85. - ECLIC NLBits set to ``__ECLIC_INTCTLBITS``, means all the nlbits are for level
  86. - Global interrupt is disabled
  87. .. note::
  88. * If you want to learn more about SoC, please click :ref:`design_soc`
  89. * If you want to learn more about Board, please click :ref:`design_board`
  90. * If you want to learn more about Peripheral, please click :ref:`design_peripheral`
  91. .. _Nuclei Spec: https://doc.nucleisys.com/nuclei_spec/
  92. .. _RISC-V IP Products: https://nucleisys.com/product.php
  93. .. _NMSIS Core API: https://doc.nucleisys.com/nmsis/core/api/index.html
  94. .. _NMSIS DSP API: https://doc.nucleisys.com/nmsis/dsp/api/index.html
  95. .. _NMSIS NN API: https://doc.nucleisys.com/nmsis/nn/api/index.html