Challenge

Project 2 - Development of TFT Cluster Speedometer Software Component

TFT Project

Aim: Development of TFT Cluster Speedometer Software Component

Objective:

1)Model file Creation

2)SLDD Creation and Linking

3)Requirement Tagging report

4)Fixed point Tool

5)Model Advisory- JMAAB

6)SLDV Design and Error detection report

7)SLDV Test generation report

8)Functional Test case, MIL, SIL Harness and coverage report

9)Auto code generation report c & h codes

10)Polyspace report

11)Test manager report Baseline and Back to Back Testing.

  1. TFT Model Creation:

Our first objective is to generate the TFT Simulink model. So, here we go step by step procedure for create it.

Steps for TFT model Creation:

Steps to solve requirement 1:

1) Insert inport block as Average speed

2) Insert the dynamic saturation block and assing the lower limit and upper limit by using two constant blocks.

3) Insert the outport as Display speed.

Steps to solve Requirement 2:

1) Insert two inport , first connect to output of requirement 1and second as main filter speed value

2) Insert gain block and connect to display speed with value 0.65. and divide the main filter speed value from it.

3) Insert the subtract block and reduce 0.5 from the output of divide block.

4) Insert the outport block name as Display speed 1.

Step to solve requirement 3:

1) Insert two inport one is Auxiliary filter speed vale and second is Display speed1which is the output of requirement 2.

2) Insert gain block to multiple 0.78 from display speed and divide the auxiliary filter speed value by using divide block.

3) Insert the subtract block and minus the 0.03 value form above output.

4) Insert the outport block, connect it at last and assign name as Display speed filter.

Steps to solve requirement 4:

1) Insert two input and connect one for Display speed(requirement 1) output and second for Display speed filter (requirement3).

2) Insert subtract block to subtract Display speed filter form display speed.

3) Insert the Abs block and connect to the output of subtraction block.

4) Insert relational operator greater than with constant block 1.5 to compare the output of Abs.

5) Insert the switch block and connect to check the condition. The output is vehicle speed display.

Figure: TFT Simulink model

2.SLDD creation and Linking:

3.Model Advisory Check:

4.Requirement Tagging by Requirement Editor:

5.Fixed Point Tool:

Data type before fixed point tool:

SLDD before Fixed point:

Preparation:

Propose datatypes:

Fixed Point Datatype converted:

SLDD after fixed point conversion:

6.SLDV Design and Error detection :
The SLDV check are use for the Error detection and test case generation for the MIL testing. We make setting of solver as fixed step discrete type. First we open the Design verifier tool from the app. Select the error detection mode, set the time and name of model. In setting click on dead logic , output boundary, division by zero, and integer overflow and click on ok. Check the compatibility. Run the model for detect the design error. Go to check the HTML analysis report.

A] Error detection mode:

Go to app, select Design verifier and select the Error detection mode. Click on setting and select the dead logic, out of boundary array access, division by zero, and integer overflow.

Figure: error detection setting

Check the compatibility of design model:

Detect the design error and generate the HTML report:

Result on model:

B] Test generation mode:

Change the mode of SLDV into Test generation and check the advisory report. Click on setting and set the coverage as MCDC, select the step size as 1000 ,and test suit as Auto. Next click on generate the test and check all the documents generated. like MIL test harness, test report, coverage report etc.

Figure: Test generation setting

Figure: check compatibility

Figure: Test generation

Figure: MIL test Harness

Figure: coverage generation of MIL harness

Figure: Automatic test case generated

Result and output:

  1. Steps for MIL Testing:

1) open the model and make the Solver setting and configuration setting.

2) Convert the Model into Atomic subsystem.

3) Run the to insure that there is no error present in the model.

4) Generate test Harness.

5) upload test cases into signal editor for input signals.

6) connect the outputs of signal editor to output viva add block.

7) run the model and check the output of scope showing as zero signal.

Description:

firstly open the model parameter setting in that we have to make solver setting. so click on solver setting and assign start time as 0, stop time is 1.04sec and sample time is 0.1 sec. to convert the model into atomic subsystem, right click on the subsystem and select the block parameters one window will open, from this window click on check box of the treat as atomic subsystem. the subsystem block will get highlighted. next is generate the test harness. to generate the test harness, right click on the atomic subsystem and select the test Harness option, in that will appear in that window select create test harness option. now we have select the Source as Signal editor and sink as Scope. this will create our model into new window and with signal builder in input and scope block at output. now its time to export the test case signals into the signal editor. connects the outputs port of signal editor to outport of atomic subsystem viva add block and subtract this signal from the output of the model. if the output of the scope is perfect zero then the MIL testing is 100% successfully conducted. otherwise if any varying signal is seen in the scope then make correction and run it repeated.

