mirror of https://github.com/KLayout/klayout.git
Added the ability to run DRC and LVS from strmrun
This commit is contained in:
parent
415650bb3a
commit
00c826688f
|
|
@ -41,7 +41,9 @@ INCLUDEPATH += $$RBA_INC
|
||||||
DEPENDPATH += $$RBA_INC
|
DEPENDPATH += $$RBA_INC
|
||||||
|
|
||||||
equals(HAVE_RUBY, "1") {
|
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 {
|
} else {
|
||||||
LIBS += -lklayout_rbastub
|
LIBS += -lklayout_rbastub
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@
|
||||||
#include "libForceLink.h"
|
#include "libForceLink.h"
|
||||||
#include "rdbForceLink.h"
|
#include "rdbForceLink.h"
|
||||||
#include "pexForceLink.h"
|
#include "pexForceLink.h"
|
||||||
|
#include "drcForceLink.h"
|
||||||
|
#include "lvsForceLink.h"
|
||||||
#include "lymMacro.h"
|
#include "lymMacro.h"
|
||||||
#include "lymMacroCollection.h"
|
#include "lymMacroCollection.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ INCLUDEPATH += $$RBA_INC
|
||||||
DEPENDPATH += $$RBA_INC
|
DEPENDPATH += $$RBA_INC
|
||||||
|
|
||||||
equals(HAVE_RUBY, "1") {
|
equals(HAVE_RUBY, "1") {
|
||||||
LIBS += -lklayout_rba
|
LIBS += -lklayout_rba -lklayout_drc -lklayout_lvs
|
||||||
} else {
|
} else {
|
||||||
LIBS += -lklayout_rbastub
|
LIBS += -lklayout_rbastub
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,7 @@
|
||||||
TEST(1)
|
TEST(1)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_PYTHON)
|
#if defined(HAVE_PYTHON)
|
||||||
std::string fp (tl::testsrc ());
|
std::string cmd_call;
|
||||||
fp += "/testdata/bd/strmrun.py";
|
|
||||||
|
|
||||||
std::string cmd;
|
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// NOTE: because of system integrity, MacOS does not inherit DYLD_LIBRARY_PATH to child
|
// 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_name = "DYLD_LIBRARY_PATH";
|
||||||
const char *ldpath = getenv (ldpath_name);
|
const char *ldpath = getenv (ldpath_name);
|
||||||
if (ldpath) {
|
if (ldpath) {
|
||||||
cmd += std::string (ldpath_name) + "=\"" + ldpath + "\"; export " + ldpath_name + "; ";
|
cmd_call += std::string (ldpath_name) + "=\"" + ldpath + "\"; export " + ldpath_name + "; ";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd += tl::combine_path (tl::get_inst_path (), "strmrun ") + fp;
|
cmd_call += tl::combine_path (tl::get_inst_path (), "strmrun");
|
||||||
tl::info << cmd;
|
|
||||||
|
|
||||||
tl::InputPipe pipe (cmd);
|
{
|
||||||
tl::InputStream is (pipe);
|
std::string fp (tl::testsrc ());
|
||||||
std::string data = is.read_all ();
|
fp += "/testdata/bd/strmrun.py";
|
||||||
tl::info << data;
|
|
||||||
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ module DRC
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
|
||||||
cv = RBA::CellView::active
|
cv = RBA.const_defined?(:CellView) && RBA::CellView::active
|
||||||
|
|
||||||
@time = Time::now
|
@time = Time::now
|
||||||
@force_gc = ($drc_force_gc == true) # for testing, $drc_force_gc can be set to true
|
@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+)/
|
if arg =~ /^@(\d+)/
|
||||||
n = $1.to_i - 1
|
n = $1.to_i - 1
|
||||||
view = RBA::LayoutView::current
|
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
|
||||||
view || raise("No view open")
|
view || raise("No view open")
|
||||||
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
|
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
|
||||||
cv = view.cellview(n)
|
cv = view.cellview(n)
|
||||||
|
|
@ -1543,7 +1543,7 @@ module DRC
|
||||||
|
|
||||||
if arg =~ /^@(\d+)/
|
if arg =~ /^@(\d+)/
|
||||||
n = $1.to_i - 1
|
n = $1.to_i - 1
|
||||||
view = RBA::LayoutView::current
|
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
|
||||||
view || raise("No view open")
|
view || raise("No view open")
|
||||||
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
|
(n >= 0 && view.cellviews > n) || raise("Invalid layout index @#{n + 1}")
|
||||||
cv = view.cellview(n)
|
cv = view.cellview(n)
|
||||||
|
|
@ -1608,7 +1608,7 @@ module DRC
|
||||||
self._context("report") do
|
self._context("report") do
|
||||||
|
|
||||||
# finish what we got so far
|
# 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 && @def_output.finish(false, view)
|
||||||
|
|
||||||
@def_output = nil
|
@def_output = nil
|
||||||
|
|
@ -2925,7 +2925,7 @@ CODE
|
||||||
def _start(job_description)
|
def _start(job_description)
|
||||||
|
|
||||||
# clearing the selection avoids some nasty problems
|
# clearing the selection avoids some nasty problems
|
||||||
view = RBA::LayoutView::current
|
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
|
||||||
view && view.cancel
|
view && view.cancel
|
||||||
|
|
||||||
@total_timer = RBA::Timer::new
|
@total_timer = RBA::Timer::new
|
||||||
|
|
@ -2950,7 +2950,7 @@ CODE
|
||||||
|
|
||||||
_flush
|
_flush
|
||||||
|
|
||||||
view = RBA::LayoutView::current
|
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
|
||||||
|
|
||||||
@def_output && @def_output.finish(final, view)
|
@def_output && @def_output.finish(final, view)
|
||||||
|
|
||||||
|
|
@ -3484,7 +3484,7 @@ CODE
|
||||||
|
|
||||||
output_rdb_index = nil
|
output_rdb_index = nil
|
||||||
|
|
||||||
view = RBA::LayoutView::current
|
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
|
||||||
if view
|
if view
|
||||||
if self._rdb_index
|
if self._rdb_index
|
||||||
output_rdb = RBA::ReportDatabase::new("") # reuse existing name
|
output_rdb = RBA::ReportDatabase::new("") # reuse existing name
|
||||||
|
|
@ -3518,7 +3518,7 @@ CODE
|
||||||
|
|
||||||
if arg =~ /^@(\d+|\+)/
|
if arg =~ /^@(\d+|\+)/
|
||||||
|
|
||||||
view = RBA::LayoutView::current
|
view = RBA.const_defined?(:LayoutView) && RBA::LayoutView::current
|
||||||
view || raise("No view open")
|
view || raise("No view open")
|
||||||
if $1 == "+"
|
if $1 == "+"
|
||||||
prev_cv = view.active_cellview_index
|
prev_cv = view.active_cellview_index
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue