diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e4c776ed9..f754d16c7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -6,15 +6,14 @@ body: attributes: value: > - If you have a general question, please ask it in the [Discussions](https://github.com/YosysHQ/yosys/discussions) area - or join our [IRC Channel](https://web.libera.chat/#yosys) or [Community Slack](https://join.slack.com/t/yosyshq/shared_invite/zt-1aopkns2q-EiQ97BeQDt_pwvE41sGSuA). + If you have a general question, please ask it on the [Discourse forum](https://yosyshq.discourse.group/). If you have a feature request, please fill out the appropriate issue form, this form is for bugs and/or regressions. Please contact [YosysHQ GmbH](https://www.yosyshq.com/) if you need - commercial support for Yosys. + commercial support or work done for Yosys. - type: input id: yosys_version diff --git a/.github/ISSUE_TEMPLATE/docs_report.yml b/.github/ISSUE_TEMPLATE/docs_report.yml index aa65c63b9..c3ad2f7cc 100644 --- a/.github/ISSUE_TEMPLATE/docs_report.yml +++ b/.github/ISSUE_TEMPLATE/docs_report.yml @@ -6,8 +6,7 @@ body: attributes: value: > - If you have a general question, please ask it in the [Discussions](https://github.com/YosysHQ/yosys/discussions) area - or join our [IRC Channel](https://web.libera.chat/#yosys) or [Community Slack](https://join.slack.com/t/yosyshq/shared_invite/zt-1aopkns2q-EiQ97BeQDt_pwvE41sGSuA). + If you have a general question, please ask it on the [Discourse forum](https://yosyshq.discourse.group/). If you have found a bug in Yosys, or in building the documentation, diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index c521b5296..49d86f341 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,18 +1,17 @@ name: Feature Request -description: "Submit a feature request for Yosys" +description: "Submit a feature request for Yosys" labels: ["feature-request"] body: - type: markdown attributes: value: > - If you have a general question, please ask it in the [Discussions](https://github.com/YosysHQ/yosys/discussions) area - or join our [IRC Channel](https://web.libera.chat/#yosys) or [Community Slack](https://join.slack.com/t/yosyshq/shared_invite/zt-1aopkns2q-EiQ97BeQDt_pwvE41sGSuA). - + If you have a general question, please ask it on the [Discourse forum](https://yosyshq.discourse.group/). + If you have a bug report, please fill out the appropriate issue form, this form is for feature requests. - + Please contact [YosysHQ GmbH](https://www.yosyshq.com/) if you need commercial support or work done for Yosys. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 82daf609d..d8d929f3f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,9 @@ +_If your work is part of a larger effort, please discuss your general plans on [Discourse](https://yosyshq.discourse.group/) first to align your vision with maintainers._ + _What are the reasons/motivation for this change?_ _Explain how this is achieved._ -_If applicable, please suggest to reviewers how they can test the change._ +_Make sure your change comes with tests. If not possible, share how a reviewer might evaluate it._ + +_These template prompts can be deleted when you're done responding to them._ \ No newline at end of file diff --git a/Makefile b/Makefile index 42f534a71..ec2096b83 100644 --- a/Makefile +++ b/Makefile @@ -567,8 +567,12 @@ ifeq ($(ENABLE_VERIFIC_YOSYSHQ_EXTENSIONS),1) VERIFIC_COMPONENTS += extensions CXXFLAGS += -DYOSYSHQ_VERIFIC_EXTENSIONS else +# YosysHQ flavor of Verific always needs extensions linked +# if disabled it will just not be invoked but parts +# are required for it to initialize properly ifneq ($(wildcard $(VERIFIC_DIR)/extensions),) VERIFIC_COMPONENTS += extensions +OBJS += kernel/log_compat.o endif endif CXXFLAGS += $(patsubst %,-I$(VERIFIC_DIR)/%,$(VERIFIC_COMPONENTS)) -DYOSYS_ENABLE_VERIFIC diff --git a/docs/source/yosys_internals/extending_yosys/extensions.rst b/docs/source/yosys_internals/extending_yosys/extensions.rst index d30dd2bae..74a7d72d6 100644 --- a/docs/source/yosys_internals/extending_yosys/extensions.rst +++ b/docs/source/yosys_internals/extending_yosys/extensions.rst @@ -9,7 +9,7 @@ Writing extensions .. todo:: update to use :file:`/code_examples/extensions/test*.log` This chapter contains some bits and pieces of information about programming -yosys extensions. Don't be afraid to ask questions on the YosysHQ Slack. +yosys extensions. Don't be afraid to ask questions on the YosysHQ Discourse. .. todo:: mention coding guide diff --git a/kernel/hashlib.h b/kernel/hashlib.h index 233c256d6..a367001bd 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -115,7 +115,7 @@ public: return; } [[nodiscard]] - hash_t yield() { + hash_t yield() const { return (hash_t)state; } @@ -383,7 +383,11 @@ public: commutative_hash() { buckets.fill(0); } - void eat(Hasher h) { + template + void eat(const T &obj) { + eat(hash_ops::hash(obj)); + } + void eat(const Hasher &h) { Hasher::hash_t v = h.yield(); size_t index = v & (buckets.size() - 1); buckets[index] += v; diff --git a/passes/opt/opt_merge.cc b/passes/opt/opt_merge.cc index bcde1e173..6cdcbc822 100644 --- a/passes/opt/opt_merge.cc +++ b/passes/opt/opt_merge.cc @@ -34,6 +34,9 @@ USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN +template +inline Hasher hash_pair(const T &t, const U &u) { return hash_ops>::hash(t, u); } + struct OptMergeWorker { RTLIL::Design *design; @@ -52,7 +55,7 @@ struct OptMergeWorker hashlib::commutative_hash comm; for (int i = 0; i < s_width; i++) - comm.eat(hash_ops>::hash({sig_s[i], sig_b.extract(i*width, width)})); + comm.eat(hash_pair(sig_s[i], sig_b.extract(i*width, width))); return comm.hash_into(h); } @@ -87,8 +90,8 @@ struct OptMergeWorker if (cell->type.in(ID($and), ID($or), ID($xor), ID($xnor), ID($add), ID($mul), ID($logic_and), ID($logic_or), ID($_AND_), ID($_OR_), ID($_XOR_))) { hashlib::commutative_hash comm; - comm.eat(hash_ops::hash(assign_map(cell->getPort(ID::A)))); - comm.eat(hash_ops::hash(assign_map(cell->getPort(ID::B)))); + comm.eat(assign_map(cell->getPort(ID::A))); + comm.eat(assign_map(cell->getPort(ID::B))); h = comm.hash_into(h); } else if (cell->type.in(ID($reduce_xor), ID($reduce_xnor))) { SigSpec a = assign_map(cell->getPort(ID::A)); @@ -108,7 +111,7 @@ struct OptMergeWorker for (const auto& [port, sig] : cell->connections()) { if (cell->output(port)) continue; - comm.eat(hash_ops>::hash(port, assign_map(sig))); + comm.eat(hash_pair(port, assign_map(sig))); } h = comm.hash_into(h); if (cell->is_builtin_ff()) @@ -121,7 +124,7 @@ struct OptMergeWorker { hashlib::commutative_hash comm; for (const auto& param : cell->parameters) { - comm.eat(hash_ops>::hash(param)); + comm.eat(param); } return comm.hash_into(h); }