[HN Gopher] Open-source high-performance RISC-V processor ___________________________________________________________________ Open-source high-performance RISC-V processor Author : burakemir Score : 227 points Date : 2023-03-26 10:32 UTC (12 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | rwmj wrote: | The license in case anyone was wondering: | https://spdx.org/licenses/MulanPSL-2.0.html Seems BSD-ish and it | is approved by OSI: https://opensource.org/license/mulanpsl-2-0/ | eyyheidihfvv wrote: | [flagged] | eyyheidihfvv wrote: | [flagged] | artemonster wrote: | are there any books to learn about advanced cpu design with | dispatch queues, microop schedulers, etc. the most I could find | would cover basics of CPU design, not advanced stuff. | DeathArrow wrote: | If China manages to reduce its dependency of US based tech like | CPUs, I wonder how this will affect the two economies. | | Would it be a viable idea to buy shares in China based tech | companies now? The thinking is that if CCP pushes something real | hard by investing large amounts of resources in it, the chances | are higher that they will succeed. Not tomorrow but in 10 or 20 | years. Conversely, if US based tech companies will have | competition, it is likely that their value will go down a bit at | one point. | | Also, it's possible that if China builds domestic silicon tech we | will see a race to the bottom if they will want to aggressively | price their products and try to undercut their competitors. Then | it might be a bad idea to own any shares in tech companies, no | matter where they are located. | bee_rider wrote: | Competition is good, if the US and China end up competing to | make more interesting CPUs, everybody wins. We're wasting a lot | of good brains in the US on ad companies and food delivery | apps, a real competitor to focus our attention would be great, | in my opinion. | DeathArrow wrote: | I never looked at it in good/bad terms, but you are, | probably, right. | | I was more interested in terms of investment. | tiedieconderoga wrote: | >Conversely, if US based tech companies will have competition, | it is likely that their value will go down a bit at one point. | | Keep thinking. If US tech firms don't have much competition | right now, they are not incentived to innovate or improve their | products. If they had more competition, they would need to put | up or shut up, rather than reaping profits from money they | might otherwise spend on R&D. | | Personally, I think that if you put competitive pressure on a | large and lazy incumbent, they will either increase in value or | fold outright. (Or convince politicians to bail them out, write | protectionist legislation, etc.) | DeathArrow wrote: | Yes, US companies will have the incentive to innovate and | better themselves. But my question is just about the material | outcomes: how will the shares of US and China based companies | be affected. | still_grokking wrote: | One more thing to consider: The new iron curtain, now called | "sanctions". | | My best guess currently would be that the US will try to outlaw | the competing market should one arise: The US will just forbid | its people and the people in the allied countries to make | business with China, like they do with a lot of other | countries, like Russia or Iran. | | It's unlikely this would happen immediately as the US is | currently still depended on China. But as the economic war | intensives walling-off will happen at some point. There are | already "sanctions" in place against Chinese companies in some | market areas. This will likely only worsen over time. | | You can still invest in China, sure. But you will be forced to | move there at some point, or loss everything over there, I | guess. | delusional wrote: | It's important to also consider how much you trust the CCP to | actually pay out your hypothetical shares, should they ever | become worth anything. It's possible that they may just | confiscate them (or outlaw foreigners from trading or something | similar). | DeathArrow wrote: | Are there precedents in which they didn't pay out? | loeg wrote: | There are examples where the CCP has materially reduced the | stock price (e.g., by forbidding the company from making a | profit) after it was marketed to western investors. And the | typical ownership structure (VIEs) is incredibly fragile. | As an individual I would not concentrate investment in | Chinese companies due to CCP risk. | | The SEC has this to say: | https://www.sec.gov/corpfin/disclosure-considerations- | china-... | | > Current regulations in China limit or prohibit foreign | investment in Chinese companies operating in certain | industries. For example, there are restrictions on foreign | ownership of telecommunications companies and prohibitions | on ownership of educational institutions.[7] To circumvent | these restrictions, many China-based Issuers form non- | Chinese holding companies that enter into contractual | arrangements, intended to mimic direct ownership, with | Chinese operating companies. Through these contractual | arrangements, the China-based Issuer is generally able to | consolidate the Chinese operating company, commonly | referred to as a variable interest entity or VIE, in its | financial statements, although whether the China-based | Issuer maintains legal control of the Chinese operating | company is a matter of Chinese law. Under this structure, | the Chinese operating company, in which the China-based | Issuer cannot hold an equity interest, typically holds | licenses and other assets that the China-based Issuer | cannot hold directly. | | > These China-based Issuer VIE structures pose risks to | U.S. investors that are not present in other organizational | structures. For example, exerting control through | contractual arrangements may be less effective than direct | equity ownership, and a company may incur substantial costs | to enforce the terms of the arrangements, including those | relating to the distribution of funds among the entities. | Further, the Chinese government could determine that the | agreements establishing the VIE structure do not comply | with Chinese law and regulations, including those related | to restrictions on foreign ownership, which could subject a | China-based Issuer to penalties, revocation of business and | operating licenses, or forfeiture of ownership interests. | | > Legal claims, including federal securities law claims, | against China-based Issuers, or their officers, directors, | and gatekeepers, may be difficult or impossible for | investors to pursue in U.S. courts. Even if an investor | obtains a judgment in a U.S. court, the investor may be | unable to enforce such judgment, particularly in the case | of a China-based Issuer, where the related assets or | persons are typically located outside of the United States | and in jurisdictions that may not recognize or enforce U.S. | judgments. | | And of course, see Levine on the subject: | | https://www.bloomberg.com/news/newsletters/2021-07-07/money | -... | | https://www.bloomberg.com/opinion/articles/2021-08-02/chine | s... | DeathArrow wrote: | Even then, you can make some money by indirectly | investing in China's tech infrastructure by buying shares | in a company that will buy and use hardware made in | China. | HopenHeyHi wrote: | > The thinking is that if CCP pushes something real hard by | investing large amounts of resources in it, the chances are | higher that they will succeed. Not tomorrow but in 10 or 20 | years. | | China's ASML is Years and Years Behind: | https://www.youtube.com/watch?v=DtOyW-JpJjM | | tl;dw - Nope. Can't just throw money at this problem. | DeathArrow wrote: | If a Chinese company isn't directly under US sanctions like | Huawei is they can still use TSMC to fab chips. | sitkack wrote: | 28nm can cover the vast majority of chip production needs for | the next 5-10 years. Most things don't need an advanced node. | | By the time SMEE is hitting 5nm, processes for 3d will be | mature. I wouldn't discount any of this at this point. | eunos wrote: | 28nm with multi patterning can go to lower process node. | SMIC has experience up to 7nm for that. I think early TSMC | 7nm used DUV. | mnau wrote: | SMEE won't be making EUV, it has it's hands full of DUV. | | Chinese Academy of Sciences will (a spinoff company for | commercialization), they publish research papers on EUV and | so on. | | Multiple project are being developed in parallel. | DeathArrow wrote: | Yes, I know. I didn't say SMEE will create EUV, I said | China will. I don't think differentiation between various | industrial arms of CCP is of importance. | | Right now they've made bets on a large scale of different | technologies. Many of them failed already. Probably they | will focus on a few and succeed in a not very long time | scale. | DeathArrow wrote: | 28nm is good for everything besides mobile, desktop and | server which is a huge market. | | I guess China will crack EUV in some time. | TheLocksmith wrote: | Has somebody compare-able DMips/Mhz numbers for: | | * Intel i7-4600U CPU DMips/Mhz (I found about 10 DMips/Mhz) | | * RISC-V VRoom = 10.3 DMips/MHz (still in development) | | * RISC-V XiangShan = ? | | * RISC-V others ? | sylware wrote: | with out-of-order and branch predicting CPUs, those metrics are | highly questionable. | | Better "benchmark" real stuff: CPU bound AAA games, etc. | nine_k wrote: | Most AAA games have not been ported to RISC-V yet. | | But I bet pytorch has been, and also openCV and other | compute-heavy stuff. (And Doom, of course.) | mhh__ wrote: | I'm guessing pytorch probably doesn't branch as much as a | game. | | One of the best "real" Benchmarks is compiling the Linux | kernel, the issue is that on an emulator/verilog simulator | that could take a very long time. | [deleted] | drmpeg wrote: | I also use this benchmark for a real world estimate. | Here's some numbers. For the pretty ginormous Ubuntu | kernel config for RISC-V, it's 7.5 hours on the HiFive | Unmatched (at 1.5 GHz) versus 25 minutes cross compiled | on a E5-1650 V4 Dell box. | tormeh wrote: | Tangential, but I'm intrigued to see Chisel having such success. | Can anyone in the know comment on how it's doing and what impact | it has in the hardware industry? | snvzz wrote: | I understand SiFive uses it heavily. | jvican wrote: | Interested in this as well. Also curious how it fares in | comparison with BlueSpec and other technologies in this space | (like HardCaml). | londons_explore wrote: | Odd choice to do hardware design in scala... | | I wasn't aware of any other big players doing this... I suspect | it will limit the impact this project can have if industry can't | adopt it easily into existing processes. | still_grokking wrote: | Almost all of RISC-V is Scala land! | | Scala has actually some stand in HW development and high- | performance computing. See also https://spatial-lang.org/ which | is another Scala DSL, this time for accelerators. | | Scala in general is a much underrated language. One of the most | powerful high level languages, but with a concise and very | clean core. Since the new syntax was introduced in version 3 it | even looks amazingly beautiful. | | I know, people (frankly especially here on HN) are repeating | some FUD about this language, but this are usually issues | solved a decade ago. | | People should really reconsider trying out Scala. Especially | the new major version 3. | | https://virtuslab.com/blog/the-most-common-scala-myths-debun... | tasuki wrote: | > Odd choice to do hardware design in scala... | | Why? (I know nothing about hardware design, but know a thing or | two about Scala. All the languages better than Scala are used | even less than Scala.) | rapiz wrote: | It's actually chisel. But github marks it as scala because | chisel is based on scala. | | Other HDL based on scala includes SpinalHDL. | | These two HDL are pretty welcomed because of opensource and | usability. You can find lots of projects in them. Notably | rocket-chip, which is also in chisel. | https://github.com/chipsalliance/rocket-chip | | They're around for a while but still young and some people are | pushing for adoption. | monocasa wrote: | It is scala. Chisel is just a scala framework. Conceptually | it's not quite an HDL but instead a scala program that | metaprograms the actual RTL netlist. So there's no chisel | compiler other than the standard scala one that comes with | sbt; you then run the resulting chisel program on your | computer to generate the netlist. | phendrenad2 wrote: | It's scala + a DSL called "chisel" that you write by | chaining scala keywords and symbols in the right order. | | There, solved it once and for all. :) | georgelyon wrote: | This is not strictly true anymore as the low-level (FIRRTL) | compilation is powered by CIRCT | (http://GitHub.com/llvm/circt) which is built using MLIR | (part of the LLVM project: https://GitHub.com/llvm/llvm- | project) | dkjaudyeqooe wrote: | It's Chisel < https://www.chisel-lang.org/ > which runs on | Scala and generates synthesizable Verilog for hardware | implementation. | | It was created and used by the same group that created RISC-V | so it makes perfect sense. | | SiFive, arguably the biggest player in RISC-V, use Chisel to | design their processors. | blacklion wrote: | I wonder, which instruction fusions are implemented, as it is key | to high-performance RISC-V and the reason not to have conditional | movs & alike in macro-ISA. | | Unfortunately, documentation for Micro-ISA is in Chinese only :-( | samvher wrote: | Why is that, that they are key to performance with RISC-V? And | why are they the reason not to have conditional moves? Would | love to know more! | jabbany wrote: | Frankly, these days machine translation is more than enough to | reproduce most technical documents at an acceptably high level | of accuracy. | | Fwiw, this is the relevant link: https://xiangshan- | doc.readthedocs.io/zh_CN/latest/frontend/d... | karasoft wrote: | [dead] | rapiz wrote: | This is part of China's effort to have its own IC industry. The | project is now owned by BOSC, Beijing Open Source Chip Research | Instiutute[1] | | [1] https://www.bosc.ac.cn/yjyjs | RobotToaster wrote: | It's impressive how quickly they seem to have embraced open | source. | pstoll wrote: | You mean the "contributing" part of OSS? | RobotToaster wrote: | Well, yes. | | I was more talking about the government though, which isn't | otherwise famous for it's love of openness. I'm not aware | of any government currently promoting FOSS/FOSH as much as | China's is. | totalhack wrote: | Was gonna flag this same thing. Maybe their hoping for help | from the open source community? | DeathArrow wrote: | China has a very diverse mix of technology. They use x86, ARM, | MIPS, RISC-V and others. I don't know if splitting the efforts | in many different directions makes sense. | snek_case wrote: | China is a huge country with a much bigger hardware industry | than the US. Seems to me it's normal not everyone there is | working with the same technology. It's just a massive number | of different companies doing different things. | | That being said, RISC-V is gaining a lot of traction. I | wouldn't be surprised if it starts to become a real challenge | to ARM in the next five years. You just need mature tooling | and better cores. Probably also need a wider variety of | smaller cores for embedded applications available at the | right price points. | sylware wrote: | Sad this is tainted by the current US-china conflict on chip | manufacturing. | | But there are good guys everywhere (and bad too), and anything | pushing a world-wide royalty free modern ISA toward "real-life" | usage does its part. | | I hope one day I'll buy a AAA game, with a noscript/basic (x)html | browser and play it on highly performant RISC-V CPU. | | Don't forget, the bad guys hate simple but able to do a good | enough job, stable in time standards. | marcodiego wrote: | > I hope one day I'll buy a AAA game, with a noscript/basic | (x)html browser and play it on highly performant RISC-V CPU. | | What a dream! I'd add the game would be open source; don't care | about the art though. | DeathArrow wrote: | China already surpassed US economy according to some studies. And | it was at 1/100 of US economy tens of years ago. | | Part of this rise to power is due to US companies investing | there, buying and giving know-how in the process, but the huge | part is they've built some of the world best learning systems, | the state is massively investing in education, they invest more | than any other country in research. And, perhaps one of the | biggest factors, unthinkable in the West, is that Chinese | economic entities are cooperating instead of being secretive. If | one Chinese company will develop something, you can bet the rest | will learn that fast and will use it in the next economic cycle. | In China all knowledge is in fact a big open source scheme. Every | new startup can benefit from the know how, experience and | research done by others. This accelerates accomplishments like | crazy. | | So, to recap: CCP makes good plans for very large time scales, | they have one of best education systems, they try to educate as | much people as possible, they invest heavily in research, | companies are more likely to cooperate instead of competing, | knowledge is shared. | | It's a perfect recipe for success. And I just wonder why other | countries can't apply the same recipe. | still_grokking wrote: | > It's a perfect recipe for success. And I just wonder why | other countries can't apply the same recipe. | | Because in capitalistic market economies you need to compete. | This is a law of nature! Or something like that... /s | | I would indeed like to see how this works in reality on side in | China. But China has one big issue: Its written language. This | is something that makes me really fear the idea to go there. If | they would just manage to finally switch to some proper writing | system, so even dumb boys like me could learn it, I would | invest some time and try to learn the language. But as long as | you need to memorize thousands of signs (and can't even use a | dictionary...) this is really off-putting. I'm dyslexic and | have already problems to write correctly in my mother tongue | (German), and had a very hard time to learn English. The second | most useful language to put effort in would be Chinese, sure. | But this writing system, oh boy... | | The Chines are smart and have a powerful government. Why can't | they make this Pinyin finally happen? It would make learning | reading and writing likely even easier for the still illiterate | people on the Chines country side. (And no, I don't buy the | argument that you need the signs to distinguish meaning for | things that sound alike. The spoken language has no signs and | it still works fine. And the whole language is anyway very | context depended, so you need to think about the meanings of | words or phrases quite precisely anyway.) | tomcam wrote: | Why convert to Pinyin? Simplified Chinese is about 80% more | efficient. How would you like to see every piece of English | take up 400% more space? | | The more I think about your comment the more I suspect you're | trolling, though. Good work! | DeathArrow wrote: | Well I was formally diagnosed with dislexia and ADHD, which | is worse. I can tell you what I did. I worked hard, read a | lot, taught myself to finish projects. And I did lots of | accomplishments and way more than my peers without ADHD. | tomcam wrote: | Yeah no. The education system you're referring to is optimized | strictly for performance on standardized tests. From a very | early age kids are trained to answer test questions, not to | understand those questions or how to apply them in real life. | It has been this way in China for thousands of years; their | civil service exams were the only way to move ahead of your | station in life without connections. | | Innovating is not done in polite company in China. If you come | up with a clever new way of doing something, there is an | extremely high possibility that your superiors will suppress it | on the off chance that it could embarrass them ("lose face"). | | These big long term plans you're referring to exist, but in the | plane of reality you imagine. There is nothing like a | meritocracy in the CCP. That is even more true now than 10 | years ago, because Xi has systematically removed dissenting | voices in what you have heard is an anti-corruption campaign. | Companies like Blackrock, and Boeing are breathtakingly corrupt | and are taking us taxpayers for a huge ride. But they can | usually do a pretty competent job of getting the job done. They | are run by technocrats, who often have an engineering | background. | | Imagine if the top 10 levels or so of any of these companies | were nothing but connected people and their friends and | children. That's what happens to all of these projects in | China. China can't build a 5m chip or a new type of wing or a | useful new programming language. Most of the people who could | even do that job are either out of the country or unable to be | recognized for their work. | ivzhh wrote: | Professor Bao of the OpenXiangShan team is known for his | outspokenness, particularly in advocating for the academic model | of the RISELab at UC Berkeley, which he often refers to as "Open | Source Heavy Industry". As a result, he is a strong proponent of | the OpenXiangShan project, as he firmly believes that it is the | ideal means of producing high-quality research. | DeathArrow wrote: | All research in China is publicly shared. And while it is | encouraged by the CCP is not demanded by law. It's a cultural | fact and any entity in China can learn about R&D done by any | entity, no matter if state owned or public owned, provided it | is not classified as a secret. | | Taking this precept down, they don't care about IP. If one | Chinese company makes a product, in a few weeks you can find | lots of different Chinese companies selling the same product on | Aliexpress. Some of better quality, some cheaper, some with | added functionality some with less functionality. | | If you are to give your hardware design to a Chinese company | and order a heavy lot you might have a good deal. But if your | product is kind of successful, you shouldn't wonder if you see | a lot of alternatives offered on Aliexpress by seemingly | increasing unknown companies for a good rebate. | panick21_ wrote: | Some people might be interested in Ocelot: | | https://github.com/tenstorrent/riscv-ocelot | | Its basically the evolved BOOM Core from Berkley but with a full | RISC-V Vector Unit attached. | | I had really hoped more people put more investment in BOOM. | skavi wrote: | by boom core, do you mean the latest "sonic boom"? | panick21_ wrote: | Yes, I'm not aware of anything after that: | | https://carrv.github.io/2020/papers/CARRV2020_paper_15_Zhao.. | .. | eunos wrote: | I'm more interested that they also developed an agile methodology | for Hardware development here | https://github.com/OpenXiangShan/XiangShan-doc/blob/main/pub... . | rektide wrote: | I'm squinting a lot to draw a net conclusion, but clearly a | massive focus on testing & simulators. | | They notably seem to be validating & simulating C/C++ targets | for a lot of this. | | They have a great breakdown of the tools they've used & build. | Chisel, out of Berkeley, lies at the heart of almost | everything. But they have reams of new tools they've madd. | There's over a dozen simulators or tester pieces they said | they've made. Which is epic, and makes total sense. | | Great paper thanks for sharing. I quickly scanned their gitbub | repos. A lot of these tools probably arent iterated on as much | & I just haven't got to them yet. The paper claims the | overarching development structure is embodied on a tool MinJie, | which the paper says is open source. Fantastic, fingers crossed | 50%+ of the tooling here is available. | | I also feel like the US's OpenROAD deserves some shout out as | related, relying on extremely good design checking/validators | to be so agile at chipmaking that ML can spit out designs en | mass & then we can run loss checks to find out how working the | various designs are. Millions of monkeys on typewriters style | ultra agile. | snvzz wrote: | Another very high performance effort is VRoom![0]. | | As of the latest update in the blog, they are at 10.3 DMips/MHz. | | 0. https://moonbaseotago.github.io/ | tyingq wrote: | >they are at 10.3 DMips/MHz | | I understand Dhrystone isn't everything, but that's pretty | impressive, and up there with high performance CPUs from the | established players. | codedokode wrote: | As I understand that is performance in a simulator, and it is | unknown what delays are going to be between pipeline stages | on real hardware. | gchadwick wrote: | 'Isn't everything' is a huge understatement. It's a | performance nice smoke test for a CPU in that if it isn't | hitting the numbers you'd expect given the microarchitecture | (issue width etc) you know there's a problem and due to the | simplicity of the benchmark it shouldn't be hard to analyse | and track down. | | Though there's way more a modern high performance CPU needs | to do. It doesn't do anything meaningful to stress the memory | system for instance. Hitting good Drystone numbers is stage 1 | in a long process to building a modern high performance CPU. | tyingq wrote: | That's fair. Perhaps "is only an imperfect early indicator" | would have been better than "isn't everything". | rektide wrote: | The practically live blogging of this VRoom! core is such a | glorious thing to behold. | | Amazing work. And it's talked about!! We can see learn & follow | that. One of the most unique singular experiences in the modern | world, creating a high performance core, and we can read about | it, see the process unfold, see the team iterate. Gobsmackingly | amazing. | mdp2021 wrote: | Does anybody have a list of DMips/MHz per CPU results, for | comparison? ___________________________________________________________________ (page generated 2023-03-26 23:00 UTC)