2019-09-01ãã1ã¶æéã®è¨äºä¸è¦§
é¢æ°ã®ãããã¼ã°ã»ã¨ããã¼ã°ã«å¿ è¦ãªæ°è¦å½ä»¤ã®å®è£ é¢æ°ã®ãããã¼ã°ã»ã¨ããã¼ã°ã®å¦çã«å ¥ãåã«ãå°ãæ°è¦å½ä»¤ãå®è£ ãã¦ãããããã¯ãé¢æ°ã®ãããã¼ã°ã»ã¨ããã¼ã°ã®å®è£ ã«éãã¦å¿ è¦ãªãã®ã ã å®æ°çæãã¿ã³ã®å®è£ ã¾ãã¯æãåºæ¬çãªå®æ°ãçæâ¦
å½ä»¤ã»ããã¢ã¼ããã¯ãã£ã«ã¯ãå½ä»¤ã®å®ç¾©ã¨ãã«ãé¢æ°å¼ã³åºãã®ã«ã¼ã«ãè¦å®ããCalling Conventionãå®ç¾©ããã¦ããã MYRISCVXã«ãCalling Conventionãåå¨ããåºæ¬çã«RISC-Vã®Calling Conventionã«åºã¥ãã¦ããããã®ã«ã¼ã«ã«åºã¥ããå¼æ°ã渡ãéã«â¦
é常ã«ã·ã³ãã«ãªé¢æ°ãã©ã®ããã«ãã¦å½ä»¤ã«å¤æãããã«ã¤ãã¦èããã int main() { return 0; } ./bin/clang -c -O2 ../myriscvx-tests/tests/simple_main.cpp -emit-llvm ./bin/llvm-dis simple_main.bc -o - define dso_local i32 @main() local_unnamâ¦
Chisel-3.2 RC2ããªãªã¼ã¹ããã¦ãããããã¤ãã®æ°æ©è½ãå ãã£ã¦ããããæ°ã«ãªãã®ã¯Asynchronous Resetã®ãµãã¼ãã ã www.chisel-lang.org ããã ãè¦ã¦ãè¯ãåãããªãã®ã§ãChiselãªãã¸ããªã®Pull Requestãè¦ã¦ä½ã¨ãªã使ãæ¹ã調ã¹ã¦ã¿ãã githuâ¦
MYRISCVXISelLoweringã¯LLVM IRããSelectionDAG(ãã¼ã¿ããã¼ã°ã©ã)ã¸ã®å¤æããã»ã¹ã«ãªããããã¯ã¨ã³ãã®ããªãåæã®é¨åã§é©ç¨ããã¾ãã ã¾ãã©ã®ãããªå¤æå¦çããå®è£ ãã¦ããã°ããã ãããï¼ããã§ã¯é¢æ°ãå¼ã°ãã¦ããçµäºããã¾ã§ã®å¦ç(mainâ¦
ã¨ãããæãããã£ã¨æããå ¬éãã¦ããã®ã ããã©ããå ´æãå ¨ãå ¬éãã¦ããªãã£ãã ãã§ã RISC-Vã®ãã¯ãã«æ¡å¼µå½ä»¤ã®ä»æ§ãããªãåºã¾ã£ã¦ãããç¾å¨ã¯0.7.1ãå ¬éããã¦ãããã¨æã£ãã以ä¸ã®ããã¥ã¡ã³ããããè¦ã¦ã¿ãã¨0.7.2ã«æ´æ°ããã¦ããã®ã§â¦
NVDLAã¨ããã®ã¯NVIDIAãå ¬éãã¦ãããªã¼ãã³ã½ã¼ã¹ã®ãã£ã¼ãã©ã¼ãã³ã°åããã¼ãã¦ã§ã¢ã ãããã®ãã¼ãã¦ã§ã¢ã§æµããã¥ã¼ã©ã«ãããã¯ã¼ã¯ãã³ã³ãã¤ã«ãããã¨ã®ã§ããã³ã³ãã¤ã© nvdla_compiler ãã¤ãã«ãªã¼ãã³ã½ã¼ã¹åãããã nvdla_compilerã¯â¦
MYRISCVXAsmPrinterã¯LLVM IRå¤æãããå½ä»¤ã®åºåãå¸ããæçµçãªè©³ç´°ã®åºåã¯å¾è¿°ããMYRISCVXInstPrinterã¯ã©ã¹ãå®è¡ããã®ã ããAsmPrinterã¯ããé«ä½ãªã¢ã»ã³ããªåºåç¨ã®ãã¬ã¼ã ã¯ã¼ã¯ã¨ãã¦ã®å½¹å²ãæããã EmitInstruction() å ·ä½çãªã¢ã»ã³ããªâ¦
LLVM 9.0.0ããªãªã¼ã¹ããããååã®ãªãªã¼ã¹ãããããåå¹´ã§ãããæè¿ã¯LLVMã¯ãªãªã¼ã¹ãã¼ã¸ã§ã³ãåå¹´ã«1åã«ã¦ã³ãã¢ããããã®ã§ãã9.0ã¾ã§å°éãã¦ãã(ããå°ãå°å»ã¿ã§ãè¯ãã®ã§ã¯ãªãã...) LLVM 9.0ã®ãã©ã³ãã¯GitHubã®LLVMãªãã¸ããªã§ãåâ¦
ããã¾ã§ã«ç¤ºããéããLLVMã«ã¿ã¼ã²ããã¢ã¼ããã¯ãã£ãç»é²ããããã«ã¯æ§ã ãªæ©è½ã追å ããå¿ è¦ãããã llcãå¼ã°ãã¦ããåæåããã»ã¹ãã©ãã§ã©ã®ããã«ãã¦å¼ã°ãã¦ããã®ãã追ãããã¦ã¿ããã¨ã«ããã llcã¯llc.cppã«å®ç¾©ããã¦ããmain()ããâ¦
LLVMã®ããã¯ã¨ã³ãã«ã¤ãã¦ä¸éãåå¼·ãé²ãã¦ããããã©ããã¾ã ãã£ããããªãé¨åãããã ããå°ãåã¡ã½ããã®æ§é ã«ã¤ãã¦ãµãã©ã¤ãºãããã£ããLLVMãã©ãããä»çµã¿ã§ããã¯ã¨ã³ããåºåãã¦ããã®ããè¦ã¦ããããã ã¾ãã¯ããã¾ã§ã§ãä½æããâ¦
æãåºããããã«ãã¨ããããã£ããå¿ãã¦ããã®ã§ããã2019å¹´ã®ããã¾ã§ã«çºè¡¨ããç§ã®RISC-Vé¢é£ã®è³æããã¹ã¦SpeakerDeckã«ã¢ãããã¼ããã¾ããã 2019å¹´ãã¾ã ã¾ã ç¶ãã¾ãããå¹´æ«ã«ãªãã¾ã§ãã£ã¨HDDã®è¥ããã«ãã¦ããã®ã¯ãã£ãããªãã®ã§ãæãâ¦
Chiselã®æ¹é ãããããã«ããã¤ãåã追å ãã試è¡ãããããä¸ã¤é¡æã¨ãã¦æµ®åå°æ°ç¹ããµãã¼ãã§ããåãä½ã£ã¦ã¿ããã ãã®ç·´ç¿ãããããã«ãã¾ãã¯Chiselã§æ¨æºçã«ãµãã¼ãããã¦ããFixedPointåã«ã¤ãã¦å°ã触ã£ã¦ã¿ããã¨ã«ããã Chiselã®Fixedâ¦
ååã¯å°ãæãæãããããªå½¢ã§æ°ãããã¼ã¿åã追å ãã¦ã¿ãããå°ãçé¢ç®ã«ãã¼ã¿åã®è¿½å æ¹æ³ã«ã¤ãã¦æ¤è¨ãã¦ã¿ãã ååãæ¸ããããUInt, SInt, Boolãå®ç¾©ããã¦ãããããã«è¯ã調ã¹ã¦ãªã ã¨experimentalã§FixedPointãå®ç¾©ããã¦ããã ããã¯Bitâ¦
Chiselãåå¼·ããããã«ã¯ã¨ããããèªåå°ç¨ã®æ¡å¼µChiselãä½ã£ã¦ã¿ãã®ãè¯ãã¨æãã ã¨ããããã¯ãã¾ãã¯æã£åãæ©ãæ°ãããã¼ã¿åã§ã追å ãã¦ã¿ãããChiselã«ã¯ä»¥ä¸ã®åºæ¬ãã¼ã¿åãåå¨ããã UInt SInt Bool ããã§ãããã«è¿½å ãã¦ä»åº¦ã¯TIntã¨â¦
Chiselã®ã³ã³ãã¤ã«ããã¼ã®è§£æã®ç¶ããåã®è¨äºã¯ä»¥ä¸ã ä¾ãã°ãChiselã§ã¯ä»¥ä¸ã®ããã«ãã¦å ¥åä¿¡å·ãåºåä¿¡å·ã«ã¤ãªããè¨è¿°ãå¯è½ã«ãªãã val io = IO(new Bundle { val in = Input(Bool()) val out = Output(Bool()) }) io.out := io.in ãã®:=ã¨ãâ¦
ãã¼ãã¦ã§ã¢è¨è¿°è¨èªChiselã¯Scalaããã¼ã¹ã«ããè¨èªã§ãããScalaã®è¨èªåä½ããã¼ã¹ã«ãã¦è¨è¨ãã¦ããã ããã§ã¯ããã¼ãã¦ã§ã¢ã®é ç·ãå¤æ°ã表ãããã«ã©ã®ãããªåãç¨æãã¦ãããã¨ããã¨ãä¾ãã°ã以ä¸ã®ãããªåãç¨æããã¦ããã UInt : ä»»æâ¦
Chiselã®ã³ã³ãã¤ã«ããã¼ã®è§£æã®ç¶ããåã®è¨äºã¯ä»¥ä¸ã ã©ãã§ChiselããFIRã¸ã®å¤æãè¡ããã¦ããã®ãã¨ããã¨ãããã¯ChiselStageã®Emitterãå¤æå¦çãè¡ã£ã¦ãããããã chisel3/src/main/scala/chisel3/internal/firrtl/Emitter.scala private defâ¦
Chiselã¯Scalaããã¼ã¹ã¨ããDSLããVerilog-HDLãçæãããã¨ã®ã§ãããã¼ãã¦ã§ã¢è¨è¿°è¨èªã§ããããã¡ãã£ã¨è¤éãªè¨æ³ãããã¨çæãããVerilogãå ¨ãèªããªããªãã ä¾ãã°ãChiselã¯Moduleã®ä¸ã«é¢æ°ãå®ç¾©ãããã¨ãã§ãããScalaãªã®ã§ä»¥ä¸ã®ããâ¦
AWSã§è¤æ°ã®EC2ã§ãã£ã¹ã¯ãå ±æããããã¸ã§ã¯ããã¡ã¤ã«ã®ã³ãã¼ã®ç¡é§ãçããã¨ãããã試è¡ããã®ã ããAWSã®EBSã¯ã©ããè¤æ°ã®EC2ã«ã¢ã¿ããã¡ã³ãããããã¨ãã§ããªãããããããã¯åãã¦ç¥ã£ãã ãã®ä»£ããã«ãè¤æ°ã®EC2ã¤ã³ã¹ã¿ã³ã¹ã§åããã¡ã¤â¦
Chisel3ã使ã£ã¦ãã¦ãã©ããã¡ã¤ã³ãã£ã¬ã¯ããªã®å¤é¨ã«ããã½ã¼ã¹ã³ã¼ããåç §ããããMavenã«ç»é²ãã¦ããããã§ã¯ãªãã®ã ããã©ãããã¼ã«ã«ã«ä½ã£ã¦ããã¯ã©ã¹ãåç §ãã¦ä½ããããªã¨æã£ãã¨ãã ä¾ãã°ã以ä¸ã®ãããªã¢ã¸ã¥ã¼ã«ãéçºãã¦ãããããâ¦
ãã¼ãã¦ã§ã¢è¨è¿°è¨èªChiselã¯Scalaã®ãã©ãããã©ã¼ã ã®ä¸ã«æ§ç¯ããã¦ããã大ããåãã¦2ã¤ã®ãªãã¸ããªããæ§æããã¦ããã chisel3 : https://github.com/freechipsproject/chisel3 firrtl : https://github.com/freechipsproject/firrtl chisel3ã®ãªâ¦
ãã¼ãã¦ã§ã¢è¨è¿°è¨èªChiselã¯Scalaã®ãã©ãããã©ã¼ã ã®ä¸ã«æ§ç¯ããã¦ããã大ããåãã¦2ã¤ã®ãªãã¸ããªããæ§æããã¦ããã chisel3 : https://github.com/freechipsproject/chisel3 firrtl : https://github.com/freechipsproject/firrtl chisel3ã®ãªâ¦
Arianeã®å®è£ ãè¦ã¦ããã¨ãPopCountã®å®è£ ãSystem Verilogã®å帰ã使ã£ã¦å®è£ ãã¦ãã£ãã github.com Popcountã®å®è£ module popcount #( parameter int unsigned INPUT_WIDTH = 256, localparam POPCOUNT_WIDTH = $clog2(INPUT_WIDTH)+1 ) ( input logicâ¦
Chiselã¯Scalaããã¼ã¹ã¨ãããã¼ãã¦ã§ã¢è¨è¿°è¨èªãªã®ã§ãVerilog-HDLã§ã¯ãã¾ãè¦ããããã¨ã®ãªãè¨è¿°ãã§ããã æè¿ä½¿ã£ã¦ããChiselã®ä¾¿å©ãªææ³ã®ããã¤ããã¾ã¨ãã¦ã¿ãã Vecã®ä¸èº«ã.reducã使ã£ã¦ãªãã¯ã·ã§ã³ãã Vecã«ã¯reductionãªã©ã®è¨æ³ãâ¦
SystemVerilogã§è¨è¿°ãããRISC-Vããã»ããµArianeã«ã¤ãã¦è§£æãé²ãã¦ããã ã¾ãã¯ããã³ãã¨ã³ããããããã³ãã¨ã³ãã¯å½ä»¤ããã§ããããã¨ããã ãã以ä¸ã®ãããªãµãã¢ã¸ã¥ã¼ã«ã§æ§æãããã instr_realign : å½ä»¤ã¢ã©ã¤ããå½ä»¤ãã§ããæã«å½ä»¤ã®â¦
SystemVerilogã§è¨è¿°ãããRISC-Vããã»ããµArianeã«ã¤ãã¦è§£æãé²ãã¦ãããåè·¯é¢ç©ã大ããã¨ãã話ã§ãå®éã«ã©ããããã®ãµã¤ãºãªã®ãè¦ã¦ã¿ããã¨ã«ããã github.com ä¸è¨ã使ç¨ãã¦ãããFPGAã®åæã«ã¯ããªãã¸ããªããã¦ã³ãã¼ãããä¸ã§make fpgâ¦
RISC-V Vector Extensionã¯ä»æ§ãå¾ã ã«åºã¾ã£ã¦ãã¦ãããå®è£ ã¯ã¾ã åãããªãããã¼ã«ã»ãããã¢ã»ã³ãã©ãå¾ã ã«å ¬éããã¦ããã Vector Extensionã¯ç¾å¨ã§ã使ç¨ãã¢ãããã¼ãããã¦ãããç¹ã«ããã¾ã§ã®0.6ãã0.7ã¸ã®ã¢ãããã¼ãã¯ããªãã®ä¿®æ£ãâ¦
"Digital Design with Chisel"ã®è¡¨ç´ åã ããChiselã®ã¡ã¼ãªã³ã°ãªã¹ãã«æµãã¦ãããChiselã®å ¥éè çãªæ¸ç±ã"Digital Design with Chisel"ãæçµæ£å¼çã«ãªã£ã¦ã¤ãã«çºå£²ããããããã Amazonã§ãå ¥æãå¯è½ã ãpdfã¯ç¡æå ¬éããã¦ãããGitHubãããâ¦
https://www.eembc.org/coremark-pro/ CPUã®ãã³ããã¼ã¯ã¨ããã°æ§ã ãªãã®ãããããæåãªã¨ããã¨ããã° SPEC (https://spec.org/) Standard Performance Evaluation Corperationããããããã£ã¨ãæåãªãã³ããã¼ã¯ãå種CPUã®ãã³ããã¼ã¯è©ä¾¡ãªã©ã§â¦