It is possible to analyze Simulink models in TICS.

Prerequisites

For a successful Simulink integration, the following prerequisites must be met:

Setup

The following prerequisites concern the environment of the buildserver:

Analysis

The following prerequisites are necessary for a complete analysis of a project:

Basic configuration

To be able to analyze a Simulink model the language must be added in the SERVER.txt with a PREPARE step. Note that Simulink model analysis is only possible with TICSQServer, and must always include a PREPARE step.

Syntax

The following language properties have to be declared on SERVER level:

'LANGUAGES' => {
  'SIMULINK' => {
    'EXTENSIONS' => [
      'simulink',
    ],
    'RULESETS' => [
      {
        'METRIC' => 'CODINGSTANDARD',
        'NAME' => 'Simulink Coding Standard',
        'RULESDIR' => 'codingstandards/SIMULINK',
      },
      {
        'METRIC' => 'COMPILERWARNING',
        'NAME' => 'Simulink Compiler Warnings',
        'RULESDIR' => 'compilerwarnings/SIMULINK',
      },
      {
        'METRIC' => 'ABSTRACTINTERPRETATION',
        'NAME' => 'Simulink Abstract Interpretation',
        'RULESDIR' => 'abstractinterpretation/SIMULINK',
      },
    ],
    'FANOUT' => {
      'TOOL' => 'Simulink',
    },
    'TESTCOVERAGE' => {
      'TOOL' => 'Simulink',
    },
    'CYCLOMATICCOMPLEXITY' => {
      'TOOL' => 'Simulink',
    },
    'DEADCODE' => {
      'TOOL' => 'Simulink',
    },
    'DUPLICATEDCODE' => {
      'TOOL' => 'Simulink',
    },
  },
}

and:

'PREPAREQDB' => 'PREPAREQDB.pm',

The following needs to be included in PREPAREQDB.pm, where SIMULINK.slx is the entry point of the simulink model:

use TICSPrepSimulink;

sub PrepareQDB ($$$) : Private {
  my ($project, $branchdir, $branchname) = @_;

  #create your prepare steps here
  &TICSPrepSimulink::PrepareSimulink('SIMULINK.slx', $project, $branchdir);
}

For more information please refer to the implementation ticket.