Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch over to using bit vectors #21

Merged
merged 1 commit into from
Aug 15, 2018
Merged

Switch over to using bit vectors #21

merged 1 commit into from
Aug 15, 2018

Conversation

rsetaluri
Copy link
Collaborator

One of the test vector generators used to return plain ints. Now it returns bit vectors to make everything consistent.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 125

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 75.681%

Totals Coverage Status
Change from base Build 123: 0.05%
Covered Lines: 389
Relevant Lines: 514

💛 - Coveralls

Copy link
Owner

@leonardt leonardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks

@leonardt leonardt merged commit 096631f into master Aug 15, 2018
@leonardt leonardt deleted the type-fix branch August 15, 2018 17:20
@@ -30,20 +30,23 @@ def generate_function_test_vectors(circuit, func, input_ranges=None,
for i, (name, port) in enumerate(circuit.interface.ports.items()):
if port.isoutput():
if isinstance(port, BitType):
args.append([0, 1])
args.append([BitVector(0), BitVector(1)])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to make a Bit type as opposed to BitVector since this is not a multibit value. We could use Python bools for Bits, but they have some funky behavior

>>> ~True
-2

which would motivate defining our own wrapper class with the operator semantics we expect

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of a Bit type with the exact same semantics. python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants