Announcement

Collapse
No announcement yet.

RISC-V Vector ISA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RISC-V Vector ISA

    For those not familiar with the RISC-V Vector ISA, Roger Espasa from Esperanto has some really good YouTube videos explaining it all.

    https://www.youtube.com/watch?v=GzZ-8bHsD5s

    https://www.youtube.com/watch?v=S4fxBZD79gc

    You can find the full spec here:

    https://github.com/riscv/riscv-v-spec

    The Spike RISC-V Simulator with the V ISA can be found here:

    https://github.com/riscv/riscv-isa-sim

  • #2
    Looks like Google may be making an RTL model from RV64X?? Although could be another project?

    https://github.com/google/riscv-dv/b...rv64x_instr.sv

    Comment


    • abel
      abel commented
      Editing a comment
      It is us :-)

      They have RV64V quite complete, and a placeholder for our extension

  • #3
    Wow! This is awesome! Wonder if someone from Google has LLVM experience and can work with us? I'll try and find out.

    Here is a list of the RISC-V 32-bit Vector ISA instructions.

    https://github.com/google/riscv-dv/b...rv32v_instr.sv

    A good tutorial on programming using the Vector ISA is here: https://gms.tf/riscv-vector.html

    One thing we could do is try to implement our ISA extension as "macros" using these vector instructions. For example, the minimum hardware we need is a buffer to store pixels, textures, geometry and a Z-buffer. We can implement the core graphics operations using pure RISC-V and RISC-V Vector assembly. I have some C code I wrote up for math functions, graphics related structures and a set of functions to rasterize a triangle using flat shading, Gouraud shading and Perspective Correct Texture Mapping. I will post that on our shared drive location this week.

    Comment


    • #4
      Thanks to Abel for working on the texturing unit and Vulkan texture instruction for our next call.

      I will investigate the special function unit. There are multiple ways of making that, including Taylor series approximations, bipartite table based methods and Cordic algorithms. Since these are scalar operations we can use a "scalarized" version of a vector to implement them in the vector ISA. Also there are tricks we can use:

      For example, Log(x) and Exp(x) or Antilog(x) are very useful:

      1. Float(x) mult Float(y): Convert to Log, add and take antilog: Antilog (Log(x) + Log(y)) -> convert mult to add with table lookups
      2. Float(x) div Float(y) = Antilog (Log(x) - Log(y))
      3. X^a = Antilog (a * Log(X))
      4. Sqrt(X) = Antilog (Log(x) / 2)

      Also, 1/sqrt(x) is very useful

      1. 1/x = 1/sqrt(x) * 1/sqrt(x)
      2. Sqrt(x) = 1/sqrt(x) * x

      And Cordic will give all the sines and cosines:

      1. http://www.dcs.gla.ac.uk/~jhw/cordic/
      2. https://people.sc.fsu.edu/~jburkardt...ic/cordic.html
      3. https://people.sc.fsu.edu/~jburkardt...ic/cordic.html

      Comment


      • #5
        Good points Peter yes, I agree we should focus on the ISA itself, as any implementation is out of scope for this project anyway. The focus is an open source ISA initially not an open source implementation. However, we do need a little knowledge of implementation strategies and architecture to design the ISA itself. For example, a cordic implementation vs. bipartite tables for math functions may necessitate a "vcordic" instruction that would take as input x,y or rho,theta and what we want to compute, versus a table-based implementation that could compute like a sine or cosine immediately without a need for a vcordic instruction. That is the only reason I am bringing this up. But please let me know if I am off base also.

        I think the categories of instruction extensions we need to think about are:

        1. Texture Unit instructions like Abel has defined already
        2. Special Functions - like those defined in the OpenGL ES 2.0 spec. - I posted a spreadsheet on that on the shared drive
        3. Pixel processing functions like stencils, rasterops, z-buffer tests, swizzles, multisampling, alpha blending and frame buffer set/clear.
        4. Rasterizer Functions - like barycentric edge function computation, tile walking etc.

        Comment

        Working...
        X