ãã€ãã®ããã«ãçå®ã®ç解ã¯å®éã®åé¡ã解決ããããšã«ãã£ãŠå©ããããŸããã ä»æ¥ã®èª¬æã§ã¯ãè¥ãFPGAã®å€ãã«åœãŠã¯ãŸãè©Šéšã«ã€ããŠã話ããããšæããŸãã è©Šç·Žãä¹ãè¶ããŠãçå®ãç解ããŸãã ããããçããèŠã€ãããªãã£ã質åããããŸãã ãã®ãããçµéšãç©ãã ããããã¹ã¯å åŒã®FPGAãè°è«ã«åå ããåŒãã¡ã«æŽå©ã®æã貞ããŠãããããšããšãŠãæãã§ããŸãã
ãã®èšäºã¯åå¿è åãã§ãã ãã®äžã§ããã¬ãŒãã³ã°ã®æåã«çŸããå¯èœæ§ã®ããå žåçãªåé¡ã質åã誀解ããšã©ãŒã«ã€ããŠèª¬æããŸãïŒãããã¯ç§ã«çŸããããïŒã ãã ãããã®èšäºã®ã³ã³ããã¹ãã¯ã Verilogã® Quartusã®ã¢ã«ãã©ã® FPGAã§éçºãè¡ãããŠãããšããäºå®ã«ãã£ãŠå¶éãããŠããŸãã
äœãããã«çããããšã¯é£ããã§ãããç§ãã¡ã¯å°é£ãæããŠããŸããïŒ
å€ãã®äººãçŸåšVerilogãåŠç¿ãå§ããŠããªãçç±ã®1ã€ã¯ãå®éã®FPGAããªãããšã§ãã é«äŸ¡ã§ãããã泚æã§ããªã人ãäœããã¹ããããããªããã泚æãã人ïŒéžæã«ã€ããŠã¯åã®èšäºã§èª¬æããŸããïŒã 誰ãã®FPGAããŸã éµéãããŠããŸãã
ããããç§ã®éçºã§ã¯ããããŒããŠã§ã¢ã§ããããžã§ã¯ãããã¹ãããå¿ èŠãããå Žåãéçºã®æçµæ®µéã§ãã§ã«å®éã®FPGAãå¿ èŠã§ãããšããçµè«ã«éããŸããã åé¡ã¯ãã»ãšãã©ã®æéãã·ãã¥ã¬ãŒã¿ã䜿çšããŠã³ãŒãããããã°ããããšã«è²»ãããŠããããšã§ãã
ãããã£ãŠãç§ã®ã¢ããã€ã¹ïŒ FPGAããªãããšã¯ãéã¢ã¯ãã£ããªãŸãŸã§ããçç±ã§ã¯ãããŸããã ã·ãã¥ã¬ãŒã¿ãŒã§FPGAã¢ãžã¥ãŒã«ãäœæããã³ãããã°ããŸãïŒ
Verilogã®ã·ãã¥ã¬ãŒã¿ãŒ
ããã§ã¯ãéå±ãªé·ãåŽåæ¥ïŒãããããªãïŒã§äœã楜ããã®ã§ããããïŒ ãã¡ãããFPGAããã¹ã¿ãŒããŠããŸãïŒ ããããã¢ã«ãã©ã®éçºç°å¢å šäœãã€ã³ã¿ãŒãããã®3ãæã®äœæ¥å¶éã®éãã®å Žåãã©ã®ããã«æ©èœãããããšãã§ããŸããïŒ ãã©ãã·ã¥ãã©ã€ãã«æã£ãŠããããšãã§ããŸãïŒ ãã ããç 究察象ãVerilogã®å Žåã¯ãã¡ã¢åž³ãIcarusVerilogã³ã³ãã€ã©ã«éå®ããŠãGTK Waveã§çµæã確èªã§ããŸãã
ä»ãããè©Šããã ãã
Windowsã§éå§ããã«ã¯ããªã³ã¯http://bleyer.org/icarus/ [11.2MB]ããiverilog-20130827_setup.exeã€ã³ã¹ããŒã«ãã¡ã€ã«ïŒéçºã¹ãããã·ã§ããïŒãããŠã³ããŒãããã ãã§ãã
åé¡ã®ã€ã³ã¹ããŒã«ã¯çºçããŸããã ã§ã¯ãå°ãå ã«é²ãã§ã¿ãŸãããããããžã§ã¯ãçšã®ãã©ã«ããŒãäœæãããã®äžã«ãŸã æ確ã§ãªãå 容ã®ãã¡ã€ã«ãããã€ãäœæããŸãã
ãã¹ããã³ããã¹ãã¢ãžã¥ãŒã«ã¯bench.vãã¡ã€ã«ã«èšè¿°ãããŠããããã¹ãä¿¡å·ãœãŒã¹clkïŒèè¡ïŒãäœæãããŸãã ä»ã®ã¢ãžã¥ãŒã«ã¯å¥ã®ãã¡ã€ã«ã§äœæãããŸãããŸãã¯ããã®ã¢ãžã¥ãŒã«ã§æåã«ããžãã¯ããã¹ãããŠãããå¥ã®ã¢ãžã¥ãŒã«ã«ç§»åã§ããŸãã 次ã«ããããã®ã¢ãžã¥ãŒã«ã®ã€ã³ã¹ã¿ã³ã¹ããã¹ããã³ãã¢ãžã¥ãŒã«ã«è¿œå ãããå ¥åã«ãã¹ãä¿¡å·ãéä¿¡ããŠãçµæãååŸããŸãã éå±€ãæ§ç¯ã§ããã¢ãžã¥ãŒã«ããã誰ã«ã§ãæããã ãšæããŸãã
ãã®ãã¡ã€ã«ãéå§ãããšã$ displayïŒããã¯ãããã°åºåã§ãïŒã§æå®ãããããã¹ããç»é¢ã«è¡šç€ºãããŸããä¿¡å·ãšåè·¯ã¬ãžã¹ã¿ã®å€ã¯test.vcdãã¡ã€ã«ã«ãããŸãã ãã¡ã€ã«ãã¯ãªãã¯ããŠã衚瀺ããããã°ã©ã -GTKWaveïŒç§ã®å Žåã¯DïŒ\ iverilog \ gtkwave \ bin \ gtkwave.exeïŒãéžæããŸãã æ°åã¯ãªãã¯ããã ãã§ãclkã衚瀺ãããŸãã
åé¡ã®ã€ã³ã¹ããŒã«ã¯çºçããŸããã ã§ã¯ãå°ãå ã«é²ãã§ã¿ãŸãããããããžã§ã¯ãçšã®ãã©ã«ããŒãäœæãããã®äžã«ãŸã æ確ã§ãªãå 容ã®ãã¡ã€ã«ãããã€ãäœæããŸãã
ã¢ãžã¥ãŒã«ãã¹ãã³ãŒããå«ãã¢ãžã¥ãŒã«ãã¡ã€ã«-bench.v
`timescale 1ns / 100 ps module testbench(); reg clk; initial begin $display("start"); $dumpfile("test.vcd"); $dumpvars(0,testbench); clk <= 0; repeat (100) begin #10; clk <= 1; #10; clk <= 0; end $display("finish"); end
ãã¹ããã³ããã¹ãã¢ãžã¥ãŒã«ã¯bench.vãã¡ã€ã«ã«èšè¿°ãããŠããããã¹ãä¿¡å·ãœãŒã¹clkïŒèè¡ïŒãäœæãããŸãã ä»ã®ã¢ãžã¥ãŒã«ã¯å¥ã®ãã¡ã€ã«ã§äœæãããŸãããŸãã¯ããã®ã¢ãžã¥ãŒã«ã§æåã«ããžãã¯ããã¹ãããŠãããå¥ã®ã¢ãžã¥ãŒã«ã«ç§»åã§ããŸãã 次ã«ããããã®ã¢ãžã¥ãŒã«ã®ã€ã³ã¹ã¿ã³ã¹ããã¹ããã³ãã¢ãžã¥ãŒã«ã«è¿œå ãããå ¥åã«ãã¹ãä¿¡å·ãéä¿¡ããŠãçµæãååŸããŸãã éå±€ãæ§ç¯ã§ããã¢ãžã¥ãŒã«ããã誰ã«ã§ãæããã ãšæããŸãã
BATçŸåšã®ãã©ã«ããŒããä»ã®ã¢ãžã¥ãŒã«ãè¿œå ããããšã«ãããã¡ã€ã³ã¢ãžã¥ãŒã«ãã³ã³ãã€ã«ããã³ã·ãã¥ã¬ãŒããããã¡ã€ã«-makev.bat
iverilog -o test -I./ -y./ bench.v vvp test pause
ãã®ãã¡ã€ã«ãéå§ãããšã$ displayïŒããã¯ãããã°åºåã§ãïŒã§æå®ãããããã¹ããç»é¢ã«è¡šç€ºãããŸããä¿¡å·ãšåè·¯ã¬ãžã¹ã¿ã®å€ã¯test.vcdãã¡ã€ã«ã«ãããŸãã ãã¡ã€ã«ãã¯ãªãã¯ããŠã衚瀺ããããã°ã©ã -GTKWaveïŒç§ã®å Žåã¯DïŒ\ iverilog \ gtkwave \ bin \ gtkwave.exeïŒãéžæããŸãã æ°åã¯ãªãã¯ããã ãã§ãclkã衚瀺ãããŸãã
å®éã«ã¯ãã¡ã¢åž³ã§æ°ããã¢ãžã¥ãŒã«ãããããäœæããIcarusVerilogããããã°ããŸãã ãã®ãããªãããã°åŸã®æ¬¡ã®ã¹ãããã¯ãQuartusã®ã¢ãžã¥ãŒã«ããã§ãã¯ããããšã§ãã Quartusã«ã¯ç¬èªã®ã·ãã¥ã¬ãŒã¿ããããŸãããç§ã¯ããŸã䜿çšããŸããã ãã®çç±ã¯ãã³ãŒãã®æŽæ°ãšIcarusVerilogã§ã®çµæã®è¡šç€ºã®åçŽãã§ããå€æŽããã¡ã€ã«ã«ä¿åããBATãèµ·åããGTKWaveã®ãæŽæ°ããã¿ã³ãã¯ãªãã¯ããŸããã ModelSimã§ã¯ãããã«ã¯ããå°ã移åãå¿ èŠã§ãããç¹ã«è€éãªæ§é ã®ããŒã¿ã§ã¯ãæªãã¯ãããŸããã
ã·ãã¥ã¬ãŒã·ã§ã³ã®åŸãQuartusãèµ·åããŸãã ãããããã¡ãŒã ãŠã§ã¢ãFPGAã«ã¢ããããŒãããã«ã¯ææå°æ©ã§ãã ç¥ã®ã³ã³ãã¥ãŒã¿ãŒãã©ã®ãããªåè·¯ãååŸãããããæ£ããç解ããŠããããšã確èªããå¿ èŠããããŸããVerilogã®åœ¢åŒã§èããè¿°ã¹ãŸãã
ã·ãã¥ã¬ãŒã·ã§ã³ãšå®éã®ããŒããŠã§ã¢ã§ã®äœæ¥ã®éã
æåã¯ãç²ç®ã®åç«ã®ããã«ãç§ã¯æšªæ£ã«é ãæã¡ãŸããã æ£ããã³ãŒãããŸã£ããæ©èœããªãããæåŸ ã©ããã«æ©èœããªãããã§ãã ãŸãã¯ããã¯ã¡ããã©åããããä»ã§ã¯çªç¶åæ¢ããïŒ
奜å¥å¿itiveçãªåç«ã¯ãèªåã®è¡åãšçµæã®éã®é¢ä¿ãæ¢ãå§ããŸãïŒ ãããžã§ã³è¿·ä¿¡ã ïŒã
æ倧ã®ãã©ã
以äžã¯å¥åŠãªãªã¹ãã§ãããæåã«ç§ãééããæ倧ã®ãã©ãïŒ ãã¹ãŠã®Verilogã³ã³ã¹ãã©ã¯ããéã§åæã§ããããã§ã¯ãããŸãã ã ããã¯ãã¢ãžã¥ãŒã«ã«çµ±åãããŠããŒããŠã§ã¢ã§åäœããããŒããŠã§ã¢ããžãã¯ã ãã§ãªããVerilogãèšè¿°ããŠããããã§ãã ãŸããVerilogã§ã¯ããã¹ãæžã¿ã¢ãžã¥ãŒã«ãçµã¿åãããŠãã¹ãä¿¡å·ãå ¥åã«éä¿¡ããéåžžã¯ã³ã³ãã¥ãŒã¿ãŒã§ã®ãã¹ãå°çšã«ååšãããã¹ãã¢ãžã¥ãŒã«ã«ã€ããŠã説æããŠããŸãã æéã®çµéã«äŒŽãä¿¡å·å€ã®å€æŽã¯ãVerilogããã¹ãã«ãïŒãèšå·ãå«ãæ§é ã«ãã£ãŠæå®ãããŸãã ãã®ãããªå åã¯æéã®é ããæå³ããŸãã äžèšã®äŸã§ã¯ããããCLKä¿¡å·ã®çææ¹æ³ã§ãã ãããŠãå®éã®FPGAå ã§ãåãæ¹æ³ã§ãããšãã°RS232ãä»ããŠã¡ãã»ãŒãžãéä¿¡ããããã®ãããã·ãŒã±ã³ã¹ãçæã§ããã®ã¯çœªæ·±ãããšã ãšæããŸããã çµå±ã50 MHzãžã§ãã¬ãŒã¿ãŒããã®ä¿¡å·ã¯FPGAå ¥åã«éãããŸãïŒ å€å圌女ã¯ã©ãããããã圌ã«çŠç¹ãåœãŠãŠããŸãã çµå±ã®ãšãããå¥è·¡ãæãã ã®ã¯ç§ã ãã§ã¯ãããŸããïŒ1ã2ã3ã4ã5ã çŸå®ã¯ãã€ãã®ããã«å³ãããã®ã«ãªã£ãŠããŸãïŒFPGAã¯ããžãã¯ã®ã»ããã§ããããžã§ãã¬ãŒã¿ãŒããç¹å®ã®å€ãŸã§ã¯ããã¯ãµã€ã¯ã«ã§å€ãå¢å ããã«ãŠã³ã¿ãŒã䜿çšããå ŽåããŸãã¯äœããã®æ¹æ³ã§ïŒãã ãåžžã«ããŒããŠã§ã¢ã§ïŒæéé 延ãçºçããå¯èœæ§ããããŸãã
èŠã€ãã£ãå¥åŠãªãªã¹ã
ããããæ¬ãèªãã§é©ãã¹ãããš[1,2]ã¯ããã®æªéã«å ãåœãŠãŸãã ããã«ãæµã¿ãåŸãããŸãã
regãæå®ããå Žåããããäœæããããšããäºå®ã§ã¯ãããŸãã
ã©ã®ããã«ããŠåé¡ãçºçããŸãããïŒ 1ã€ã®ã¢ãžã¥ãŒã«ãããããã®å ¥åãïŒãã©ã¡ãŒã¿ãŒã®ã¿ã€ãããšã«ïŒå€ãéä¿¡ããå¿ èŠããããšããŸãã å°æ¥çã«ã¯ããã®ãã©ã¡ãŒã¿ãŒã¯å€éšã€ãã³ãã«å¿ããŠæéãå€æŽããå¿ èŠããããŸãã ãããã£ãŠãå€ã¯ã¬ãžã¹ã¿ïŒregïŒã«æ ŒçŽããå¿ èŠããããŸãã ãã ããå€éšã€ãã³ããåä¿¡ããå®è£ ã¯ãŸã å®è£ ãããŠããªããããã¬ãžã¹ã¿ãå€æŽãããåã«å ã®å€ã«èšå®ããŸãããå°æ¥çã«ã¯å€æŽãããŸããã
// 8 reg [7:0] val; // initial val <= 8'd0240; //wire wire [7:0] out_data; // , bbox // bb_01 // , in_data out_data // val, wire - out_data bbox bb_01(.in_data(val), .out_data(out_data));
ãã£ããã¯äœã§ããããïŒ åœä»€åPLã§ã¯ãå€æ°ãå®æ°ãšããŠèšå®ããããšãå€ãããã®åŸå€æ°ãå€æŽããããšã¯ãªãããã¹ãŠãæ©èœããŸãã éã«ã¯äœãèŠããŸããïŒ
ãŸããã¬ãžã¹ã¿ã衚瀺ãããŸããã 次ã«ã8'd0240ã§ã¯ãªãã8'hFFãã¢ãžã¥ãŒã«ã®å ¥åã«äŸçµŠãããŸãïŒ ãããŠãããã¯èšç»ãèšç»ã©ããã«æ©èœããªãããšãä¿èšŒããã®ã«ååã§ãã ã¬ãžã¹ã¿ããªããšããäºå®ã¯æ£åžžã§ãã Verilogã¯ããŸããŸãªæ¹æ³ã§ããžãã¯ãèšè¿°ã§ããŸãããåæã«ãã·ã³ã»ãµã€ã¶ãŒã¯åžžã«ããŒããŠã§ã¢å®è£ ãæé©åããŸãã alwaysãããã¯ãäœæããŠãã®äžã®ã¬ãžã¹ã¿ãæäœããŠããåºåå€ã¯åžžã«å ¥åãããã¯ã«ãã£ãŠæ±ºå®ããããããããã§ã¬ãžã¹ã¿ã䜿çšããå¿ èŠã¯ãªããã·ã³ã»ãµã€ã¶ã¯ãããé 眮ããŸããã éã«ãå ¥åããŒã¿ã®äžéšã®å€ã§åºåå€ãå€ãããªãå Žåã¯ãã¬ãžã¹ã¿ã©ãããªãã§è¡ãæ¹æ³ã¯ãªããã·ã³ã»ãµã€ã¶ã¯ãããäœæããŸãã ïŒBook 1 ppã88-89ïŒã ããããäœãç¶ããŸããïŒ ããšãã°ããã¿ã³ã®æŒäžã«å¿ããŠãã¬ãžã¹ã¿ã®å€ã®å€æŽãéå§ãããšããžã§ãªã¹ã¿ãŒãæ¢ã«äœæããããã¹ãŠãæ£åžžã«æ©èœããŸãã ãã¿ã³ãäœãå€æŽããªãããšãå€æããå Žåãã·ã³ã»ãµã€ã¶ãŒã¯åã³ãããæšãŠãåã³ãã¹ãŠãå£ããŸãã å®æ°ãã©ããããïŒ ã¢ãžã¥ãŒã«ã®å ¥åã«çŽæ¥éä¿¡ããå¿ èŠããããŸãã
bbox bb_01(.in_data(8'd0240), .out_data(out_data));
ããã§ãã¢ãžã¥ãŒã«ã®å ¥åã§æ£ããå€ãåŸãããŸããã
ã¬ãžã¹ã¿ãæžãããšãã«ãåæå€ã®å€ãã¢ãžã¥ãŒã«ã®å ¥åã«çœ®ãæããããªãçç±ã¯è¬ã®ãŸãŸã§ãã
ã¯ã€ã€ã®å¯žæ³ã¯ãèªåã§èšå®ããã®ãæé©ã§ãã
Quartusç°å¢ã§éçºããå Žåãäºåã«ã¯ã€ã€ã©ã€ã³ãèšå®ããªãã§ãã ããã ãã®å Žåããããã¯èªåçã«äœæãããŸãããèŠåãçºè¡ãããŸãã åé¡ã¯ãé ç·å®¹éã1ãããã«ãªããããŒãã®å®¹éã1ããããè¶ ããå Žåãå€ãéä¿¡ãããªãããšã§ãã
bbox bb_01(.in_data(8'd0240), .out_data(int_data)); other_bbox bb_02(.in_data(int_data), .out_data(out_data));
èŠå
Warning (10236): Verilog HDL Implicit Net warning at test.v(15): created implicit net for "int_data"
çµæïŒ
ã芧ã®ãšããã1ããããæ¥ç¶ãããæ®ãã®7ãããã¯æªæ¥ç¶ïŒNCïŒã§ååŸãããŸãã ãã®ãããªåé¡ãåé¿ããã«ã¯ãã¯ã€ã€ãŒãèªåã§äœæããå¿ èŠããããŸãã IcarusVerilogã³ã³ãã€ã©ãŒãèŠåãåºããªãããšã¯äœããããŸããããã¯ã€ã€ãäºåã«æå®ãããŠããªãå Žåã¯ãšã©ãŒã«ãªããŸãã
wire [7:0] int_data; bbox bb_01(.in_data(8'd0240), .out_data(int_data)); other_bbox bb_02(.in_data(int_data), .out_data(out_data));
ã³ã³ãã¥ãŒã¿ãŒã¯ã¢ãžã¥ãŒã«ãç»ããŸãããããŒãã®ããã深床ã確èªããŠãã ããã ããã«ãããã深床ã¯ç°ãªãå Žåãããããã¹ãŠã®ããããã¢ãžã¥ãŒã«ã®å ¥åãŸãã¯åºåããååŸãããããã§ã¯ãªããç¹å®ã®ããããååŸãããŸãã
è«çé¢æ°ã®åºåãã¯ããã¯ä¿¡å·ãšããŠäœ¿çšããããšã¯ã§ããŸãã
ãããžã§ã¯ãã§ã¯ãã¯ããã¯åšæ³¢æ°ãäžããããNã¯ããã¯ãµã€ã¯ã«ã®æéé 延ãå°å ¥ããå¿ èŠãããå ŽåããããŸãã åå¿è ã¯ãã«ãŠã³ã¿ãŒãšã«ãŠã³ã¿ãŒãç¹å®ã®å€ã«éãããã©ãããå€æããããã®è¿œå ã®ã¹ããŒã ïŒæ¯èŒã¹ããŒã ïŒã䜿çšã§ããŸãã ãã ããæ¯èŒåè·¯ããã®åºåãã¯ããã¯ãšããŠçŽæ¥äœ¿çšãããšãåé¡ãçºçããå¯èœæ§ããããŸãã ããã¯ãè«çåè·¯ãå®å®ããåºåå€ãèšå®ããã®ã«æéããããããã§ãã ãã®é 延ã¯ãã¬ãŒã¹ãæºå®å®æ§ãéåææ§ã®çµæãšããŠãã¯ããã¯ã«å¯ŸããŠè«çåè·¯ã®ç°ãªãéšåãééããä¿¡å·ã®åãã·ããããŸãã ããã«ã€ããŠãFPGAã«å¯Ÿããæ¹å€ãšããŠãFPGAã«ã¯åžžã«åé¡ããããŸã-ä¿¡å·ã®ç«¶åããšããçºèšãèãæ©äŒããããŸããã
å°ãªããšã2ã3ã®èšäºãèªãã å ŽåïŒ
æºå®å®æ§ãšãµã€ã¯ã«éåæã®ããªã¬ãŒ
FPGAã®ãã€ãã©ã€ã³ã«ã€ããŠäžèš
FPGAããã€ã¹ã®éçºæ¹æ³ãæããã«ãªããŸããã¿ã¹ã¯å šäœãããŒããŠã§ã¢ãããã¯ã«åå²ããããããã®éã®ããŒã¿ãã³ã³ãã¢ã«æ²¿ã£ãŠç§»åããã¯ããã¯ä¿¡å·ã«ãã£ãŠã¬ãžã¹ã¿ã«åæçã«ã©ãããããŸãã ãããã£ãŠãã·ã³ã»ãµã€ã¶ãŒã¯åèšã¯ããã¯åšæ³¢æ°ãç¥ã£ãŠããã¹ãŠã®çµã¿åããåè·¯ã®æ倧åšæ³¢æ°ãèšç®ãããã®é床ããµã€ã¯ã«åšæã«é©åãããã©ãããå€æããFPGAã§åè·¯ãæ©èœãããã©ããã決å®ããŸãã ãããã¯ãã¹ãŠåæ段éã§çºçããŸãã ã¹ããŒã ããã©ã¡ãŒã¿ãŒã«é©åããå ŽåãFPGAããã©ãã·ã¥ã§ããŸãã
å®å šã«ç解ããã«ã¯ããã¯ããã¯ãã¡ã€ã³ãã«é¢ããã¢ã«ãã©ãã³ãããã¯ãèªãã ãã§ãªãããããžã§ã¯ãã®TimeQuestèšç®ãã©ã¡ãŒã¿ã®èšå®æ¹æ³ãç解ãã䟡å€ããããŸãã
ãããã£ãŠãFPGAããŒã¹ã®ããã€ã¹ã®éçºè ã«ãšã£ãŠã¯ãå¿ èŠãªãã¹ãŠã®æ¹æ³è«ãäœæãããŠãããããããé å®ããã°åé¡ã¯ãããŸããã
ããããã·ã¹ãã ã«å察ãããå Žåã¯ã©ããªããŸããïŒ
åè·¯ã·ã³ã»ãµã€ã¶ãŒã®éçºé åºãšåäœã«ãããFPGAã¯ããŒããŠã§ã¢ã¬ãã«ã«ãããšããçµè«ã«è³ããŸãã ãããã¯åæåè·¯ã§ãã ãããã£ãŠãã·ã³ã»ãµã€ã¶ãŒã®ç®æšã®1ã€ã¯ãæéééå ã«ç¶æããããšã§ãã ããšãã°ã圌ã¯è«çåŒãåçŽåããä»ã®åè·¯ã§äœ¿çšããããFPGAã®ç©çççµè«ã«çµã³ä»ããããŠããªãåè·¯ã®åæéšåããé€å€ããŸãã éåæãœãªã¥ãŒã·ã§ã³ãšã¢ããã°ããªãã¯ã¯æè¿ãããŸããããªããªãããããã®äœæ¥ã¯äºæž¬äžå¯èœã§ããããããã®ïŒé»å§ã枩床ã補é ããã»ã¹ãããããFPGAçæïŒã«äŸåããå¯èœæ§ãããããããã£ãŠãä¿èšŒããããåçŸæ§ã®ããã移æ€å¯èœãªçµæãââãããããªãããã§ãã ãããã誰ããå®å®ããçµæãšèšèšã®ããã®äžè¬çãªã¢ãããŒããå¿ èŠãšããŠããŸãïŒ
ããããäžå€ã®ã¬ãžã¹ã¿ãæšãŠãŠè«çåè·¯ãçãããå¿ èŠããããšããã·ã³ã»ãµã€ã¶ãŒã®æèŠã«åæããªãå Žåã¯ã©ãããã°ããã§ããããïŒ éåæããžãã¯ã§åè·¯ãäœãããå Žåã¯ã©ãããŸããïŒ åŸ®èª¿æŽãå¿ ââèŠã§ããïŒ ãããã¯ãFPGAã®äœã¬ãã«ã³ã³ããŒãã³ãäžã«åè·¯ãçµã¿ç«ãŠãããšæããããããŸããã ç°¡åïŒ ãã®ãããªæ©äŒãšè©³çŽ°ãªããã¥ã¡ã³ããæäŸããŠãããã¢ã«ãã©ã®éçºè ã«æè¬ããŸãïŒ
ã©ããã£ãŠããã®ïŒ ã°ã©ãã£ã«ã«ãã€ã¢ã°ã©ã ãšãã£ã¿ãè©Šãããšãã§ããŸãã Quartusã§ãã€ã¢ã°ã©ã ãæç»ã§ãããšèããããšããããŸããïŒ èªåã§ãã«ãã£ã³ã°ãããã¯ãéžæããããããæ¥ç¶ã§ããŸãã ããããããã¯è§£æ±ºçã§ã¯ãããŸããïŒ æç»ãããåè·¯ã§ãããå¯èœã§ããã°ã·ã³ã»ãµã€ã¶ãŒã«ãã£ãŠæé©åãããŸãã
ãã®çµæãç§ãã¡ã¯å€ãçå®ã«å°éããŸãïŒ äœãå©ããªããã°ãæ瀺ãèªãã§ãã ãã ã ã€ãŸãã ãQuartus IIåæãªãã·ã§ã³ããšåŒã°ãããAltera HandbookãããŒãã§ãã
ãŸããç¹å®ã®æ¹æ³ã§Verilogã®ã¢ãŒããã¯ãã£ã説æãããšãç¹å®ã®çµæãåŸãããŸãã åæããã³éåæRSããªã¬ãŒãååŸããããã®ãµã³ãã«ã³ãŒãã次ã«ç€ºããŸãã
// RS module rs(clk, r, s, q); input wire clk, r,s; output reg q; always @(posedge clk) begin if (r) begin q <= 0; end else if (s) begin q <= 1; end end endmodule
ãã®å Žåãåæããªã¬ãŒãååŸããŸãã
ã¯ããã¯ä¿¡å·ãèæ ®ãããrãšsã®å€æŽã«å¿ããŠåãæ¿ãããšãçµæã¯éåæèšå®å€ãæã€èŠçŽ ïŒã©ããïŒã«ãªããŸãã
// RS module ModuleTester(clk, r, s, q); input wire clk, r,s; output reg q; always @(r or s) begin if (r) begin q <= 0; end else if (s) begin q <= 1; end end endmodule
ããããããã«é²ãã§ãããªããã£ãããã©ãããèªåã§äœæããããšãã§ããŸãïŒããªããã£ãã¯ãä»ã®Verilogã¢ãžã¥ãŒã«ãšåãããã«äœ¿çšã§ããŸãïŒã
module ModuleTester(clk, r, s, q); input wire clk, r,s; output reg q; DLATCH lt(.q(q), .clrn(~r), .prn(~s)); endmodule
ãã®çµæãã·ã³ã»ãµã€ã¶ãŒãå¿ èŠãšå€æããã©ããã®å ¥åã«ãããããã£ããããå šäœãæ¶ããå¿ èŠãªãã®ãæ£ç¢ºã«åŸãããŸãã
æ¢åã®ããªããã£ãã®ãªã¹ã㯠ãã¢ã«ãã©ã®Webãµã€ãã§èŠã€ããããšãã§ããŸãã
ãããŠä»ãéåæãšåæžã«ã€ããŠã®å°ããªäŸã§ãã ããšãã°ã以åã¯æ £ç¿çã ã£ãã®ãšåãåçã§ãFPGAã®ã¿ã§ãžã§ãã¬ãŒã¿ãŒãäœæãããšæããŸããã
ããããæéãå¢ããããã«4ã€ã®èŠçŽ ãåããŸããããã®ãã¡ã®1ã€ã ããå転ãããŸãã
module ModuleTester(q); output wire q; wire a,b,c,d; assign a = b; assign b = c; assign c = d; assign d = ~a; assign q = a; endmodule
ããããåæžïŒ4ã€ã§ã¯ãªã1ã€ã®èŠçŽ ïŒãååŸããŸãã è«ççã§ãã ãããããã®åŸãé 延ç·ãèæ¡ããŸããã
ããããã·ã³ã»ãµã€ã¶ãŒããã©ã€ã³aãbãcãdãçž®å°ãããªãæ¡ä»¶ã«èšå®ãããšãæå³ãããšããã«ãªããŸãã ã·ã³ã»ãµã€ã¶ãŒãæ¯æŽããããã«ãã£ã¬ã¯ãã£ãã䜿çšãããŸãã ããã瀺ã1ã€ã®æ¹æ³ã¯ãã³ã¡ã³ãå ã®ããã¹ãã§ãã
module ModuleTester(q); output wire q; wire a,b,c,d /* synthesis keep */; // ^^^--- assign a = b; assign b = c; assign c = d; assign d = ~a; assign q = a; endmodule
ãããŠãããã«çµæããããŸã-4ã€ã®èŠçŽ ã®ãã§ãŒã³ïŒ
ãããŠãããã¯ãã¹ãŠãšã¯çšé ãïŒ ç§ã¯ãããç¬åŠã®åã³ã«ä»»ããŸããã±ãŒã¹ãšãRAM / ROMãŸãã¯è«çåè·¯ãšããŠå®è£ ããããã®ãã£ã¬ã¯ãã£ããæäœããŸãã å èµã¡ã¢ãªãŠãããïŒRAM / ROMïŒã䜿çšããŸãã ä¹ç®ã®å®è£ ã®éžæ-ããŒããŠã§ã¢ä¹ç®åšãŸãã¯è«çåè·¯ã
çµè«
èšäºãåŒçšããŠã ãFPGA / FPGAã¯ããã»ããµãŒã§ã¯ãªãããšèšãããã®ã§ãããFPGAïŒFPGAã®æ§æã¡ã¢ãªãŒãæºããïŒãããã°ã©ãã³ã°ããŠé»ååè·¯ïŒããŒããŠã§ã¢ïŒãäœæããããã»ããµãŒïŒåºå®ããŒããŠã§ã¢ïŒãããã°ã©ãã³ã°ãããšã¹ãªããããŸã圌ã«ã¯ãã¡ã¢ãªïŒãœãããŠã§ã¢ïŒã«æžã蟌ãŸããäžé£ã®é 次ããã°ã©ã åœä»€ ã ã
ããã«ãæåã¯ç¹å®ã®éã«åŒ·ããªããããªãã£ãããã«ãå Žåã«ãã£ãŠã¯ããªãœãŒã¹ãããå¹ççãã€çµæžçã«äœ¿çšããããã«ãäœã¬ãã«ã§äœæ¥ããå¿ èŠããããŸãã å€ãã®å Žåãããã¯åæåè·¯ãæ£ããéçºããããšã§åé¿ã§ããŸãã ãã ãããããéã§ããããšãå®å šã«å¿ããŠãæ©èœããŸããã
ç§ã¯ãŸããçä¿¡ãšæ倧䞻矩ãæéãšãšãã«æžå°ãããšèšãããã§ãã FPGAã§ã¯èš±å¯ãããŠãããããæåã¯ãã¹ãŠã®ã¢ã¯ã·ã§ã³ãšFPGAèšç®ã1ã¯ããã¯ãµã€ã¯ã«ã§å®è¡ããããšããŸããã ãã ããããã¯å¿ ãããå¿ èŠã§ã¯ãããŸããã ç§ã¯ãŸã ãœããããã»ããµã®èšç®ã«ãŒãã«ã䜿çšã§ããŸããã§ããããç¹å®ã®ã¢ã«ãŽãªãºã ã«åŸã£ãŠåäœããããã®ã¹ããŒããã·ã³ã®äœ¿çšãæšæºã«ãªããŸããã èšç®ã¯1ãµã€ã¯ã«ããšã§ã¯ãªãããã€ãã©ã€ã³ã®äœ¿çšã«ããæ°ãµã€ã¯ã«ã®æéé 延ãæšæºã§ãã
æ¬åœã«å©ããŠãããæ¬
1. V.V. Soloviev-Verilogããžã¿ã«æ©åšèšèšèšèªã®åºç€ã 2014
2.ã¢ã«ãã©ïŒQuartus IIãã³ãããã¯
3.ã¢ã«ãã©ïŒAdvanced Synthesis Cookbook
4.ã¢ã«ãã©ïŒäœã¬ãã«ã®ããªããã£ãã䜿çšããèšèš
é¢é£èšäºFPGAãã¢ã«ãã©ããã³Verilog
FPGAæ¥çãã¥ãŒã¹
ãã€ã¯ããœããã¯ç¬èªã®ããã»ããµã«åãæ¿ããŸã
ã€ã³ãã«ã¯ãFPGAãçµ±åããXeonãµãŒããŒããã»ããµããªãªãŒã¹ããäºå®ã§ã
Intelã¯ã¢ã«ãã©ãè³Œå ¥ããäºå®
RBCïŒã€ã³ãã«ã¯167åãã«ã§ã¢ã«ãã©ã®ãããã¡ãŒã«ãŒãè²·å
FPGAãã¥ãŒã©ã«ãããã¯ãŒã¯ã䜿çšããŠæé©åãããBingæ€çŽ¢
FPGAãã¥ãŒã©ã«ãããã¯ãŒã¯ã䜿çšããŠæé©åãããBingæ€çŽ¢
ã¢ã«ãã©FPGAãæèŒããIntel Xeonããã»ããµ
çè«
VLSIããã°ã©ããã«ããžãã¯ã«åºã¥ãããžã¿ã«ããã€ã¹ã®éçº
ããŒããŠã§ã¢æ©èœ
æºå®å®æ§ãšãµã€ã¯ã«éåæã®ããªã¬ãŒ
äžæçãªFPGAåæãŸãã¯Timequestã®ç¿åŸæ¹æ³
FPGAã®ãã€ãã©ã€ã³ã«ã€ããŠäžèš
Verilogã RAMã©ãããŒãšãããå¿ èŠãªçç±
åæåè·¯ã®èšèšã Verilog HDLã®ã¯ã€ãã¯ã¹ã¿ãŒã
äŸ
ã¿ã€ããŒãŸãã¯æåã®FPGAãããžã§ã¯ãã®äœæ
Quartus IIãšå°ããªVerilogã䜿çšããFPGAã¯ããã¯
USBããã€ã¹ã®äœãæ¹
FPGAããŒã¹ã®ã«ã©ãŒãã¥ãŒãžãã¯
FPGAããã°ã©ãã³ã°ã ãé£çµ¡å ã®è·³ãè¿ããã®çŸè±¡ãšãããåãé€ãæ¹æ³ã®ç 究ïŒVHDLïŒïŒ
ããžã¿ã«IIRãã£ã«ã¿ãŒã®Verilogå®è£
Verilogã RAMäžã®ããžã¿ã«ãã£ã«ã¿ãŒ
FPGAã¯ã·ã³ãã«ãŸãã¯DIY
ã¢ã«ãã©Cyclone III FPGA VGAã¢ããã¿ãŒ
CPUã®ç 究ãšãã®æ©èœã·ãã¥ã¬ãŒã·ã§ã³
NESãFPGAã§ã®å®è£
FPGAãããªæ°åŠé¢æ°ã®çæ
VerilogããŒããŠã§ã¢çªå·ãœãŒã¿ãŒ
ã·ã³ãã«ãªSDR FPGAã¬ã·ãŒããŒ
FPGAã¹ã¿ã³ãã¢ãã³SDRã¬ã·ãŒããŒ
éçºè ã®10Gã€ãŒãµããããã¥ãŒ
ã·ã³ãã«ãªFM FPGAããŒã¹ã®ãã©ã³ã¹ããã¿ãŒ
FPGAã§ãããªã¹ãäœæãã
FPGAã®ææµ·è
FPGAã§IBM PCãäœæãã
PS
ãã®å Žæãèªãã§ãããã¿ããªã«æè¬ããŸãã ãã®èšäºã§ãFPGAã®åäœãšäœ¿çšã®ååãå°ãªããšãå°ãè¿ããªããããç解ãããããªãããšãé¡ã£ãŠããŸãã ãããŠãå®éã®ãããžã§ã¯ãã§ã®ã¢ããªã±ãŒã·ã§ã³ã®äŸãšããŠã