Skip to content

Commit 4c9b096

Browse files
authored
Merge pull request #8488 from The-OpenROAD-Project-staging/fix-omp-bzl
rm runtime/src/test-touch.c from the omp bazel build
2 parents c134670 + c1e11b9 commit 4c9b096

32 files changed

+548
-392
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ common --incompatible_disallow_empty_glob
1414

1515
build --cxxopt "-std=c++17" --host_cxxopt "-std=c++17"
1616
build --cxxopt "-xc++" --host_cxxopt "-xc++"
17+
build --cxxopt "-DBAZEL_BUILD" --host_cxxopt "-DBAZEL_BUILD"
1718

1819
# Needed for floating point stability in FFT (fft_test will check this).
1920
# See also https://kristerw.github.io/2021/11/09/fp-contract/

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ bazel_dep(name = "boost.smart_ptr", version = BOOST_VERSION)
7979
bazel_dep(name = "boost.spirit", version = BOOST_VERSION)
8080
bazel_dep(name = "boost.stacktrace", version = BOOST_VERSION)
8181
bazel_dep(name = "boost.system", version = BOOST_VERSION)
82-
bazel_dep(name = "boost.test", version = BOOST_VERSION + ".bcr.1")
8382
bazel_dep(name = "boost.thread", version = BOOST_VERSION + ".bcr.2")
8483
bazel_dep(name = "boost.tokenizer", version = BOOST_VERSION)
8584
bazel_dep(name = "boost.unordered", version = BOOST_VERSION)

