Skip to content

Commit

Permalink
make ports >64 bit run with older verilator versions
Browse files Browse the repository at this point in the history
  • Loading branch information
miree committed Mar 11, 2024
1 parent 7adce6e commit 79c8750
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gvi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ std::string cpp_verilator_interface_function_definition_in(const std::string &mo
}
} else { // port.bitsize > 64
for (int part = parts-1; part >= 0; --part) {
out << "\t\t" << modulename << "_top_instances[idx]->" << port.name_orig << ".at(" << part << ") = " << gen_mask(bitsize) << " & (unsigned)" << port.name << "_gvi_lw" << part << ";" << std::endl;
out << "\t\t" << modulename << "_top_instances[idx]->" << port.name_orig << "[" << part << "] = " << gen_mask(bitsize) << " & (unsigned)" << port.name << "_gvi_lw" << part << ";" << std::endl;
bitsize = 32;
}
}
Expand All @@ -708,7 +708,7 @@ std::string cpp_verilator_interface_function_definition_out(const std::string &m
if (port.bitsize <= 64) {
out << "\t\treturn " << modulename << "_top_instances[idx]->" << port.name_orig << " >> " << part*32 << ";" << std::endl;
} else {
out << "\t\treturn " << modulename << "_top_instances[idx]->" << port.name_orig << ".at(" << part << ");" << std::endl;
out << "\t\treturn " << modulename << "_top_instances[idx]->" << port.name_orig << "[" << part << "];" << std::endl;
}
out << "\t}" << std::endl;
}
Expand Down

0 comments on commit 79c8750

Please sign in to comment.