9 ms·
XiangShan – Open-source high performance RISC-V processor
- fithisux 2y agoBravo guys! Tremendous piece of work.
- paulsutter 2y agoIt important to be aware of the significant progress that China is making in AI, robotics, and processors, and admirable that they are open sourcing so much of it. It’s great work and an inspiration
- blackeyeblitzar 2y ago[flagged]
- codengine 2y ago[flagged]
- nine_k 2y agoQuite possibly the open-sourcing is a part of the success story. The Chinese culture is built around incessant reproducing and gradual improvement, which dates back at least to the times of Confucius. Some think it's mindless copycatting, but it's more about learning deeply and then standing on others' shoulders. It's the "fork this" attitude that meshes quite well with open source, but is understandably infuriating for IP-licensing / patents crowd. This doesn't mean that the openness extends easily to those outside China, its culture, and especially its language though.
- bpfrh 2y agoI don't see that much opensource coming from china. For example the popular arm rockchip offerings are so bad at contributing to mainline linux or even sharing documentation that the single person supporting them dropped it due to lack of fund and being unable to get any contact to share documentation. IMHO, chinese opensource does at best the same thing many western companies do: Opensource the things that are not you secret sauce/income, or things which would benefit you if people adopt them. With the added caveat that china in generally is notorious for not abiding by patent laws and copying.
- wakawaka28 2y agoIndeed, the Chinese often violate open source licenses and outright steal proprietary code from non-Chinese companies.
- holoduke 2y agoHuggingface rings a bell? 80% is coming from chinese reaearch.
- nine_k 2y agoI suspect that Rockchip has better documentation in Chinese, which may be not easy to locate if you're not fluent in Chinese and are not inside China. Upstreaming the kernel support has never been a breeze for any ARM designs, IIRC. But the custom kernels are GPL [1], aren't they? [1]:https://github.com/radxa/rockchip-bsp https://github.com/radxa/rockchip-bsp
- sitkack 2y ago> I don't see that much opensource coming from china. What you don't look for you don't see. I see a huge contribution in OSS from contributors based in China.
- miki123211 2y agoI think many companies in China have a different relationship with IP. They realize that people copy from each other, they will gladly copy from others and expect them to do the same, yet they realize that being hard-to-copy gives them a competitive advantage. In the west, being hard-to-copy often just means slapping a proprietary license on your software and not worrying about much else. THe "source available" model is a prime example, the software is trivial to copy in theory, but everybody knows there would be legal consequences, so nobody serious actually does it. In China, this doesn't work, so you have to obfuscate your code, build anti-reverse-engineering protections etc. This is similar to how the gaming market works in the west. There are plenty of great writeups on reverse-engineering Chinese apps and hardware, and their reverse-engineering protections are often far more elaborate than what those same apps would have if made by western companies.
- pantalaimon 2y ago
- Barrin92 2y ago>The Chinese culture is built around incessant reproducing and gradual improvement all successful cultures are, they're just divided on whether they admit it or not. Germany was late to industrialization and a lot of our businesses went to Britain under the pretense of doing business and copied chemical plant factory layouts one-to-one, but we like the "we're the country of engineers and thinkers" story much better than "we were a bit slow and ripped the British and French off". The Chinese just don't pretend. I've spent a lot of time in China and around FB's attempted Snapchat acquisition in tech circles there used to be the joke that FB is the most Chinese American company because of Zuckerberg's relentless copying. The valley works the exact same way, they're just more likely to pretend everything is the result of some boy genius making it up.
- cute_boi 2y agoI hope China don't follow all these IP/patents. They have harmed more imo.
- lenerdenator 2y agoIsn't RISC-V FOSS to begin with?
- gdiamos 2y agoThe instruction set is, not necessarily the implementation.
- Arnavion 2y agoThat said, an open ISA certainly invites people amenable to open-sourcing their implementations, which is why more exist for RISC-V than for x86 or ARM.
- sitkack 2y agoIf you try and make an OSS implementation of either, even using parts of the ISA where all the patents have expired and you will still get sued. The purpose of RISC-V was to have a boring, unencumbered ISA that everyone could freely implement. It was a patent play, not a technical advancement.
- deleted 2y ago[deleted]
- _bin_ 2y ago[flagged]
- WiSaGaN 2y agoIs there anything that the Chinese can do that's not seen as a threat to the American people?
- devsda 2y agoThe definiton is probably not $country == "China" but a lot closer to $country != "America".
- fisf 2y agoTo stop being a one party dictatorship would be a start.
- suraci 2y agoYou didn't realize you just used exactly the same excuse that the US used to threaten other countries for dozens of years, did you?
- fisf 2y agoYes. And liberal democracy (the US in particular) is far from perfect. But it is objectively better than a one party dictatorship. It is also less "threatening" from an international relations perspective.
- suraci 2y agoGreat, finally it's not in the name of God and human rights
- Over2Chars 2y agoObjectively better than a one-party dictatorship? On what measures?
- johnea 2y ago[flagged]
- m3kw9 2y agoWhat’s the strategy in open sourcing this?
- slongfield 2y agoThey presented at HotChips 2024: https://www.youtube.com/watch?v=4_R0S6piLA0&t=2114s https://www.youtube.com/watch?v=4_R0S6piLA0&t=2114s There, one of the things they mentioned was that they were hoping that RISC-V in general, and their cores in particular, becomes a platform for academic research. That way, cutting-edge things are shared in the open and the industry benefits globally. The optimistic view of this is that it's hoping for a better future for all. The cynical view is that open source is much harder to sanction/export control. The truth is probably somewhere in the middle.
- lenerdenator 2y ago[flagged]
- jazzyjackson 2y agoget off it. americans are not the only people in the world that can invent and innovate.
- blackeyeblitzar 2y agoBut it’s true that most inventions and innovations in the last 100 years have come from Americans (with work from immigrants, descendants of immigrants, etc). China’s progress economically and technologically has almost entirely been copying those innovations and competing on price due to poor labor and environmental laws and conditions. In many cases it literally involved espionage, and in others it involved unethical stealing from partners or even customers (for example companies that used a manufacturer there).
- phkahler 2y ago>> China’s progress economically and technologically has almost entirely been copying those innovations and competing on price due to poor labor and environmental laws and conditions. That may have been true for a while when they were catching up. They are now leading R&D in a number of areas. They do have more issues (fraud, piling on co-authors) in published research, but there is a lot of legit stuff going on too. There are also cases where China has always been ahead of the US - flat panel displays have never really been manufactured in the U.S. for example. A lot of their innovations are also seen as "just cost reduction" on our end, but that still counts and is part of why they're still competitive even as their labor costs go up.
- luyu_wu 2y agoI posted a link to this project a few weeks ago as well! It's really interesting to see an academic project like this one. For people interested, there's bi-weekly blogs (some in English) linked here: https://docs.xiangshan.cc/zh-cn/latest/blog/ https://docs.xiangshan.cc/zh-cn/latest/blog/
- camel-cdr 2y agoIf anyone wants to play arround with simulating it, here is a Dockerfile I use: # Dockerfile FROM ubuntu:24.04 RUN apt-get update && apt-get install -y build-essential clang libclang-dev llvm-dev cmake libspdlog-dev vim git curl wget time default-jre default-jdk RUN git clone --recursive https://github.com/OpenXiangShan/xs-env WORKDIR /xs-env RUN sed 's/apt\S* install/\0 -y/g;s/source /. /g;s/sudo //g' -i ./*.sh RUN . ./env.sh && sed 's/\/master/\/master/g;s/$/; cd \/xs-env/g' -i ./update-submodule.sh && ./update-submodule.sh RUN . ./env.sh && ./setup-tools.sh RUN . ./env.sh && . ./install-verilator.sh RUN . ./env.sh && sed 's/^git submodule.*$//g;s/env.*$//g' -i ./setup.sh && . ./setup.sh RUN . ./env.sh && make -C XiangShan init RUN . ./env.sh && cd DRAMsim3 && mkdir build && cd build && cmake -D COSIM=1 .. && make -j 8 RUN . ./env.sh && make -C XiangShan emu CONFIG=DefaultConfig WITH_DRAMSIM3=1 MFC=1 -j 8 RUN . ./env.sh \ && sed 's/unknown-//g;s/rv64gc/rv64gcv/g' -i $AM_HOME/am/arch/*.mk $AM_HOME/am/arch/isa/*.mk \ && sed 's/define MSTATUS_FS.*$/define MSTATUS_FS 0x6600/g' -i $AM_HOME/am/src/*/isa/riscv/boot/*.S WORKDIR nexus-am/apps/hello RUN make ARCH=riscv64-xs # $NOOP_HOME/build/emu --no-diff -i ./build/hello-riscv64-xs.bin 2>/dev/null Make sure you have 64GB of RAM. I only had 16GB, but allocating additional 48GB of swap worked. There are probably some redundant steps, but this worked for me last time I tried.
- ge96 2y agowhy so much ram?
- deleted 2y ago[deleted]
- chrsw 2y ago64GB of RAM isn't that much for full chip simulation of a "high performance" CPU.
- ge96 2y agoyeah I'm super ignorant here, wondering, say you simulated this, could you run a VM OS against it? What kind of scale it it, personal computer or server (i7/xeon)? Or you just use it to compile programs against it? edit: I did skim the readme, I saw verilog makes me think FPGA
- omolobo 2y agoFree hardware is the dream. I want to replace the proprietary, DRM-bloated CPU on my PC yesterday.
- luyu_wu 2y agoHere is a commercial product using the older 'Nanhu' architecture by XiangShan. Doesn't seem to be released yet, but interesting nonetheless! https://milkv.io/ja/ruyibook https://milkv.io/ja/ruyibook
- mooreed 2y agoThis project is the first that tickles my brain in the right serendipitous ways; it merges topics of my recent interests. However, after a VERY short perusal, I grew a giant sense of empathy for non-native English speakers. The readme is gentle enough to English speakers (aka: +95% English) no less I felt like I muddled through renaming tokens in my mind as I went. However, that quickly showed me two things. 1. It reminds me why I never seem to finish classic Russian literature… so often get lost in the introductory parade of names that are a cache miss for my usual set of names. 2. This is perhaps a significant cultural muscle that has never been necessitated for English speakers. Since the earth has largely been using English (in some capacity) for significantly longer than my life span - as my favorite joke says in the punch line “what do you call someone who only knows one language… uni-lingual… jk: American” PS: it seems like there could be an open registry maintained by “Americans like me” who would rather pre-process the code for tokens within the docs and src… seems like a “DefinitelyTyped style” definitions registry would be very niche, but SUPER useful.
- musicale 2y ago> as my favorite joke says in the punch line “what do you call someone who only knows one language… uni-lingual… jk: American” "Another thing to keep in mind, when you get to feeling bad about being monolingual, is that the fair question is not 'how many languages do you know?' It is, 'of the languages spoken by five million people or more within a thousand miles or so of where you live, what percentage do you know?'" https://structuredprocrastination.com/light/biling.php https://structuredprocrastination.com/light/biling.php
- notpushkin 2y ago> of the languages spoken by five million people or more within a thousand miles or so of where you live, what percentage do you know? IRL interactions are just one aspect of life. Pretty important, sure, but it’s not the only important thing.
- MobiusHorizons 2y agoLots of the heavily multilingual people in the world also have a lot of irl interactions that necessitate knowing languages other than their mother tongue. Of course that’s not the only reason to learn languages, but it is both common and effective. So in terms of expected number of languages spoken I think it’s a good baseline. In the case of the US the languages that would meet that criteria in most parts of the country would be English and Spanish. But there are also hierarchies around languages, ie people that speak the more dominant languages are less likely to speak the less dominant languages, but the speakers of the less dominant languages are expected to speak the more dominant languages and suffer higher consequences if they don’t.
- remexre 2y agohttps://github.com/OpenXiangShan/XiangShan-doc/blob/main/docs/frontend/decode.md https://github.com/OpenXiangShan/XiangShan-doc/blob/main/doc... The list of fused instructions is kinda weird; besides the ones that correspond to SH{1,2,3,4}ADD anyway, I don't think I expected any of the others. I don't see a mention of Sifive-style short jump predication there either, though I'm using Google Translate.
- deleted 2y ago[deleted]
- zozbot234 2y agoDoes RISC-V org itself list/document suggested insn fusion sequences anywhere? I can't quite figure out whether they do because the technical wiki they use is quite hard to navigate and search, and their unofficial Github repos are not much better.
- snvzz 2y agoYou might find this[0] reddit thread useful. 0. https://old.reddit.com/r/RISCV/comments/1hnm5y1/where_did_the_pseudo_instructions_list_go/ https://old.reddit.com/r/RISCV/comments/1hnm5y1/where_did_th...
- zozbot234 2y agoThat's talking about the list of pseudo-instructions, which are just special-cased assembly mnemonics for a single RISC insn. I'm wondering whether there's also a documented list of suggested fusable sequences, comprising multiple insns each.
- snvzz 2y agoYou'll find that a lot of them are equivalent to a sequence of -i.e. more than one- instructions. Refer to the "base instruction" column in the pseudoinstruction table[0]. 0. https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/src/asm-manual.adoc#a-listing-of-standard-risc-v-pseudoinstructions https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/...
- pantalaimon 2y agoI wonder what 'high performance' means in that context. So far, RISC-V has been rather underwhelming in regards to performance when compared to ARM or Loongarch (3A6000).
- brucehoult 2y agoThat's simply not true. RISC-V cores, SoCs, and boards perform very comparably to even better than Arm devices with similar µarch e.g. SiFive U74 vs Arm A55, SiFive P550 vs Arm A72, THead C906 vs ARM1176. While Arm CPUs have existed for 40 years, the initial RISC-V spec was frozen and formally published only in mid 2019 and most of the CPUs currently available to buy were designed around that time. This is quite normal. For example the Arm A76 core that features in the latest Raspberry Pi 5 and RK3588 boards (Rock 5, Orange Pi 5) was announced in May 2018, and took until 2022/3 to be available in consumer SBCs. The A53, A55, and A72 had similar time spans from announcement until being available in SBCs: Pi 3 / Odroid C2; Odroid C4; Pi 4. Only in November 2024 was a RISC-V ISA spec suitable for high performance phones, laptops, desktops, servers frozen and published: RVA23. Cores meeting this spec and with expected performance comparable to Arm A78 up to maybe X2 have been announced, but it will be several years before they are available in products. RISC-V is simply very very new. It is doing very well in the markets which it currently addresses.
- itomato 2y agoI found these useful: "The latest version of XiangShan achieves a normalized score of 45 at 3GHz on SPECint 2006. With the performance comparable to ARM Neoverse N2, it is the highest performing open-source processor to our knowledge." https://riscv-europe.org/summit/2024/media/proceedings/posters/51_poster.pdf https://riscv-europe.org/summit/2024/media/proceedings/poste... https://hc2024.hotchips.org/assets/program/conference/day2/29_HC2024.ChineseAcademy.XiangShan.Kaifan.final.pdf https://hc2024.hotchips.org/assets/program/conference/day2/2...
- snvzz 2y agoGreat, considering the project does not end at V3, and V3 is already competitive. They will continue to improve the performance.
- tormeh 2y agoCool to see another project using Chisel. Anyone in the industry know what direction things are moving in? Seems like Verilog and VHDL are ripe for disruption. I remember one of them as outright unpleasant from university.
- tinco 2y agoWhat has changed that they are now ripe for disruption? My BSc thesis supervisor runs a company that tries to disrupt Verilog and VHDL and they've been at it for well over a decade. I don't think they're making much of a dent yet but I didn't keep up with the space: https://github.com/clash-lang/clash-compiler https://github.com/clash-lang/clash-compiler. There's also a RISCV implementation written in it. All the tooling in this space is so expensive to build and expensive to verify, with such a small market that it seems almost impossible for something to ever challenge the incumbent ecosystems in a reasonable span of time.
- DriftRegion 2y agoI like that the microarch names -- Yanqihu (雁栖湖), Nanhu (南湖), and Kunminghu (昆明湖) -- are lake-themed. Coffee lake? Skylake? no, Kunming lake. https://en.m.wikipedia.org/wiki/List_of_Intel_codenames https://en.m.wikipedia.org/wiki/List_of_Intel_codenames