Example standard-cell placement engine for the LibrEDA-Rust framework. This placement algorithm simulates the movement of electric charges that are sparsely connected by springs (wires).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.7 KiB

/*
* Copyright (c) 2019-2020 Thomas Kramer.
*
* This file is part of LibrEDA
* (see https://codeberg.org/libreda).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//! Example standard-cell placement algorithms for the LibrEDA framework.
//!
//! * [`SimpleQuadraticPlacer`] does global placement of standard-cells by minimizing the quadratic wire-length.
//! It yields solutions quickly but they have strong overlaps and do not respect any density constraints.
//! Quadratic placement is therefore used mainly as an initial value for other placers.
//! * [`ElectronPlacer`] is a global placement algorithm driven by electrostatic repulsion between cells
//! and attracting spring forces between connected cells. Works best with an initial placement. The initial
//! placement can come for example from the [`SimpleQuadraticPlacer`].
//! * [`DiffusionPlacer`] simulates the diffusion of charges to solve density contraints. This placer
//! requires a relatively good initial placement.
//!
#![deny(missing_docs)]
// TODO: Remove those once this crate stabilizes.
#![allow(unused)]
mod types;
mod nbody;
mod quadtree;
mod spring_force;
mod quadratic_placer;
mod electron_placer;
mod placer_argmin;
mod sparse_matrix;
mod diffusion_placer;
pub mod eplace_ms;
pub use quadratic_placer::SimpleQuadraticPlacer;
pub use crate::electron_placer::ElectronPlacer;
pub use placer_argmin::ElectronPlacerArgmin;
pub use diffusion_placer::DiffusionPlacer;
// #[test]
// fn test_sparse21_solve_sparse_matrix() {
// let mut m = sparse21::Matrix::from_entries(vec![
// (0, 0, 1.0),
// (0, 1, 1.0),
// (0, 2, 1.0),
// (1, 1, 2.0),
// (1, 2, 5.0),
// (2, 0, 2.0),
// (2, 1, 5.0),
// (2, 2, -1.0),
// ]);
//
// let soln = m.solve(vec![6.0, -4.0, 27.0]);
// assert_eq!(soln.unwrap(), vec![5.0, 3.0, -2.0]);
// }
// #[test]
// fn test_nalgebra_sparse_matrix() {
// extern crate nalgebra;
// use nalgebra as na;
// let n = na::Dynamic::new(4);
// let mat = na::sparse::CsMatrix::new_uninitialized_generic(n, n, 6);
// }