Skip to content

Conversation

@jk2997
Copy link
Collaborator

@jk2997 jk2997 commented Jul 8, 2025

No description provided.

@matth2k matth2k self-requested a review July 9, 2025 01:29
.insert_gate(and_gate(), "inst_0".into(), &[a.into(), b.into()])
.insert_gate(and_gate(), "inst_0".into(), &[a, b])
.unwrap();

Copy link
Owner

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())
Copy link
Owner

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> {
Copy link
Owner

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

Copy link
Owner

@matth2k matth2k left a 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.

@matth2k matth2k changed the title Corrected error in NetRef::is_fully_connected, added test_bus_operations test Fix bug in NetRef::is_fully_connected, added test_bus_operations test, enhance DrivenNet API Jul 9, 2025
@matth2k matth2k changed the title Fix bug in NetRef::is_fully_connected, added test_bus_operations test, enhance DrivenNet API Fix bug in NetRef::is_fully_connected, enhance DrivenNet API Jul 9, 2025
@matth2k matth2k merged commit 99e7679 into main Jul 9, 2025
3 checks passed
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.

3 participants