From ec2f8796bd7a5180f257a92d7ffb2029571cada6 Mon Sep 17 00:00:00 2001 From: rockybulwinkle Date: Thu, 23 Jun 2022 13:34:08 -0500 Subject: Update tcl doc, yosys does not return data to tcl This pull request is to address YosysHQ/yosys#2980. The documentation, as originally written, does not make it clear that yosys commands, when used within a tcl script, do not return any value to the tcl script. This pull request notes this and offers a workaround via tee as noted in the issue. --- kernel/yosys.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kernel/yosys.cc') diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 64d2b4def..521717ce7 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -773,6 +773,12 @@ struct TclPass : public Pass { log("\n"); log("If any arguments are specified, these arguments are provided to the script via\n"); log("the standard $argc and $argv variables.\n"); + log("\n"); + log("Note, tcl will not recieve the output of any yosys command. If the output\n"); + log("of the tcl commands are needed, use the yosys command 'tee' to redirect yosys's\n"); + log("output to a temporary file.\n"); + + log("\n"); } void execute(std::vector args, RTLIL::Design *) override { -- cgit v1.2.3 From 58c51b9a0bd63af7bfc11f7ba4d19c0e933c18ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Mon, 11 Jul 2022 16:19:34 +0200 Subject: Remove empty lines --- kernel/yosys.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'kernel/yosys.cc') diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 521717ce7..c532115d8 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -777,8 +777,6 @@ struct TclPass : public Pass { log("Note, tcl will not recieve the output of any yosys command. If the output\n"); log("of the tcl commands are needed, use the yosys command 'tee' to redirect yosys's\n"); log("output to a temporary file.\n"); - - log("\n"); } void execute(std::vector args, RTLIL::Design *) override { -- cgit v1.2.3 From 29a5947bf83c8011e62cc859a0a832ee8ab690ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Milanovi=C4=87?= Date: Wed, 27 Jul 2022 14:16:46 +0200 Subject: Make all compile under OpenBSD (#3423) Co-authored-by: Josuah Demangeon --- kernel/yosys.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'kernel/yosys.cc') diff --git a/kernel/yosys.cc b/kernel/yosys.cc index c532115d8..11df235e4 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -871,6 +871,35 @@ std::string proc_self_dirname() { return "/"; } +#elif defined(__OpenBSD__) +char yosys_path[PATH_MAX]; +char *yosys_argv0; + +std::string proc_self_dirname(void) +{ + char buf[PATH_MAX + 1] = "", *path, *p; + // if case argv[0] contains a valid path, return it + if (strlen(yosys_path) > 0) { + p = strrchr(yosys_path, '/'); + snprintf(buf, sizeof buf, "%*s/", (int)(yosys_path - p), yosys_path); + return buf; + } + // if argv[0] does not, reconstruct the path out of $PATH + path = strdup(getenv("PATH")); + if (!path) + log_error("getenv(\"PATH\") failed: %s\n", strerror(errno)); + for (p = strtok(path, ":"); p; p = strtok(NULL, ":")) { + snprintf(buf, sizeof buf, "%s/%s", p, yosys_argv0); + if (access(buf, X_OK) == 0) { + *(strrchr(buf, '/') + 1) = '\0'; + free(path); + return buf; + } + } + free(path); + log_error("Can't determine yosys executable path\n."); + return NULL; +} #else #error "Don't know how to determine process executable base path!" #endif -- cgit v1.2.3 From a6819042378d6b211f2e9c5a24fafb01fbde2bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Wed, 27 Jul 2022 16:15:11 +0200 Subject: Assorted microoptimization speedups in core data structures. --- kernel/yosys.cc | 5 ----- 1 file changed, 5 deletions(-) (limited to 'kernel/yosys.cc') diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 11df235e4..a56a066fe 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -534,11 +534,6 @@ std::string escape_filename_spaces(const std::string& filename) return out; } -int GetSize(RTLIL::Wire *wire) -{ - return wire->width; -} - bool already_setup = false; void yosys_setup() -- cgit v1.2.3