return std::max(wid1, wid2);
}
+/* increments the offset and sub-offset appropriately in a FSM-based
+ version of a twin-nested for-loop:
+ for (offs = 0; offs < vlen; offs++) {
+ for (suboffs = 0; suboffs < subvl; suboffs++) {
+ ... doooo stuuuuff (python would use "yield" here)
+ }
+ suboffs = 0; // reset to zero after "loop"
+ }
+*/
+bool inc_offs(int vlen, int subvl, int &offs, int &suboffs)
+{
+ suboffs++;
+ if (suboffs < subvl) {
+ return true; // double-nested loop can continue
+ }
+ suboffs = 0; // reset the sub-offs
+ offs += 1; // increment the outer (VL) loop instead
+ if (offs < vlen) {
+ return true; // also can continue
+ }
+ return false; // should not continue, however let FN deal with it
+}
+
sv_insn_t::sv_insn_t(processor_t *pr, bool _sv_enabled,
insn_bits_t bits, unsigned int f,
int _xlen, int _src_flen, int _dest_flen,
#define SV_CFG_BANK (0x7)
#define SV_CFG_SIZE (0x3<<3)
+bool inc_offs(int vlen, int subvl, int &offs, int &suboffs);
+
#endif