Skip to content

Commit bdb811b

Browse files
authored
Merge branch 'YosysHQ:main' into master
2 parents 088240c + 6378ba1 commit bdb811b

40 files changed

+1204
-99
lines changed

CHANGELOG

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,29 @@
22
List of major changes and improvements between releases
33
=======================================================
44

5-
Yosys 0.52 .. Yosys 0.53-dev
5+
Yosys 0.53 .. Yosys 0.54-dev
66
--------------------------
77

8+
Yosys 0.52 .. Yosys 0.53
9+
--------------------------
10+
* New commands and options
11+
- Added "constmap" pass for technology mapping of coarse constant value.
12+
- Added "timeest" pass to estimate the critical path in clock domain.
13+
- Added "-blackbox" option to "cutpoint" pass to cut all instances of
14+
blackboxes.
15+
- Added "-noscopeinfo" option to "cutpoint" pass.
16+
- Added "-nocleanup" option to "flatten" pass to prevent removal of
17+
unused submodules.
18+
- Added "-declockgate" option to "formalff" pass that turns clock
19+
gating into clock enables.
20+
21+
* Various
22+
- Added "$scopeinfo" cells to preserve information during "cutpoint" pass.
23+
- Added dataflow tracking documentation.
24+
- share: Restrict activation patterns to potentially relevant signal.
25+
- liberty: More robust parsing.
26+
- verific: bit blast RAM if using mem2reg attribute.
27+
828
Yosys 0.51 .. Yosys 0.52
929
--------------------------
1030
* New commands and options

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ ifeq ($(OS), Haiku)
160160
CXXFLAGS += -D_DEFAULT_SOURCE
161161
endif
162162

163-
YOSYS_VER := 0.52+63
163+
YOSYS_VER := 0.53+3
164164
YOSYS_MAJOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f1)
165165
YOSYS_MINOR := $(shell echo $(YOSYS_VER) | cut -d'.' -f2 | cut -d'+' -f1)
166166
YOSYS_COMMIT := $(shell echo $(YOSYS_VER) | cut -d'+' -f2)
@@ -183,7 +183,7 @@ endif
183183
OBJS = kernel/version_$(GIT_REV).o
184184

185185
bumpversion:
186-
sed -i "/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline fee39a3.. | wc -l`/;" Makefile
186+
sed -i "/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline 53c22ab.. | wc -l`/;" Makefile
187187

188188
ABCMKARGS = CC="$(CXX)" CXX="$(CXX)" ABC_USE_LIBSTDCXX=1 ABC_USE_NAMESPACE=abc VERBOSE=$(Q)
189189

@@ -396,6 +396,10 @@ ifeq ($(DISABLE_ABC_THREADS),1)
396396
ABCMKARGS += "ABC_USE_NO_PTHREADS=1"
397397
endif
398398

399+
ifeq ($(LINK_ABC),1)
400+
ABCMKARGS += "ABC_USE_PIC=1"
401+
endif
402+
399403
ifeq ($(DISABLE_SPAWN),1)
400404
CXXFLAGS += -DYOSYS_DISABLE_SPAWN
401405
endif
@@ -787,7 +791,7 @@ $(PROGRAM_PREFIX)yosys-config: misc/yosys-config.in $(YOSYS_SRC)/Makefile
787791
.PHONY: check-git-abc
788792

789793
check-git-abc:
790-
@if [ ! -d "$(YOSYS_SRC)/abc" ]; then \
794+
@if [ ! -d "$(YOSYS_SRC)/abc" ] && git -C "$(YOSYS_SRC)" status >/dev/null 2>&1; then \
791795
echo "Error: The 'abc' directory does not exist."; \
792796
echo "Initialize the submodule: Run 'git submodule update --init' to set up 'abc' as a submodule."; \
793797
exit 1; \
@@ -813,6 +817,12 @@ check-git-abc:
813817
echo "3. Initialize the submodule: Run 'git submodule update --init' to set up 'abc' as a submodule."; \
814818
echo "4. Reapply your changes: Move your saved changes back to the 'abc' directory, if necessary."; \
815819
exit 1; \
820+
elif ! git -C "$(YOSYS_SRC)" status >/dev/null 2>&1; then \
821+
echo "$(realpath $(YOSYS_SRC)) is not configured as a git repository, and 'abc' folder is missing."; \
822+
echo "If you already have ABC, set 'ABCEXTERNAL' make variable to point to ABC executable."; \
823+
echo "Otherwise, download release archive 'yosys.tar.gz' from https://github.com/YosysHQ/yosys/releases."; \
824+
echo " ('Source code' archive does not contain submodules.)"; \
825+
exit 1; \
816826
else \
817827
echo "Initialize the submodule: Run 'git submodule update --init' to set up 'abc' as a submodule."; \
818828
exit 1; \

