refactor testing! - #21
Merged
Merged
Conversation
sampsyo
approved these changes
Jul 23, 2026
sampsyo
left a comment
Contributor
There was a problem hiding this comment.
Looks great!! It is fantastic that we get to use the same set of programs to test everything we want to do so far. Nice work getting this stimulus-generator script to do the right thing!!
|
|
||
| # just for fun: use path name as random seed! | ||
| # (not necessary AT ALL but I think it's cool) | ||
| rng = Random(aag_path.name) |
| # just for fun: use path name as random seed! | ||
| # (not necessary AT ALL but I think it's cool) | ||
| rng = Random(aag_path.name) | ||
| clock_cycles = 1 if L == 0 else 2**L + 1 |
Contributor
There was a problem hiding this comment.
I don't totally understand why 2^L+1 is the right number of cycles, but choosing something that is somehow related to the number of latches seems perfectly reasonable, I suppose.
|
|
||
| stim_path = aag_path.with_suffix(".stim") | ||
|
|
||
| stim_path.write_text("\n".join([*input_rows, "."]) + "\n") |
Contributor
There was a problem hiding this comment.
FWIW, this might be slightly more readable/maintainable as a loop. Something like this:
with open(stim_path, 'w') as f:
for row in input_rows:
print(row, file=f)
print('.', file=f)| values_to_bits(&step.inputs), | ||
| values_to_bits(&step.outputs), | ||
| values_to_bits(&step.next_state), | ||
| values_to_bits(&step.state), |
Contributor
There was a problem hiding this comment.
No action required here; just noting that this is the weird place where we think the C AIGER implementation probably has a bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.