Labs 2 Error Message

I have a project that Labs 2 finds error free. But if a change one number, which should be OK with any 16 bit number, I get the message below from Labs 2. Any idea what this is about? What is it saying went wrong with my otherwise no error project.

    fromIndex(320) > toIndex(16)java.lang.IllegalArgumentException: fromIndex(320) > toIndex(16)
at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:511)
at java.base/java.util.ArrayList.subList(ArrayList.java:1191)
at com.alchitry.labs2.parsers.hdl.values.SimpleValue.ushr(SimpleValue.kt:197)
at com.alchitry.labs2.parsers.hdl.ExprEvaluator.shift(ExprEvaluator.kt:626)
at com.alchitry.labs2.parsers.hdl.lucid.parsers.ExprParser.exitExprShift(ExprParser.kt:371)
at com.alchitry.labs2.parsers.grammar.LucidParser$ExprShiftContext.exitRule$suspendImpl(LucidParser.kt:6761)
at com.alchitry.labs2.parsers.grammar.LucidParser$ExprShiftContext.exitRule(LucidParser.kt)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.exitRule(ParseTreeMultiWalker.kt:116)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:46)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk$default(ParseTreeMultiWalker.kt:10)
at com.alchitry.labs2.parsers.hdl.lucid.context.LucidBlockContext.walk(LucidBlockContext.kt:210)
at com.alchitry.labs2.parsers.hdl.lucid.context.LucidBlockContext.walk$default(LucidBlockContext.kt:209)
at com.alchitry.labs2.parsers.hdl.lucid.context.LucidBlockContext.initialWalk(LucidBlockContext.kt:196)
at com.alchitry.labs2.parsers.hdl.types.ModuleInstance.initialWalk(ModuleInstance.kt:48)
at com.alchitry.labs2.parsers.hdl.lucid.parsers.TypesParser.exitModuleInst(TypesParser.kt:361)
at com.alchitry.labs2.parsers.grammar.LucidParser$ModuleInstContext.exitRule$suspendImpl(LucidParser.kt:3397)
at com.alchitry.labs2.parsers.grammar.LucidParser$ModuleInstContext.exitRule(LucidParser.kt)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.exitRule(ParseTreeMultiWalker.kt:116)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.exitRule(ParseTreeMultiWalker.kt:116)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:46)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk(ParseTreeMultiWalker.kt:44)
at com.alchitry.labs2.parsers.ParseTreeMultiWalker.walk$default(ParseTreeMultiWalker.kt:10)
at com.alchitry.labs2.parsers.hdl.lucid.context.LucidBlockContext.walk(LucidBlockContext.kt:210)
at com.alchitry.labs2.parsers.hdl.lucid.context.LucidBlockContext.walk$default(LucidBlockContext.kt:209)
at com.alchitry.labs2.parsers.hdl.lucid.context.LucidBlockContext.initialWalk(LucidBlockContext.kt:196)
at com.alchitry.labs2.parsers.hdl.types.ModuleInstance.initialWalk(ModuleInstance.kt:48)
at com.alchitry.labs2.project.Project.buildContext(Project.kt:564)
at com.alchitry.labs2.project.Project$buildContext$1.invokeSuspend(Project.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:35)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:101)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:829)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@ed1be45, Dispatchers.Default]

Can you post the module causing issues? Seems to be caused by a shift right expression.

I am going to call this resolved. I never found out the exact cause or what this error means. But I was able to rebuild this project, and the rebuild version doesn’t have the problem.

The error occurred in a ROM module, containing a simple list of 24-bit instructions for a CPU. The error occurred whenever I put anything other than 0 for the 16 bit operand in one of the instructions. The error was not with the instruction itself, but with something it was causing somewhere else in the circuit. The error didn’t supply any useful information, and I was never able to locate it. Must have been my stupid error, but never could find it.

This is still clearly a bug and I made a GitHub issue to track it. I haven’t had a chance yet to dive in.

Thanks Justin. If I see it again, I will the circumstances here.