-
Notifications
You must be signed in to change notification settings - Fork 3
Fix bug in NetRef::is_fully_connected, enhance DrivenNet API
#9
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
Conversation
| .insert_gate(and_gate(), "inst_0".into(), &[a.into(), b.into()]) | ||
| .insert_gate(and_gate(), "inst_0".into(), &[a, b]) | ||
| .unwrap(); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insert_input() now returns a DrivenNet reference, which is more specific than a NetRef. So we can get rid of a lot of calls to into()
| self.get_num_input_ports() | ||
| ); | ||
| self.netref.borrow().operands.iter().any(|o| o.is_none()) | ||
| self.netref.borrow().operands.iter().all(|o| o.is_some()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
|
|
||
| /// Borrow the net being driven | ||
| pub fn get_net(&self) -> Ref<Net> { | ||
| pub fn as_net(&self) -> Ref<Net> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to match idioms with NetRef::as_net
matth2k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the bug fix @jk2997 !
Also, you test revealed how I can make the API better. Lots of into() and get_output(0) removed from code where it should not have been needed.
Thanks. Feel free to merge this in at your leisure.
NetRef::is_fully_connected, added test_bus_operations test, enhance DrivenNet API
NetRef::is_fully_connected, added test_bus_operations test, enhance DrivenNet APINetRef::is_fully_connected, enhance DrivenNet API
No description provided.