13 comments

  • tantalor2 hours ago
    &gt; posted a video that got a few million views<p>Anybody got a link to that?<p>Is it this?<p><a href="https:&#x2F;&#x2F;www.instagram.com&#x2F;armaan.gomes&#x2F;reel&#x2F;DatqWKChtnw&#x2F;?hl=en" rel="nofollow">https:&#x2F;&#x2F;www.instagram.com&#x2F;armaan.gomes&#x2F;reel&#x2F;DatqWKChtnw&#x2F;?hl=...</a><p>I was expecting a real video, not some 9 second clip posted to random social media website.
    • jervant2 hours ago
      &gt; <i>instagram</i><p>&gt; <i>random social media website</i>
  • _joel4 hours ago
    Cool, I thought this was a CPU custom designed for Doom, but I guess that&#x27;s just a 486 :)<p>edit: I went to down a quick hole &quot;The historical footnote is that a version of this genuinely happened. SNES Doom shipped with a Super FX 2 in the cartridge, a custom RISC chip with a pixel-plot instruction, because the console&#x27;s own CPU had no chance. Jaguar and PlayStation ports both moved the rasteriser onto dedicated hardware. Doom&#x27;s design was shaped by the absence of an FPU, and then hardware kept getting built to catch up with it.&quot;
    • toast01 hour ago
      &gt; SNES Doom shipped with a Super FX 2 in the cartridge, a custom RISC chip with a pixel-plot instruction, because the console&#x27;s own CPU had no chance.<p>The Super FX is a custom RISC chip, but it was custom made for Star Fox and used for other projects with refinements.
    • blastonico3 hours ago
      &gt; but I guess that&#x27;s just a 486<p>*just* a 486. :-(
  • arghunter3 hours ago
    This is just RV32I-ZMMUL not a custom architecture, bt if you do want to see something from scratch, without any premade ISA or anything, here is an NPU I built: <a href="https:&#x2F;&#x2F;www.armaangomes.com&#x2F;blogs&#x2F;kernn&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.armaangomes.com&#x2F;blogs&#x2F;kernn&#x2F;</a>
    • ge9641 minutes ago
      When you say &quot;can upload any model to it&quot; are you talking LLM models? Surely there is a limit eg. parameters
  • Flex247A9 hours ago
    Great work!<p>This reminded me of a project I built a while back: a RV32IM emulator in C++ that can boot and run DOOM. Initially I implemented only RV32I, and implementing the M extension provided a massive speedup!<p>If anyone&#x27;s curious, here&#x27;s the source code: <a href="https:&#x2F;&#x2F;github.com&#x2F;lalitshankarch&#x2F;rvcore" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lalitshankarch&#x2F;rvcore</a>
    • kailpa19 hours ago
      Nice one! Sounds like a fun project to do. Did you follow any tutorial or guide for this? If so, I would appreciate it if you shared it.
      • sph6 hours ago
        If you don&#x27;t want to delegate the fun of learning to an LLM, here&#x27;s how I&#x27;ve built a RV64IM simulator in C in a weekend. All you need is an opcode table, the RISC-V specs and to implement each instruction; the good thing of RISC CPUs is that instructions are very simple (i.e. pretty much everything is a variation of `dest = src1 OP src2`) and memory instructions are dedicated. The other cool thing is that there are no &quot;flags&quot;. Start with the base instruction set, then you can add M on top later. 64-bit support requires just a handful more instructions to zero&#x2F;sign extend from 32-bit.<p>Then, wire your simulator to <a href="https:&#x2F;&#x2F;github.com&#x2F;riscv-software-src&#x2F;riscv-tests" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;riscv-software-src&#x2F;riscv-tests</a>, and there you have an official test suite. When everything passes, you have a fully-compliant RISC-V CPU. You can at this point tell GCC or Rust or your favourite language to compile to RV32IM and see it run on your simulator. It&#x27;s a very gratifying process.<p>If you get at this stage, you might want to use the <i>ecall</i> instruction to hard-code I&#x2F;O operations such as &quot;read from stdin&quot; or &quot;print a character&quot;, and there you have a sandboxed CPU that you can target with your favourite programming language. Make it run DOOM (start with <a href="https:&#x2F;&#x2F;github.com&#x2F;ozkl&#x2F;doomgeneric" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ozkl&#x2F;doomgeneric</a> and see which I&#x2F;O do you need), or turn it into a toy game console; the sky&#x27;s the limit.<p>---<p>Here&#x27;s a copy-paste of the list of resources I have saved in my notes:<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;libriscv&#x2F;libriscv" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;libriscv&#x2F;libriscv</a> A very fast RISC-V VM with sandboxing of memory and syscalls.<p>- <a href="https:&#x2F;&#x2F;luplab.gitlab.io&#x2F;rvcodecjs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;luplab.gitlab.io&#x2F;rvcodecjs&#x2F;</a> RISC-V Instruction Encoder&#x2F;Decoder<p>- <a href="https:&#x2F;&#x2F;www.cs.sfu.ca&#x2F;~ashriram&#x2F;Courses&#x2F;CS295&#x2F;assets&#x2F;notebooks&#x2F;RISCV&#x2F;RISCV_CARD.pdf" rel="nofollow">https:&#x2F;&#x2F;www.cs.sfu.ca&#x2F;~ashriram&#x2F;Courses&#x2F;CS295&#x2F;assets&#x2F;noteboo...</a> Reference card<p>- <a href="https:&#x2F;&#x2F;cs.brown.edu&#x2F;courses&#x2F;csci1952y&#x2F;2024&#x2F;assets&#x2F;docs&#x2F;riscv-spec-v2.2.pdf" rel="nofollow">https:&#x2F;&#x2F;cs.brown.edu&#x2F;courses&#x2F;csci1952y&#x2F;2024&#x2F;assets&#x2F;docs&#x2F;risc...</a> Spec<p>- <a href="https:&#x2F;&#x2F;riscv-software-src.github.io&#x2F;riscv-unified-db&#x2F;manual&#x2F;html&#x2F;isa&#x2F;isa_20240411&#x2F;insts&#x2F;sd.html" rel="nofollow">https:&#x2F;&#x2F;riscv-software-src.github.io&#x2F;riscv-unified-db&#x2F;manual...</a><p>- ABI: <a href="https:&#x2F;&#x2F;lists.riscv.org&#x2F;g&#x2F;tech-psabi&#x2F;attachment&#x2F;61&#x2F;0&#x2F;riscv-abi.pdf" rel="nofollow">https:&#x2F;&#x2F;lists.riscv.org&#x2F;g&#x2F;tech-psabi&#x2F;attachment&#x2F;61&#x2F;0&#x2F;riscv-a...</a><p>Good luck!
        • kailpa16 hours ago
          Huge thanks! Will certainly try doing that.
      • Flex247A8 hours ago
        Hi, I didn&#x27;t follow any specific guide on this, but asked ChatGPT about the bare minimum environment needed to run DOOM. From there, I figured out how to execute the instructions using a switch-case and how to make a custom syscall to trigger rendering.<p>I made a post a while back that details the entire process: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;EmuDev&#x2F;comments&#x2F;1t1or4j&#x2F;doom_runs_on_my_custom_riscv_emulator&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;EmuDev&#x2F;comments&#x2F;1t1or4j&#x2F;doom_runs_o...</a>
        • kailpa16 hours ago
          Thanks, am going to check it out.
  • Archit3ch6 hours ago
    Reading &quot;Custom CPU&quot; I expected wafer.space, instead of FPGA.
    • mithro6 hours ago
      <a href="https:&#x2F;&#x2F;www.linkedin.com&#x2F;posts&#x2F;hirosh-dabui-a5367443_linux-running-on-my-risc-v-asic-first-silicon-ugcPost-7484586796769669120-8JYm&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.linkedin.com&#x2F;posts&#x2F;hirosh-dabui-a5367443_linux-r...</a>
    • arghunter3 hours ago
      We hope to tape it out, along with an NPU and GPU once we raise $10k. Though first we have to find $10k :(
      • varispeed2 hours ago
        I think you need one more zero.
  • paulmooreparks9 hours ago
    Very cool!<p>I just did the same thing, but for a byte-code interpreter for a completely novel ISA I made up a while back (with an assist from Claude). I just haven&#x27;t made the HN post yet, since I&#x27;m doing a bit of cleanup.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;paulmooreparks&#x2F;Maize&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;paulmooreparks&#x2F;Maize&#x2F;</a> <a href="https:&#x2F;&#x2F;paulmooreparks.github.io&#x2F;Maize&#x2F;" rel="nofollow">https:&#x2F;&#x2F;paulmooreparks.github.io&#x2F;Maize&#x2F;</a>
  • layer82 hours ago
    I wonder, if Doom didn’t exist, what would have taken its place for the “can it run X” usage.
    • AndrewOMartin1 hour ago
      Doom 2. And only John &quot;Benevolent hyper-intelligent architect of the post singularity simulation we all live in&quot; Carmack would know why he named it that.
  • dmitrygr11 hours ago
    For anyone else curious: custom FPGA-based CPU code but not a custom architecture. This is an RV32I core. The article takes along time to give up this fact.
    • kryptiskt10 hours ago
      Deciding on an ISA like RV32I only sets constraints on your architecture, it doesn&#x27;t give you any of it for free. So I think it&#x27;s entirely valid to say that it&#x27;s a custom architecture if they didn&#x27;t use any pre-existing CPU design.<p>Basically, they had the API interface and implemented everything behind it. I think saying that &quot;it&#x27;s an RV32I core&quot; vastly underrates the design work that goes into actually implementing an RV32I core from scratch.
      • Dylan168079 hours ago
        Making a particularly good core is hard. Making <i>a</i> core to the minimum risc-v spec is what you do in a single college course. It&#x27;s what the ISA was designed for.
      • voidUpdate10 hours ago
        It&#x27;s a custom implementation of an existing architecture
        • ahartmetz8 hours ago
          It&#x27;s common to call the instruction set just &quot;architecture&quot;, or ISA (instruction set architecture) to be more precise. The implementation is commonly called &quot;microarchitecture&quot;.
        • speed_spread6 hours ago
          RV32I doesn&#x27;t define any architecture, it&#x27;s just an ISA i.e. a software contract that happens to be implementable in hardware. The CPU could run on outer space goop and still be RV32I.
          • Brian_K_White2 hours ago
            &quot;RV32I doesn&#x27;t define any architecture, it&#x27;s just an ISA.&quot;<p>My friend...
            • speed_spread1 hour ago
              You are right, &#x27;A&#x27; stands for Architecture. _Instruction Set_ Architecture that is. Not CPU architecture. I should have been more clear:<p>&gt; RV32I doesn&#x27;t define the hardware architecture<p>FTFM - satisfied?
      • dmitrygr9 hours ago
        The *architecture* is RV32I_Zmmul which is unambiguously neither new nor custom.<p>What you describe (the specific implementation details of a core) is *microarchitecture*. In this case clearly a lot of work was done and it <i>is</i> cool, but the *architecture* is indeed RV32I and not custom<p>I was not undermining anything. I was helping others find the info I sought and took a while to find. This is why i left my comment. Everyone has their own interests. As an example, my thoughts were &quot;whoa... a new architecture... did they write a new compiler or rewrite doom in assembly?&quot; and for that &quot;it is rv32i&quot; would have been a quick answer.
    • zuzululu11 hours ago
      thanks for saving me the time but it is pretty cool to see i&#x27;d love to learn more about fpga my goal is to run very old rare consoles
    • ahk-dev8 hours ago
      [dead]
  • caruasdo56 minutes ago
    Well, Doom runs everywhere.
    • neonmagenta35 minutes ago
      We need to update Stardew Valleys saloon game to play Doom
  • terekhindc7 hours ago
    why Zmmul and not full M — is it just fpga area, or did the doom port let you drop div&#x2F;rem?
    • arghunter3 hours ago
      I&#x27;m kinda lazy lol. We are also implementing out-of-order rn, so we want to get a really solid rv32i setup going before adding multiplication, floating point, vector, etc.
  • sweetjuly11 hours ago
    Always a delight seeing Chisel in the wild :)
  • deton39915 hours ago
    [dead]
  • huflungdung7 hours ago
    [dead]