From: Dave Gutz on
I recently upgraded to 2009a from 2007a. The legacy_code tool sfun generator now adds much data type checking that wasn't done before. For example see the code snippet below for one element of my data structure. The resultant files for my "large" model went from ~2 MB to ~20 MB and the legacy code generation time went from ~2 minute to ~20 minutes. Short term solution is to revert to 2007b (a slight upgrade). Does anybody know an option to disable the added data type checking?


/* Verify Bus/Struct element 'FADCOM.TRQR_GAIN_MULT' */
if (strcmp((char *) dtaGetDataTypeElementName(dta, bpath, __FADCOMId, 6210),
"TRQR_GAIN_MULT")!=0) {
ssSetErrorStatus(S,
"The Bus/StructType 'FADCOM' must have the element 'TRQR_GAIN_MULT' in position 6211.");
return;
}

/* Verify Bus/Struct element 'FADCOM.TRQR_GAIN_MULT' data type */
if (dtaGetDataTypeStorageId(dta, bpath, dtaGetDataTypeElementDataType(dta,
bpath, __FADCOMId, 6210)) != dtaGetDataTypeStorageId(dta, bpath,
dtaGetDataTypeId(dta, "single"))) {
ssSetErrorStatus(S,
"The Bus/StructType element 'FADCOM.TRQR_GAIN_MULT' must have the same data type storage Id as an 'single' has.");
return;
}

/* Verify Bus/Struct element 'FADCOM.TRQR_GAIN_MULT' width */
width = 1;
dims = (int_T *) dtaGetDataTypeElementDimensions(dta, bpath, __FADCOMId,
6210);
for (dimIdx = 0; dimIdx < dtaGetDataTypeElementNumDimensions(dta, bpath,
__FADCOMId, 6210); dimIdx++) {
width *= dims[dimIdx];
}

if (width!=1) {
ssSetErrorStatus(S,
"The Bus/StructType element 'FADCOM.TRQR_GAIN_MULT' must have 1 element(s).");
return;
}

/* Verify Bus/Struct element 'FADCOM.TRQR_GAIN_MULT' complexity */
if (dtaGetDataTypeElementSignalType(dta, bpath, __FADCOMId, 6210)!=0) {
ssSetErrorStatus(S,
"The Bus/StructType element 'FADCOM.TRQR_GAIN_MULT' must be real.");
return;
}