Added the ability to run DRC and LVS from strmrun

This commit is contained in:
Matthias Koefferlein 2026-03-18 22:01:26 +01:00
parent 415650bb3a
commit 00c826688f
5 changed files with 46 additions and 22 deletions

View File

@ -41,7 +41,9 @@ INCLUDEPATH += $$RBA_INC
DEPENDPATH += $$RBA_INC
equals(HAVE_RUBY, "1") {
LIBS += -lklayout_rba
INCLUDEPATH += $$DRC_INC $$LVS_INC
DEPENDPATH += $$DRC_INC $$LVS_INC
LIBS += -lklayout_rba -lklayout_drc -lklayout_lvs
} else {
LIBS += -lklayout_rbastub
}

View File

@ -36,6 +36,8 @@
#include "libForceLink.h"
#include "rdbForceLink.h"
#include "pexForceLink.h"
#include "drcForceLink.h"
#include "lvsForceLink.h"
#include "lymMacro.h"
#include "lymMacroCollection.h"

View File

@ -25,7 +25,7 @@ INCLUDEPATH += $$RBA_INC
DEPENDPATH += $$RBA_INC
equals(HAVE_RUBY, "1") {
LIBS += -lklayout_rba
LIBS += -lklayout_rba -lklayout_drc -lklayout_lvs
} else {
LIBS += -lklayout_rbastub
}

View File

@ -28,10 +28,7 @@
TEST(1)
{
#if defined(HAVE_PYTHON)
std::string fp (tl::testsrc ());
fp += "/testdata/bd/strmrun.py";
std::string cmd;
std::string cmd_call;
#if defined(__APPLE__)
// NOTE: because of system integrity, MacOS does not inherit DYLD_LIBRARY_PATH to child
@ -39,19 +36,42 @@ TEST(1)
const char *ldpath_name = "DYLD_LIBRARY_PATH";
const char *ldpath = getenv (ldpath_name);
if (ldpath) {
cmd += std::string (ldpath_name) + "=\"" + ldpath + "\"; export " + ldpath_name + "; ";
cmd_call += std::string (ldpath_name) + "=\"" + ldpath + "\"; export " + ldpath_name + "; ";
}
#endif
cmd += tl::combine_path (tl::get_inst_path (), "strmrun ") + fp;
tl::info << cmd;
cmd_call += tl::combine_path (tl::get_inst_path (), "strmrun");
tl::InputPipe pipe (cmd);
tl::InputStream is (pipe);
std::string data = is.read_all ();
tl::info << data;
{
std::string fp (tl::testsrc ());
fp += "/testdata/bd/strmrun.py";
std::string cmd = cmd_call + " " + fp;
tl::info << cmd;
tl::InputPipe pipe (cmd);
tl::InputStream is (pipe);
std::string data = is.read_all ();
tl::info << data;
EXPECT_EQ (data, "Hello, world (0,-42;42,0)!\n");
}
{
std::string fp (tl::testsrc ());
fp += "/testdata/bd/strmrun.drc";
std::string cmd = cmd_call + " " + fp;
tl::info << cmd;
tl::InputPipe pipe (cmd);
tl::InputStream is (pipe);
std::string data = is.read_all ();
tl::info << data;
EXPECT_EQ (data, "This is DRC.\n");
}
EXPECT_EQ (data, "Hello, world (0,-42;42,0)!\n");
#endif
}

View File

@ -164,7 +164,7 @@ module DRC
def initialize
cv = RBA::CellView::active
cv = RBA.const_defined?(:CellView) && RBA::CellView::active
@time = Time::now
@force_gc = ($drc_force_gc == true) # for testing, $drc_force_gc can be set to true
@ -1444,7 +1444,7 @@ module DRC
if arg =~ /^@(\d+)/
n = $1.to_i - 1
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
view || raise("No view open")
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
cv = view.cellview(n)
@ -1543,7 +1543,7 @@ module DRC
if arg =~ /^@(\d+)/
n = $1.to_i - 1
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
view || raise("No view open")
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
cv = view.cellview(n)
@ -1608,7 +1608,7 @@ module DRC
self._context("report") do
# finish what we got so far
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
@def_output && @def_output.finish(false, view)
@def_output = nil
@ -2925,7 +2925,7 @@ CODE
def _start(job_description)
# clearing the selection avoids some nasty problems
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
view && view.cancel
@total_timer = RBA::Timer::new
@ -2950,7 +2950,7 @@ CODE
_flush
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
@def_output && @def_output.finish(final, view)
@ -3484,7 +3484,7 @@ CODE
output_rdb_index = nil
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
if view
if self._rdb_index
output_rdb = RBA::ReportDatabase::new("") # reuse existing name
@ -3518,7 +3518,7 @@ CODE
if arg =~ /^@(\d+|\+)/
view = RBA::LayoutView::current
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
view || raise("No view open")
if $1 == "+"
prev_cv = view.active_cellview_index