MODULE.bazel.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/openmp/bundled.BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ cc_library(
8686
"runtime/src/ompt-general.cpp",
8787
"runtime/src/ompt-internal.h",
8888
"runtime/src/ompt-specific.h",
89-
"runtime/src/test-touch.c",
9089
"runtime/src/z_Linux_asm.S",
9190
"runtime/src/z_Linux_util.cpp",
9291
] + [

src/cut/test/BUILD

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ package(features = ["layering_check"])
88
cc_test(
99
name = "cut_abc_test",
1010
srcs = ["cpp/TestAbc.cc"],
11+
data = [
12+
"Nangate45/Nangate45_stdcell.lef",
13+
"Nangate45/Nangate45_tech.lef",
14+
"Nangate45/Nangate45_typ.lib",
15+
"aes_nangate45.v",
16+
"asap7/asap7_tech_1x_201209.lef",
17+
"asap7/asap7sc7p5t_28_R_1x_220121a.lef",
18+
"asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz",
19+
"asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz",
20+
"asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz",
21+
"asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib",
22+
"asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz",
23+
"empty_cut_set.v",
24+
"side_outputs_extract.v",
25+
"side_outputs_extract_logic_depth.v",
26+
"simple_and_gate_extract.v",
27+
"sky130/sky130_fd_sc_hd__ss_n40C_1v40.lib",
28+
"sky130/sky130hd.tlef",
29+
"sky130/sky130hd_std_cell.lef",
30+
"sky130_const_cell.v",
31+
],
1132
linkstatic = True, # TODO: remove once deps define all symbols
1233
deps = [
1334
"//src/cut",

src/cut/test/cpp/TestAbc.cc

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,22 @@ using cut::LogicCut;
6262
using cut::LogicExtractorFactory;
6363
using ::testing::Contains;
6464

65-
std::once_flag init_abc_flag;
65+
static std::once_flag init_abc_flag;
66+
67+
static const std::string prefix("_main/src/cut/test/");
6668

6769
class AbcTest : public tst::Fixture
6870
{
6971
protected:
7072
void SetUp() override
7173
{
7274
std::call_once(init_abc_flag, []() { abc::Abc_Start(); });
73-
library_ = readLiberty("./Nangate45/Nangate45_typ.lib");
75+
library_ = readLiberty(prefix + "Nangate45/Nangate45_typ.lib");
7476

7577
odb::dbTech* tech
76-
= loadTechLef("nangate45", "./Nangate45/Nangate45_tech.lef");
77-
loadLibaryLef(tech, "nangate45", "./Nangate45/Nangate45_stdcell.lef");
78+
= loadTechLef("nangate45", prefix + "Nangate45/Nangate45_tech.lef");
79+
loadLibaryLef(
80+
tech, "nangate45", prefix + "Nangate45/Nangate45_stdcell.lef");
7881

7982
sta::Units* units = library_->units();
8083
power_unit_ = units->powerUnit();
@@ -87,7 +90,7 @@ class AbcTest : public tst::Fixture
8790
ord::dbVerilogNetwork verilog_network(sta_.get());
8891

8992
sta::VerilogReader verilog_reader(&verilog_network);
90-
verilog_reader.read(file_name.c_str());
93+
verilog_reader.read(getFilePath(file_name).c_str());
9194

9295
ord::dbLinkDesign(top.c_str(),
9396
&verilog_network,
@@ -143,11 +146,11 @@ class AbcTestSky130 : public AbcTest
143146
{
144147
std::call_once(init_abc_flag, []() { abc::Abc_Start(); });
145148

146-
library_ = readLiberty("./sky130/sky130_fd_sc_hd__ss_n40C_1v40.lib");
149+
library_ = readLiberty(prefix + "sky130/sky130_fd_sc_hd__ss_n40C_1v40.lib");
147150

148-
odb::dbTech* tech = loadTechLef("sky130", "./sky130/sky130hd.tlef");
149-
odb::dbLib* lib
150-
= loadLibaryLef(tech, "sky130", "./sky130/sky130hd_std_cell.lef");
151+
odb::dbTech* tech = loadTechLef("sky130", prefix + "sky130/sky130hd.tlef");
152+
odb::dbLib* lib = loadLibaryLef(
153+
tech, "sky130", prefix + "sky130/sky130hd_std_cell.lef");
151154

152155
sta_->postReadLef(tech, lib);
153156

@@ -163,20 +166,20 @@ class AbcTestAsap7 : public AbcTest
163166
std::call_once(init_abc_flag, []() { abc::Abc_Start(); });
164167

165168
std::array<const char*, 5> liberty_paths
166-
= {"./asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz",
167-
"./asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz",
168-
"./asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz",
169-
"./asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib",
170-
"./asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz"};
169+
= {"asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz",
170+
"asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz",
171+
"asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz",
172+
"asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib",
173+
"asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz"};
171174

172175
for (const char* liberty_path : liberty_paths) {
173-
library_ = readLiberty(liberty_path);
176+
library_ = readLiberty(prefix + liberty_path);
174177
}
175178

176179
odb::dbTech* tech
177-
= loadTechLef("asap7", "./asap7/asap7_tech_1x_201209.lef");
180+
= loadTechLef("asap7", prefix + "asap7/asap7_tech_1x_201209.lef");
178181
odb::dbLib* lib = loadLibaryLef(
179-
tech, "asap7", "./asap7/asap7sc7p5t_28_R_1x_220121a.lef");
182+
tech, "asap7", prefix + "asap7/asap7sc7p5t_28_R_1x_220121a.lef");
180183

181184
sta_->postReadLef(tech, lib);
182185

@@ -353,7 +356,7 @@ TEST_F(AbcTest, ExtractsAndGateCorrectly)
353356
factory.AddDbSta(sta_.get());
354357
AbcLibrary abc_library = factory.Build();
355358

356-
LoadVerilog("simple_and_gate_extract.v");
359+
LoadVerilog(prefix + "simple_and_gate_extract.v");
357360

358361
sta::dbNetwork* network = sta_->getDbNetwork();
359362
sta::Vertex* flop_input_vertex = nullptr;
@@ -378,7 +381,7 @@ TEST_F(AbcTest, ExtractsEmptyCutSetCorrectly)
378381
factory.AddDbSta(sta_.get());
379382
AbcLibrary abc_library = factory.Build();
380383

381-
LoadVerilog("empty_cut_set.v");
384+
LoadVerilog(prefix + "empty_cut_set.v");
382385

383386
sta::dbNetwork* network = sta_->getDbNetwork();
384387
sta::Vertex* flop_input_vertex = nullptr;
@@ -402,7 +405,7 @@ TEST_F(AbcTest, ExtractSideOutputsCorrectly)
402405
factory.AddDbSta(sta_.get());
403406
AbcLibrary abc_library = factory.Build();
404407

405-
LoadVerilog("side_outputs_extract.v");
408+
LoadVerilog(prefix + "side_outputs_extract.v");
406409

407410
sta::dbNetwork* network = sta_->getDbNetwork();
408411
sta::Vertex* flop_input_vertex = nullptr;
@@ -433,7 +436,7 @@ TEST_F(AbcTest, BuildAbcMappedNetworkFromLogicCut)
433436
factory.AddDbSta(sta_.get());
434437
AbcLibrary abc_library = factory.Build();
435438

436-
LoadVerilog("side_outputs_extract_logic_depth.v");
439+
LoadVerilog(prefix + "side_outputs_extract_logic_depth.v");
437440

438441
sta::dbNetwork* network = sta_->getDbNetwork();
439442
sta::Vertex* flop_input_vertex = nullptr;
@@ -479,7 +482,7 @@ TEST_F(AbcTest, BuildComplexLogicCone)
479482
factory.AddDbSta(sta_.get());
480483
AbcLibrary abc_library = factory.Build();
481484

482-
LoadVerilog("aes_nangate45.v", /*top=*/"aes_cipher_top");
485+
LoadVerilog(prefix + "aes_nangate45.v", /*top=*/"aes_cipher_top");
483486

484487
sta::dbNetwork* network = sta_->getDbNetwork();
485488
sta::Vertex* flop_input_vertex = nullptr;
@@ -503,7 +506,7 @@ TEST_F(AbcTest, InsertingMappedLogicCutDoesNotThrow)
503506
factory.AddDbSta(sta_.get());
504507
AbcLibrary abc_library = factory.Build();
505508

506-
LoadVerilog("aes_nangate45.v", /*top=*/"aes_cipher_top");
509+
LoadVerilog(prefix + "aes_nangate45.v", /*top=*/"aes_cipher_top");
507510

508511
sta::dbNetwork* network = sta_->getDbNetwork();
509512
sta::Vertex* flop_input_vertex = nullptr;
@@ -533,7 +536,7 @@ TEST_F(AbcTest,
533536
factory.AddDbSta(sta_.get());
534537
AbcLibrary abc_library = factory.Build();
535538

536-
LoadVerilog("side_outputs_extract_logic_depth.v");
539+
LoadVerilog(prefix + "side_outputs_extract_logic_depth.v");
537540

538541
sta::dbNetwork* network = sta_->getDbNetwork();
539542
sta::Vertex* flop_input_vertex = nullptr;
@@ -595,7 +598,7 @@ TEST_F(AbcTestSky130, EnsureThatSky130MultiOutputConstCellsAreMapped)
595598
factory.AddDbSta(sta_.get());
596599
AbcLibrary abc_library = factory.Build();
597600

598-
LoadVerilog("sky130_const_cell.v");
601+
LoadVerilog(prefix + "sky130_const_cell.v");
599602

600603
sta::dbNetwork* network = sta_->getDbNetwork();
601604
sta::Instance* flop_input_instance = network->findInstance("_403_");

src/dbSta/test/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ filegroup(
176176
cc_test(
177177
name = "dbsta_hconn_unittest",
178178
srcs = ["cpp/TestHconn.cpp"],
179+
data = [
180+
"Nangate45/Nangate45.lef",
181+
"Nangate45/Nangate45_typ.lib",
182+
],
179183
linkstatic = True, # TODO: remove once deps define all symbols
180184
deps = [
181185
"//src/dbSta",

src/dbSta/test/cpp/TestHconn.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
namespace odb {
3939

40+
static const std::string prefix("_main/src/dbSta/test/");
41+
4042
/*
4143
Extract the hierarchical information in human readable format.
4244
Shows the dbNet and dbModNet view of the database.
@@ -216,9 +218,9 @@ class TestHconn : public ::tst::Fixture
216218
void SetUp() override
217219
{
218220
// this will be so much easier with read_def
219-
auto path = std::filesystem::canonical("./Nangate45/Nangate45_typ.lib");
220-
library_ = readLiberty(path.string().c_str());
221-
lib_ = loadTechAndLib("tech", "Nangate45.lef", "./Nangate45/Nangate45.lef");
221+
library_ = readLiberty(prefix + "Nangate45/Nangate45_typ.lib");
222+
lib_ = loadTechAndLib(
223+
"tech", "Nangate45", prefix + "Nangate45/Nangate45.lef");
222224

223225
db_network_ = sta_->getDbNetwork();
224226
// turn on hierarchy

src/drt/CMakeLists.txt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ if(ENABLE_TESTS)
166166
${FLEXROUTE_HOME}/test/gcTest.cpp
167167
${FLEXROUTE_HOME}/test/fixture.cpp
168168
${FLEXROUTE_HOME}/test/stubs.cpp
169-
${OPENROAD_HOME}/src/gui/src/stub.cpp
170169
)
171170

172171
target_include_directories(trTest
@@ -176,24 +175,13 @@ if(ENABLE_TESTS)
176175
)
177176

178177
target_link_libraries(trTest
179-
drt
178+
drt_lib
180179
odb
180+
GTest::gtest
181+
GTest::gtest_main
182+
GTest::gmock
181183
)
182184

183-
# Use the shared library if found. We need to pass this info to
184-
# the code to select the corresponding include. Using the shared
185-
# library speeds up compilation.
186-
if (Boost_unit_test_framework_FOUND)
187-
message(STATUS "Boost unit_test_framework library found")
188-
target_link_libraries(trTest
189-
Boost::unit_test_framework
190-
)
191-
target_compile_definitions(trTest
192-
PRIVATE
193-
HAS_BOOST_UNIT_TEST_LIBRARY
194-
)
195-
endif()
196-
197185
add_test(NAME trTest COMMAND trTest)
198186
add_dependencies(build_and_test trTest)
199187

src/drt/test/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ cc_test(
125125
"//src/drt:db_hdrs",
126126
"//src/odb",
127127
"//src/utl",
128-
"@boost.test",
128+
"@googletest//:gtest",
129+
"@googletest//:gtest_main",
129130
],
130131
)

0 commit comments

Comments
 (0)