From b9a9422905debb635c01403cd7167e6c73832c48 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 7 Mar 2022 22:18:09 +0100 Subject: [PATCH] LEF/DEF paths for buddies are relative to cwd --- .../streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc index d93afec52..1cce6e831 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc @@ -116,7 +116,12 @@ LEFDEFReader::read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &opti effective_options = *lefdef_options; } - db::LEFDEFReaderState state (&effective_options, layout, effective_options.paths_relative_to_cwd () ? std::string () : tl::dirname (m_stream.absolute_path ())); + std::string base_path; + if (! effective_options.paths_relative_to_cwd ()) { + base_path = tl::dirname (m_stream.absolute_path ()); + } + + db::LEFDEFReaderState state (&effective_options, layout, base_path); layout.dbu (effective_options.dbu ()); @@ -131,7 +136,7 @@ LEFDEFReader::read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &opti for (std::vector::const_iterator l = effective_options.begin_lef_files (); l != effective_options.end_lef_files (); ++l) { - std::string lp = correct_path (*l, layout, tl::dirname (m_stream.absolute_path ())); + std::string lp = correct_path (*l, layout, base_path); tl::InputStream lef_stream (lp); tl::log << tl::to_string (tr ("Reading")) << " " << lp; @@ -152,7 +157,7 @@ LEFDEFReader::read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &opti for (std::vector::const_iterator l = effective_options.begin_lef_files (); l != effective_options.end_lef_files (); ++l) { - std::string lp = correct_path (*l, layout, tl::dirname (m_stream.absolute_path ())); + std::string lp = correct_path (*l, layout, base_path); tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading LEF file: ")) + lp); @@ -205,7 +210,7 @@ LEFDEFReader::read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &opti tl::shared_collection macro_layout_object_holder; for (std::vector::const_iterator l = effective_options.begin_macro_layout_files (); l != effective_options.end_macro_layout_files (); ++l) { - std::string lp = correct_path (*l, layout, tl::dirname (m_stream.absolute_path ())); + std::string lp = correct_path (*l, layout, base_path); tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading LEF macro layout file: ")) + lp);