Merge pull request #50 from antmicro/set_false_path_through_switch

Add -through switch to set_false_path command
diff --git a/sdc-plugin/sdc_writer.cc b/sdc-plugin/sdc_writer.cc
index e4076f8..4c7ae57 100644
--- a/sdc-plugin/sdc_writer.cc
+++ b/sdc-plugin/sdc_writer.cc
@@ -71,6 +71,9 @@
 	if (!path.from_pin.empty()) {
 	    file << " -from " << path.from_pin;
 	}
+	if (!path.through_pin.empty()) {
+	    file << " -through " << path.through_pin;
+	}
 	if (!path.to_pin.empty()) {
 	    file << " -to " << path.to_pin;
 	}
diff --git a/sdc-plugin/sdc_writer.h b/sdc-plugin/sdc_writer.h
index 05a8dea..9bcbcf1 100644
--- a/sdc-plugin/sdc_writer.h
+++ b/sdc-plugin/sdc_writer.h
@@ -25,6 +25,7 @@
 struct FalsePath {
     std::string from_pin;
     std::string to_pin;
+    std::string through_pin;
 };
 
 struct TimingPath {
diff --git a/sdc-plugin/set_false_path.cc b/sdc-plugin/set_false_path.cc
index 72bb41c..18262d0 100644
--- a/sdc-plugin/set_false_path.cc
+++ b/sdc-plugin/set_false_path.cc
@@ -41,6 +41,9 @@
     log("    -to\n");
     log("        List of end points or clocks.\n");
     log("\n");
+    log("    -through\n");
+    log("        List of through points or clocks.\n");
+    log("\n");
 }
 
 void SetFalsePath::execute(std::vector<std::string> args,
@@ -54,6 +57,7 @@
     bool is_quiet = false;
     std::string from_pin;
     std::string to_pin;
+    std::string through_pin;
 
     // Parse command arguments
     for (argidx = 1; argidx < args.size(); argidx++) {
@@ -65,13 +69,16 @@
 
 	if (arg == "-from" and argidx + 1 < args.size()) {
 	    from_pin = args[++argidx];
-	    log("From: %s\n", from_pin.c_str());
 	    continue;
 	}
 
 	if (arg == "-to" and argidx + 1 < args.size()) {
 	    to_pin = args[++argidx];
-	    log("To: %s\n", to_pin.c_str());
+	    continue;
+	}
+
+	if (arg == "-through" and argidx + 1 < args.size()) {
+	    through_pin = args[++argidx];
 	    continue;
 	}
 
@@ -83,8 +90,10 @@
     }
     if (!is_quiet) {
 	std::string msg = (from_pin.empty()) ? "" : "-from " + from_pin;
+	msg += (through_pin.empty()) ? "" : " -through " + through_pin;
 	msg += (to_pin.empty()) ? "" : " -to " + to_pin;
 	log("Adding false path %s\n", msg.c_str());
     }
-    sdc_writer_.AddFalsePath(FalsePath{.from_pin = from_pin, .to_pin = to_pin});
+    sdc_writer_.AddFalsePath(FalsePath{
+        .from_pin = from_pin, .to_pin = to_pin, .through_pin = through_pin});
 }
diff --git a/sdc-plugin/tests/set_false_path/set_false_path.golden.sdc b/sdc-plugin/tests/set_false_path/set_false_path.golden.sdc
index 4e75de4..b90bd9b 100644
--- a/sdc-plugin/tests/set_false_path/set_false_path.golden.sdc
+++ b/sdc-plugin/tests/set_false_path/set_false_path.golden.sdc
@@ -1,3 +1,4 @@
 set_false_path -to inter_wire
 set_false_path -from clk
 set_false_path -from clk -to bottom_inst.I
+set_false_path -through bottom_inst.I
diff --git a/sdc-plugin/tests/set_false_path/set_false_path.tcl b/sdc-plugin/tests/set_false_path/set_false_path.tcl
index a4e01f4..ae14469 100644
--- a/sdc-plugin/tests/set_false_path/set_false_path.tcl
+++ b/sdc-plugin/tests/set_false_path/set_false_path.tcl
@@ -16,4 +16,7 @@
 # -from clk to bottom_inst/I
 set_false_path -from clk -to bottom_inst.I
 
+# -through bottom_inst/I
+set_false_path -through bottom_inst.I
+
 write_sdc $::env(DESIGN_TOP).sdc