if (idxs[order[j]] != lims[order[j]]) {
break;
}
- idxs[order[i]] = 0;
+ idxs[order[j]] = 0;
}
}
}
case CSR_USHAPE2:
{
int shapeidx = which - CSR_USHAPE0;
- state.shape[shapeidx].xsz = get_field(val, SV_SHAPE_XDIM);
- state.shape[shapeidx].ysz = get_field(val, SV_SHAPE_YDIM);
- state.shape[shapeidx].zsz = get_field(val, SV_SHAPE_ZDIM);
+ state.shape[shapeidx].xsz = get_field(val, SV_SHAPE_XDIM) + 1;
+ state.shape[shapeidx].ysz = get_field(val, SV_SHAPE_YDIM) + 1;
+ state.shape[shapeidx].zsz = get_field(val, SV_SHAPE_ZDIM) + 1;
state.shape[shapeidx].offs = (get_field(val, (1<<7 )) ? 0x1 : 0) |
(get_field(val, (1<<15)) ? 0x2 : 0) |
(get_field(val, (1<<23)) ? 0x4 : 0);
state.shape[shapeidx].permute = get_field(val, SV_SHAPE_PERM);
state.shape[shapeidx].setup_map();
+ fprintf(stderr, "sv shape %d x %d y %d z %d offs %d perm %d\n",
+ shapeidx,
+ state.shape[shapeidx].xsz,
+ state.shape[shapeidx].ysz,
+ state.shape[shapeidx].zsz,
+ state.shape[shapeidx].offs,
+ state.shape[shapeidx].permute);
break;
}
#endif
// changing the CSRs is the way to change the map.
// the map is still calculated even for the 1D case
// because it's a linear map
- return (unsigned int)shape->map[offs] + shape->offs;
+ unsigned int res = (unsigned int)shape->map[offs] + shape->offs;
+ fprintf(stderr, "remap %d %d -> %d\n",
+ spec.reg, offs, res);
+ return res;
}
void (sv_proc_t::DO_WRITE_FREG)(reg_spec_t const& spec, sv_freg_t const& value)
}
freg_shift fs;
fs.f = _insn->p->get_state()->FPR[reg];
- fprintf(stderr, "READ_FREG rd %ld ew %d bw %d fl %d data %lx %lx\n",
- reg, elwidth, bitwidth, flen, fs.f.v[0], fs.f.v[1]);
+ fprintf(stderr, "READ_FREG rd %ld offs %d ew %d bw %d fl %d data %lx %lx\n",
+ reg, offs, elwidth, bitwidth, flen, fs.f.v[0], fs.f.v[1]);
if (regflen != bitwidth)
{