Introduction
DEF together with LEF is a common file format in VLSI physical design. Generally LEF/DEF formats are quit complicated due to the complex cases in chip design. This parser is adjusted from the open source LEF parser released by Cadence Design Systems with C++ wrappers. The original parsers lie in the Thirdparty package. Users have to follow the LICENSE agreement from the original release. The parser does not contain full API of the original LEF/DEF parsers, but it is tested under various academic benchmarks for VLSI placement.
Examples
Flex/Bison Parser
See documented version: test/parsers/def/test_adapt.cpp
#include <iostream>
#include <fstream>
using std::cout;
using std::cin;
using std::endl;
using std::string;
{
public:
{
cout << "DefDataBase::" << __func__ << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ << " => " << t1 << "," << t2 << "," << t3 << "," << t4 << endl;
}
{
cout << __func__ << endl;
}
{
cout << __func__ <<
": " << c.
comp_name <<
": status = " << c.
status << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ <<
": " << p.
pin_name << endl;
}
{
cout << __func__ << " => " << token << endl;
}
{
}
{
cout << __func__ << " => " << token << endl;
}
{
cout << __func__ << " => " << n << endl;
}
{
cout << __func__ << " => ";
for (std::vector<std::vector<int> >::const_iterator it = vBbox.begin(); it != vBbox.end(); ++it)
cout << "(" << (*it)[0] << ", " << (*it)[1] << ", " << (*it)[2] << ", " << (*it)[3] << ") ";
cout << endl;
}
{
cout << __func__ << endl;
}
};
void test1(
string const& filename)
{
cout << "////////////// test1 ////////////////" << endl;
}
void test2(
string const& filename)
{
cout << "////////////// test2 ////////////////" << endl;
driver.parse_file(filename);
}
int main(
int argc,
char** argv)
{
if (argc > 1)
{
}
else
cout << "at least 1 argument is required" << endl;
return 0;
}
Compiling and running commands (assuming LIMBO_DIR is exported as the environment variable to the path where limbo library is installed)
1 g++ -o test_adapt test_adapt.cpp -I $LIMBO_DIR/include -L $LIMBO_DIR/lib -ldefparseradapt
2 ./test_adapt benchmarks/simple.def
All Examples
References
LICENSE
Copyright 2012 - 2016, Cadence Design Systems
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.