evalsoc.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. .. _design_soc_evalsoc:
  2. Nuclei Eval SoC
  3. ===============
  4. .. note::
  5. Nuclei CPU IP now with iregion feature will use totally new evaluation SoC,
  6. this SoC is different from previous Demo SoC, please take care.
  7. Nuclei DemoSoC is now removed in 0.5.0 release, and please use evalsoc now.
  8. Nuclei Eval SoC is an evaluation FPGA SoC from Nuclei
  9. for customer to evaluate Nuclei RISC-V Process Core, and it is a successor for Demo SoC.
  10. .. _design_soc_evalsoc_overview:
  11. Overview
  12. --------
  13. To easy user to evaluate Nuclei Processor Core, the prototype
  14. SoC (called Nuclei Eval SoC) is provided for evaluation purpose.
  15. This prototype SoC includes:
  16. * Processor Core, it can be Nuclei N class, NX class or UX class Processor Core.
  17. * On-Chip SRAMs for instruction and data.
  18. * The SoC buses.
  19. * The basic peripherals, such as UART, SPI etc.
  20. With this prototype SoC, user can run simulations, map it into the FPGA board,
  21. and run with real embedded application examples.
  22. If you want to learn more about this evaluation SoC, please get the
  23. ``<Nuclei_Eval_SoC_Intro.pdf>`` from `Nuclei`_.
  24. .. _design_soc_evalsoc_boards:
  25. Supported Boards
  26. ----------------
  27. In Nuclei N100 SDK, we support the following boards based on **Nuclei evalsoc** SoC, see:
  28. * :ref:`design_board_nuclei_fpga_eval`, default Board when this SoC selected.
  29. .. _design_soc_evalsoc_usage:
  30. Usage
  31. -----
  32. .. note::
  33. In latest N100 CPU RTL generation flow, it will also generate an Nuclei N100 SDK to match CPU
  34. and EvalSoC RTL configuration, please use the generated Nuclei N100 SDK to evaluate your
  35. CPU and EvalSoC feature.
  36. The generated Nuclei SDK by **nuclei_gen** will do the following tasks:
  37. - Generate ``SoC/evalsoc/cpufeature.mk``: which will define **CORE**, **ARCH_EXT**, **QEMU_SOCCFG** or **SIMULATION** default value.
  38. - Generate ``SoC/evalsoc/Common/Include/cpufeature.h``: which will define current cpu feature macros.
  39. - Generate ``SoC/evalsoc/Board/nuclei_fpga_eval/Source/GCC/evalsoc.memory``: which will define the sram/flash base address and size and mtvt and mtvec address.
  40. - Modify ``SoC/evalsoc/Board/nuclei_fpga_eval/openocd_evalsoc.cfg``: Mainly change ``workmem_base/workmem_size/flashxip_base/xipnuspi_base`` to adapt the evalsoc configuration.
  41. If you want to use the generated Nuclei SDK by **nuclei_gen** In Nuclei Studio IDE, you need to zip it first,
  42. and then **import** it using ``RV-Tools -> NPK Package Management`` in Nuclei Studio IDE's menu, and when
  43. creating a IDE project using ``New Nuclei RISC-V C/C++ Project``, please select the correct sdk and version which
  44. you can check it in the ``<SDK>/npk.yml`` file, and in the project example configuration wizard window, you should
  45. click the **SDK gen by nuclei_gen**, and configure the **Nuclei RISC-V Core** and **ARCH Extensions**, **Nuclei Cache Extensions**
  46. according to your configured CPU ISA, and CPU feature defined in generated ``cpufeature.h``.
  47. Currently you still need to modify IAR linker script by yourself, it is not automatically modified.
  48. In latest evalsoc for n100, the ``interrupt vector table`` + ``reset_vector`` + ``exception_entry`` will be placed tightly in the top of an RO/RW memory.
  49. **It will looks like this as below:**
  50. .. code-block:: shell
  51. Disassembly of section .init: -> top of RO/RW memory
  52. a0000000 <vector_base>: -> vector table for interrupt, which is the MTVT
  53. ... eg. for this case, there are 30 external interrupts(CFG_IRQ_NUM),
  54. totally 32 interrupts
  55. a0000080 <_reset_vector>: -> reset vector right following the vector_table array, size may variable according to the external interrupt number count
  56. a0000080: 0080006f j a0000088 <_start> -> the reset vector code, just jump to real startup code
  57. a0000084: 0bc0006f j a0000140 <exc_entry> -> exception entry(MTVEC), just jump to real exception handling code
  58. a0000088 <_start>:
  59. a0000088: 30047073 csrc mstatus,8
  60. **NOTE**: Since evalsoc implementation is just a reference, you can customized your vector table, reset vector, exception entry as you want,
  61. but you **MUST** modify the startup code and linker script code to match your real CPU design.
  62. If you want to use this **Nuclei evalsoc SoC** in Nuclei N100 SDK, you need to set the
  63. :ref:`develop_buildsystem_var_soc` Makefile variable to ``evalsoc``.
  64. .. code-block:: shell
  65. # Choose SoC to be evalsoc
  66. # the following command will build application
  67. # using default evalsoc SoC based board
  68. # defined in Build System and application Makefile
  69. make SOC=evalsoc all
  70. .. _Nuclei: https://nucleisys.com/