Skip to content

Commit 54d8b1c

Browse files
Merge remote-tracking branch 'upstream/openroad' into cts_dbwrapper_update
2 parents ae0a928 + 24f08c6 commit 54d8b1c

40 files changed

+853
-1035
lines changed

LICENSE

Lines changed: 28 additions & 674 deletions
Large diffs are not rendered by default.

doc/CodingPractices.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ Same here:
173173
}
174174

175175

176+
....
177+
Don't use logical operators to test for null pointers.
178+
179+
if (!net) {
180+
181+
should be
182+
183+
if (net != nullptr) {
184+
176185
....
177186

178187
Don't use malloc.

include/openroad/Error.hh

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
1-
// Copyright (c) 2020, Parallax Software, Inc.
2-
//
3-
// This program is free software: you can redistribute it and/or modify
4-
// it under the terms of the GNU General Public License as published by
5-
// the Free Software Foundation, either version 3 of the License, or
6-
// (at your option) any later version.
7-
//
8-
// This program is distributed in the hope that it will be useful,
9-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
// GNU General Public License for more details.
12-
//
13-
// You should have received a copy of the GNU General Public License
14-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1+
/////////////////////////////////////////////////////////////////////////////
2+
//
3+
// BSD 3-Clause License
4+
//
5+
// Copyright (c) 2019, James Cherry, Parallax Software, Inc.
6+
// All rights reserved.
7+
//
8+
// Redistribution and use in source and binary forms, with or without
9+
// modification, are permitted provided that the following conditions are met:
10+
//
11+
// * Redistributions of source code must retain the above copyright notice, this
12+
// list of conditions and the following disclaimer.
13+
//
14+
// * Redistributions in binary form must reproduce the above copyright notice,
15+
// this list of conditions and the following disclaimer in the documentation
16+
// and/or other materials provided with the distribution.
17+
//
18+
// * Neither the name of the copyright holder nor the names of its
19+
// contributors may be used to endorse or promote products derived from
20+
// this software without specific prior written permission.
21+
//
22+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
// POSSIBILITY OF SUCH DAMAGE.
33+
//
34+
///////////////////////////////////////////////////////////////////////////////
1535

1636
#pragma once
1737

include/openroad/InitOpenRoad.hh

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
1-
// This program is free software: you can redistribute it and/or modify
2-
// it under the terms of the GNU General Public License as published by
3-
// the Free Software Foundation, either version 3 of the License, or
4-
// (at your option) any later version.
5-
//
6-
// This program is distributed in the hope that it will be useful,
7-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
8-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9-
// GNU General Public License for more details.
10-
//
11-
// You should have received a copy of the GNU General Public License
12-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1+
/////////////////////////////////////////////////////////////////////////////
2+
//
3+
// BSD 3-Clause License
4+
//
5+
// Copyright (c) 2019, James Cherry, Parallax Software, Inc.
6+
// All rights reserved.
7+
//
8+
// Redistribution and use in source and binary forms, with or without
9+
// modification, are permitted provided that the following conditions are met:
10+
//
11+
// * Redistributions of source code must retain the above copyright notice, this
12+
// list of conditions and the following disclaimer.
13+
//
14+
// * Redistributions in binary form must reproduce the above copyright notice,
15+
// this list of conditions and the following disclaimer in the documentation
16+
// and/or other materials provided with the distribution.
17+
//
18+
// * Neither the name of the copyright holder nor the names of its
19+
// contributors may be used to endorse or promote products derived from
20+
// this software without specific prior written permission.
21+
//
22+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
// POSSIBILITY OF SUCH DAMAGE.
33+
//
34+
///////////////////////////////////////////////////////////////////////////////
1335

1436
#pragma once
1537

include/openroad/OpenRoad.hh

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
1-
// This program is free software: you can redistribute it and/or modify
2-
// it under the terms of the GNU General Public License as published by
3-
// the Free Software Foundation, either version 3 of the License, or
4-
// (at your option) any later version.
5-
//
6-
// This program is distributed in the hope that it will be useful,
7-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
8-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9-
// GNU General Public License for more details.
10-
//
11-
// You should have received a copy of the GNU General Public License
12-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1+
/////////////////////////////////////////////////////////////////////////////
2+
//
3+
// BSD 3-Clause License
4+
//
5+
// Copyright (c) 2019, James Cherry, Parallax Software, Inc.
6+
// All rights reserved.
7+
//
8+
// Redistribution and use in source and binary forms, with or without
9+
// modification, are permitted provided that the following conditions are met:
10+
//
11+
// * Redistributions of source code must retain the above copyright notice, this
12+
// list of conditions and the following disclaimer.
13+
//
14+
// * Redistributions in binary form must reproduce the above copyright notice,
15+
// this list of conditions and the following disclaimer in the documentation
16+
// and/or other materials provided with the distribution.
17+
//
18+
// * Neither the name of the copyright holder nor the names of its
19+
// contributors may be used to endorse or promote products derived from
20+
// this software without specific prior written permission.
21+
//
22+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
// POSSIBILITY OF SUCH DAMAGE.
33+
//
34+
///////////////////////////////////////////////////////////////////////////////
1335

1436
#pragma once
1537

src/FastRoute

src/OpenDB

src/OpenRoad.cc

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
1-
// This program is free software: you can redistribute it and/or modify
2-
// it under the terms of the GNU General Public License as published by
3-
// the Free Software Foundation, either version 3 of the License, or
4-
// (at your option) any later version.
5-
//
6-
// This program is distributed in the hope that it will be useful,
7-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
8-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9-
// GNU General Public License for more details.
10-
//
11-
// You should have received a copy of the GNU General Public License
12-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1+
/////////////////////////////////////////////////////////////////////////////
2+
//
3+
// BSD 3-Clause License
4+
//
5+
// Copyright (c) 2019, James Cherry, Parallax Software, Inc.
6+
// All rights reserved.
7+
//
8+
// Redistribution and use in source and binary forms, with or without
9+
// modification, are permitted provided that the following conditions are met:
10+
//
11+
// * Redistributions of source code must retain the above copyright notice, this
12+
// list of conditions and the following disclaimer.
13+
//
14+
// * Redistributions in binary form must reproduce the above copyright notice,
15+
// this list of conditions and the following disclaimer in the documentation
16+
// and/or other materials provided with the distribution.
17+
//
18+
// * Neither the name of the copyright holder nor the names of its
19+
// contributors may be used to endorse or promote products derived from
20+
// this software without specific prior written permission.
21+
//
22+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
// POSSIBILITY OF SUCH DAMAGE.
33+
//
34+
///////////////////////////////////////////////////////////////////////////////
1335

1436
#include "openroad/OpenRoad.hh"
1537

@@ -197,7 +219,9 @@ OpenRoad::readLef(const char *filename,
197219
}
198220

199221
void
200-
OpenRoad::readDef(const char *filename, bool order_wires, bool continue_on_errors)
222+
OpenRoad::readDef(const char *filename,
223+
bool order_wires,
224+
bool continue_on_errors)
201225
{
202226
odb::defin def_reader(db_);
203227
std::vector<odb::dbLib *> search_libs;
@@ -207,18 +231,17 @@ OpenRoad::readDef(const char *filename, bool order_wires, bool continue_on_error
207231
def_reader.continueOnErrors();
208232
}
209233
dbChip* chip = def_reader.createChip(search_libs, filename);
210-
if (chip == nullptr) { // parser failed
211-
return;
212-
}
213-
dbBlock* block = chip->getBlock();
214-
if (order_wires) {
215-
odb::orderWires(block,
216-
nullptr /* net_name_or_id*/,
217-
false /* force */);
218-
}
234+
if (chip) {
235+
dbBlock* block = chip->getBlock();
236+
if (order_wires) {
237+
odb::orderWires(block,
238+
nullptr /* net_name_or_id*/,
239+
false /* force */);
240+
}
219241

220-
for (Observer* observer : observers_) {
221-
observer->postReadDef(block);
242+
for (Observer* observer : observers_) {
243+
observer->postReadDef(block);
244+
}
222245
}
223246
}
224247

src/OpenRoad.i

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
%module openroad
22

3-
// Copyright (c) 2019, Parallax Software, Inc.
4-
//
5-
// This program is free software: you can redistribute it and/or modify
6-
// it under the terms of the GNU General Public License as published by
7-
// the Free Software Foundation, either version 3 of the License, or
8-
// (at your option) any later version.
9-
//
10-
// This program is distributed in the hope that it will be useful,
11-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
// GNU General Public License for more details.
14-
//
15-
// You should have received a copy of the GNU General Public License
16-
// along with this program. If not, see <https://www.gnu.org/licenses/>.
3+
/////////////////////////////////////////////////////////////////////////////
4+
//
5+
// BSD 3-Clause License
6+
//
7+
// Copyright (c) 2019, James Cherry, Parallax Software, Inc.
8+
// All rights reserved.
9+
//
10+
// Redistribution and use in source and binary forms, with or without
11+
// modification, are permitted provided that the following conditions are met:
12+
//
13+
// * Redistributions of source code must retain the above copyright notice, this
14+
// list of conditions and the following disclaimer.
15+
//
16+
// * Redistributions in binary form must reproduce the above copyright notice,
17+
// this list of conditions and the following disclaimer in the documentation
18+
// and/or other materials provided with the distribution.
19+
//
20+
// * Neither the name of the copyright holder nor the names of its
21+
// contributors may be used to endorse or promote products derived from
22+
// this software without specific prior written permission.
23+
//
24+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+
// POSSIBILITY OF SUCH DAMAGE.
35+
//
36+
///////////////////////////////////////////////////////////////////////////////
1737

1838
%{
1939

src/OpenRoad.tcl

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
1-
# Copyright (c) 2019, Parallax Software, Inc.
2-
#
3-
# This program is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License as published by
5-
# the Free Software Foundation, either version 3 of the License, or
6-
# (at your option) any later version.
7-
#
8-
# This program is distributed in the hope that it will be useful,
9-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11-
# GNU General Public License for more details.
12-
#
13-
# You should have received a copy of the GNU General Public License
14-
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1+
############################################################################
2+
##
3+
## BSD 3-Clause License
4+
##
5+
## Copyright (c) 2019, James Cherry, Parallax Software, Inc.
6+
## All rights reserved.
7+
##
8+
## Redistribution and use in source and binary forms, with or without
9+
## modification, are permitted provided that the following conditions are met:
10+
##
11+
## * Redistributions of source code must retain the above copyright notice, this
12+
## list of conditions and the following disclaimer.
13+
##
14+
## * Redistributions in binary form must reproduce the above copyright notice,
15+
## this list of conditions and the following disclaimer in the documentation
16+
## and/or other materials provided with the distribution.
17+
##
18+
## * Neither the name of the copyright holder nor the names of its
19+
## contributors may be used to endorse or promote products derived from
20+
## this software without specific prior written permission.
21+
##
22+
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26+
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
## POSSIBILITY OF SUCH DAMAGE.
33+
##
34+
############################################################################
1535

1636
proc show_openroad_splash {} {
1737
puts "OpenROAD [ord::openroad_version] [string range [ord::openroad_git_sha1] 0 9]
18-
License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
19-
20-
This is free software, and you are free to change and redistribute it
21-
under certain conditions; type `show_copying' for details.
22-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show_warranty'."
38+
This program is licensed under the BSD-3 license. See the LICENSE file for details.
39+
Components of the program may be licensed under more restrictive licenses which must be honored."
2340
}
2441

2542
# -library is the default
@@ -137,6 +154,12 @@ proc ensure_units_initialized { } {
137154
}
138155
}
139156

157+
proc clear {} {
158+
[get_db] clear
159+
sta::clear_network
160+
sta::clear_sta
161+
}
162+
140163
# namespace ord
141164
}
142165

0 commit comments

Comments
 (0)