Support public packed struct / union (#860) (#4878)

This commit is contained in:
Kefa Chen
2024-03-03 10:23:04 -05:00
committed by GitHub
parent 5e1fc6e24d
commit 5f1dc73a1b
17 changed files with 1015 additions and 43 deletions
+2 -1
View File
@@ -173,7 +173,8 @@ class RandomizeVisitor final : public VNVisitor {
AstCDType* findVlRandCDType(FileLine* fl, uint64_t items) {
// For 8 items we need to have a 9 item LFSR so items is max count
const std::string type = AstCDType::typeToHold(items);
// width(items) = log2(items) + 1
const std::string type = AstCDType::typeToHold(V3Number::log2bQuad(items) + 1);
const std::string name = "VlRandC<" + type + ", " + cvtToStr(items) + "ULL>";
// Create or reuse (to avoid duplicates) randomization object dtype
const auto pair = m_randcDtypes.emplace(name, nullptr);