SlideShare uma empresa Scribd logo
1 de 34
Bluespec 電気通信大学 大学院情報システム学研究科 三好健文 2010.08.31
 
Bluespec とは ,[object Object]
Verilog コードの生成 ,[object Object]
多数のライブラリ群 ,[object Object]
サーバレスポンス / リクエスト
なぜ、 Bluespec?? 生産性 速度 合成可能 教育コスト Bluespec ◎ ◎ ○ ?? C/C++/SystemC ○ ○ × ○ Verilog HDL △ ×/◎ ○ △
目次 ,[object Object]
Bluespec ツール群
Bluespec のいろいろ ,[object Object]
強力な型システム
ライブラリ探訪 ,[object Object]
Bluespec デザインコンテストのサンプル interface BubSort_IFC; method Action start(Vector#(5, int) a); method Vector#(5, int) result(); endinterface (* execution_order =&quot;disp, fin&quot; *) (* preempts = &quot;(swap_3, swap_2, swap_1, swap), fin&quot; *) (* synthesize *) module mkBubSort (BubSort_IFC); Vector#(5, Reg#(int)) x <- replicateM(mkReg(0)); Reg#(Bool) sorted <- mkDReg(False); rule disp ; $write(&quot;%2d : &quot;, $time); for (Integer i=0; i<5; i=i+1) $write(&quot;x[%0d]=%2d, &quot;, i, x[i]); $display(&quot;&quot;); endrule rule fin (x[0] != 0); sorted <= True; endrule for (Integer i=0; i<4; i=i+1) begin rule swap ((x[i] > x[i+1])); x[i] <= x[i+1]; x[i+1] <= x[i]; endrule end method Action start(Vector#(5, int) a); writeVReg(x, a); endmethod method Vector#(5, int) result() if (sorted); return readVReg(x); endmethod endmodule http://www.cybernet.co.jp/bluespec/documents/Sort_Sample.pdf
Bluespec デザインコンテストのサンプル interface BubSort_IFC; method Action start(Vector#(5, int) a); method Vector#(5, int) result(); endinterface (* execution_order =&quot;disp, fin&quot; *) (* preempts = &quot;(swap_3, swap_2, swap_1, swap), fin&quot; *) (* synthesize *) module mkBubSort (BubSort_IFC); Vector#(5, Reg#(int)) x <- replicateM(mkReg(0)); Reg#(Bool) sorted <- mkDReg(False); rule disp ; $write(&quot;%2d : &quot;, $time); for (Integer i=0; i<5; i=i+1) $write(&quot;x[%0d]=%2d, &quot;, i, x[i]); $display(&quot;&quot;); endrule rule fin (x[0] != 0); sorted <= True; endrule for (Integer i=0; i<4; i=i+1) begin rule swap ((x[i] > x[i+1])); x[i] <= x[i+1]; x[i+1] <= x[i]; endrule end method Action start(Vector#(5, int) a); writeVReg(x, a); endmethod method Vector#(5, int) result() if (sorted); return readVReg(x); endmethod endmodule 外部へのエクスポート と実装 http://www.cybernet.co.jp/bluespec/documents/Sort_Sample.pdf
Bluespec デザインコンテストのサンプル interface BubSort_IFC; method Action start(Vector#(5, int) a); method Vector#(5, int) result(); endinterface start result int int int int int int int int int int BubSort_IFC start() result()
Bluespec デザインコンテストのサンプル interface BubSort_IFC; method Action start(Vector#(5, int) a); method Vector#(5, int) result(); endinterface (* execution_order =&quot;disp, fin&quot; *) (* preempts = &quot;(swap_3, swap_2, swap_1, swap), fin&quot; *) (* synthesize *) module mkBubSort (BubSort_IFC); Vector#(5, Reg#(int)) x <- replicateM(mkReg(0)); Reg#(Bool) sorted <- mkDReg(False); rule disp ; $write(&quot;%2d : &quot;, $time); for (Integer i=0; i<5; i=i+1) $write(&quot;x[%0d]=%2d, &quot;, i, x[i]); $display(&quot;&quot;); endrule rule fin (x[0] != 0); sorted <= True; endrule for (Integer i=0; i<4; i=i+1) begin rule swap ((x[i] > x[i+1])); x[i] <= x[i+1]; x[i+1] <= x[i]; endrule end method Action start(Vector#(5, int) a); writeVReg(x, a); endmethod method Vector#(5, int) result() if (sorted); return readVReg(x); endmethod endmodule 条件を満たすときに実行される 組み合わせ回路 http://www.cybernet.co.jp/bluespec/documents/Sort_Sample.pdf
Bluespec デザインコンテストのサンプル for (Integer i=0; i<4; i=i+1) begin rule swap ((x[i] > x[i+1])); x[i] <= x[i+1]; x[i+1] <= x[i]; endrule end rule swap ((x[0] > x[1])); x[0] <= x[1]; x[1] <= x[0]; endrule rule swap ((x[1] > x[2])); x[1] <= x[2]; x[2] <= x[1]; endrule rule swap ((x[3] > x[4])); x[3] <= x[4]; x[4] <= x[3]; endrule ... forは繰り返しではなくて生成文
Bluespec デザインコンテストのサンプル interface BubSort_IFC; method Action start(Vector#(5, int) a); method Vector#(5, int) result(); endinterface (* execution_order =&quot;disp, fin&quot; *) (* preempts = &quot;(swap_3, swap_2, swap_1, swap), fin&quot; *) (* synthesize *) module mkBubSort (BubSort_IFC); Vector#(5, Reg#(int)) x <- replicateM(mkReg(0)); Reg#(Bool) sorted <- mkDReg(False); rule disp ; $write(&quot;%2d : &quot;, $time); for (Integer i=0; i<5; i=i+1) $write(&quot;x[%0d]=%2d, &quot;, i, x[i]); $display(&quot;&quot;); endrule rule fin (x[0] != 0); sorted <= True; endrule for (Integer i=0; i<4; i=i+1) begin rule swap ((x[i] > x[i+1])); x[i] <= x[i+1]; x[i+1] <= x[i]; endrule end method Action start(Vector#(5, int) a); writeVReg(x, a); endmethod method Vector#(5, int) result() if (sorted); return readVReg(x); endmethod endmodule finが呼ばれる前に swap_3~swap_1が実行され 安定するまでfinの実行が待たされる http://www.cybernet.co.jp/bluespec/documents/Sort_Sample.pdf
目次 ,[object Object]
Bluespec ツール群
Bluespec のいろいろ ,[object Object]
強力な型システム
ライブラリ探訪 ,[object Object]
Bluespec システムツール群 > bsc -u -sim ram.bsv > bsc -sim -o sim.out -e tbBram tbBram.ba > bsc -verilog -g mkBram_Test ram.bsv
Bluespec システムツール群 ,[object Object]
RTL(Verilog HDL/VHDL) 他言語との連携
Bluespec システムツール群 他言語との連携(C) import &quot;BDPI&quot; function Bool my_and (Bool, Bool); unsigned char my_and (unsigned char x, unsigned char y); ,[object Object]
実際に呼び出される関数
Bluespec システムツール群 他言語との連携(Verilog) module mkVerilog_SRAM_model (clk, v_in_address, v_in_data, v_in_write_not_read, v_in_enable, v_out_data); parameter FILENAME = &quot;Verilog_SRAM_model.data&quot;; parameter ADDRESS_WIDTH = 10; parameter DATA_WIDTH = 8; parameter NWORDS = (1 << ADDRESS_WIDTH); input clk; input [ADDRESS_WIDTH-1:0] v_in_address; input [DATA_WIDTH-1:0] v_in_data; input v_in_write_not_read; input v_in_enable; output [DATA_WIDTH-1:0] v_out_data; ... endmodule 呼び出されるモジュール
Bluespec システムツール群 他言語との連携(Verilog) import &quot;BVI&quot; mkVerilog_SRAM_model = module mkSRAM #(String filename) (SRAM_Ifc #(addr_t, data_t)) provisos(Bits#(addr_t, addr_width), Bits#(data_t, data_width)); parameter FILENAME = filename; parameter ADDRESS_WIDTH = valueOf(addr_width); parameter DATA_WIDTH = valueof(data_width); method request (v_in_address, v_in_data, v_in_write_not_read) enable (v_in_enable); method v_out_data read_response; default_clock clk(clk, (*unused*) clk_gate); default_reset no_reset; schedule (read_response) SB (request); endmodule 呼び出すための準備
Bluespec システムツール群 FPGAによるシミュレーション(SCE-MI)
( 脱線 )FAME 分類 [0bit目] 0:Direct, 1:Decoupled [1bit目] 0:Full RTL, 1:Abstracted Machine [2bit目] 0:Single-Threade, 1:Multi-Threaded Level 000: Direct FAME (ex. Quickturn) Level 001: Decoupled FAME       (ex. Green Flash memory system) Level 011: Abstract FAME (ex. HAsim) Level 111: Multithreaded FAME (ex. RAMP Gold)
目次 ,[object Object]
Bluespec ツール群

Mais conteúdo relacionado

Mais procurados

ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
Little Tukta Lita
 
The mighty js_function
The mighty js_functionThe mighty js_function
The mighty js_function
timotheeg
 

Mais procurados (20)

04 sequentialbasics 1
04 sequentialbasics 104 sequentialbasics 1
04 sequentialbasics 1
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
 
Regular Expression (RegExp)
Regular Expression (RegExp)Regular Expression (RegExp)
Regular Expression (RegExp)
 
The mighty js_function
The mighty js_functionThe mighty js_function
The mighty js_function
 
C&cpu
C&cpuC&cpu
C&cpu
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
clang-intro
clang-introclang-intro
clang-intro
 
C++20 the small things - Timur Doumler
C++20 the small things - Timur DoumlerC++20 the small things - Timur Doumler
C++20 the small things - Timur Doumler
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th Study
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
 
C++ CoreHard Autumn 2018. Concurrency and Parallelism in C++17 and C++20/23 -...
C++ CoreHard Autumn 2018. Concurrency and Parallelism in C++17 and C++20/23 -...C++ CoreHard Autumn 2018. Concurrency and Parallelism in C++17 and C++20/23 -...
C++ CoreHard Autumn 2018. Concurrency and Parallelism in C++17 and C++20/23 -...
 
Коварный code type ITGM #9
Коварный code type ITGM #9Коварный code type ITGM #9
Коварный code type ITGM #9
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical ReviewerC++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
 
DEF CON 23 - COLIN O'FLYNN - dont whisper my chips
DEF CON 23 - COLIN O'FLYNN - dont whisper my chipsDEF CON 23 - COLIN O'FLYNN - dont whisper my chips
DEF CON 23 - COLIN O'FLYNN - dont whisper my chips
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzer
 
1 introducing c language
1  introducing c language1  introducing c language
1 introducing c language
 

Destaque (7)

Ptt391
Ptt391Ptt391
Ptt391
 
Vyatta 201310
Vyatta 201310Vyatta 201310
Vyatta 201310
 
Fpga local 20130322
Fpga local 20130322Fpga local 20130322
Fpga local 20130322
 
Bluespec @waseda(PDF)
Bluespec @waseda(PDF)Bluespec @waseda(PDF)
Bluespec @waseda(PDF)
 
Google 20130218
Google 20130218Google 20130218
Google 20130218
 
Fpgax 20130604
Fpgax 20130604Fpgax 20130604
Fpgax 20130604
 
Fpgax 20130830
Fpgax 20130830Fpgax 20130830
Fpgax 20130830
 

Semelhante a Bluespec @waseda

Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
 
ISCA Final Presentaiton - Compilations
ISCA Final Presentaiton -  CompilationsISCA Final Presentaiton -  Compilations
ISCA Final Presentaiton - Compilations
HSA Foundation
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
Abed Bukhari
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
knight1128
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
sean chen
 

Semelhante a Bluespec @waseda (20)

An Overview of SystemVerilog for Design and Verification
An Overview of SystemVerilog  for Design and VerificationAn Overview of SystemVerilog  for Design and Verification
An Overview of SystemVerilog for Design and Verification
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
Hands on clang-format
Hands on clang-formatHands on clang-format
Hands on clang-format
 
ISCA Final Presentaiton - Compilations
ISCA Final Presentaiton -  CompilationsISCA Final Presentaiton -  Compilations
ISCA Final Presentaiton - Compilations
 
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing Speed
 
Whats new in_csharp4
Whats new in_csharp4Whats new in_csharp4
Whats new in_csharp4
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
 
Microkernel Development
Microkernel DevelopmentMicrokernel Development
Microkernel Development
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 
Getting started cpp full
Getting started cpp   fullGetting started cpp   full
Getting started cpp full
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 

Mais de Takefumi MIYOSHI

Mais de Takefumi MIYOSHI (20)

ACRi_webinar_20220118_miyo
ACRi_webinar_20220118_miyoACRi_webinar_20220118_miyo
ACRi_webinar_20220118_miyo
 
DAS_202109
DAS_202109DAS_202109
DAS_202109
 
ACRiルーム1年間の活動と 新たな取り組み
ACRiルーム1年間の活動と 新たな取り組みACRiルーム1年間の活動と 新たな取り組み
ACRiルーム1年間の活動と 新たな取り組み
 
RISC-V introduction for SIG SDR in CQ 2019.07.29
RISC-V introduction for SIG SDR in CQ 2019.07.29RISC-V introduction for SIG SDR in CQ 2019.07.29
RISC-V introduction for SIG SDR in CQ 2019.07.29
 
Misc for edge_devices_with_fpga
Misc for edge_devices_with_fpgaMisc for edge_devices_with_fpga
Misc for edge_devices_with_fpga
 
Cq off 20190718
Cq off 20190718Cq off 20190718
Cq off 20190718
 
Synthesijer - HLS frineds 20190511
Synthesijer - HLS frineds 20190511Synthesijer - HLS frineds 20190511
Synthesijer - HLS frineds 20190511
 
Reconf 201901
Reconf 201901Reconf 201901
Reconf 201901
 
Hls friends 201803.key
Hls friends 201803.keyHls friends 201803.key
Hls friends 201803.key
 
Abstracts of FPGA2017 papers (Temporary Version)
Abstracts of FPGA2017 papers (Temporary Version)Abstracts of FPGA2017 papers (Temporary Version)
Abstracts of FPGA2017 papers (Temporary Version)
 
Hls friends 20161122.key
Hls friends 20161122.keyHls friends 20161122.key
Hls friends 20161122.key
 
Slide
SlideSlide
Slide
 
Synthesijer and Synthesijer.Scala in HLS-friends 201512
Synthesijer and Synthesijer.Scala in HLS-friends 201512Synthesijer and Synthesijer.Scala in HLS-friends 201512
Synthesijer and Synthesijer.Scala in HLS-friends 201512
 
Das 2015
Das 2015Das 2015
Das 2015
 
Microblaze loader
Microblaze loaderMicroblaze loader
Microblaze loader
 
Reconf 201506
Reconf 201506Reconf 201506
Reconf 201506
 
Synthesijer jjug 201504_01
Synthesijer jjug 201504_01Synthesijer jjug 201504_01
Synthesijer jjug 201504_01
 
Synthesijer zynq qs_20150316
Synthesijer zynq qs_20150316Synthesijer zynq qs_20150316
Synthesijer zynq qs_20150316
 
Synthesijer fpgax 20150201
Synthesijer fpgax 20150201Synthesijer fpgax 20150201
Synthesijer fpgax 20150201
 
Synthesijer hls 20150116
Synthesijer hls 20150116Synthesijer hls 20150116
Synthesijer hls 20150116
 

Bluespec @waseda