Internals: Add isForceable() to VerilatedVarProps
Allows runtime checking whether a signal is forceable without needing to check the existence of the `__VforceEn` and `__VforceVal` signals. This will be useful for a later implementation of `vpiForceFlag` for `vpi_put_value`.
This commit is contained in:
parent
fe5d6b213c
commit
1f0c1d47a9
|
|
@ -154,7 +154,8 @@ enum VerilatedVarFlags {
|
|||
// Flags
|
||||
VLVF_PUB_RD = (1 << 8), // Public readable
|
||||
VLVF_PUB_RW = (1 << 9), // Public writable
|
||||
VLVF_DPI_CLAY = (1 << 10) // DPI compatible C standard layout
|
||||
VLVF_DPI_CLAY = (1 << 10), // DPI compatible C standard layout
|
||||
VLVF_FORCEABLE = (1 << 11) // Forceable
|
||||
};
|
||||
|
||||
// IEEE 1800-2023 Table 20-6
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ public:
|
|||
return bits;
|
||||
}
|
||||
bool isPublicRW() const { return ((m_vlflags & VLVF_PUB_RW) != 0); }
|
||||
bool isForceable() const { return ((m_vlflags & VLVF_FORCEABLE) != 0); }
|
||||
// DPI compatible C standard layout
|
||||
bool isDpiCLayout() const { return ((m_vlflags & VLVF_DPI_CLAY) != 0); }
|
||||
int udims() const VL_MT_SAFE { return m_unpacked.size(); }
|
||||
|
|
|
|||
|
|
@ -630,6 +630,9 @@ string AstVar::vlEnumDir() const {
|
|||
} else if (isSigUserRdPublic()) {
|
||||
out += "|VLVF_PUB_RD";
|
||||
}
|
||||
if (isForceable()) {
|
||||
out += "|VLVF_FORCEABLE";
|
||||
}
|
||||
//
|
||||
if (const AstBasicDType* const bdtypep = basicp()) {
|
||||
if (bdtypep->keyword().isDpiCLayout()) out += "|VLVF_DPI_CLAY";
|
||||
|
|
|
|||
Loading…
Reference in New Issue