Merge branch 'YosysHQ:main' into main

This commit is contained in:
Akash Levy 2025-09-30 11:14:33 -07:00 committed by GitHub
commit c26f38faeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 31 additions and 19 deletions

View File

@ -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

View File

@ -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,

View File

@ -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.

View File

@ -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._

View File

@ -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

View File

@ -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

View File

@ -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 <typename T>
void eat(const T &obj) {
eat(hash_ops<T>::hash(obj));
}
void eat(const Hasher &h) {
Hasher::hash_t v = h.yield();
size_t index = v & (buckets.size() - 1);
buckets[index] += v;

View File

@ -34,6 +34,9 @@
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
template <typename T, typename U>
inline Hasher hash_pair(const T &t, const U &u) { return hash_ops<std::pair<T, U>>::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<std::pair<SigBit, SigSpec>>::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<RTLIL::SigSpec>::hash(assign_map(cell->getPort(ID::A))));
comm.eat(hash_ops<RTLIL::SigSpec>::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<std::pair<IdString, SigSpec>>::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<std::pair<IdString, Const>>::hash(param));
comm.eat(param);
}
return comm.hash_into(h);
}