Trait libreda_pnr::route::simple_router::SimpleRouter
source · pub trait SimpleRouter {
// Required methods
fn name(&self) -> &str;
fn compute_routes_impl(
&self,
boundary: Rect<SInt>,
net_terminals: &HashMap<usize, Vec<Vec<(SimpleRPolygon<SInt>, u8)>>>,
obstacles: &Vec<(SimpleRPolygon<SInt>, u8)>
) -> HashMap<usize, SimpleRoutedNet>;
// Provided methods
fn compute_routes(
&self,
boundary: Rect<SInt>,
net_terminals: &HashMap<usize, Vec<Vec<(SimpleRPolygon<SInt>, u8)>>>,
obstacles: &Vec<(SimpleRPolygon<SInt>, u8)>
) -> HashMap<usize, SimpleRoutedNet> { ... }
fn draw_routes<LN: L2NEdit<Coord = SInt>>(
&self,
chip: &mut LN,
routes: HashMap<usize, SimpleRoutedNet>,
routes_cell: LN::CellId,
routing_layers: &Vec<LN::LayerId>,
via_layers: &Vec<LN::LayerId>
) { ... }
fn route_all_nets<LN: L2NEdit<Coord = SInt>>(
&self,
chip: &mut LN,
top_cell: LN::CellId,
routing_layers: &Vec<LN::LayerId>,
via_layers: &Vec<LN::LayerId>
) -> Result<(), Vec<LN::NetId>> { ... }
fn route_nets<LN: L2NEdit<Coord = SInt>>(
&self,
chip: &mut LN,
top_cell: LN::CellId,
routing_layers: &Vec<LN::LayerId>,
via_layers: &Vec<LN::LayerId>,
nets: &Vec<LN::NetId>
) -> Result<(), Vec<LN::NetId>> { ... }
}Expand description
Basic trait for a router with a simplified interface.
The simplified router gets as an input an already flattened set of net terminal shapes that need to be connected.
Required Methods§
sourcefn compute_routes_impl(
&self,
boundary: Rect<SInt>,
net_terminals: &HashMap<usize, Vec<Vec<(SimpleRPolygon<SInt>, u8)>>>,
obstacles: &Vec<(SimpleRPolygon<SInt>, u8)>
) -> HashMap<usize, SimpleRoutedNet>
fn compute_routes_impl( &self, boundary: Rect<SInt>, net_terminals: &HashMap<usize, Vec<Vec<(SimpleRPolygon<SInt>, u8)>>>, obstacles: &Vec<(SimpleRPolygon<SInt>, u8)> ) -> HashMap<usize, SimpleRoutedNet>
Routing algorithm implementation.
Provided Methods§
sourcefn compute_routes(
&self,
boundary: Rect<SInt>,
net_terminals: &HashMap<usize, Vec<Vec<(SimpleRPolygon<SInt>, u8)>>>,
obstacles: &Vec<(SimpleRPolygon<SInt>, u8)>
) -> HashMap<usize, SimpleRoutedNet>
fn compute_routes( &self, boundary: Rect<SInt>, net_terminals: &HashMap<usize, Vec<Vec<(SimpleRPolygon<SInt>, u8)>>>, obstacles: &Vec<(SimpleRPolygon<SInt>, u8)> ) -> HashMap<usize, SimpleRoutedNet>
Wrapper around compute_route_impl().
Does some sanity checks before and after.
boundary: Boundary of the area that can be used for the routing.net_terminals: Pin shapes for each net together with the layer number. Lowest layer is0.obstacles: Obstacle shapes together with the layer number.
Returns all freshly drawn routes.
sourcefn draw_routes<LN: L2NEdit<Coord = SInt>>(
&self,
chip: &mut LN,
routes: HashMap<usize, SimpleRoutedNet>,
routes_cell: LN::CellId,
routing_layers: &Vec<LN::LayerId>,
via_layers: &Vec<LN::LayerId>
)
fn draw_routes<LN: L2NEdit<Coord = SInt>>( &self, chip: &mut LN, routes: HashMap<usize, SimpleRoutedNet>, routes_cell: LN::CellId, routing_layers: &Vec<LN::LayerId>, via_layers: &Vec<LN::LayerId> )
Draw the computed routes into the layout.
routes: Routes computed withcompute_routes().routes_cell: The cell where to draw the routes into.routing_layers: The metal layer stack starting with the layer ID of the lowest metal layer.via_layers: IDs of the via layers, starting with the lowest via layer which is the via layer between the first two metal layers.
sourcefn route_all_nets<LN: L2NEdit<Coord = SInt>>(
&self,
chip: &mut LN,
top_cell: LN::CellId,
routing_layers: &Vec<LN::LayerId>,
via_layers: &Vec<LN::LayerId>
) -> Result<(), Vec<LN::NetId>>
fn route_all_nets<LN: L2NEdit<Coord = SInt>>( &self, chip: &mut LN, top_cell: LN::CellId, routing_layers: &Vec<LN::LayerId>, via_layers: &Vec<LN::LayerId> ) -> Result<(), Vec<LN::NetId>>
Route all nets in the top_cell.
top_cell: The cell containing the layout to be routed.routing_layers: The metal layer stack starting with the layer ID of the lowest metal layer.via_layers: IDs of the via layers, starting with the lowest via layer which is the via layer between the first two metal layers.
Returns
- On success returns
Ok(()). - On failure, when some nets could not be routed returns a list of the unrouted nets
Err(unrouted nets).
sourcefn route_nets<LN: L2NEdit<Coord = SInt>>(
&self,
chip: &mut LN,
top_cell: LN::CellId,
routing_layers: &Vec<LN::LayerId>,
via_layers: &Vec<LN::LayerId>,
nets: &Vec<LN::NetId>
) -> Result<(), Vec<LN::NetId>>
fn route_nets<LN: L2NEdit<Coord = SInt>>( &self, chip: &mut LN, top_cell: LN::CellId, routing_layers: &Vec<LN::LayerId>, via_layers: &Vec<LN::LayerId>, nets: &Vec<LN::NetId> ) -> Result<(), Vec<LN::NetId>>
Route a set of nets and creates a new cell that contains the shapes of the routes. Also outputs the routing terminal shapes to this cell (for debugging).
top_cell: The cell containing the layout to be routed.routing_layers: The metal layer stack starting with the layer ID of the lowest metal layer.via_layers: IDs of the via layers, starting with the lowest via layer which is the via layer between the first two metal layers.nets: The nets to be routed.
Returns
- On success returns
Ok(()). - On failure, when some nets could not be routed returns a list of the unrouted nets
Err(unrouted nets).