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

verilator: update to 4.204 #8954

Merged
merged 1 commit into from
Jun 18, 2021
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
64 changes: 64 additions & 0 deletions mingw-w64-verilator/0001-Fix-V3Hash-when-building-m32.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From 0c4d88baccd3d253479ac94f444b0f3c621807a2 Mon Sep 17 00:00:00 2001
From: Geza Lore <gezalore@gmail.com>
Date: Sun, 13 Jun 2021 20:04:26 +0100
Subject: [PATCH] Fix V3Hash when building -m32

---
src/V3Hash.h | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/V3Hash.h b/src/V3Hash.h
index b28b3bf1..06223567 100644
--- a/src/V3Hash.h
+++ b/src/V3Hash.h
@@ -26,6 +26,10 @@
class V3Hash final {
uint32_t m_value; // The 32-bit hash value.

+ inline static uint32_t combine(uint32_t a, uint32_t b) {
+ return a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2));
+ }
+
public:
// CONSTRUCTORS
V3Hash()
@@ -34,8 +38,10 @@ public:
: m_value{val} {}
explicit V3Hash(int32_t val)
: m_value{static_cast<uint32_t>(val)} {}
- explicit V3Hash(size_t val)
- : m_value{static_cast<uint32_t>(val)} {}
+ explicit V3Hash(uint64_t val)
+ : m_value{combine(static_cast<uint32_t>(val), static_cast<uint32_t>(val >> 32))} {}
+ explicit V3Hash(int64_t val)
+ : m_value{combine(static_cast<uint32_t>(val), static_cast<uint32_t>(val >> 32))} {}
explicit V3Hash(const std::string& val);

// METHODS
@@ -48,20 +54,12 @@ public:
bool operator<(const V3Hash& rh) const { return m_value < rh.m_value; }

// '+' combines hashes
- V3Hash operator+(const V3Hash& that) const {
- return V3Hash(m_value ^ (that.m_value + 0x9e3779b9 + (m_value << 6) + (m_value >> 2)));
+ template <class T> V3Hash operator+(T that) const {
+ return V3Hash(combine(m_value, V3Hash(that).m_value));
}
- V3Hash operator+(uint32_t value) const { return *this + V3Hash(value); }
- V3Hash operator+(int32_t value) const { return *this + V3Hash(value); }
- V3Hash operator+(size_t value) const { return *this + V3Hash(value); }
- V3Hash operator+(const std::string& value) const { return *this + V3Hash(value); }

// '+=' combines in place
- V3Hash& operator+=(const V3Hash& that) { return *this = *this + that; }
- V3Hash& operator+=(uint32_t value) { return *this += V3Hash(value); }
- V3Hash& operator+=(int32_t value) { return *this += V3Hash(value); }
- V3Hash& operator+=(size_t value) { return *this += V3Hash(value); }
- V3Hash& operator+=(const std::string& that) { return *this += V3Hash(that); }
+ template <class T> V3Hash& operator+=(T that) { return *this = *this + that; }
};

std::ostream& operator<<(std::ostream& os, const V3Hash& rhs);
--
2.32.0

13 changes: 10 additions & 3 deletions mingw-w64-verilator/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_realname=verilator
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=4.202
pkgver=4.204
pkgrel=1
pkgdesc="The fastest free Verilog HDL simulator (mingw-w64)"
arch=('any')
Expand All @@ -14,13 +14,20 @@ groups=("${MINGW_PACKAGE_PREFIX}-eda")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "flex")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")

source=("${_realname}::https://codeload.github.com/${_realname}/${_realname}/tar.gz/v${pkgver}")
sha256sums=('a60c02f299ddb5bb8e963dc7d81983c55c293d97718685c1cd4b66638a33d98e')
source=(
"${_realname}::https://codeload.github.com/${_realname}/${_realname}/tar.gz/v${pkgver}"
'0001-Fix-V3Hash-when-building-m32.patch'
)
sha256sums=(
'dbad9bd3cac34e63bbd945fff9a59eaabe31dae1e1c93c847d0f894db9919498'
'9c2a039f72d14896e9def846f4f274ce98cde52ee34cd3adad2c715b8e93c000'
)

prepare() {
[[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
cp -rf "${srcdir}/${_realname}-${pkgver}" "${srcdir}/build-${MINGW_CHOST}"
cd "${srcdir}/build-${MINGW_CHOST}"
patch -p1 < ${srcdir}/0001-Fix-V3Hash-when-building-m32.patch
sh autoconf
}

Expand Down