Follow the workflow in the following documentation to check which checksum is not equal:
If the checksums for the "BlockFullPath" identifier are unequal and preventing code reuse, the following is an explanation and workaround:
WORKAROUND (1)
When the sample times of the input signals to the S-Function block of the dynamic Lookup Table (LUT) are constant (including inf), Simulink Coder performs an optimized lookup using the block's full path. Hence, the "BlockFullPath" checksums are compared and since the two subsystems would have different/unique names, the checksums will not be unequal. Thereby, preventing code reuse.
To prevent Simulink Coder from comparing the block full path for code-reuse, the sample times for the input signals to the S-function block need to be set to non-constant (-1, inherited). This change in sample time can be made at the source blocks driving the input signals of the S-Function blocks (here, dynamic LUTs). This prevents Simulink Coder from optimizing from considering the "BlockFullPath" for code generation optimization and code is reused.
WORKAROUND (2)
The root cause of the issue preventing code reusability is the look-up optimization performed by codegen for dynamic LUTs. Specifically, it uses an input value based algorithm that uses tunable parameters for optimization. To avoid using dynamic LUTs on which Simulink Coder performs such optimization, one can use the following alternatives to achieve the same workflow:
- Prelookup_InterpND blocks combination: have always supported ‘Table’ and ‘breakpoints’ fed into ports.
- N-D Lookup Table: started supporting ‘Table’ and ‘breakpoints’ via ports in and after R2020b.