Challenge

Project 2 - Development of TFT Cluster Speedometer Software Component

Simulink Model:

SLDD:

Requirement Tagging Report:

Model Advisor-JMAAB:

Fixed point Tool:

SLDV- Design Error Detection Report:

SLDV- Test Generation:

Functional Test Cases,MIL, SIL Harness, Coverage Report:

Auto Code Generation Report:

/*
* File: TFT_cluster_1.c
*
* Code generated for Simulink model 'TFT_cluster_1'.
*
* Model version : 1.13
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Thu Jul 27 10:46:59 2023
*
* Target selection: ert.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#include "TFT_cluster_1.h"
#include "TFT_cluster_1_private.h"
/* Block signals (default storage) */
B_TFT_cluster_1_T TFT_cluster_1_B;
/* External inputs (root inport signals with default storage) */
ExtU_TFT_cluster_1_T TFT_cluster_1_U;
/* External outputs (root outports fed by signals with default storage) */
ExtY_TFT_cluster_1_T TFT_cluster_1_Y;
/* Real-time model */
static RT_MODEL_TFT_cluster_1_T TFT_cluster_1_M_;
RT_MODEL_TFT_cluster_1_T *const TFT_cluster_1_M = &TFT_cluster_1_M_;
int16_T div_s16s32_floor(int32_T numerator, int32_T denominator)
{
uint32_T absDenominator;
uint32_T absNumerator;
uint32_T tempAbsQuotient;
int16_T quotient;
boolean_T quotientNeedsNegation;
if (denominator == 0) {
quotient = (int16_T)(numerator >= 0 ? 32767 : -32768);
/* Divide by zero handler */
} else {
absNumerator = numerator < 0 ? ~(uint32_T)numerator + 1U : (uint32_T)
numerator;
absDenominator = denominator < 0 ? ~(uint32_T)denominator + 1U : (uint32_T)
denominator;
quotientNeedsNegation = ((numerator < 0) != (denominator < 0));
tempAbsQuotient = absNumerator / absDenominator;
if (quotientNeedsNegation) {
absNumerator %= absDenominator;
if (absNumerator > 0U) {
tempAbsQuotient++;
}
}
quotient = (int16_T)(quotientNeedsNegation ? (int32_T)(int16_T)-(int32_T)
tempAbsQuotient : (int32_T)(int16_T)tempAbsQuotient);
}
return quotient;
}
/* Model step function */
void TFT_cluster_1_step(void)
{
int16_T rtb_Abs;
uint16_T rtb_DisplaySpeed;
/* DataTypeConversion: '<Root>/Subsystem1_boundary_DTC1' incorporates:
* Inport: '<Root>/Average_Vehicle_Speed'
*/
if (TFT_cluster_1_U.Average_Vehicle_Speed <= 0) {
rtb_DisplaySpeed = 0U;
} else if (TFT_cluster_1_U.Average_Vehicle_Speed > 4095) {
rtb_DisplaySpeed = MAX_uint16_T;
} else {
rtb_DisplaySpeed = (uint16_T)(TFT_cluster_1_U.Average_Vehicle_Speed << 4);
}
/* Outputs for Atomic SubSystem: '<Root>/Subsystem1' */
/* Outputs for Atomic SubSystem: '<S1>/Subsystem' */
/* Saturate: '<S5>/Saturation' incorporates:
* DataTypeConversion: '<Root>/Subsystem1_boundary_DTC1'
*/
if (rtb_DisplaySpeed > 64000) {
rtb_DisplaySpeed = 64000U;
} else if (rtb_DisplaySpeed < 512) {
rtb_DisplaySpeed = 512U;
}
/* End of Saturate: '<S5>/Saturation' */
/* End of Outputs for SubSystem: '<S1>/Subsystem' */
/* Sum: '<S1>/Subtract' incorporates:
* Abs: '<S1>/Abs'
* Saturate: '<S5>/Saturation'
* Sum: '<S4>/Subtract'
*/
rtb_Abs = (int16_T)((int16_T)((TFT_cluster_1_B.DisplaySpeed_Filter << 4) -
rtb_DisplaySpeed) << 5);
/* Abs: '<S1>/Abs' */
if (rtb_Abs < 0) {
rtb_Abs = (int16_T)-rtb_Abs;
}
/* End of Abs: '<S1>/Abs' */
/* Switch: '<S1>/Switch' */
if (rtb_Abs > 12288) {
/* Outport: '<Root>/Out_VehicleSpeed' incorporates:
* Saturate: '<S5>/Saturation'
*/
TFT_cluster_1_Y.Out_VehicleSpeed = (uint16_T)(rtb_DisplaySpeed << 6);
} else {
/* Outport: '<Root>/Out_VehicleSpeed' incorporates:
* Sum: '<S4>/Subtract'
*/
TFT_cluster_1_Y.Out_VehicleSpeed = (uint16_T)((uint16_T)
TFT_cluster_1_B.DisplaySpeed_Filter << 10);
}
/* End of Switch: '<S1>/Switch' */
/* End of Outputs for SubSystem: '<Root>/Subsystem1' */
}
/* Model initialize function */
void TFT_cluster_1_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void TFT_cluster_1_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/

Poly Space Analysis Report:

Test Manager REport- Baseline

Test Manager REport- Back to Back:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.