rohd icon indicating copy to clipboard operation
rohd copied to clipboard

Allow negative indices on `Logic` and `LogicValue` to relative to the end

Open mkorbel1 opened this issue 2 years ago • 1 comments

Motivation

Python allows you to access the end of a list using negative numbers, which is a nifty feature.

Desired solution

Functions like operator [], getRange, and slice should handle negative numbers, treating it as from the end of the value/signal. -1 is the last element, etc.

Alternatives considered

SystemVerilog does not support this.

mkorbel1 avatar Mar 29 '22 04:03 mkorbel1

Hey Max, I will be working on it.

RPG-coder-intc avatar Jul 25 '22 17:07 RPG-coder-intc