Bugfixed map file reader for mask case, added test

This commit is contained in:
Matthias Koefferlein 2020-08-02 00:56:55 +02:00
parent 440b2b122b
commit 404799bdfd
5 changed files with 44 additions and 48 deletions

View File

@ -783,7 +783,7 @@ LEFDEFReaderState::read_map_file (const std::string &path, db::Layout &layout)
tl::Extractor ex (p_uc.c_str ());
std::string ps;
ex.read (ps);
ex.read_word_or_quoted (ps);
unsigned int mask = 0;
@ -805,6 +805,11 @@ LEFDEFReaderState::read_map_file (const std::string &path, db::Layout &layout)
}
if (mask > 0) {
purpose_str += ":";
purpose_str += tl::to_string (mask);
}
}
std::string final_name = w1 + "." + purpose_str;

View File

@ -473,5 +473,42 @@ TEST(113_masks_1)
"'VIA0.VIA:2' : VIA0 (2/202)\n"
"'M0PO.NET:1' : M0PO (1/100)\n"
)
options = default_options ();
lm_read = run_test (_this, "masks-1", "map:in.map+lef:in_tech.lef+def:in.def", "au_map.oas.gz", options, false);
EXPECT_EQ (lm_read.to_string_file_format (),
"OUTLINE : OUTLINE (4/0)\n"
"'M0PO.NET:1' : 'M0PO.NET:1' (1/100)\n"
"'M0PO.NET:2' : 'M0PO.NET:2' (1/200)\n"
"'M0PO.SPNET:1' : 'M0PO.SPNET:1' (1/101)\n"
"'M0PO.SPNET:2' : 'M0PO.SPNET:2' (1/201)\n"
"'M0PO.VIA:1' : 'M0PO.VIA:1' (1/102)\n"
"'M0PO.VIA:2' : 'M0PO.VIA:2' (1/202)\n"
"M0PO.LABEL : M0PO.LABEL (1/1)\n"
"M0PO.PIN : M0PO.PIN (1/2)\n"
"'M0PO.PIN:1' : 'M0PO.PIN:1' (1/110)\n"
"'M0PO.PIN:2' : 'M0PO.PIN:2' (1/210)\n"
"'M1.NET:1' : 'M1.NET:1' (3/100)\n"
"'M1.NET:2' : 'M1.NET:2' (3/200)\n"
"'M1.SPNET:1' : 'M1.SPNET:1' (3/101)\n"
"'M1.SPNET:2' : 'M1.SPNET:2' (3/201)\n"
"'M1.VIA:1' : 'M1.VIA:1' (3/102)\n"
"'M1.VIA:2' : 'M1.VIA:2' (3/202)\n"
"M1.LABEL : M1.LABEL (3/1)\n"
"M1.PIN : M1.PIN (3/2)\n"
"'M1.PIN:1' : 'M1.PIN:1' (3/110)\n"
"'M1.PIN:2' : 'M1.PIN:2' (3/210)\n"
"'VIA0.NET:1' : 'VIA0.NET:1' (2/100)\n"
"'VIA0.NET:2' : 'VIA0.NET:2' (2/200)\n"
"'VIA0.SPNET:1' : 'VIA0.SPNET:1' (2/101)\n"
"'VIA0.SPNET:2' : 'VIA0.SPNET:2' (2/201)\n"
"'VIA0.VIA:1' : 'VIA0.VIA:1' (2/102)\n"
"'VIA0.VIA:2' : 'VIA0.VIA:2' (2/202)\n"
"VIA0.LABEL : VIA0.LABEL (2/1)\n"
"VIA0.PIN : VIA0.PIN (2/2)\n"
"'VIA0.PIN:1' : 'VIA0.PIN:1' (2/110)\n"
"'VIA0.PIN:2' : 'VIA0.PIN:2' (2/210)\n"
)
}

View File

@ -193,7 +193,7 @@ const char *ANSI_GREEN = "\033[32m";
const char *ANSI_RESET = "\033[0m";
TestConsole::TestConsole (FILE *file)
: m_file (file), m_col (0), m_max_col (250), m_columns (50), m_rows (0), m_file_is_tty (false)
: m_file (file), m_col (0), m_max_col (400), m_columns (50), m_rows (0), m_file_is_tty (false)
{
ms_instance = this;

BIN
testdata/lefdef/masks-1/au_map.oas.gz vendored Normal file

Binary file not shown.

View File

@ -1,46 +0,0 @@
DIEAREA ALL 100 0
M0PO LEFPIN 10 0
M0PO LEFPIN:MASK:1 10 1
M0PO LEFPIN:MASK:2 10 2
M0PO PIN 10 10
M0PO PIN:MASK:1 10 11
M0PO PIN:MASK:2 10 12
M0PO NET 10 20
M0PO NET:MASK:1 10 21
M0PO NET:MASK:2 10 22
M0PO SPNET 10 30
M0PO SPNET:MASK:1 10 31
M0PO SPNET:MASK:2 10 32
M0PO VIA 10 30
M0PO VIA:MASK:1 10 31
M0PO VIA:MASK:2 10 32
VIA LEFPIN 11 0
VIA LEFPIN:MASK:1 11 1
VIA LEFPIN:MASK:2 11 2
VIA PIN 11 10
VIA PIN:MASK:1 11 11
VIA PIN:MASK:2 11 12
VIA NET 11 20
VIA NET:MASK:1 11 21
VIA NET:MASK:2 11 22
VIA SPNET 11 30
VIA SPNET:MASK:1 11 31
VIA SPNET:MASK:2 11 32
VIA VIA 11 30
VIA VIA:MASK:1 11 31
VIA VIA:MASK:2 11 32
M1 LEFPIN 12 0
M1 LEFPIN:MASK:1 12 1
M1 LEFPIN:MASK:2 12 2
M1 PIN 12 10
M1 PIN:MASK:1 12 11
M1 PIN:MASK:2 12 12
M1 NET 12 20
M1 NET:MASK:1 12 21
M1 NET:MASK:2 12 22
M1 SPNET 12 30
M1 SPNET:MASK:1 12 31
M1 SPNET:MASK:2 12 32
M1 VIA 12 30
M1 VIA:MASK:1 12 31
M1 VIA:MASK:2 12 32