[libre-riscv-dev] spike-sv non-default element widths

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri Oct 19 00:06:18 BST 2018


changing spike to support polymorphic element widths is turning into a
massively hair-raising task.  i tried creating an overload class
(class sv_reg_t) which stored a uint64_t and a bitwidth field, and it
went horribly wrong.  twice :)

the number of changes was so massive that i was completely unable to
do even basic debugging, as too many instructions were messed up.

howeverrrr.... by reverting and placing a typedef sv_reg_t reg_t (and
likewise for sreg_t) i have been able to incrementally put in each
modification... in an incremental fashion... *without* having the code
that i originally suspected was broken (but probably wasn't, but it's
impossible to tell).

with each incremental modification, whilst still actually having only
sv_reg_t -> reg_t as a typedef, the riscv-tests passed, so each was in
the clear.

*now* i have far less risky a near drop-in replacement for typedef
sv_reg_t with class sv_reg_t.

the only thing that's a bit of a problem is where there is uint64_t to
int64_t type-casting.  i might need your help with that, jacob, if i
get stuck?

l.



More information about the libre-riscv-dev mailing list