diff options
-rw-r--r-- | common/pybindings.cc | 8 | ||||
-rw-r--r-- | nexus/arch.cc | 3 | ||||
-rw-r--r-- | nexus/constids.inc | 2 | ||||
-rw-r--r-- | nexus/fasm.cc | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc index 076d315a..f9ee9eb7 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -304,6 +304,8 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m) static wchar_t *program; #endif +void (*python_sighandler)(int) = nullptr; + void init_python(const char *executable) { #ifdef MAIN_EXECUTABLE @@ -316,7 +318,7 @@ void init_python(const char *executable) py::initialize_interpreter(); py::module::import(TOSTRING(MODULE_NAME)); PyRun_SimpleString("from " TOSTRING(MODULE_NAME) " import *"); - signal(SIGINT, SIG_DFL); + python_sighandler = signal(SIGINT, SIG_DFL); #endif } @@ -336,7 +338,10 @@ void execute_python_file(const char *python_file) fprintf(stderr, "Fatal error: file not found %s\n", python_file); exit(1); } + if (python_sighandler) + signal(SIGINT, python_sighandler); int result = PyRun_SimpleFile(fp, python_file); + signal(SIGINT, SIG_DFL); fclose(fp); if (result == -1) { log_error("Error occurred while executing Python script %s\n", python_file); @@ -344,6 +349,7 @@ void execute_python_file(const char *python_file) } catch (py::error_already_set const &) { // Parse and output the exception std::string perror_str = parse_python_exception(); + signal(SIGINT, SIG_DFL); log_error("Error in Python: %s\n", perror_str.c_str()); } } diff --git a/nexus/arch.cc b/nexus/arch.cc index 90acc7b7..fa81485a 100644 --- a/nexus/arch.cc +++ b/nexus/arch.cc @@ -591,6 +591,9 @@ delay_t Arch::getRipupDelayPenalty() const { return 250; } delay_t Arch::estimateDelay(WireId src, WireId dst) const { + const auto &dst_data = wire_data(dst); + if (src.tile == 0 && dst_data.name == ID_LOCAL_VCC) + return 0; int src_x = src.tile % chip_info->width, src_y = src.tile / chip_info->width; int dst_x = dst.tile % chip_info->width, dst_y = dst.tile / chip_info->width; int dist_x = std::abs(src_x - dst_x); diff --git a/nexus/constids.inc b/nexus/constids.inc index 5407cb23..48b0ca2b 100644 --- a/nexus/constids.inc +++ b/nexus/constids.inc @@ -528,3 +528,5 @@ X(TOUT) X(Q0) X(Q1) X(SCLK) + +X(LOCAL_VCC) diff --git a/nexus/fasm.cc b/nexus/fasm.cc index c4eb9a1b..964828cb 100644 --- a/nexus/fasm.cc +++ b/nexus/fasm.cc @@ -211,6 +211,8 @@ struct NexusFasmWriter return; std::string tile = tile_name(pip.tile, tile_by_type_and_loc(pip.tile, IdString(pd.tile_type))); std::string source_wire = escape_name(ctx->pip_src_wire_name(pip).str(ctx)); + if (source_wire == "LOCAL_VCC") + source_wire = "G__VCC"; std::string dest_wire = escape_name(ctx->pip_dst_wire_name(pip).str(ctx)); out << stringf("%s.PIP.%s.%s", tile.c_str(), dest_wire.c_str(), source_wire.c_str()) << std::endl; } |