Skip to content

Commit 995044f

Browse files
authored
Merge branch 'YosysHQ:main' into master
2 parents 2df3a55 + 6f9c515 commit 995044f

File tree

17 files changed

+133
-49
lines changed

17 files changed

+133
-49
lines changed

.github/workflows/test-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
mkdir build
5757
cd build
5858
make -f ../Makefile config-$CC
59+
echo 'SANITIZER = undefined' >> Makefile.conf
5960
make -f ../Makefile -j$procs ENABLE_LTO=1
6061
6162
- name: Log yosys-config output
@@ -82,6 +83,7 @@ jobs:
8283
if: needs.pre_job.outputs.should_skip != 'true'
8384
env:
8485
CC: clang
86+
UBSAN_OPTIONS: halt_on_error=1
8587
strategy:
8688
matrix:
8789
os: [ubuntu-latest, macos-latest]

.mailmap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Marcelina Kościelnicka <[email protected]>
2-
Marcelina Kościelnicka <mwk@0x04.net> <[email protected]>
3-
Marcelina Kościelnicka <mwk@0x04.net> <[email protected]>
1+
2+
Wanda Phinode <wanda@phinode.net> <[email protected]>
3+
Wanda Phinode <wanda@phinode.net> <[email protected]>
44
55
66

CHANGELOG

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

5-
Yosys 0.49 .. Yosys 0.50-dev
5+
Yosys 0.50 .. Yosys 0.51-dev
66
--------------------------
77

8+
Yosys 0.49 .. Yosys 0.50
9+
--------------------------
10+
* Various
11+
- "write_verilog" emits "$check" cell names as labels.
12+
813
Yosys 0.48 .. Yosys 0.49
914
--------------------------
1015
* Various

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ifeq ($(OS), Haiku)
153153
CXXFLAGS += -D_DEFAULT_SOURCE
154154
endif
155155

156-
YOSYS_VER := 0.49+1
156+
YOSYS_VER := 0.50+0
157157

158158
# Note: We arrange for .gitcommit to contain the (short) commit hash in
159159
# tarballs generated with git-archive(1) using .gitattributes. The git repo
@@ -169,7 +169,7 @@ endif
169169
OBJS = kernel/version_$(GIT_REV).o
170170

171171
bumpversion:
172-
sed -i "/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline 427b5a2.. | wc -l`/;" Makefile
172+
sed -i "/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline b5170e1.. | wc -l`/;" Makefile
173173

174174
ABCMKARGS = CC="$(CXX)" CXX="$(CXX)" ABC_USE_LIBSTDCXX=1 ABC_USE_NAMESPACE=abc VERBOSE=$(Q)
175175

