From f4efb0ded971d8ef49112f0631b255ac82e32254 Mon Sep 17 00:00:00 2001 From: Dan Fritchman Date: Sat, 22 Jun 2024 13:30:16 -0700 Subject: [PATCH] Revert "Made parser capable of handling USEMINSPACING and MASKS in rectangles" --- lef21/src/data.rs | 5 ++--- lef21/src/read.rs | 19 ++++--------------- lef21/src/write.rs | 9 ++------- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/lef21/src/data.rs b/lef21/src/data.rs index f9afdd9..56ed789 100644 --- a/lef21/src/data.rs +++ b/lef21/src/data.rs @@ -93,7 +93,7 @@ pub struct LefLibrary { /// "Use Min Spacing" Option #[serde(default, skip_serializing)] #[builder(default)] - pub use_min_spacing: Option, + pub use_min_spacing: Option, /// Clearance Measure #[serde(default, skip_serializing)] #[builder(default)] @@ -426,7 +426,7 @@ pub enum LefGeometry { /// rectangles, polygons, and paths. #[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq, Eq)] pub enum LefShape { - Rect(Option, LefPoint, LefPoint), + Rect(LefPoint, LefPoint), Polygon(Vec), Path(Vec), } @@ -610,7 +610,6 @@ enumstr!( DesignRuleWidth: "DESIGNRULEWIDTH", Spacing: "SPACING", Bump: "BUMP", - Mask: "MASK", // UNITS Fields Units: "UNITS", diff --git a/lef21/src/read.rs b/lef21/src/read.rs index 04054df..385112a 100644 --- a/lef21/src/read.rs +++ b/lef21/src/read.rs @@ -503,15 +503,9 @@ impl<'src> LefParser<'src> { self.expect_key(LefKey::Library)?; // Expect END LIBRARY break; } - LefKey::UseMinSpacing => { - self.advance()?; - self.expect_key(LefKey::Obs)?; - let e = self.parse_enum::()?; - self.expect(TokenType::SemiColon)?; - lib.use_min_spacing(e) - } LefKey::BeginExtension | LefKey::ManufacturingGrid + | LefKey::UseMinSpacing | LefKey::ClearanceMeasure | LefKey::PropertyDefinitions | LefKey::MaxViaStack @@ -837,21 +831,16 @@ impl<'src> LefParser<'src> { match self.peek_key()? { LefKey::Rect => { self.advance()?; - let mut mask = None; if self.matches(TokenType::Name) { - if self.get_key()? == LefKey::Mask { - mask = Some(self.parse_number()?); - } else { - // The ITERATE construction would go here, but is not supported. - self.fail(LefParseErrorType::Unsupported)?; - } + // The ITERATE construction would go here, but is not supported. + self.fail(LefParseErrorType::Unsupported)?; } // Parse the two points let p1 = self.parse_point()?; let p2 = self.parse_point()?; self.expect(TokenType::SemiColon)?; // And return the Rect - Ok(LefGeometry::Shape(LefShape::Rect(mask, p1, p2))) + Ok(LefGeometry::Shape(LefShape::Rect(p1, p2))) } LefKey::Polygon => { self.advance()?; diff --git a/lef21/src/write.rs b/lef21/src/write.rs index 5fe6566..e68aabf 100644 --- a/lef21/src/write.rs +++ b/lef21/src/write.rs @@ -294,13 +294,8 @@ impl<'wr> LefWriter<'wr> { match geom { LefGeometry::Iterate { .. } => unimplemented!(), LefGeometry::Shape(ref shape) => match shape { - LefShape::Rect(mask, p0, p1) => { - let mut line = format!("{Rect} "); - match mask { - Some(mask) => line.push_str(&format!("MASK {mask} ")), - None => (), - }; - self.write_line(format_args_f!("{line}{p0} {p1} ; "))?; + LefShape::Rect(p0, p1) => { + self.write_line(format_args_f!("{Rect} {p0} {p1} ; "))?; } LefShape::Polygon(pts) => { let ptstr = pts