ã©ãã§ãã
ããããæãããªãã®ã§ã
Verilatorï¼å·ããä¸è¯ï¼ãã¯ããã¾ãããw
ãªããVerilateãããªãã·ã§ã³ãã³ãã³ã試è¡é¯èª¤ãã¦ããåºåããã¾ããã»ã»ã»ã»
â AUDIY (@AUDIY14) February 18, 2024
ãã¾ã£ãåºåãããªãã£ãã¨ãã®ã³ãã³ãå±¥æ´æ®ãã¦ãªãã§ãã»ã»ã» pic.twitter.com/GGDCODdsoa
Verilatorã¨ã¯
Veripoolãéçºãããªã¼ãã³ã½ã¼ã¹ã®Verilog/SystemVerilogã·ãã¥ã¬ã¼ã¿ã§ãã
ãã¹ããã³ããã¢ã¸ã¥ã¼ã«ããã«ãã¹ã¬ããï¼ï¼ï¼ã®C++ã³ã¼ãã«å¤æï¼å ¬å¼ã§ã¯ãã®å¤æã"Verilate"ã¨å¼ãã§ãã¾ãï¼ããC++ã³ã³ãã¤ã©ã§å®è¡å¯è½å½¢å¼ã«ã³ã³ãã¤ã«å¾ãå®è¡ãããã¨ã§é«éãªã·ãã¥ã¬ã¼ã·ã§ã³ãå®ç¾ãã¦ããã®ãã¦ãªã®ããã§ãã
åã ããåå°ä½ã¡ã¼ã«ã¼ï¼WDãIntelãNXPãªã©ï¼ã§ã使ç¨ããã¦ãããChips AllianceãLinux Foundationããæ¯æ´ãåãã¦ãããªã©ãæ¥çã§ã¯ããªãæåãªæ§åã
å ¬å¼ã§ã¯ãSynopsysï¼VCSï¼/Siemensï¼Questa/ModelSimï¼/Cadenceï¼Xcelium/Incisive/NC-Simï¼ã¨åããã4大ã·ãã¥ã¬ã¼ã¿ã®ä¸ã¤ãã¨è±ªèªãã¦ãã¾ãï¼æ¬å½ãï¼ï¼
AUDIYèªèº«ãVerilatorã®åå¼·ä¼ãæ°å¹´åã«åãããã¨ããããå人çã«ã¯èå³ãæã£ã¦ãã¾ãããå½æã¯C++ã§ã®è¨è¿°ã大éã«åºã¦ãã¦æ£ç´ããããªãã·ãã¥ã¬ã¼ã·ã§ã³ã¯Icarus Verilogã¨ãQuartusçã«ä»å±ãã¦ãããã¤ã§è¯ãããªãã¨ããå°è±¡ã§ããã
å°å ¥æ¹æ³
主ã«3éãã®å°å ¥æ¹æ³ãããã¾ãã
- Linuxãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ããã±ã¼ã¸ããã¼ã¸ã£ã使ç¨ãã
- gitããã½ã¼ã¹ã³ã¼ããå ¥æããã«ããã
- Dockerã使ç¨ãã
ããããã®å°å ¥æ¹æ³ã§ã®ã¡ãªããã»ãã¡ãªããã¯ä»¥ä¸ã®éãã¨ãªãã¾ãã
ããã±ã¼ã¸ããã¼ã¸ã£ã使ç¨ãã
ã¡ãªãã
- 確å®ã«å®å®çãå°å ¥ã§ãã
- ä¾åé¢ä¿ãåããã¦ã¤ã³ã¹ãã¼ã«ãã¦ããã
ãã¡ãªãã
- åãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§ã®å®å®çãªã®ã§ææ°çã¯é
ããªããã¡
ï¼æ©è½è¿½å ããã°ä¿®æ£çã®å¯¾å¿ãé ãï¼
gitããã½ã¼ã¹ã³ã¼ããå ¥æããã«ããã
ã¡ãªãã
- 常ã«ææ°çãå°å ¥ã§ãã
- ããã±ã¼ã¸ããã¼ã¸ã£ã§èªåçã«ãã¼ã¸ã§ã³ã¢ãããããªãã®ã§ç¹å®ã®ãã¼ã¸ã§ã³ãé·ã使ç¨å¯è½
ãã¡ãªãã
- ä¾åé¢ä¿ãèªåã§èª¿ã¹ã¦å°å ¥ãã¦ããå¿ è¦ããã
- OSãä¾åé¢ä¿ã¨ã®ãã¼ã¸ã§ã³ã®æ´åæ§ãåããªãã¨ãã«ã¤ã³ã¹ãã¼ã«ã«å¤±æããå ´åããã
- ææ°çå°å ¥ã®ãã³ã«ãã«ãã®å¿ è¦ããã
Dockerã使ç¨ãã
ã¡ãªãã
- ãã«ãããã«ææ°çãå°å ¥å¯è½
- 常ã«ææ°çãå°å ¥ã§ãã
- ã³ã³ãããå©ç¨ãã¦ããã®ã§ä¾åé¢ä¿ãæ°ã«ããªãã¦è¯ã
ãã¡ãªãã
- Dockerã®ç¥èãå¿ è¦
- Verilatorã§ã¯èªåã®ç°å¢ããåä½ã«è¥å¹²æéãããã
- Verilatorã§ã¯VSCodeã¨ã®é£æºãå°é£
ä»åã¯VSCodeã®ãã©ã°ã¤ã³ã¨é£æºããã¦Linteræ©è½ã使ãããã£ãã®ã¨ãAUDIYã使ã£ã¦ããUbuntu 22.04 LTSã§ã¯ããã±ã¼ã¸ããã¼ã¸ã£ã§é å¸ããã¦ãVerilatorã®ãã¼ã¸ã§ã³ã4ã¨å¤ãã®ã§ãgitããã½ã¼ã¹ã³ã¼ããå ¥æããã«ããããã¨æãã¾ãã
ãã«ãæ¹æ³
ä»åã¯Windowsãã·ã³ä¸ã«WSL2 + Ubuntu 22.04ãæ§ç¯ãã¦å°å ¥ãããã¨æãã¾ãã
WSL2ã®å°å ¥ã¯ãã®è¨äºã詳ããã¨æãã¾ãã
Ubuntuãå°å ¥ã§ããããã¨ã¯ä»¥ä¸ã®ãã¼ã¸ã®å 容ã®éãã«ä¾åé¢ä¿ãå°å ¥ãã¦ã¤ã³ã¹ãã¼ã«ããã°åé¡ãªãã¨æãã¾ãã
Ubuntu 22.04ã®å ´åã§ã¯ãzlibcãç¡ããã¨ã¨ã©ã¼ãåºã¾ããããã®å ´åã¯ç¡è¦ãã¦è¯ãã§ãã
ã¡ãªã¿ã«ã§ããã
Verilator 5ã ã¨C++ã§ãã¹ããã³ããæ¸ãå¿ è¦æ§ãèãã§ãï¼
â Susumu Yamazaki (ZACKY) (@zacky1972) February 22, 2024
ãã以åã¯C++ã§ãã¹ããã³ãæ¸ãå¿
è¦ããã£ãããã§ããã»ã»ã»ã»
ã¡ãªã¿ã«C++ãã¹ããã³ãã®ãµã³ãã«ã³ã¼ãã¯ã«ãªã¹ã§ãã
åããã¦ã¿ã
ãã¹ããã³ãããå®è¡å½¢å¼ãåãåºãã¦ã¿ã¾ãã
ã¨ããããã§ã¦ããè¦åã¯ç¡è¦ããã¦ãã¾ãã
Â
- verilator --cc --binary --timing --trace --trace-params --trace-structs --trace-underscore -Wno-TIMESCALEMOD -Wno-WIDTHTRUNC +1364-2005ext+v SDPRAM_SINGLECLK_tb.v
Â
æåããã¨obj_dirã¨ãããã£ã¬ã¯ããªå ã«å®è¡ãã¡ã¤ã«ãã§ãã¾ãã®ã§ãã¡ã¢ãªåæåãã¡ã¤ã«ï¼ram_init_file.memï¼ãåä¸ãã£ã¬ã¯ããªã«ç½®ãã¦
- ./VSDPRAM_SINGLECLK_tb
Â
vcdãã¡ã¤ã«ãä½æãããã®ã§ãgtkwaveã§èªã¿è¾¼ãã°
ãªããVerilateãããªãã·ã§ã³ãã³ãã³ã試è¡é¯èª¤ãã¦ããåºåããã¾ããã»ã»ã»ã»
â AUDIY (@AUDIY14) February 18, 2024
ãã¾ã£ãåºåãããªãã£ãã¨ãã®ã³ãã³ãå±¥æ´æ®ãã¦ãªãã§ãã»ã»ã» pic.twitter.com/GGDCODdsoa
Â
vcdåºåã®éã«ãªãã·ã§ã³ãå¿ è¦ã«ãªã£ãããä¸é¨ã®Verilogè¨è¿°ã®ã·ãã¥ã¬ã¼ã·ã§ã³ãé対å¿ã ã£ããã
Warningãåºåãããæç¹ã§å®è¡å½¢å¼ã¯çæãããªãï¼å³ãããªã»ã»ã»ã»ï¼ã®ã§ãåç´ãªã·ãã¥ã¬ã¼ã·ã§ã³ã ãã§ããã°Icarus Verilogã®æ¹ãå®è¡ãªãã·ã§ã³ãå°ãªã使ããããå°è±¡ã§ãã
Â
WarningãErrorã¯çµæ§ç´°ããå 容ãç¶²ç¾ ããã¦ããï¼æªãè¨ãã°å¶éãå¼·ãï¼ã®ã§ãAUDIYã®ãããªãã³ã¼ãã£ã³ã°ã«ã¼ã«ããã©ãã©ããã¡ããªäººã«ã¯è¯ãç¯æ£ãã¼ã«ã ã¨æãã¾ãã
ããã§èãã
ããããLinterã¨ãã¦ä½¿ããªããã»ã»ã»ï¼ã
ããã§AUDIYã使ã£ã¦ããVSCodeã®Verilogãã©ã°ã¤ã³ã調ã¹ã¦ã¿ãã¨ã»ã»ã»ã»
ã»ã»ã»ã»ã»ããã¾ããã
Verilatorã¨é£æºãã¦VSCodeå ã®Linterã¨ãã¦ä½¿ãã¾ãï¼
ããå°ãè¨å®ã追ã£ã¦ããã¾ãã¨ã»ã»ã»
Â
Verilatorã®å®è¡ãªãã·ã§ã³ã追å ã§ããã
WSLä¸ã«æ§ç¯ããVerilatorã使ç¨ãããã¨ãã§ããããã§ãã
ããã§ã¯ãã£ã¦ããã¾ãããã
ãVerilog > Linting: Linterãã"verilator"ã«è¨å®ãã¾ãã
ãVerilog > Linting > Verilator: Argumentsãã«å¿
è¦ãªãªãã·ã§ã³ã追å ãã¾ãã
AUDIYã®å ´åã¯ãè¦åãå
¨ã¦åºåããé
延è©ä¾¡ããããVerilogè¨æ³ã¯Verilog-2005ã§æå®ãã«ãã¾ããã
ãVerilog > Linting > Verilator: Run At File Locationãã¨ãVerilog > Linting > Verilator: Use WSLãã«ã¨ãã«ãã§ãã¯ãä»ãã¾ãã
ã§ã¯Linterå®è¡çµæãè¦ã¦ããã¾ãããã
Icarus Verilogã¨Lintçµæãæ¯è¼
Icarus Verilog
ãªãã»ã©ãªãã»ã©ã»ã»ã»
"syntax error"ãæãã¦ãããã®ã¯è¯ããã§ããä½ãã©ããã¡ãªã®ãã»ã»ã»
ãã®è¡ã¯åé¡ãªãã®ã«ãã®åã®è¡ã®ã¨ã©ã¼ã«å¼ã£å¼µããã¦ã¨ã©ã¼ã«ãªã£ã¦ãã¾ã£ã¦ãã¾ãã»ã»ã»
Verilator
ã"="ããããããªãï¼ãã¨ã¨ã©ã¼ç®æãæ¨æ¸¬ãã¦ãã¾ã
ãããåæ§ã§ãããã"end"å¨è¾ºããããããã¨ãããã¾ãã
Icarus Verilogã®Lintæ©è½ã«ã¯ããã¾ããã§ããããVerilatorã ã¨Warningãåºãã¦ããã¾ãã
ãé åºåè·¯ã®ä¸ã§ããããã³ã°ä»£å ¥ä½¿ã£ã¦ããã©å¤§ä¸å¤«ï¼ãã¨ããWarningã§ãã
ããã¡ã¤ã«æ«å°¾ã¯è¡ãå ¥ãã¦ããã®ãæ¨å¥¨ã§ãããã¨ã¾ã§ãããªãä¸å¯§ã§ããã
ã¨ãããã¨ã§ãVerilatorãLinterã¨ãã¦å°å ¥ãã¾ããã
AUDIYã®Xã«ã¯
https://t.co/5DdYSh9scS
â ãããã« (@taichi600730) February 23, 2024
ã¸ã¼ãããã¼ã±ã¼ãããã«ã謹製ãªã®ã§ããã¡ããå°å ¥ãã¹ã
ã¨ãªã¹ã¹ã¡ãããã¾ãããããã¡ãã¬ãã¬ãã®SystemVerilogã«ã¼ã«ã§Lintï¼wire, reg宣è¨ãããWarningã«ããã»ã©ã«ã¯ï¼ãã¦ã¦ãVerilog主ä½ã®AUDIYã«ã¯ã¾ã ã¾ã æ©ãæãã§ããï¼è¨å®ãã¡ã¤ã«ãç·¨éãã¦Lintã«ã¼ã«ãç´°ããè¨å®ã§ããã®ã§ãããã¯ä½¿ãããªãããï¼ã
Windowsã®ã¿ãªããLinuxãã·ã³ã«ãå°å ¥ãã¦ããã®ã§ãLinterã®ã¿ãªããã·ãã¥ã¬ã¼ã¿ã¨ãã¦ã使ã£ã¦ãããã°ã¨æãã¾ãã