@@ -1054,7 +1054,6 @@ clean:
10541054
rm -f tests/svinterfaces/*.log_stdout tests/svinterfaces/*.log_stderr tests/svinterfaces/dut_result.txt tests/svinterfaces/reference_result.txt tests/svinterfaces/a.out tests/svinterfaces/*_syn.v tests/svinterfaces/*.diff
10551055
rm -f tests/tools/cmp_tbdata
10561056
-$(MAKE) -C docs clean
1057-
-$(MAKE) -C docs/images clean
10581057
rm -rf docs/source/cmd docs/util/__pycache__
10591058

10601059
clean-abc:

backends/json/json.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ struct JsonBackend : public Backend {
408408
log("\n");
409409
log("The \"offset\" and \"upto\" fields are skipped if their value would be 0.\n");
410410
log("They don't affect connection semantics, and are only used to preserve original\n");
411-
log("HDL bit indexing.");
411+
log("HDL bit indexing.\n");
412412
log("And <cell_details> is:\n");
413413
log("\n");
414414
log(" {\n");

backends/verilog/verilog_backend.cc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,16 +1044,23 @@ void dump_cell_expr_print(std::ostream &f, std::string indent, const RTLIL::Cell
10441044
void dump_cell_expr_check(std::ostream &f, std::string indent, const RTLIL::Cell *cell)
10451045
{
10461046
std::string flavor = cell->getParam(ID(FLAVOR)).decode_string();
1047+
std::string label = "";
1048+
if (cell->name.isPublic()) {
1049+
label = stringf("%s: ", id(cell->name).c_str());
1050+
}
1051+
10471052
if (flavor == "assert")
1048-
f << stringf("%s" "assert (", indent.c_str());
1053+
f << stringf("%s" "%s" "assert (", indent.c_str(), label.c_str());
10491054
else if (flavor == "assume")
1050-
f << stringf("%s" "assume (", indent.c_str());
1055+
f << stringf("%s" "%s" "assume (", indent.c_str(), label.c_str());
10511056
else if (flavor == "live")
1052-
f << stringf("%s" "assert (eventually ", indent.c_str());
1057+
f << stringf("%s" "%s" "assert (eventually ", indent.c_str(), label.c_str());
10531058
else if (flavor == "fair")
1054-
f << stringf("%s" "assume (eventually ", indent.c_str());
1059+
f << stringf("%s" "%s" "assume (eventually ", indent.c_str(), label.c_str());
10551060
else if (flavor == "cover")
1056-
f << stringf("%s" "cover (", indent.c_str());
1061+
f << stringf("%s" "%s" "cover (", indent.c_str(), label.c_str());
1062+
else
1063+
log_abort();
10571064
dump_sigspec(f, cell->getPort(ID::A));
10581065
f << stringf(");\n");
10591066
}

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.49"
9+
yosys_ver = "0.50"
1010

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

frontends/ast/simplify.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,10 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
29362936
lsb_expr->children[stride_ix]->detectSignWidth(stride_width, stride_sign);
29372937
max_width = std::max(i_width, stride_width);
29382938
// Stride width calculated from actual stride value.
2939-
stride_width = std::ceil(std::log2(std::abs(stride)));
2939+
if (stride == 0)
2940+
stride_width = 0;
2941+
else
2942+
stride_width = std::ceil(std::log2(std::abs(stride)));
29402943

29412944
if (i_width + stride_width > max_width) {
29422945
// For (truncated) i*stride to be within the range of dst, the following must hold:

kernel/celledges.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ void shift_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell)
253253
if (a_width == 1 && is_signed) {
254254
int skip = 1 << (k + 1);
255255
int base = skip -1;
256-
if (i % skip != base && i - a_width + 2 < 1 << b_width)
256+
if (i % skip != base && i - a_width + 2 < 1 << b_width_capped)
257257
db->add_edge(cell, ID::B, k, ID::Y, i, -1);
258258
} else if (is_signed) {
259-
if (i - a_width + 2 < 1 << b_width)
259+
if (i - a_width + 2 < 1 << b_width_capped)
260260
db->add_edge(cell, ID::B, k, ID::Y, i, -1);
261261
} else {
262-
if (i - a_width + 1 < 1 << b_width)
262+
if (i - a_width + 1 < 1 << b_width_capped)
263263
db->add_edge(cell, ID::B, k, ID::Y, i, -1);
264264
}
265265
// right shifts
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/fastlz.cc b/fastlz.cc
2+
index 3272ca7a8..41ea27a16 100644
3+
--- a/fastlz.cc
4+
+++ b/fastlz.cc
5+
@@ -60,24 +60,9 @@
6+
#endif
7+
8+
/*
9+
- * Prevent accessing more than 8-bit at once, except on x86 architectures.
10+
+ * Yosys patch: do not do unaligned accesses on any platform
11+
*/
12+
-#if !defined(FASTLZ_STRICT_ALIGN)
13+
#define FASTLZ_STRICT_ALIGN
14+
-#if defined(__i386__) || defined(__386) /* GNU C, Sun Studio */
15+
-#undef FASTLZ_STRICT_ALIGN
16+
-#elif defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__amd64) /* GNU C */
17+
-#undef FASTLZ_STRICT_ALIGN
18+
-#elif defined(_M_IX86) /* Intel, MSVC */
19+
-#undef FASTLZ_STRICT_ALIGN
20+
-#elif defined(__386)
21+
-#undef FASTLZ_STRICT_ALIGN
22+
-#elif defined(_X86_) /* MinGW */
23+
-#undef FASTLZ_STRICT_ALIGN
24+
-#elif defined(__I86__) /* Digital Mars */
25+
-#undef FASTLZ_STRICT_ALIGN
26+
-#endif
27+
-#endif
28+
29+
/* prototypes */
30+
int fastlz_compress(const void* input, int length, void* output);
31+
@@ -88,11 +73,7 @@ int fastlz_decompress(const void* input, int length, void* output, int maxout);
32+
#define MAX_LEN 264 /* 256 + 8 */
33+
#define MAX_DISTANCE 8192
34+
35+
-#if !defined(FASTLZ_STRICT_ALIGN)
36+
-#define FASTLZ_READU16(p) *((const flzuint16*)(p))
37+
-#else
38+
#define FASTLZ_READU16(p) ((p)[0] | (p)[1]<<8)
39+
-#endif
40+
41+
#define HASH_LOG 13
42+
#define HASH_SIZE (1<< HASH_LOG)

0 commit comments

Comments
 (0)