Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulk29 committed Dec 31, 2023
1 parent 60230a0 commit 943de4d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 30 deletions.
4 changes: 2 additions & 2 deletions libs/atoll/src/abs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl AtollAbstract {
.layer_bbox(virtual_layers.outline.id())
.expect("cell must provide an outline on ATOLL virtual layer");

let top = top_layer(cell, &*stack)
let top = top_layer(cell, &stack)
.expect("cell did not have any ATOLL routing layers; cannot produce an abstract");
let top = if top == 0 { 1 } else { top };

Expand All @@ -184,7 +184,7 @@ impl AtollAbstract {
let grid = RoutingGrid::new((*stack).clone(), 0..top + 1);
let mut state = RoutingState::new((*stack).clone(), top, nx, ny);
let mut ports = Vec::new();
for (i, (name, geom)) in cell.ports().enumerate() {
for (i, (_name, geom)) in cell.ports().enumerate() {
let net = NetId(i);
ports.push(net);
if let Some(layer) = stack.layer_idx(geom.primary.layer().drawing()) {
Expand Down
5 changes: 2 additions & 3 deletions libs/atoll/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use grid::Grid;
use num::integer::{div_ceil, div_floor};
use serde::{Deserialize, Serialize};
use std::any::Any;
use std::collections::HashMap;
use std::marker::PhantomData;
use std::ops::{Deref, DerefMut, Range};

use std::ops::Range;
use substrate::context::{ContextBuilder, Installation};
use substrate::geometry::corner::Corner;
use substrate::geometry::dims::Dims;
Expand Down
33 changes: 15 additions & 18 deletions libs/atoll/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,28 @@ pub mod grid;

use crate::abs::AtollAbstract;
use crate::grid::{LayerStack, PdkLayer};
use ::grid::Grid;
use ena::unify::{UnifyKey, UnifyValue};

use ena::unify::UnifyKey;
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet, VecDeque};
use std::marker::PhantomData;
use std::ops::Deref;
use std::collections::HashMap;

use std::sync::Arc;
use substrate::arcstr::ArcStr;
use substrate::block::Block;
use substrate::context::{prepare_cell_builder, Context, PdkContext};
use substrate::context::{prepare_cell_builder, PdkContext};
use substrate::geometry::polygon::Polygon;
use substrate::geometry::prelude::{Bbox, Dir, Point, Transformation};
use substrate::geometry::transform::{HasTransformedView, Translate, TranslateMut};
use substrate::io::layout::{Builder, PortGeometry, PortGeometryBuilder};
use substrate::io::schematic::{Bundle, Connect, Node, Terminal, TerminalView};
use substrate::io::{FlatLen, Flatten, Signal};
use substrate::geometry::prelude::{Bbox, Dir, Point};
use substrate::geometry::transform::{Translate, TranslateMut};
use substrate::io::layout::{Builder, PortGeometry};
use substrate::io::schematic::{Bundle, Connect, Node, TerminalView};
use substrate::io::{FlatLen, Flatten};
use substrate::layout::element::Shape;
use substrate::layout::tracks::{EnumeratedTracks, FiniteTracks, Tracks};

use substrate::layout::{ExportsLayoutData, Layout};
use substrate::pdk::layers::{HasPin, Layers};
use substrate::pdk::Pdk;
use substrate::schematic::schema::Schema;
use substrate::schematic::{
CellId, ExportsNestedData, HasNestedView, InstanceId, InstancePath, SchemaCellHandle, Schematic,
};
use substrate::schematic::{CellId, ExportsNestedData, Schematic};
use substrate::{io, layout, schematic};

/// Identifies nets in a routing solver.
Expand Down Expand Up @@ -504,7 +501,7 @@ impl<'a, PDK: Pdk + Schema> AtollTileBuilder<'a, PDK> {
let layout = self.layout.generate(block.clone());
let schematic = self.schematic.instantiate(block);
let abs = AtollAbstract::generate(&self.layout.ctx, layout.raw_cell());
let top = abs.top_layer;
let _top = abs.top_layer;
Instance {
layout,
schematic,
Expand All @@ -523,7 +520,7 @@ impl<'a, PDK: Pdk + Schema> AtollTileBuilder<'a, PDK> {
let schematic = self.schematic.instantiate(wrapper);
// todo: generate abstract from AtollTile trait directly
let abs = AtollAbstract::generate(&self.layout.ctx, layout.raw_cell());
let top = abs.top_layer;
let _top = abs.top_layer;
Instance {
layout,
schematic,
Expand Down Expand Up @@ -582,7 +579,7 @@ impl<'a, PDK: Pdk + Schema> AtollTileBuilder<'a, PDK> {
}

/// Match the given nodes and port geometry.
pub fn match_geometry<D1, D2>(&mut self, s1: D1, s2: D2)
pub fn match_geometry<D1, D2>(&mut self, _s1: D1, _s2: D2)
where
D1: Flatten<Node>,
D2: Flatten<PortGeometry>,
Expand Down
2 changes: 0 additions & 2 deletions libs/geometry/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,6 @@ impl<T: HasTransformedView> HasTransformedView for Vec<T> {

#[cfg(test)]
mod tests {
use std::collections::HashMap;
use std::sync::{Arc, Mutex};

use approx::assert_relative_eq;

Expand Down
2 changes: 1 addition & 1 deletion substrate/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ impl<T: Block> Block for Arc<T> {
}

fn io(&self) -> Self::Io {
T::io(&self)
T::io(self)
}
}
8 changes: 4 additions & 4 deletions tests/src/atoll/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use atoll::abs::{AtollAbstract, DebugAbstract};
use atoll::grid::{LayerStack, PdkLayer};
use atoll::{AtollIo, AtollTile, AtollTileBuilder, AtollTileWrapper};
use geometry::point::Point;
use geometry::rect::Rect;

use serde::{Deserialize, Serialize};
use sky130pdk::atoll::{MosLength, NmosTile};
use sky130pdk::{Sky130CommercialSchema, Sky130Pdk};
use spice::netlist::NetlistOptions;
use spice::Spice;
use substrate::block::Block;
use substrate::io::layout::{HardwareType, IoShape};
use substrate::io::layout::HardwareType;
use substrate::io::{InOut, Io, Signal};
use substrate::layout::tiling::{GridTiler, Tile};

use substrate::layout::{CellBuilder, ExportsLayoutData, Layout};
use substrate::schematic;
use substrate::schematic::netlist::ConvertibleNetlister;
Expand Down Expand Up @@ -144,7 +144,7 @@ impl AtollTile<Sky130Pdk> for Sky130NmosTileAutoroute {
let mut instances = Vec::new();

for i in 0..3 {
let mut inst = cell.generate_primitive(block.clone());
let mut inst = cell.generate_primitive(block);
inst.translate_mut(Point::new(5 * i, 0));
cell.draw(&inst)?;

Expand Down

0 comments on commit 943de4d

Please sign in to comment.