update
[libreriscv.git] / simple_v_extension / simple_v_chennai_2018.tex
index ff5dc80c8dc154600b0ea1a0e9acae8d66bc6253..417c0f3d921824477b98097ec8ed6eb1f9a4d652 100644 (file)
@@ -11,7 +11,7 @@
 
 \frame{
    \begin{center}
-    \huge{Simple-V RISC-V Extension for Vectors and SIMD}\\
+    \huge{Simple-V RISC-V Parallelism Abstraction Extension}\\
     \vspace{32pt}
     \Large{Flexible Vectorisation}\\
     \Large{(aka not so Simple-V?)}\\
 \frame{\frametitle{Quick refresher on RVV}
 
  \begin{itemize}
-   \item Extremely powerful (extensible to 256 registers)\vspace{10pt}
-   \item Supports polymorphism, several datatypes (inc. FP16)\vspace{10pt}
-   \item Requires a separate Register File (32 w/ext to 256)\vspace{10pt}
-   \item Implemented as a separate pipeline (no impact on scalar)\vspace{10pt}
+   \item Effectively a variant of SIMD / SIMT (arbitrary length)\vspace{4pt}
+   \item Extremely powerful (extensible to 256 registers)\vspace{4pt}
+   \item Supports polymorphism, several datatypes (inc. FP16)\vspace{4pt}
+   \item Requires a separate Register File (32 w/ext to 256)\vspace{4pt}
+   \item Implemented as a separate pipeline (no impact on scalar)
   \end{itemize}
-  However...\vspace{10pt}
+  However...
    \begin{itemize}
    \item 98 percent opcode duplication with rest of RV (CLIP)
    \item Extending RVV requires customisation not just of h/w:\\
             gcc, binutils also need customisation (and maintenance)
+   \item Fascinatingly, despite being a SIMD-variant, RVV only has
+         O(N) opcode proliferation! (extremely well designed)
   \end{itemize}
 }
 
          registers are reinterpreted through a level of indirection
    \item Primarily at the Instruction issue phase (except SIMD)\\
          Note: it's ok to pass predication through to ALU (like SIMD)
-   \item Standard (and future, and custom) opcodes now parallel\vspace{10pt}
+   \item Standard and future and custom opcodes now parallel\\
+         (crucially: with NO extra instructions needing to be added)
   \end{itemize}
   Note: EVERYTHING is parallelised:
    \begin{itemize}
    \begin{itemize}
    \item Predication in INT reg as a BIT field (max VL=XLEN)
    \item Minimum VL must be Num Regs - 1 (all regs single LD/ST)
-   \item SV may condense sparse Vecs: RVV lets ALU do predication
-   \item Choice to Zero or skip non-predicated elements
+   \item SV may condense sparse Vecs: RVV cannot (SIMD-like):\\
+         SV gives choice to Zero or skip non-predicated elements\\
+         (no such choice in RVV: zeroing-only)
   \end{itemize}
 }
 
@@ -247,7 +252,7 @@ for (int i = 0; i < VL; ++i)
 \end{frame}
 
 
