From d7dbaa2c7e8e0f96a69dd0fe632a9ed61787c78b Mon Sep 17 00:00:00 2001 From: SpaceCat-Chan <49094338+SpaceCat-Chan@users.noreply.github.com> Date: Sun, 27 Nov 2022 01:34:41 +0100 Subject: [PATCH] fix bug in split_line_over_x --- common/route/awooter/rust/src/lib.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/common/route/awooter/rust/src/lib.rs b/common/route/awooter/rust/src/lib.rs index c5499b8b..4f8dd8c4 100644 --- a/common/route/awooter/rust/src/lib.rs +++ b/common/route/awooter/rust/src/lib.rs @@ -123,7 +123,7 @@ fn find_partition_point( /// /// the function assumes the line goes on forever in both directions, and it truncates the actual coordinate fn split_line_over_x(line: (npnr::Loc, npnr::Loc), x_location: i32) -> i32 { - if line.0.x == line.0.y { + if line.0.x == line.1.x { // the line is a straight line in the direction, there is either infinite solutions, or none // we simply average the y coordinate to give a "best effort" guess return (line.0.y + line.1.y) / 2; @@ -300,15 +300,8 @@ fn partition_nets( let port_ref = dereffed_port_refs.get(name); - if port_ref.is_none() { - println!( - "{} suddenly become none", - ctx.name_of(*name).to_str().unwrap() - ); - } - port_ref - .expect("it's this one!") + .unwrap() .into_par_iter() .flat_map(|sink| { ctx.sink_wires(net, *sink)