Closed Sanchit-kumar closed 1 year ago
Hi @mkorbel1
There is a test case where LogicValue.ofBigInt(BigInt.zero, width)
for any width > 64
leads to throw an error in case of arithmetic +,-,*
operations when applied to the same LogicValue. It throws an error only when both are valued zero.
E.g., LogicValue.ofBigInt(BigInt.zero, 128) + (LogicValue.ofBigInt(BigInt.zero, 128))
throws an error.
Can you please confirm if this is an issue or I misunderstood something. If it's an issue, we need to handle _FilledLogicValue
with width>64 also for arithmetic operations.
There is a test case where LogicValue.ofBigInt(BigInt.zero, width) for any width > 64 leads to throw an error in case of arithmetic +,-,* operations when applied to the same LogicValue. It throws an error only when both are valued zero.
E.g., LogicValue.ofBigInt(BigInt.zero, 128) + (LogicValue.ofBigInt(BigInt.zero, 128)) throws an error.
Can you please confirm if this is an issue or I misunderstood something. If it's an issue, we need to handle _FilledLogicValue with width>64 also for arithmetic operations.
@Sanchit-kumar, yes this looks like a bug, thanks for raising it! I think this is a manifestation of #299 which is WIP being addressed in PR #319 (which has been WIP for a while, should probably poke on that). Your test case that reproduces the issue is pretty simple, so I'll make a note on that issue to suggest using that as an additional test case. Sorry you ran into this!
Description & Motivation
In SystemVerilog, power (a**b) is a useful function.
It would be nice to have a synthesizable Module and associated functions for generating hardware and SystemVerilog with powers as per issue #336
Testing
Added necessary test cases to test/logic_value_test.dart and test/math_test.dart
Documentation
Yes. Updated both README.md and doc/tutorials/chapter_2/00_basic_logic.md