@internal<EOL>def slice_to_SLICE(sliceVals, width):
if sliceVals.step is not None:<EOL><INDENT>raise NotImplementedError()<EOL><DEDENT>start = sliceVals.start<EOL>stop = sliceVals.stop<EOL>if sliceVals.start is None:<EOL><INDENT>start = INT.fromPy(width)<EOL><DEDENT>else:<EOL><INDENT>start = toHVal(sliceVals.start)<EOL><DEDENT>if sliceVals.stop is None:<EOL><INDENT>stop = INT.fromPy(<NUM_LIT:0>)<EOL><DEDENT>else:<EOL><INDENT>stop = toHVal(sliceVals.stop)<EOL><DEDENT>startIsVal = isinstance(start, Value)<EOL>stopIsVal = isinstance(stop, Value)<EOL>indexesAreValues = startIsVal and stopIsVal<EOL>if indexesAreValues:<EOL><INDENT>updateTime = max(start.updateTime, stop.updateTime)<EOL><DEDENT>else:<EOL><INDENT>updateTime = -<NUM_LIT:1><EOL><DEDENT>return Slice.getValueCls()((start, stop), SLICE, <NUM_LIT:1>, updateTime)<EOL>
convert python slice to value of SLICE hdl type