2022-01-01ãã1å¹´éã®è¨äºä¸è¦§
FPGAéçºæ¥è¨ã¯2015å¹´1æ4æ¥éå§ããããããã8å¹´ãçµéãã¾ããã 大ã¿ããã®è¨äºã¯ãä¾ã«ãã£ã¦ä»å¹´ãã¾ã¨ããè¨äºã«ãªãã¾ãã æ°ããæå±ã«å ¥ã£ã ä»å¹´ã«å ¥ã£ã¦æ°ããªæå±ã«å ¥ã£ããç¾å¨ã®ä»äºãã¤ã¥ããªããæ°ãããã¨ãå§ããã®ã¯é常ã«å¤§å¤ã ã ãã â¦
2022å¹´ã¯RISC-Vã¨ããISAã大ããé²åããå¹´ã ã£ãã¨æãã èªåã®è¦ããç¯å²ã§ã¯ããã®ã ããä»å¹´ã®RISC-Væ¥çãå°ãæ¯ãè¿ã£ã¦ã¿ããã¨æãã çµã¿è¾¼ã¿ã§ãHPCã§ããRISC-Vãé¿ãã¦éããã¨ã¯ã§ããªããªã£ãã ããã¨ããããã¨ããã§ãCPUã«é¢ãã話ã¯RISâ¦
LiteXã§ã®èªä½CPUã®åä½æ¤è¨¼ã«ã¤ãã¦ãã¾ã æ£ããã·ãã¥ã¬ã¼ã·ã§ã³ãéå§ã§ããã¨ããã¾ã§ã¯è³ã£ã¦ããªãã ãã®ä»£ãããLiteXã®ç°å¢ã§VexRiscVã®æ³¢å½¢ãåå¾ããã¨ããã¾ã§ã¯åãããã«ãªã£ãã ã³ãã³ãã©ã¤ã³ã¨ãã¦ã¯ä»¥ä¸ã®ããã«ãªãã ./sim.py --trace â¦
ä»äºæè«æãèªãæ©ä¼ã¯å¤ããã£ã¦ãèªåãªãã®èªã¿æ¹ãã¾ã¨ãæ¹ãæ·±å ã®ä»æ¹ãªã©ã¯ããç¨åº¦ã«ã¼ãã£ã³ãããã¾ããããããããæ¬å½ã«æé©è§£ãªã®ãã©ããã¯åããã¾ããããã£ã¨èªåã«åã£ãããæ¹ããããããããªãããä»ã®æ¹æ³ããã¹ããªã®ãããããªãâ¦
LiteXã®ç¶ããSoCç°å¢ã®ã³ã³ãã¤ã«ã«ã©ããã¦ãæéããããã®ã§ãgccãã¼ã¹ã®ã³ã³ãã¤ã«ç°å¢ã§ã¯ãªããClangãã¼ã¹ã®ã³ã³ãã¤ã«ç°å¢ã«ç½®ãæãããã ãããã調æ»ãã¦ãçµæçã«ãã©ãçããã®ã¯ãããmakeã2段éã«åããã¦ããã®ã§æ°ãä»ãã®ã«æéåã£â¦
linux-on-litex-vexriscvã®ã³ã¼ããèªãã§ãã©ã®ããã«Linuxããã¼ããããã°ããã®ã調æ»ãã¦ããã linux-on-litex-vexriscv/sim.py class SoCLinux(SoCCore): def __init__(self, init_memories = False, sdram_module = "MT48LC16M16", sdram_data_widthâ¦
LLVM+RISC-Væ¬ã®ãµãã¼ããæè¿ã§ãã¦ããªãã¦Issueãæºã¾ã£ã¦ããã®ã ããããã¤ãLLVMå´ã®å®è£ ãã¹ãããããµã³ãã«ã³ã¼ãããªãã«ãããå¿ è¦ãçããã LLVMãµã³ãã«ãªãã¸ããªã¯ãä½æ¥ã®åå²ãªã©ãå ¨ãçºçãããã«ã¹ãã¬ã¼ãã«ä¼¸ã°ãã¦ããã ã¾ããå®â¦
LiteXã«ããSoCç°å¢æ§ç¯ã試è¡ãã (6. VexRiscV Linuxãã¼ãã«ããã波形ã®åå¾)
LiteXã§ã®ã·ãã¥ã¬ã¼ã·ã§ã³ç°å¢ã®è©³ç´°ãã¤ãã¿ããã¦ããããã試ãã¦ããã®ã ããã©ããã¦ãFSTãã¡ã¤ã«ãåå¾ãããã¨æã£ã¦ããã ã½ã¼ã¹ã³ã¼ããèªãã§ããã¨ãã©ãããªãã·ã§ã³ã追å ããã ãã§FSTãåå¾ã§ããã ./sim.py --trace --trace-fst ããã§.â¦
SCPã使ç¨ããéã«ã2段éã§ãµã¼ããçµç±ããããã®æ¹æ³ã¡ã¢ã qiita.com
LiteXã§ã®ã·ãã¥ã¬ã¼ã·ã§ã³è©ä¾¡ç°å¢ãå¼ãç¶ãç«ã¡ä¸ãã¦ããããVerilatorã®ã³ã³ãã¤ã«ãçµãã£ãã¨ããã¾ã§ã§ã©ããã·ãã¥ã¬ã¼ã·ã§ã³ããã¾ããããªãã ãããã試ããçµæã以ä¸ã®åºåã¾ã§ã§æ¢ã¾ã£ã¦ãã¾ããFSTãã¡ã¤ã«ããã¾ãåºåã§ãã¦ããªãããã â¦
valgrindãé£ããããæãªã©ãSniperãrun-sniperã®Python Wrapperãªãã§åããããæãããã®ã§ããã®åå¿é²ã export LD_LIBRARY_PATH=/home/msyksphinz/work/sniper/sniper/sniper/xed_kit/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=/home/msyksphiâ¦
RISC-V Summit 2022ã§å ¬éãããè³æãèªãã§ããã®ã ããé¢ç½ãããªã®ã¯ç²¾è¯å¤§å¦ã¨RIOSã§éçºããã¦ããRISC-V Vector Extensionåãã®ã©ã³ãã ãã¹ãçæå¨ã ã https://static.sched.com/hosted_files/riscvsummit2022/14/RVV-ATG%2BPre.pdf Sailã¨ããDSâ¦
LiteXã¯èªåã§SoCç°å¢ãæ§æãããã¨ãã§ãããã¼ã«ãèªä½CPUãSoCã«çµã¿è¾¼ãã§ã¿ããã®ã§ãä»åã¯ããã試è¡ãã¦ã¿ãã github.com ååã¾ã§ã®è©¦è¡ã§ãVerilatorãèµ·åãããã¨ã¯ã§ããããããã¤ãã®ç°å¢æ´åãã§ãã¦ããªããdefineã®æ¿å ¥ãã§ããã³ã³ãã¤â¦
çè¡åãã¯ãã«ç©ã«ã¤ãã¦èª¿ã¹ãªãã¦ã¯ãªããªããªã£ãã®ã§ãèªåã®åå¿é²ã¨ãã¦æ®ãã¦ããã è¡åãã¯ãã«ç©ã¨ããã®ã¯æ®éã«ã®ãã¨ãæãããè¡åAãçã§ããå ´åãã¤ã¾ãå¤ãã®è¦ç´ ã0ã§ããå ´åã«ã¯ãã¡ã¢ãªãç¯ç´ããããã«0åºãªãè¦ç´ ã®ã¿ãè¨æ¶ãããâ¦
èªä½ã¢ã¦ããªããªã¼ãCPUãé常ã«ä¹ ãã¶ãã«è«çåæããã¦ã¿ãã¨ãé常ã«å¤§ããªCritical Pathãåå¨ãã¦ããã ããã¯è¯ããªãã®ã§æ¹åããå¿ è¦ãããã Vivadoã使ç¨ããã使ç¨ããFPGAããã¤ã¹ã¯ããããããªãã --------------------------------------â¦
LiteXã¯èªåã§SoCç°å¢ãæ§æãããã¨ãã§ãããã¼ã«ãèªä½CPUãSoCã«çµã¿è¾¼ãã§ã¿ããã®ã§ãä»åã¯ããã試è¡ãã¦ã¿ãã github.com åºæ¬çã«ã¯litex/soc/cores/cpu/mycpu/core.pyãå¤æ´ãããããã ãã¡ã¤ã«ãªã¹ãã®ä½æãfilelist.vfãªã©ãããã¡ã¤ã«ãåâ¦
LiteXã¯èªåã§SoCç°å¢ãæ§æãããã¨ãã§ãããã¼ã«ãèªä½CPUãSoCã«çµã¿è¾¼ãã§ã¿ããã®ã§ãä»åã¯ããã試è¡ãã¦ã¿ãã github.com èªä½ã®ã³ã³ãã£ã°ã¬ã¼ã·ã§ã³ã追å ããã¨ãã¯litex_setup.pyã®å®è¡æã«--devãã¤ããªããã°ãªããªãããããããããªãã¨maâ¦
ã¨ããäºæ ã§RISC-Vã®ãã¯ãã«å½ä»¤ã®å®è¡åæ°ã®ã¿ãè¨é²ãããã¦ãç¹æ®ãªã·ã¹ãã ã¬ã¸ã¹ã¿ãå®è£ ããã®ãåä»ãªã®ã§ãRISC-Vã®ã¤ãã³ãã«ã¦ã³ã¿ã§ããHPMCOUNTERã·ã¹ãã ã¬ã¸ã¹ã¿ã使ããã¨ã«ããã Spikeã使ã£ã¦ããã®ã ããHPMCOUNTERã·ã¹ãã ã¬ã¸ã¹ã¿ã¯â¦
LiteXã¯èªåã§SoCç°å¢ãæ§æãããã¨ãã§ãããã¼ã«ãèªä½CPUãSoCã«çµã¿è¾¼ãã§ã¿ããã®ã§ãä»åã¯ããã試è¡ãã¦ã¿ãã github.com Rocketã§ã®ã³ã³ãã£ã°ã¬ã¼ã·ã§ã³ãã§ãããããã以ä¸ã§ãã§ãã¯ãã¦ã¿ãã ä¸è¨ã®ã³ãã³ãã§ãRocketç¨ã®ããã±ã¼ã¸ãã¤ã³â¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã ããå°ãå®è£ ãä¿®æ£ãã¦ãè¤æ°åã®å²è¾¼ã¿è¦æ±ã®åä½ã«å¯¾å¿ããã ã¨ããããããã§åä½ãã¦ããã次ã¯Software Interruptã®å¯¾å¿ããªï¼ @@ -835,9â¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã å²è¾¼ã¿ã®ããæ¹ã ããããä¸åº¦èãç´ããã¨ã«ãããBOOMã®å®è£ æ¹æ³ãåèã«ãã¦ããã å²è¾¼ã¿è¦æ±ä¿¡å·ãCSRããæ¿å ¥ãããã¨ãROBã®æ¬¡ã«ã³ãããâ¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã ãã¹ãã§å²ãè¾¼ã¿ããããããã«ãªã£ãã®ã ããéä¸ã§ãã¹ããFailãã¦ãããåé¡ã¯mcauseã®è¨å®ã ã mcauseã¯ãä¾å¤ã®è¦å ãOne Hotã§ã¯ãªãã¨â¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã çµå±å²è¾¼ã¿æ¿å ¥ã®æ¹éã¯ä»¥ä¸ã«å¤ããã ãããã¯ãå²è¾¼ã¿è¦æ±ä¿¡å·ãä¸åº¦ãã§ããã¢ã¸ã¥ã¼ã«ã§Acceptãããã¨ããã以éã¯å²è¾¼ã¿æ¿å ¥ãªã¯ã¨ã¹ããâ¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã RTLå´ã®å²è¾¼ã¿ã®ããæ¹ã®åé¡ã«ã¤ãã¦ãæèãã¾ã¨ãã¦ããã ä¸çªåç´ã«æã£ãã®ã¯ãå²è¾¼ã¿è¦æ±ä¿¡å·ãä¸ããã¨ãããããã®ã¾ã¾S2ã¹ãã¼ã¸ã®intâ¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã RTLå´ã®å²è¾¼ã¿ã®ããæ¹ã®åé¡ã«ã¤ãã¦ãæèãã¾ã¨ãã¦ããã ä¸çªåç´ã«æã£ãã®ã¯ãå²è¾¼ã¿è¦æ±ä¿¡å·ãä¸ããã¨ãããããã®ã¾ã¾S2ã¹ãã¼ã¸ã®intâ¦
èªä½CPUã«å¯¾ãã¦å²è¾¼ã¿ã³ã³ããã¼ã©ã®å®è£ ããã¦ããããä¹ ãã¶ãã«æéãã§ããã®ã§ããã®ä¿®æ£ãè¡ã£ã¦ããã ä½ãåé¡ãï¼ CLINTãå²ãè¾¼ã¿ãæ¿å ¥ãã¦ãã次ã®å½ä»¤ãã§ããã®PCãåãæ¿ããã ãã§ããã«å²è¾¼ã¿ãå ¥ãããã§ã¯ãªãã ä¸æ¹ã§Spikeå²ãè¾¼ã¿ãâ¦
LiteXã¯èªåã§SoCç°å¢ãæ§æãããã¨ãã§ãããã¼ã«ãèªä½CPUãSoCã«çµã¿è¾¼ãã§ã¿ããã®ã§ãä»åã¯ããã試è¡ãã¦ã¿ãã github.com $ wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py $ ./litex_setup.py --init --instâ¦
èªä½CPUã®å½ä»¤çºè¡ã¹ã±ã¸ã¥ã¼ã©ãMatrix Schedulerã«ç½®ãæãããã¦ãè«æãèªã¿ç´ãã¦ããã Matrix Schedulerã¯è¡åã®ãµã¤ãºããå½ä»¤ã¦ã£ã³ãã¦ã®æ°ã ãå¿ è¦ (ROB 32ã¨ã³ã㪠x 5å½ä»¤ã ã¨160x160ãããã®è¡åãå¿ è¦ï¼) ã¨ããã®ãåºæ¬ã ã¨æã£ã¦ãã¦ãããâ¦
èªä½CPUã®å½ä»¤çºè¡ã¹ã±ã¸ã¥ã¼ã©ãMatrix Schedulerã«ç½®ãæãããã¦ãè«æãèªã¿ç´ãã¦ããã Matrix Schedulerã¯è¡åã®ãµã¤ãºããå½ä»¤ã¦ã£ã³ãã¦ã®æ°ã ãå¿ è¦ (ROB 32ã¨ã³ã㪠x 5å½ä»¤ã ã¨160x160ãããã®è¡åãå¿ è¦ï¼) ã¨ããã®ãåºæ¬ã ã¨æã£ã¦ãã¦ãããâ¦
èªä½CPUã®å½ä»¤çºè¡ã¹ã±ã¸ã¥ã¼ã©ãMatrix Schedulerã«ç½®ãæãããã¦ãè«æãèªã¿ç´ãã¦ããã Matrix Schedulerã¯è¡åã®ãµã¤ãºããå½ä»¤ã¦ã£ã³ãã¦ã®æ°ã ãå¿ è¦ (ROB 32ã¨ã³ã㪠x 5å½ä»¤ã ã¨160x160ãããã®è¡åãå¿ è¦ï¼) ã¨ããã®ãåºæ¬ã ã¨æã£ã¦ãã¦ãããâ¦