1. 程式人生 > >RISC-V雙週簡報0x13:想把事情做簡單可不是那麼簡單的事情(2018-03-16)

RISC-V雙週簡報0x13:想把事情做簡單可不是那麼簡單的事情(2018-03-16)

RISC-V 雙週簡報 (2018-03-16)

要點新聞:

  • QEMU、GDB和libffi併入主線
  • 歐洲主導的超算處理器或採用RISC-V
  • RISC-V的微控制器規範提案

RV新聞

RISC-V除錯標準公開徵求意見45天

RISC-V Debug Spec的公開徵求意見期為45天,從2月22日至4月8日。

這將是RISC-V基金會第一個從工作小組遞交的標準擴充套件草案。因為是第一次,所以整個流程還不是非常明確。現在已知的部分流程如下:

  • RISC-V成立工作小組。
  • 工作小組選取自己的主席和副主席,制定標準擴充套件草案的輪廓。
  • 當工作小組完成標準草案,草案向公眾(非基金會成員)公佈45天,蒐集意見。
  • 45天后,工作小組根據蒐集的意見,選擇做出改動然後遞交基金會審閱,或重新編寫草案重新公佈。
  • 如果草案被提交基金會,基金會根據草案和蒐集的而意見,投票。
  • 投票通過後,草案成為標準的一部分。

這個還是暫時的流程,關於45天公佈期之後流程,RISC-V基金會將很快在riscv.org上公佈細節。不過,已經確認,這45天是RISC-V標準擴充套件草案唯一的向所有人徵集意見的機會。如果基金會投票通過,草案成為標準,則很難再有大的改動。CNRV的RISC-V愛好者多次在微信群討論了除錯,特別是最近針對semi-host的部分。請相關愛好者務必抓住機會。如果意見足夠多,還是有可能被接受甚至重新一輪45天意見徵集的。

生態發展

RISC-V 的 QEMU port 進入主線

經過八個版本的patch,最近 Sifive的 Michael Clark 把QEMU的risc-v port 推進主線了! 期待之後更多軟體的發展。

RISC-V 的 gdb port 進入主線

Embecosm 的 Andrew Burgess 最近將 risc-v port 推進 gdb 的主線了! 期待 risc-v 的基礎軟體架構能越來越完整!

libffi 的risc-v port 合併主線

libffi 是 OpenJDK 以及 Dalvik 等軟體的基礎。Stefan O’Rear 最近將libffi 的 risc-v port成功推入主線。

OpenJDK Zero 的 risc-v port

Ed Nevill 最近開始了OpenJDK Zero 的 risc-v port。期待risc-v 軟體生態能早日支援 java。

技術討論

RISC-V微控制器規範(microprocessor profile)

GNU MCU Eclipse的作者Liviu Ionescu最近提出一個非常詳細的微控制器規範,用以明確定義微控制器的外設、時鐘、啟動過程、ABI等等硬軟體相關資訊。這對統一RISC-V微處理器在嵌入式和IoT領域的應用有很重要的意義。

現在的問題是,該微控制規範和Alex Bradbury和SiFive正在定一個64位系統的ABI規範不相容。 希望他們能迅速協調並制定出一個相容方案。

直接快取操作(explicit cache control)指令提案

直接快取操作(explicit cache control)指令提案 (第3版, 第4版, 第5版)

有時候不得不佩服外國人的堅持。繼去年8月份提出的第4版提案,Jacob Bachmeyer 最近又提出了直接快取操作指令的第5版!

直接快取操作指令擴充套件了FENCE指令還未用的指令空間。

