Closed sh-mug closed 1 year ago
When trying to perform a binary operation on an int variable and a Parameter variable:
m = Module('blinkled') width = m.Parameter('WIDTH', 8) a = m.Input('A', 32) b = m.Output('B', width) b.assign(a[32-width:32])
And I expected B to be assigned the following:
assign B = A[31:32-WIDTH];
But I got the following error.
TypeError: unsupported operand type(s) for -: 'int' and 'Parameter'
So I added support for binary operations with _Numeric class in the right term.
When trying to perform a binary operation on an int variable and a Parameter variable:
And I expected B to be assigned the following:
But I got the following error.
So I added support for binary operations with _Numeric class in the right term.