Live data from Hacker News

VRoom A high end RISC-V implementation

moonbaseotago.github.io

31–40 of 135 posts

Re: VRoom A high end RISC-V implementation

#31
post #16

Author here (Paul Campbell) - AMA

Any thoughts about higher level HDLs in embedded in software languages, like Chisel, nMigen, or others? Some other RISC-V core designers claim they've had increased productivity with those.

It seems that despite a lot of valid criticism against (System)Verilog, nothing really seems to be a on trajectory to replace it today. I'm not sure if that's purely inertia (existing tooling, workflows, methodologies), other HDLs not being attractive enough, or maybe Verilog is just good enough?

Re: VRoom A high end RISC-V implementation

#32
post #28
post #23

Earlier quoted context omitted.

If you're at the point in your career where you're not sure which is the right textbook then "A Quantitative Approach" is likely to be really tough to get through. Computer Organization and Design, by the same authors, is considered a better choice for a first book. I personally loved it and couldn't put it down the first time I read it. https://www.elsevier.com/books/computer-organization-and-des...

Any recommendation for books on (System)Verilog

I personally am not into the verilog specific books. For me HDLs are hardware description languages, so first you learn to design digital hardware, then you learn to describe them.

For that I highly recommend: https://www.cambridge.org/us/academic/subjects/engineering/c...

Great first book on the subject.

Re: VRoom A high end RISC-V implementation

#33

What does GPL mean for a chip design? I understand how it applies to the HDL, but I doubt that it obligates you have to open your code to users of physical chips.

Well (author here) - this is a private project - typically such a project would be very propriety - people don't get to show their work.

But I'm looking to find someone to build this thing, it's been a while since I last built chips (last CPU I helped design never saw the light of day due to reason that had little to do with how well it worked). So I need a way to show it off, show it's real. So GPLing it is a great way to do that - as is showing up on HN (thanks to whoever posted this :-).

In practice the RTL level design of a processor is only a part of making a real processor - a real VRoom! would likely have hand built ALUs, shifters, caches, register files etc those things are all in the RTL at a high level but are really different IP - likely they'd be entangled with GPL and a manufacturer might feel that to be an issue.

However I'm happy to dual license (I want to get it built, and maybe get paid to do it).

Also about half the companies building RISCVs are in China (I've been building open source hardware in China for a decade or so now, so I know there's lots of smart people there) - they have a real problem (in the West) building something like this - all the rumors about supply chain/etc stuff - having an open sourced GPL'd reference that's cycle accurate is a way help build confidence.

Re: VRoom A high end RISC-V implementation

#34
post #16

Author here (Paul Campbell) - AMA

What does your benchmarking workflow look like? I am interested in

  * From a high level what does your dev iteration look like? 
  * Getting instruction traces, timing and resimulating those traces
  * Power analysis, timing analysis (do you do this as part of performance simulation) ? 
  * Do you benchmark the whole chip or specific sub units?
  * How do you choose what to focus on in terms of performance enhancements? 
  * What areas are you focusing on now? 
  * What tools would make this easier?

Re: VRoom A high end RISC-V implementation

#35

The presentation was interesting; but I would like to write an idea that is tangentially related to this CPU. I noticed that modern CPUs are optimized for legacy monolith OS kernels like Linux or Windows. But having a large, multimegabyte kernel is a bad idea from a security standpoint. A single mistake or intentional error in some rarely used component (like a temperature sensor driver) can get attacker full access…

These days there are few caches that need to be flushed at context switch time - RISCV's ASIDs mean that you don't need to flush the TLBs (mostly) when you contect switch.

VRoom! largely has physically tagged caches so they don't need to be flushed, the BTC is virtually tagged, but split into kernel and user caches, you need to flush the user one on on a context switch (or both on a VM switch) - also the trace cache (L0 icache) will also be virtually tagged. VRoom! also doesn't do speculative accesses past the TLBs.