Solver setting and code generation setting:

Atomic model:

Test Cases:

Test case upload into signal editor:

MIL Test Harness:

Coverage report:

Test Result:

  1. SIL Testing:

Steps for MIL Testing:

1) open the model and make the Solver setting and configuration setting.

2) Convert the Model into Atomic subsystem.

3) Run the to insure that there is no error present in the model.

4) Generate the code using Build.

5) Generate SIL test Harness.

5) upload test cases into signal editor for input signals.

6) connect the outputs of signal editor to output viva add block.

7) run the model and check the output of scope showing as zero signal and take coverage report.

Description:

The SIL testing is always perform the MIL testing is successfully done and code generation. For that we have to follow the above steps First opened the model and its respective init file in MATLAB. Now we do the model configuration setting for the simulink model. So for that go to model configuration setting click on model setting. After that go to solver and select the starting time 0, stop time 1 and sample time 0.1 of the solver setting. next step is to setting of code generation, from that select the Embedded coder language and remaining parameters get automatically selected. For the coverage setting , click on enable coverage analysis. Also select the coverage as MCDC and other metrics and apply it. Next step is to convert the model into atomic subsystem so for that right click on model and select the block parameter option and new window will appear on the screen , from this we have to select the check box of create atomic subsystem. ones run the model to insure the error is not present in out simulink model. Next step is to generate the code. Click on Build option from the simulink task bar and from that select the select the embedded coder app form that, select the generate code option and wait for some time, it will create the code for our simulink atomic model. At the last we have to convert this atomic model into SIL model. To generate the SIL model , we have two ways. One it right click on the given model and select the Test harness option, from this new window will appear beside it and select create for option. After also new window will open from that window we have to select the source as signal editor and sink as a scope. From the same window select the advance setting and select the Software in loop which will covert our model into SIL model. The second method to generate the SIL is right click on model and select C/C++ and click on generate S-Function. from new window click the check box of generate SIL. Id we want to add any parameters then we can add otherwise click on ok and build.

Al last, the new SIL model will generate into new simulink window with signal editor at input side and scope at last of the model. Generate the test cases into excel sheet and upload it the signal editor. After that as per our input and output requirements, numbers of port will appear on signal editor. Connect the outputs of the of the signal editor to output of SIL with the help of add block with subtracting from output and observe the scope output are zero showing. Also we get the coverage report to see the status about the SIL testing.

Simulink Model:

Generate the Embedded code:

(the c and h file are attached in zip file uploaded)

Test case upload in signal editor:

SIL Testing Harness:

SIL Test Result:

SIL Testing coverage report:

9. Polyspace Report Generation:

9.Poly Space report:

Steps for Poly space Bug finder Analysis:

As we stated above it generate the bug report, code violation report and cod equality matrix reports.

Step1: Open the project, go to app and select the Polyspace static code analyser.

Step2: select the setting option and click on polyspace option for he window.

Step3: form the setting select setting from Project Configuration& MISRA C2004 setting. Input option use for minimum and maximum values. Tuneable parameter can be use calibration data. Set the output as No verification. Enable the check open verification result after verification.

Step4: in bug finder code configuration select the source code language as C or C++ as per the requirement.

Step5: next click to code standard and code matrix, form here select MISRA C or CERT C guideline as per industry standard use.

Step6: select bug finder analysis, based on run time error or code errors. We can also select it as default.

Step7: At last click on Run button, it will give the Analysis report. Also go to source code to find the error and we can check and correct it.

Steps to solve Polyspace code prover:

This code prover are use for overflow, divide by zero, out of boundary array access and other runtime errors detection. Here color coding is use to indicate the various errors.

Step1: Change the mode of Polyspace tool form Bug finder to Code proven.

Step2: select the code prover verification form the window and click the radio button to Enable it.

Step3: Run the analysis.

Step4: check the Analysis report, here green colour shows completely pass, red colour shows the error, also see the coverage report.

Step5: if any warning in red colour then click on that, it will open the code. Make correction and run repeatedly.

Result:

In this way we have use the Polyspace Code Analysis for the given model to find the Bug into the generated code and code prover also.

10.Simulink Test Manager:

Requirement linking for Simulink model

Step 1: make the solver setting as Fixed step and Discrete type, the starting time is zero and stop time as per model test cases.

Step 2: make the code generation setting as ert.tlc Embedded coder.

Step 3: take the model advisory report according to standard guideline JMAAB.

Step 4: Go to App and select Requirement Editor Tool, select new requirement set and save the with name in slreqx format.