第5版中的指令定義:(有區別的加粗)

  • FENCE(有的架構也叫barrier)
    • FENCE.I 原有的指令fence
    • FENCE.RD 帶區間的資料fence
    • FENCE.RI 帶區間的指令fence
  • 預取
    • MEM.PF(0-3) 這裡的數字標明預取資料的時間區域性性(temporal locality),3表示非常頻繁使用
    • MEM.PF.EXCL 預取資料並獲得可寫許可權
    • MEM.PF.ONCE 欲取資料並暗示只讀一次(assistant cache)
    • MEM.PF.TEXT 預取指令
  • 快取鎖定(把部分快取的區域變成scratchpad)
    • CACHE.PIN 鎖定資料區域
    • CACHE.UNPIN 解鎖資料區域
    • CACHE.PIN.I 鎖定指令區域 (Machine mode only)
    • CACHE.UNPIN.I 解鎖指令區域 (Machine mode only)
  • 快取清理(flush)
    • CACHE.WRITEBACK 強制寫回緩衝區域(但不失效)
    • CACHE.FLUSH 清除緩衝區域(寫回並失效)
  • 其他破壞性快取操作
    • MEM.DISCARD 直接失效快取區域(資料丟失,用於拋棄無用資料而避免寫回)
    • MEM.REWRITE 為寫操作直接初始化快取區域而不讀取資料(已知資料會被徹底覆蓋時,可以直接建立快取資料同時標記已修改)

直接快取操作對於高效能運算系統和嵌入式系統是非常重要的。 提案還沒有被收納入RISC-V正式指令集,看起來是因為對一些指令的副作用,特別是帶破壞性的指令,還不是完全清除。 RISC-V指令集仍然堅持,所有對快取的直接操作必須對軟體透明。也就是說,這些指令只能是hint,快取一定可以不遵照執行。

具體的討論可著重看這麼幾段:

實用資料

衚衕學的《大道至簡——RISC-V架構之魂》系列文章

蜂鳥處理器的作者胡振波同學最近發表了系列文章《大道至簡——RISC-V架構之魂》來深入淺出的介紹了RISC-V相關的內容,有興趣的同學歡迎移步它的公眾號。

LWN 上介紹 RISC-V 和 RISC-V Fedora port 的系列文章

Richard.W.M.Jones 開始在LWN上連載一系列關於risc-v 和 risc-v fedora的文章。目前,第一篇關於risc-v的介紹已經公開。Richard在文中介紹了risc-v 軟體的現況,以及risc-v 指令設計中的一些特點,像是:

Macro-op fusion v.s. Instruction extension

Although the architecture is (by design) simple, boring, and similar to others that have gone before, one interesting area is the approach to complex instructions such as specialized instructions for string handling, video decoding, or encryption.

Some of these may be implemented in future extensions. For others, the designers have expressed a preference not to add complex instructions to the specification but instead to rely on macro-op fusion for performance. (Note there is a patent claim on a limited version of this technique, although it expires in 2022.) Processors are expected to detect sequences of simpler instructions that together perform some complex operation (e.g. copying a string) and fuse them together at run time into a single more efficient macro operation. How this wish will meet reality is yet to be seen, but it does mean that, for now, writing a RISC-V emulator is relatively easy because there are only simple instructions.

Richard表示下一篇將開始介紹Fedora 是怎麼被移植到risc-v中的。敬請期待。

行業視角

Heterogeneous Hubbub

SemiEngineering的Ann Steffora Mutschler最近發表短評《Heterogeneous Hubbub: The combination of heterogenous architectures and RISC-V is encouraging new tool support for SoC teams》。文中主要是對Krste Asanovic做的一些訪談。

教授首先提到了過去常見的一個通用處理器(比如ARM)加一個專用處理器的做法。而現在,RISC-V的可擴充套件效能夠結合兩者的優勢,從而減少不必要的開銷。

“Really, the best energy efficiency you’re going to get for anything that has significant compute is going to be adding new functions, custom instructions to tackle that application domain. We made the base RISC-V ISA lean and clean, and easy to extend to add those special functions on the side. If you think about in the market previously, you basically had to pick either a general core that ran lots of software or some kind of configurable core that didn’t run all the software and usually you’d have to pair these two together. And then what happens is you’re shifting data between the two of them going between the general core and the accelerator; that also takes a lot of energy. Low power designs, the current systems most of the power and energy goes into shifting data around, so you want to minimize that traffic if you can.”

