Skip to content

Commit

Permalink
Merge pull request #3927 from alainmarcel/alainmarcel-patch-1
Browse files Browse the repository at this point in the history
enum const constant pushing
  • Loading branch information
alaindargelas authored Nov 14, 2023
2 parents 36ec06b + 0d636f0 commit a5149e8
Show file tree
Hide file tree
Showing 20 changed files with 1,439 additions and 3,377 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/non_vendored.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DJSON_BuildTests=OFF . && cmake --build build && sudo cmake --install build
popd
git clone --depth 1 --branch v1.79 https://github.com/chipsalliance/UHDM.git
git clone --depth 1 --branch v1.80 https://github.com/chipsalliance/UHDM.git
pushd UHDM
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DUHDM_USE_HOST_GTEST=ON -DUHDM_USE_HOST_CAPNP=ON . && cmake --build build && sudo cmake --install build
popd
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[submodule "third_party/UHDM"]
path = third_party/UHDM
url = https://github.com/chipsalliance/UHDM.git
branch = v1.79
branch = v1.80
[submodule "third_party/antlr4"]
path = third_party/antlr4
url = https://github.com/antlr/antlr4.git
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
# Version changes whenever some new features accumulated, or the
# grammar or the cache format changes to make sure caches
# are invalidated.
project(SURELOG VERSION 1.79)
project(SURELOG VERSION 1.80)

# Detect build type, fallback to release and throw a warning if use didn't
# specify any
Expand Down
26 changes: 26 additions & 0 deletions src/DesignCompile/UhdmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3273,6 +3273,27 @@ void UhdmWriter::lateBinding(Serializer& s, DesignComponent* mod, scope* m) {
}
}
}
if (m->Typespecs()) {
for (auto n : *m->Typespecs()) {
if (n->UhdmType() == uhdmenum_typespec) {
enum_typespec* tps = any_cast<enum_typespec*>(n);
if (tps && tps->Enum_consts()) {
for (auto c : *tps->Enum_consts()) {
if (c->VpiName() == name) {
ref->Actual_group(c);
break;
}
if (std::string(std::string(m->VpiName()) +
std::string("::") + std::string(name)) ==
c->VpiName()) {
ref->Actual_group(c);
break;
}
}
}
}
}
}
}
}
if (ref->Actual_group()) break;
Expand Down Expand Up @@ -3611,6 +3632,11 @@ void UhdmWriter::lateBinding(Serializer& s, DesignComponent* mod, scope* m) {
ref->Actual_group(c);
break;
}
if (std::string(std::string(m->VpiName()) + std::string("::") +
std::string(name)) == c->VpiName()) {
ref->Actual_group(c);
break;
}
}
}
}
Expand Down
Loading

0 comments on commit a5149e8

Please sign in to comment.