Merge branch 'main' of chef.heaplab.deib.polimi.it:nnicolosi/Raptor into main
Some checks failed
Validate Operations / validate-operations (push) Failing after 21m43s

This commit is contained in:
ilgeco
2026-04-14 13:44:22 +02:00
3 changed files with 7 additions and 5 deletions

View File

@@ -651,7 +651,9 @@ static OnnxMlirCompilerErrorCodes writeConfigJson(func::FuncOp funcOp,
json::Object xbarsPerArrayGroup,
StringRef outputDirPath) {
json::Object configJson;
configJson["core_cnt"] = coreCount;
// +1 because pimsim-nn also considers the host as a core
configJson["core_cnt"] = coreCount + 1;
// TODO: Should this be based on the floating point type used in the model?
// The 2 following values determine the bitwidth of the vectors' elements: bitwidth = adc_count * cell_precision
@@ -718,7 +720,8 @@ OnnxMlirCompilerErrorCodes onnx_mlir::compileToPimJson(ModuleOp& moduleOp, std::
errs() << "Error while opening host core file `" << outputHostCorePath << "`: " << errorCode.message() << '\n';
return InvalidOutputFileAccess;
}
hostFileStream << "[]";
// The host core json contains 2 random instructions, just to make pimsim-nn happy
hostFileStream << "[{\"imm\":0,\"op\":\"sldi\",\"rd\":0},{\"imm\":0,\"op\":\"sldi\",\"rd\":0}]";
hostFileStream.close();
// For each core, specify the number of crossbar per array group.