e.g. InstructionCSRRW(x1, x0, csrnames.cycle) raises an error because csrnames.cycle isn't in the valid range. I have worked around this by subtracting 0x1000 from the constant.
I think there should be a variant of the InstructionIType that treats the immediate as unsigned, used for the CSR instructions.