-\frame{\frametitle{Register key-value CSR store}
+\frame{\frametitle{Register key-value CSR store (lookup table / CAM)}
 
  \begin{itemize}
    \item key is int regfile number or FP regfile number (1 bit)
@@ -296,7 +301,6 @@ for (int i = 0; i < VL; ++i)
 
 \begin{semiverbatim}
 struct vectorised fp\_vec[32], int\_vec[32]; // 64 in future
-
 for (i = 0; i < 16; i++) // 16 CSRs?
    tb = int\_vec if CSRvec[i].type == 0 else fp\_vec
    idx = CSRvec[i].regkey // INT/FP src/dst reg in opcode
@@ -305,6 +309,7 @@ for (i = 0; i < 16; i++) // 16 CSRs?
    tb[idx].isvector = CSRvec[i].isvector
    tb[idx].packed   = CSRvec[i].packed  // SIMD or not
    tb[idx].bank     = CSRvec[i].bank    // 0 (1=rsvd)
+   tb[idx].enabled  = true
 \end{semiverbatim}
 
  \begin{itemize}
@@ -339,7 +344,6 @@ for (i = 0; i < 16; i++) // 16 CSRs?
 
 \begin{semiverbatim}
 struct pred fp\_pred[32], int\_pred[32]; // 64 in future
-
 for (i = 0; i < 16; i++) // 16 CSRs?
    tb = int\_pred if CSRpred[i].type == 0 else fp\_pred
    idx = CSRpred[i].regkey
@@ -351,7 +355,8 @@ for (i = 0; i < 16; i++) // 16 CSRs?
 \end{semiverbatim}
 
  \begin{itemize}
-   \item All 32 int and 32 FP entries zero'd before setting
+   \item All 32 int and 32 FP entries zero'd before setting\\
+            (predication disabled)
    \item Might be a bit complex to set up in hardware (keep as CAM?)
   \end{itemize}
 
@@ -435,7 +440,7 @@ def get\_pred\_val(bool is\_fp\_op, int reg):
 % but MODIFYING the remaining "vectorised" op, subtracting the now
 % scalar ops from it.
 
-\frame{\frametitle{Predicated 8-parallel ADD: 1-wide ALU}
+\frame{\frametitle{Predicated 8-parallel ADD: 1-wide ALU (no zeroing)}
  \begin{center}
   \includegraphics[height=2.5in]{padd9_alu1.png}\\
   {\bf \red Predicated adds are shuffled down: 6 cycles in total}
@@ -443,7 +448,7 @@ def get\_pred\_val(bool is\_fp\_op, int reg):
 }
 
 
-\frame{\frametitle{Predicated 8-parallel ADD: 4-wide ALU}
+\frame{\frametitle{Predicated 8-parallel ADD: 4-wide ALU (no zeroing)}
  \begin{center}
   \includegraphics[height=2.5in]{padd9_alu4.png}\\
   {\bf \red Predicated adds are shuffled down: 4 in 1st cycle, 2 in 2nd}
@@ -519,7 +524,8 @@ function op\_add(rd, rs1, rs2) # add not VADD!
 \frame{\frametitle{Why are overlaps allowed in Regfiles?}
 
  \begin{itemize}
-   \item Same register(s) can have multiple "interpretations"
+   \item Same target register(s) can have multiple "interpretations"
+   \item CSRs are costly to write to (do it once)
    \item Set "real" register (scalar) without needing to set/unset CSRs.
    \item xBitManip plus SIMD plus xBitManip = Hi/Lo bitops
    \item (32-bit GREV plus 4x8-bit SIMD plus 32-bit GREV:\\
@@ -530,7 +536,7 @@ function op\_add(rd, rs1, rs2) # add not VADD!
   \end{itemize}
   Note:
    \begin{itemize}
-   \item xBitManip reduces O($N^{6}$) SIMD down to O($N^{3}$)
+   \item xBitManip reduces O($N^{6}$) SIMD down to O($N^{3}$) on its own.
    \item Hi-Performance: Macro-op fusion (more pipeline stages?)
   \end{itemize}
 }
@@ -544,15 +550,15 @@ function op\_add(rd, rs1, rs2) # add not VADD!
    \item scalar-to-vector (w/ 1-bit dest-pred): VINSERT
    \item vector-to-scalar (w/ [1-bit?] src-pred): VEXTRACT
    \item vector-to-vector (w/ no pred): Vector Copy
-   \item vector-to-vector (w/ src pred): Vector Gather
-   \item vector-to-vector (w/ dest pred): Vector Scatter
+   \item vector-to-vector (w/ src pred): Vector Gather (inc VSLIDE)
+   \item vector-to-vector (w/ dest pred): Vector Scatter (inc. VSLIDE)
    \item vector-to-vector (w/ src \& dest pred): Vector Gather/Scatter
   \end{itemize}
   \vspace{4pt}
   Notes:
    \begin{itemize}
    \item Surprisingly powerful! Zero-predication even more so
-   \item Same arrangement for FVCT, FMV, FSGNJ etc.
+   \item Same arrangement for FCVT, FMV, FSGNJ etc.
   \end{itemize}
 }
 
@@ -680,7 +686,7 @@ loop:
  CSRvect1 = \{type: F, key: a3, val: a3, elwidth: dflt\}
  CSRvect2 = \{type: F, key: a7, val: a7, elwidth: dflt\}
 loop:
- setvl  t0, a0, 4       # vl = t0 = min(4, n)
+ setvl  t0, a0, 4       # vl = t0 = min(min(mvl, 4, n))
  ld     a3, a1          # load 4 registers a3-6 from x
  slli   t1, t0, 3       # t1 = vl * 8 (in bytes)
  ld     a7, a2          # load 4 registers a7-10 from y
@@ -694,7 +700,7 @@ loop:
 \end{frame}
 
 
-\frame{\frametitle{Under consideration}
+\frame{\frametitle{Under consideration (some answers documented)}
 
  \begin{itemize}
    \item Should future extra bank be included now?