Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtlil: Adjust internal check for $mem_v2 cells #4723

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kernel/rtlil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
}

// signed needs one leading bit
if (is_signed && idx < size()) {

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, clang-14)

comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc-10)

comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-20.04, clang-10)

comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, clang)

comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, clang)

comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (macos-13, clang)

comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Check warning on line 400 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (macos-13, clang)

comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
idx++;
}
// must be at least one bit
Expand Down Expand Up @@ -1856,9 +1856,9 @@
param_bits(ID::RD_COLLISION_X_MASK, max(1, param(ID::RD_PORTS) * param(ID::WR_PORTS)));
param_bits(ID::RD_WIDE_CONTINUATION, max(1, param(ID::RD_PORTS)));
param_bits(ID::RD_CE_OVER_SRST, max(1, param(ID::RD_PORTS)));
param_bits(ID::RD_ARST_VALUE, param(ID::RD_PORTS) * param(ID::WIDTH));
param_bits(ID::RD_SRST_VALUE, param(ID::RD_PORTS) * param(ID::WIDTH));
param_bits(ID::RD_INIT_VALUE, param(ID::RD_PORTS) * param(ID::WIDTH));
param_bits(ID::RD_ARST_VALUE, max(1, param(ID::RD_PORTS) * param(ID::WIDTH)));
param_bits(ID::RD_SRST_VALUE, max(1, param(ID::RD_PORTS) * param(ID::WIDTH)));
param_bits(ID::RD_INIT_VALUE, max(1, param(ID::RD_PORTS) * param(ID::WIDTH)));
param_bits(ID::WR_CLK_ENABLE, max(1, param(ID::WR_PORTS)));
param_bits(ID::WR_CLK_POLARITY, max(1, param(ID::WR_PORTS)));
param_bits(ID::WR_WIDE_CONTINUATION, max(1, param(ID::WR_PORTS)));
Expand Down
9 changes: 9 additions & 0 deletions tests/memories/nordports.ys
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# check memory_collect doesn't produce invalid RTLIL on a memory w/o read ports
read_rtlil <<EOF
autoidx 1
attribute \top 1
module \top
memory width 4 size 3 \foo
end
EOF
memory_collect
Loading