Internals: Fis emit spacing etc. No functional change

This commit is contained in:
Wilson Snyder 2025-08-02 13:47:07 -04:00
parent dca504c706
commit 473d54aa95
2 changed files with 5 additions and 3 deletions

View File

@ -80,6 +80,7 @@ void svPutBitselLogic(svLogicVecVal* dp, int bit, svLogic s) {
} }
void svGetPartselBit(svBitVecVal* dp, const svBitVecVal* sp, int lsb, int width) { void svGetPartselBit(svBitVecVal* dp, const svBitVecVal* sp, int lsb, int width) {
// Verilator supports > 32 bit widths, which is an extension to IEEE DPI
// See also VL_SEL_WWI // See also VL_SEL_WWI
const int msb = lsb + width - 1; const int msb = lsb + width - 1;
const int word_shift = VL_BITWORD_I(lsb); const int word_shift = VL_BITWORD_I(lsb);
@ -103,6 +104,7 @@ void svGetPartselBit(svBitVecVal* dp, const svBitVecVal* sp, int lsb, int width)
dp[VL_WORDS_I(width) - 1] &= VL_MASK_I(width); dp[VL_WORDS_I(width) - 1] &= VL_MASK_I(width);
} }
void svGetPartselLogic(svLogicVecVal* dp, const svLogicVecVal* sp, int lsb, int width) { void svGetPartselLogic(svLogicVecVal* dp, const svLogicVecVal* sp, int lsb, int width) {
// Verilator supports > 32 bit widths, which is an extension to IEEE DPI
const int msb = lsb + width - 1; const int msb = lsb + width - 1;
const int word_shift = VL_BITWORD_I(lsb); const int word_shift = VL_BITWORD_I(lsb);
if (VL_BITBIT_I(lsb) == 0) { if (VL_BITBIT_I(lsb) == 0) {

View File

@ -337,7 +337,7 @@ struct TaskDpiUtils final {
const string frSvType = portp->basicp()->isDpiBitVec() ? "SVBV" : "SVLV"; const string frSvType = portp->basicp()->isDpiBitVec() ? "SVBV" : "SVLV";
if (portp->isWide()) { if (portp->isWide()) {
// Need to convert to wide, using special function // Need to convert to wide, using special function
frstmt = "VL_SET_W_" + frSvType + "(" + cvtToStr(portp->width()) + ","; frstmt = "VL_SET_W_" + frSvType + "(" + cvtToStr(portp->width()) + ", ";
return true; return true;
} else { } else {
const AstNodeDType* const dtypep = portp->dtypep()->skipRefp(); const AstNodeDType* const dtypep = portp->dtypep()->skipRefp();
@ -826,7 +826,7 @@ class TaskVisitor final : public VNVisitor {
linesp->addNext(srcp); linesp->addNext(srcp);
linesp->addNext( linesp->addNext(
new AstText{portvscp->fileline(), new AstText{portvscp->fileline(),
"," + frName + " + " + cvtToStr(i * widthWords) + ");\n"}); ", " + frName + " + " + cvtToStr(i * widthWords) + ");\n"});
stmtp = new AstCStmt{portvscp->fileline(), linesp}; stmtp = new AstCStmt{portvscp->fileline(), linesp};
} else { } else {
string from = frstmt; string from = frstmt;
@ -884,7 +884,7 @@ class TaskVisitor final : public VNVisitor {
stmt += "if (VL_UNLIKELY(__Vfuncnum == -1)) __Vfuncnum = Verilated::exportFuncNum(\"" stmt += "if (VL_UNLIKELY(__Vfuncnum == -1)) __Vfuncnum = Verilated::exportFuncNum(\""
+ nodep->cname() + "\");\n"; + nodep->cname() + "\");\n";
// If the find fails, it will throw an error // If the find fails, it will throw an error
stmt += "const VerilatedScope* __Vscopep = Verilated::dpiScope();\n"; stmt += "const VerilatedScope* const __Vscopep = Verilated::dpiScope();\n";
// If dpiScope is fails and is null; the exportFind function throws and error // If dpiScope is fails and is null; the exportFind function throws and error
const string cbtype const string cbtype
= VIdProtect::protect(v3Global.opt.prefix() + "__Vcb_" + nodep->cname() + "_t"); = VIdProtect::protect(v3Global.opt.prefix() + "__Vcb_" + nodep->cname() + "_t");