Skip to content

Commit 215d7ca

Browse files
committed
refactor(compiler): merging main
1 parent edd79e0 commit 215d7ca

File tree

3 files changed

+12
-37
lines changed

3 files changed

+12
-37
lines changed

core/compiler/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ derive-where = { version = "1", features = ["serde"] }
88
nalgebra = { version = "0.34", features = ["rayon"] }
99
nalgebra-sparse = "0.11"
1010
klayout-lyp = "0.1.1"
11+
rayon = "1.10"
12+
libc = "0.2"
13+
rand = "0.8.5"
1114
gds21 = "0.2"
1215

1316
anyhow = { workspace = true }

core/compiler/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub mod spqr;
1010
#[cfg(test)]
1111
mod tests {
1212

13+
use gds21::GdsUnits;
1314
use std::path::PathBuf;
1415

1516
use crate::{
@@ -20,7 +21,7 @@ mod tests {
2021
use approx::assert_relative_eq;
2122
use const_format::concatcp;
2223

23-
use crate::compile::{compile, CellArg, CompileInput};
24+
use crate::compile::{CellArg, CompileInput, compile};
2425
const EPSILON: f64 = 1e-10;
2526

2627
const EXAMPLES_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../examples");
@@ -435,11 +436,14 @@ mod tests {
435436

436437
assert!(cells.is_valid());
437438

439+
let GDunit = GdsUnits::new(0.001, 1e-9);
440+
438441
let work_dir =
439442
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("build/argon_sky130_inverter");
440443
cells
441444
.to_gds(
442445
GdsMap::from_lyp(SKY130_LYP).expect("failed to create GDS map"),
446+
GDunit,
443447
work_dir.join("layout.gds"),
444448
)
445449
.expect("Failed to write to GDS");
@@ -678,10 +682,13 @@ mod tests {
678682
);
679683
println!("{cells:#?}");
680684

685+
let GDunit = GdsUnits::new(0.001, 1e-9);
686+
681687
let work_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("build/argon_text");
682688
cells
683689
.to_gds(
684690
GdsMap::from_lyp(SKY130_LYP).expect("failed to create GDS map"),
691+
GDunit,
685692
work_dir.join("layout.gds"),
686693
)
687694
.expect("Failed to write to GDS");

core/compiler/src/solver.rs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use indexmap::{IndexMap, IndexSet};
44
use itertools::{Either, Itertools};
55
use nalgebra::DVector;
66
use nalgebra_sparse::{CooMatrix, CsrMatrix};
7+
use rayon::iter::IntoParallelRefIterator;
78
use rayon::prelude::*;
89
use serde::{Deserialize, Serialize};
910

@@ -432,42 +433,6 @@ mod tests {
432433
assert_relative_eq!(*solver.solved_vars.get(&z).unwrap(), 4., epsilon = EPSILON);
433434
}
434435

435-
#[test]
436-
fn linear_constraints_solved_correctly_five() {
437-
let mut solver = Solver::new();
438-
let x = solver.new_var();
439-
let y = solver.new_var();
440-
let z = solver.new_var();
441-
solver.constrain_eq0(LinearExpr {
442-
coeffs: vec![(2., x), (1., y), (1., z)],
443-
constant: -0.03,
444-
});
445-
solver.constrain_eq0(LinearExpr {
446-
coeffs: vec![(1., x), (2., y), (1., z)],
447-
constant: -0.05,
448-
});
449-
solver.constrain_eq0(LinearExpr {
450-
coeffs: vec![(1., x), (1., y), (2., z)],
451-
constant: -0.08,
452-
});
453-
solver.solve();
454-
assert_relative_eq!(
455-
*solver.solved_vars.get(&x).unwrap(),
456-
-0.01,
457-
epsilon = EPSILON
458-
);
459-
assert_relative_eq!(
460-
*solver.solved_vars.get(&y).unwrap(),
461-
0.01,
462-
epsilon = EPSILON
463-
);
464-
assert_relative_eq!(
465-
*solver.solved_vars.get(&z).unwrap(),
466-
0.04,
467-
epsilon = EPSILON
468-
);
469-
}
470-
471436
//big matrix
472437
#[test]
473438
fn big_num_stab_test() {

0 commit comments

Comments
 (0)