backends/cxxrtl/cxxrtl_backend.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,12 @@ struct CxxrtlWorker {
24102410
auto cell_attrs = scopeinfo_attributes(cell, ScopeinfoAttrs::Cell);
24112411
cell_attrs.erase(ID::module_not_derived);
24122412
f << indent << "scopes->add(path, " << escape_cxx_string(get_hdl_name(cell)) << ", ";
2413-
f << escape_cxx_string(cell->get_string_attribute(ID(module))) << ", ";
2413+
if (module_attrs.count(ID(hdlname))) {
2414+
f << escape_cxx_string(module_attrs.at(ID(hdlname)).decode_string());
2415+
} else {
2416+
f << escape_cxx_string(cell->get_string_attribute(ID(module)));
2417+
}
2418+
f << ", ";
24142419
dump_serialized_metadata(module_attrs);
24152420
f << ", ";
24162421
dump_serialized_metadata(cell_attrs);

backends/cxxrtl/runtime/cxxrtl/cxxrtl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ value<BitsY> shr_uu(const value<BitsA> &a, const value<BitsB> &b) {
17691769
template<size_t BitsY, size_t BitsA, size_t BitsB>
17701770
CXXRTL_ALWAYS_INLINE
17711771
value<BitsY> shr_su(const value<BitsA> &a, const value<BitsB> &b) {
1772-
return a.shr(b).template scast<BitsY>();
1772+
return a.template scast<BitsY>().shr(b);
17731773
}
17741774

17751775
template<size_t BitsY, size_t BitsA, size_t BitsB>
@@ -2010,7 +2010,7 @@ std::pair<value<BitsY>, value<BitsY>> divmod_uu(const value<BitsA> &a, const val
20102010
value<Bits> quotient;
20112011
value<Bits> remainder;
20122012
value<Bits> dividend = a.template zext<Bits>();
2013-
value<Bits> divisor = b.template zext<Bits>();
2013+
value<Bits> divisor = b.template trunc<BitsB>().template zext<Bits>();
20142014
std::tie(quotient, remainder) = dividend.udivmod(divisor);
20152015
return {quotient.template trunc<BitsY>(), remainder.template trunc<BitsY>()};
20162016
}

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
project = 'YosysHQ Yosys'
77
author = 'YosysHQ GmbH'
88
copyright ='2025 YosysHQ GmbH'
9-
yosys_ver = "0.52"
9+
yosys_ver = "0.53"
1010

1111
# select HTML theme
1212
html_theme = 'furo-ys'

frontends/ast/simplify.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,6 +1919,8 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
19191919
if (!str.empty() && str[0] == '\\' && (template_node->type == AST_STRUCT || template_node->type == AST_UNION)) {
19201920
// replace instance with wire representing the packed structure
19211921
newNode = make_packed_struct(template_node, str, attributes);
1922+
if (newNode->attributes.count(ID::wiretype))
1923+
delete newNode->attributes[ID::wiretype];
19221924
newNode->set_attribute(ID::wiretype, mkconst_str(resolved_type_node->str));
19231925
// add original input/output attribute to resolved wire
19241926
newNode->is_input = this->is_input;

frontends/verific/verific.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,25 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
14461446
module_name = "\\" + sha1_if_contain_spaces(module_name);
14471447
}
14481448

1449+
{
1450+
Array ram_nets ;
1451+
MapIter mem_mi;
1452+
Net *mem_net;
1453+
FOREACH_NET_OF_NETLIST(nl, mem_mi, mem_net)
1454+
{
1455+
if (!mem_net->IsRamNet()) continue ;
1456+
1457+
if (mem_net->GetAtt("mem2reg"))
1458+
ram_nets.Insert(mem_net) ;
1459+
}
1460+
unsigned i ;
1461+
FOREACH_ARRAY_ITEM(&ram_nets, i, mem_net) {
1462+
log("Bit blasting RAM for identifier '%s'\n", mem_net->Name());
1463+
mem_net->BlastNet();
1464+
}
1465+
nl->RemoveDanglingLogic(0);
1466+
}
1467+
14491468
netlist = nl;
14501469

14511470
if (design->has(module_name)) {

frontends/verilog/verilog_parser.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,8 @@ cell_parameter:
22492249
node->children.push_back($1);
22502250
} |
22512251
'.' TOK_ID '(' ')' {
2252-
// just ignore empty parameters
2252+
// delete unused TOK_ID
2253+
delete $2;
22532254
} |
22542255
'.' TOK_ID '(' expr ')' {
22552256
AstNode *node = new AstNode(AST_PARASET);

kernel/celledges.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void shift_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell)
247247
db->add_edge(cell, ID::A, a_width - 1, ID::Y, i, -1);
248248
}
249249

250-
for (int k = 0; k < b_width; k++) {
250+
for (int k = 0; k < b_width_capped; k++) {
251251
// left shifts
252252
if (cell->type.in(ID($shl), ID($sshl))) {
253253
if (a_width == 1 && is_signed) {
@@ -268,7 +268,7 @@ void shift_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell)
268268
bool shift_in_bulk = i < a_width - 1;
269269
// can we jump into the zero-padding by toggling B[k]?
270270
bool zpad_jump = (((y_width - i) & ((1 << (k + 1)) - 1)) != 0 \
271-
&& (((y_width - i) & ~(1 << k)) < (1 << b_width)));
271+
&& (((y_width - i) & ~(1 << k)) < (1 << b_width_capped)));
272272

273273
if (shift_in_bulk || (cell->type.in(ID($shr), ID($shift), ID($shiftx)) && zpad_jump))
274274
db->add_edge(cell, ID::B, k, ID::Y, i, -1);
@@ -279,7 +279,7 @@ void shift_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell)
279279
// bidirectional shifts (positive B shifts right, negative left)
280280
} else if (cell->type.in(ID($shift), ID($shiftx)) && is_b_signed) {
281281
if (is_signed) {
282-
if (k != b_width - 1) {
282+
if (k != b_width_capped - 1) {
283283
bool r_shift_in_bulk = i < a_width - 1;
284284
// assuming B is positive, can we jump into the upper zero-padding by toggling B[k]?
285285
bool r_zpad_jump = (((y_width - i) & ((1 << (k + 1)) - 1)) != 0 \

kernel/driver.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
314314
auto result = options.parse(argc, argv);
315315

316316
if (result.count("M")) memhasher_on();
317-
if (result.count("X")) yosys_xtrace++;
317+
if (result.count("X")) yosys_xtrace += result.count("X");
318318
if (result.count("A")) call_abort = true;
319319
if (result.count("Q")) print_banner = false;
320320
if (result.count("T")) print_stats = false;

0 commit comments

Comments
 (0)