--- /dev/null
+# Lanes
+
+Example parallel add:
+
+ /* XLEN and N are "baked-in" to the hardware */
+ parameter XLEN;
+ parameter N;
+ /* note that N cannot be greater than XLEN */
+
+ register plane[XLEN];
+ register x[N][32][XLEN];
+
+ function op_add(rd, rs1, rs2) {
+ /* note that this is ADD, not PADD */
+ int i;
+ for (i = 0; i<N; i++)
+ if (plane[i])
+ x[i][rd] <= x[i][rs1] + x[i][rs2];
+ }
+ /* note that "<=" is the Verilog non-blocking assignment operator */
+
get to choose precisely where to focus and target the benefits of their
implementation efforts, without "extra baggage".
+# Example of vector / vector, vector / scalar, scalar / scalar => vector add
+
+ register CSRvectorlen[XLEN][4]; # not quite decided yet about this one...
+ register CSRpredicate[XLEN][4]; # 2^4 is max vector length
+ register CSRreg_is_vectorised[XLEN]; # just for fun support scalars as well
+ register x[32][XLEN];
+
+ function op_add(rd, rs1, rs2, predr)
+ {
+ /* note that this is ADD, not PADD */
+ int i, id, irs1, irs2;
+ # checks CSRvectorlen[rd] == CSRvectorlen[rs] etc. ignored
+ # also destination makes no sense as a scalar but what the hell...
+ for (i = 0, id=0, irs1=0, irs2=0; i<CSRvectorlen[rd]; i++)
+ if (CSRpredicate[predr][i]) # i *think* this is right...
+ x[rd+id] <= x[rs1+irs1] + x[rs2+irs2];
+ # now increment the idxs
+ if (CSRreg_is_vectorised[rd]) # bitfield check rd, scalar/vector?
+ id += 1;
+ if (CSRreg_is_vectorised[rs1]) # bitfield check rs1, scalar/vector?
+ irs1 += 1;
+ if (CSRreg_is_vectorised[rs2]) # bitfield check rs2, scalar/vector?
+ irs2 += 1;
+ }
+
# V-Extension to Simple-V Comparative Analysis
This section covers the ways in which Simple-V is comparable