在採訪中,教授提到了他們對RISC-V指令集的簡潔性上所作出的努力。

Asanovic said, “I like to tell people we worked really, really hard to keep it simple. It’s not easy. We iterated many times on the design. We started in 2010 and froze the base ISA in 2014. Along the way we did about a dozen implementations, including the software, the compilers, the OS, everything, to try and trim the fat, and really get it as lean as we could, while still being efficient. I think people are surprised how well it performs given how small the instruction set is. The way we view it is that effort you save on designing the base core, you can spend on your power optimization. You have a given design effort budget for any project, and you can either spend it implementing and verifying a more complex instruction set or you can spend it tuning your design to lower the power.”

小編:相信很多是對於RISC-V都是抱著一種Yet Another RISC ISA的態度,那麼RISC-V真的又好又簡單麼?恐怕要你們使用者和處理器架構師來回答了?

EPI:歐洲雄心勃勃的Exascale級超算計劃

似乎這也是為什麼下次的RISC-V Workshop會在巴塞羅那的超算中心舉辦。European Processor Initiative (EPI),一個由20多個歐洲的廠商組成的合作聯盟將會得到約1.2億歐元的經費支援使用者開發超算用的處理器。

Europe has an ambitious plan to become a main player in supercomputing. The EuroHPC initiative is a joint undertaking with as one of its goals to construct an exascale supercomputer based on European technology. One of the core parts is a processor. Although there are several processor-related research projects, it is only now that an effort has started to build a production HPC processor with industry quality. This is done as part of a 120 million euro Framework Partnership Agreement (FPA) that has been awarded to a consortium of 23 partners. We talked to the project coordinator Philippe Notton from Atos to learn more about the “European Processor Initiative” as the project is called.

而RISC-V自然是一個上佳的選擇。當然,RISC-V在HPC領域還恐怕還需要不斷改進才能滿足其需求。

One of the goals of Europe is to create European technologies. This is also a key point for us. Because such a design cannot be 100% European in the end, since we have potential issues with the available factories for instance. We know that Europe is no longer producing memories, as another example. We are trying to bring as much European DNA as possible into the system. This makes the core selection challenging because there is no off-the-shelf core which is purely European. We have some micro-controllers technology coming from Europe but they are not powerful enough for this class of HPC design. That is why, as part of this consortium, we are going to start our own processor development which is based on RISC-V, and develop some IP’s and ecosystem around it. We do not start from zero, because there is some instruction set and elements which are ready. Unfortunately, it is not at HPC production level yet and it will take a couple of generations.

小編:國產超算領域的工程師們,你們怎麼看?

行業新聞

QuickLogic加入基金會

eFPGA廠商QuickLogic最近加入了RISC-V基金會。

暴走事件

三月

  • OpenEmbedded/Yocto on RISC-V 2018年3月12-14日,在ELC NA (Embedded Linux Conference North America 2018),來自Comcast的 Khem Raj 會給一場關於 OpenEmbedded/Yocto on RISC-V的演講。

五月

六月

  • CNRV的成員和愛好者們正在RISC-V基金會的支援下籌備一場線下活動,時間暫定為2018年6月30日,目前暫定在復旦大學舉行。有任何建議、意見和想法,都可以發郵件給群頭 [email protected]

  • 2nd CARRV 第二次CARRV workshop(Computer Architecture Research with RISC-V ) 將在6月2日和ISCA 2018共同舉辦。

招聘簡訊

CNRV提供為行業公司提供公益性質的一句話的招聘資訊釋出,若有任何體系結構、IC設計、軟體開發的招聘資訊,歡迎聯絡我們!

整理編集: 宋威、黃柏瑋、郭雄飛

歡迎關注微信公眾號CNRV,接收最新最時尚的RISC-V訊息!

CNRV微信公眾號