Honestly saving and restoring kernel context is small compared to the time spent in the kernel (and I've spent much of the past year looking at how this works in depth).

Practically you have to design stuff to an architecture (like RISCV) so that one can leverage off of the work of others (compilers, libraries, kernels) adding specialised stuff that would (in this case) get in to a critical timing path is something that one has to consider very carefully - b ut that's a lot of what RISCV is about - you can go and knock up that chip yourself on an FPGA and start trialing it on your microkernel

Re: VRoom A high end RISC-V implementation

#36
post #31
post #16

Author here (Paul Campbell) - AMA

Any thoughts about higher level HDLs in embedded in software languages, like Chisel, nMigen, or others? Some other RISC-V core designers claim they've had increased productivity with those. It seems that despite a lot of valid criticism against (System)Verilog, nothing really seems to be a on trajectory to replace it today. I'm not sure if that's purely inertia (existing tooling, workflows, methodologies), other HDLs…

As an aside, the latest and active development of nMigen has been rebranded a few months ago to Amaranth and can be found here: https://github.com/amaranth-lang/amaranth . In case people googled nMigen and came to the repository that hasn't been updated in two years.

Re: VRoom A high end RISC-V implementation

#37
post #22

> Eventually we'll do some instruction combining using this information (best place may be at entry to I$0 trace cache), or possibly at the rename stage So much for "we will do only simplest of commands and u-op fusing will fix performance". It is why I'm very suspicious about this argument from RISC-V proponents.

I think that we need lots of trace before we decide which ops make sense to combine

As far as I understand, RISC-V proponents want to have "recommended" command sequences for compilers, to avoid situation when different RISC-V CPUs will need different compilations. If different RISC-V implementations have different "fuseable" command sequences, we will be in dreadful situation when you will need exact "-mcpu" for decent performance and binary packages will be very unoptimal.

And such "conventions" are bad idea, like comments in code, IMHO. It can not be checked by tools, etc.

Re: VRoom A high end RISC-V implementation

#38
post #22

Earlier quoted context omitted.

I think that we need lots of trace before we decide which ops make sense to combine

As far as I understand, RISC-V proponents want to have "recommended" command sequences for compilers, to avoid situation when different RISC-V CPUs will need different compilations. If different RISC-V implementations have different "fuseable" command sequences, we will be in dreadful situation when you will need exact "-mcpu" for decent performance and binary packages will be very unoptimal. And such "conventions" a…

> you will need exact "-mcpu" for decent performance

For some definitions of decent, I think that ship has sailed.

https://clang.llvm.org/docs/CrossCompilation.html

-target The triple has the general format ---, where: arch = x86_64, i386, arm, thumb, mips, etc. sub = for ex. on ARM: v5, v6m, v7a, v7m, etc. vendor = pc, apple, nvidia, ibm, etc. sys = none, linux, win32, darwin, cuda, etc. abi = eabi, gnu, android, macho, elf, etc.

Note, none of those are exhaustive...

Re: VRoom A high end RISC-V implementation

#39

The presentation was interesting; but I would like to write an idea that is tangentially related to this CPU. I noticed that modern CPUs are optimized for legacy monolith OS kernels like Linux or Windows. But having a large, multimegabyte kernel is a bad idea from a security standpoint. A single mistake or intentional error in some rarely used component (like a temperature sensor driver) can get attacker full access…

You should look into the Mill CPU architecture.[0] Its design should make microkernels much more viable.

* Single 64-bit address space. Caches use virtual addresses.

* Because of that, the TLB is moved after the last level cache, so it's not on the critical path.

* There's instead a PLB (protection lookaside buffer), which can be searched in parallel with cache lookup. (Technically, there's three: two instruction PLBs and one data PLB.)

[0]: https://millcomputing.com/

Re: VRoom A high end RISC-V implementation

#40
post #31
post #16

Author here (Paul Campbell) - AMA

Any thoughts about higher level HDLs in embedded in software languages, like Chisel, nMigen, or others? Some other RISC-V core designers claim they've had increased productivity with those. It seems that despite a lot of valid criticism against (System)Verilog, nothing really seems to be a on trajectory to replace it today. I'm not sure if that's purely inertia (existing tooling, workflows, methodologies), other HDLs…

I think they're great - I earned my VLSI chops building stuff in the 90s and I can write Verilog about as fast as I can think so it's my goto language. I've also written a couple of compilers over the years so I know it really well (you can thank me for the '' in "always @()"). That's just my personal bias.

Inertia in tooling is a REALLY BIG deal - if you can't run your design through simulation, (and FPGA simulation), synthesis, layout/etc you'll never build a chip - it can take a 5-10 years for a new language feature to become ubiquitous enough so that you can depend on it en ough to use it in a design (I've been struggling with this using System Verilog interfaces this month).

If you look closely at VRoom! you'll see I'm stepping beyond some Verilog limitations by adding tiny programs that generate bespoke bits of Verilog as part of the build process - this stops me from fat fingering some bit in a giant encoder but also helps me make things that SV doesn't do so well (big 1-hot muxes, priority schedulers etc)

Post reply on HN