Step 5: at left console generated file, right click and select add requirement as per model needs.

Step 6: select req. 1 form console, copy the requirement ID and past into editor window also copy the description and past into editor window. Apply same procedure for all requirements.

Step 7: come on Simulink model select the subsystem, go to requirement in req. editor tool select it and right click on it and select the link requirement option. Apply same for all subsystem.

Step 8: complete the above process and select save all from task bar. It will save the file in slmx format.

Step 9: click on show link option in task bar and observe the all generated link of requirement. We can change anything in model and can see the changes in editor tool.

Step 10: Click on export to generate report, give the name to file, time and select generate report and save it in folder.

Base line testing Steps:

Step 1: make solver setting-start time 0, stop time 0.99, fixed step discrete, sample time 0.01, coder setting ert.tlc Embedded coder and coverage ON

Step 2: Create the Simulink model as Atomic model.

Step 3: check any Testing Harness is not generated for model and run the model.

Step 4: Open the Simulink test manager app, new window will appear, select new test file and save the file it will create the folder test related data.

Step 5: click on requirement (we have already linked with req. editor), click on add, select new, click on document type as Requirement set. Click on brows open the requirement matlab file(slreqx) generated by requirement editor tool. Click on document index we will see here all requirements present here. Select one requirement and click on apply. Same procedure use for all requirements.

Step 6: select the option system under test and click on current model symbol. Also select test harness option and click on non.

Step 7: select the simulation output setting(we have already done in step 1)

Step 8: select the Input( to create automatic test cases), do to create(external input)-small window will appear. Select excel sheet option, Click on file icon and select create. It will create excel sheet(testcase baseline) of test inputs. Copy all time, and inputs data of old test case excel sheet into the newly created excel sheet and save it.

Step 9: select the Baseline criteria. Click on capture. Brows the abover created testcase baseline sheet, it will ask for replace, click on yes. Give the sheet name and click on yes on message of overwrite existing. After this procedure done, go to excel sheet we will see outputs are calculated in the sheet.

Step 10: Select the coverage setting, click on record coverage for system under test ( it will compare the result actual and expected). We have use MCDC coverage.

Step 11: save and run the test manager.

Step 12: under the test and results, we can see the Baseline criteria output, Sim output. Green colour line sows the successful result.

Step13:go to result and right click on it, select export result and save the file.

MATLAB Simulink model:

MATLAB Simulink subsystem:

Solver and Code generation setting:

SLDD Creation:

Model Advisory check:

Test Cases:

Requirement linking by Requirement editor:

Requirement upload:

Requirement linking:

Requirement traceability:

Baseline Testing :

New test generation:

Requirement adding:

Input setting for test case template generation:

Results and Artifacts:

Back to Back Testing:

Step 1: Open the model Make it Atomic, check no test harness created. Select Simulink test manager it will open the test manager window, select new test file, save the file in folder with appropriate name.

Step 2: select new and select test for model component, new window will appear. Click on the current model component icon and click on next.

Step 3: next window ask foe how do you want to set up inputs, then click on design verifier and click on next.

Step 4: next window ask for how you want to test component. In that select Back to Back testing option, Simulation1 as Normal MIL and simulation2 as SIL. click on next.

Step 5: next window ask for where to save the excel, select the path and click on done. The test case will generate in this folder. After this process complete harness model will created and also we can see it into test manager tool window. also HTML report get generated.

Step 6: after that we see simulation 1 and 2 is present on the under the model harness on test manager window. Add requirement as previous Baseline and click on ok.

Step 7: under simulation1 see the setting only. In Input select the checkbox of signal editor scenario.

Step 8: under simulation2 go to input and click on scenario box.

Step 9: select the Equivalence criteria, select the capture it will calculate the output.

Step10: go to our saved folder we can see all the generated.

Step 11: go to coverage setting in the test manager, click on record the coverage for the system under test and click on done. All result will automatically calculated.

Model for Back to Back testing:

Add model for B2B testing:

Test case components and inputs and file save:

Requirement link with model by Req. Editor tool:

Requirement adding into test manager:

Simulation1 setting:

Simulation 2 setting:

Equivalence criteria:

Result:

Result:
In this way we have developed the TFT Simulink model, created the Simulink data dictionary, generate the Requirement tagging report, use fixed point tool for data type conversion, generate the model advisory report using JMAAB Standard guideline, generate the SLDV Design and Error detection report and test generation report, generate the Functional test cases, MIL Testing, SIL testing and its coverage report, generate the c code and h code by using Embedded language, use Poly space tool for error detection and code proven, perform the Base line testing and Back to Back Testing by using Simulink test manager.

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.