Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RISC-Vをさわってみた

 RISC-Vをさわってみた

2018-06-24 関西Debian勉強会+LinuxKernel勉強会 のLT大会ではなした内容です。
RISC-Vの紹介と、Debianのriscv64ポーティングをQEMUで動かしてみた、的な内容です。

スライド中にいっぱいリンクがはってあるので、ご興味あればpdfをダウンロードしたってください。

Katsuki Kobayashi

June 24, 2018
Tweet

More Decks by Katsuki Kobayashi

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ ▶ খྛͱ͍͍·͢ ▶ ࢓ࣄ: ૊ΈࠐΈϑΝʔϜ΢ΣΞ԰ • C ͱ ARM

    ΞηϯϒϥͰ itron ϓϩάϥϜ • ࠷ۙ Linux ͷ೾͕ฐࣾʹ΋ԡ͠دͤΔ!! • ࠷ۙ͸࢓ࣄͰ΋গ͠ Linux ΧʔωϧͷίʔυΛಡΜͩΓ΋ ▶ Linux ͸ͣͬͱ Debian • ܟᥑͳ৴ऀ େֶ࣌୅ͷઌഐୡͷ෍ڭʹΑΔ
  2. RISC-Vͱ͸ (1/5) ▶ ࠷ۙྲྀߦͬͯΔΒ͍͠ RISC-V Λͪΐ ͬͱௐ΂ͯΈͨ • ARM ʹ΋๞͖ͨ͠

    • ෇͚মਕͳͷͰଟগӕݴͬͯͯ΋ڐ͍ͯͩ͘͠͞ ▶ ෮श: ͦ΋ͦ΋ RISCͬͯ • ISA(໋ྩηοτΞʔΩςΫνϟ) ͷҰछͰ໋ྩͷछྨΛݮΒ͠ ճ࿏Λ୯७Խͯ͠ԋࢉ଎౓ͷ޲্Λਤͬͨ − RISC : Reduced Instruction Set Computer − CISC : Complex Instruction Set Computer
  3. RISC-Vͱ͸ (2/5) ▶ ಡΈํ: Γ͘͢;͍͊Ϳ (pronounced “riskfive”) ▶ ΧϧϑΥϧχΞେֶόʔΫϨʔߍͷܭࢉػՊֶՊൃ •

    ύλϔωɾϔωύλͷύλ͜ͱσΠϏουɾύλʔιϯઌੜ • RISCͬͯݴ༿Λਁಁͤͨ͞ਓୡ͕ ͜Ε·ͰʹಘΒΕͨ஌ݟͰ΋͏Ұճຊؾग़ͯ͠Έͨײ͡ͷ ISA ▶ ϑϦʔͰΦʔϓϯͳ ISA • ݩʑ͸ڭҭ༻ • ʮউखʹਓͷ໋ྩηοτͷ CPU Λ࡞Δͱେମૌ͑ΒΕΔʯ podcast: Misreading Chat ΑΓҾ༻
  4. RISC-Vͱ͸ (3/5) ▶ ࠷ۙ Podcast Ͱ࿩୊ʹ্͕ͬͯͨΓ • Misreading Chat: Ep.5

    Agile CPU / Versioned Golang • Turing Complete FM: Ep. 2. Nintendo Switch ͷΤϛϡϨʔλ ͷ։ൃ... • Rebuild: After Show 153. Exit Route to Vancouver − ήετ͕ Turing Complete FM ͷ rui314 ͞Μ ▶ Debian ͷϙʔςΟϯά·ͰਐΜͰ͍Δ (ޙड़) ▶ ࢀߟهࣄ • WDɺ2019 ೥͔Β NAND/HDD ͷίϯτϩʔϥΛॱ࣍ RISC-V ϕʔεʹҠߦ
  5. RISC-Vͱ͸ (4/5) ▶ ଞʹ΋ϑϦʔͳ ISAͬͯͳ͔ͬͨ? • OpenSPAC − UltraSPARC T1

    ͷ RTL ίʔυ (Verilog) ͕ GPL Ͱ഑෍ − LEON Έ͍ͨͳϓϩδΣΫτ͕ଘࡏ • OpenRISC ▶ όʔΫϨʔͷਓ͸͜ΜͳࣄΛݴͬͯ·͢ (ߨԋࢿྉ: Instruction Sets Want to be Free!) • Competing in microprocessor era now in SoC era
  6. RISC-Vͱ͸ (5/5) ▶ ϑϦʔͰ͋Δ͜ͱҎ֎ͷ RISC-V ͷओͳಛ௃ • 128-bit ͷΞυϨεۭؒ΋αϙʔτ (32,

    64, 128) • جຊ ISA ͱඪ४֦ுͱΧελϜ֦ு − جຊ ISA: RV32E, RV32I, RV64I, RV128I − ϛχϚϜͩͱ໋ྩ͕ 50 ݸ − ඪ४֦ு: IMAFDQ (G=IMAFD) − ΧελϜ໋ྩ༻ͷ໋ྩϑΟʔϧυ͕༧໿͞Ε͍ͯΔ • ಛݖϞʔυ΋ M-mode ͚ͩඞਢͰɺଞ͸ະ࣮૷΋Ͱ͓ k − Machine-mode, Supervisor-mode, User-mode
  7. RISC-Vͷঢ়گ (1/3) ▶ πʔϧνΣʔϯͷঢ়گ • binutils: upstreamed (2.28) • gcc:

    upstreamed (7.1) • glibc: upstreamed (2.27) • linux kernel − 4.15 ͰҰ୴ೖ͕ͬͨɺυϥΠό͕ 4.16 Ҏ߱Ͱ৭ʑೖΔ໛༷ • gdb: not upstreamed yet − Ͱ΋ಈ͘ίʔυ͸ެ։͞ΕͯΔ • qemu: upstreamed (2.12)
  8. RISC-Vͷঢ়گ (3/3) ▶ ࣮ػͱ͔΋Ͱ͖͖ͯͯΔΑ ▶ HiFive Unleashed • The world

    ʟ s first RISC-V-based, Linux-capable development board • 999$! 2018-06-30 ship! (US ֎͸+40$) ▶ Rocket Chip Generator • open-source Sysem-on-Chip design generator (RTL ͳͷͰ FPGA ʹ΋ LSI ʹ΋)
  9. Debianͷঢ়گ͸? (1/2) ▶ ͰɺզΒ͕ Debian ͰͷରԠ͸Ͳ͏ͳͬͯΔͷ? ▶ ͳʹ͔΋ͷ͍͢͝੎͍Ͱ ύοέʔδͷϙʔςΟϯά͕ਐΜͰ͍Δ •

    Manuel A. Fernandez Montecelo ͞Μ ͕ਫ਼ྗతʹ׆ಈ • ݩʑOpenRISC ͷϙʔςΟϯάΛ΍͍ͬͯͨਓ − OpenRISC ͷ gcc ͷύον͕ɺϥΠηϯεͷ໰୊Ͱ্ྲྀʹϚʔδ͞Εͳ ͍͜ͱ͕Θ͔ͬͯࣙΊͨ໛༷ (هࣄ) • άϥϑͷઆ໌ͰʮҰ൪Լͷઢʯͱ͔͋Δ͕ɺ࠷ۙ ia64 ௒͑ • ࢛͜͜൒ظͷਪҠ • SoftwareDesign ͷ΍·Ͷ͞ΜͷهࣄͰ΋औΓ্͛ΒΔ
  10. Debianͷঢ়گ͸? (2/2) ▶ Debian ͷ Wiki ϖʔδ ΛݟΔͷ͕ྑ͍Ͱ͢ • InstallingDebianOnSiFiveHiFiveUnleashed

    ͳΜͯϖʔδ΋طʹ ༻ҙ͞Ε͍ͯΔʜʜ ▶ جຊతʹ͸ QEMU Ͱࢼ͠·͢ • Debian ͷΠϝʔδ͸·ͩແ͍ͷͰɺ − ϖʔδͷϦϯΫ͔Β tarball Λམͱ͢ − debootstrap ౳Ͱࣗ෼Ͱ༻ҙ͢Δ