Hello wbj5238@163.com ,
For adding custom code to your Simulink models you have more options - one way of doing so you can find detailed in this article on our community - How to use your own C code in our Toolbox (Battery Management System example) .
I will cover another way of doing this, more suited in my opinion for this case where you only need to add 1 line.
Simulink has a block named System Start Function. You can use this block in the model you are using the SPI and there you can add the following line, in the System Start Function Exit Code section.

DSPI_MasterSetDelay(1, 100, 10, 20);

Let me go through the parameter list - you have, in order: instance, delayBetweenTransfers, delaySCKtoPCS, delayPCStoSCK
So in my example, it will set the following:
1 - it will set the delay for SPI INSTANCE 1
100 - it will set the delay between transfer to a minimum of 100ms
10 - it will set the delay between SCK and PCS to minimum 10ms
20 - it will set the delay between the PCS and SCK to minimum 20ms
This is just an example, you will need to tune this parameters as for your needs.
One more thing I'd like to mention is that you will need to put it into the Function Exit Code section so it is guaranteed to be executed after the SPI has been initialized. If this were to be executed before, the application would crash.
This code is only executed once, in the initialization. If you want to add code that would be executed in the main loop, you would need to use a similar block name System Outputs Function.
You can read more details about the function in the NXP SDK doc (you can find it in {TOOLBOX_ROOT}\MPC_Platform_SDK\doc\Start_here.html).

Hope this helps.
Kind regards,
Razvan.