주요 콘텐츠

이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

코드 생성 구성 세트

시뮬레이션 및 코드 생성을 위한 모델 구성

코드 생성을 위한 모델 구성 파라미터는 코드 생성기가 코드를 생성하고 모델에서 실행 파일을 빌드하는 방법을 정의합니다.

모델 설정

모두 확장

공유 코더 사전Embedded Coder Dictionary that contains code interface configuration for code generation (R2022b 이후)
Halide 코드 생성Generate Halide code for faster array computation (R2023b 이후)
우선 순위가 지정된 목표Prioritized list of Code Generation Advisor objectives to apply for reviewing model configuration parameter settings

데이터 초기화

루트 수준 I/O 영(0) 초기화 제거Control generation of initialization code for root-level inports and outports set to zero
내부 데이터 영(0) 초기화 제거Control generation of Initialization code for internal work structures, such as block states and block outputs, to zero

최적화 수준

LevelOptimization level for generated code
우선 순위Control application of optimizations based on priority
사용자 지정 최적화 지정Enable option to choose individual optimization parameters
배열 인덱싱 단순화Replace multiply operations in array indices when accessing arrays in a loop
병렬 for 루프 생성Optimization for parallel for-loops
for 루프 자동 스케줄링Automatically schedule generated loop nest code (R2024a 이후)
부울 데이터를 비트 필드로 패킹Control storing Boolean signals
다른 크기와 차원의 버퍼 재사용Reuse buffers to store data of different sizes and dimensions
전역 데이터 액세스 최적화Optimize global variable usage
생성 코드의 블록 작업 순서 최적화Specify to reorder block operations for improved code execution speed
전역 블록 출력 재사용Optimization to reuse global variables
Model 블록의 출력 버퍼 재사용Reuse referenced model buffers if possible (R2022b 이후)
버퍼 재사용 후보 통합Analyze buffer reuse candidates to implement efficient reuses (R2025a 이후)
Assignment 및 Bus Assignment 블록에 대해 인 플레이스(in-place) 업데이트 수행Reuse the input and output variables of Bus Assignment and Assignment blocks
Data Store Read 및 Data Store Write 블록에 대해 버퍼 재사용Eliminate temporary buffers for Data Store Read and Data Store Write blocks
비트 필드 선언자 유형 지정자Specify bitfield type
재사용 가능한 서브시스템 출력을 다음으로 전달Control how a reusable subsystem passes outputs

고급 파라미터

Optimize using the specified minimum and maximum valuesOptimize using minimum and maximum values for signals and parameters
Remove Code from Tunable Parameter Expressions That Saturate Out-of-Range ValuesControl generation of protective code that saturates out-of-range tunable parameter expression values
나눗셈 산술 예외를 방지하는 코드 제거Control generation of protective code for division arithmetic exceptions
신호 레이블을 버퍼 재사용 기준으로 사용Reuse buffers by using signal labels
Bitwise Operator 및 Logical Operator 블록을 나타내는 연산자Specify operator type in generated code
지역 변수를 0 값으로 초기화하는 설정 제거Control generation of initialization code for local variables set to zero (R2023b 이후)
코드-모델Include hyperlinks in the code generation report that link to the model diagram
모델-코드Enable code highlighting in the code generation report when you click on Simulink blocks, Stateflow objects, and MATLAB functions
제거된 블록/가상 블록Include a summary of eliminated and virtual blocks in the code generation report
추적 가능한 Simulink 블록Include a summary of Simulink blocks and the corresponding code locations in the code generation report
추적 가능한 Stateflow 객체Include a summary of Stateflow objects and the corresponding code locations in the code generation report
추적 가능한 MATLAB 함수Include a summary of MATLAB functions and corresponding code locations in the code generation report
코드 대체를 트리거한 블록 요약Include a summary of replacement functions used and their associated blocks in the code generation report
모델 웹 보기 생성Include the model Web view in the code generation report
정적 코드 메트릭Generate static code metrics report
모델 추적에 사용할 주석 형식Specify format of comments
연산자 주석Include operator annotations for Polyspace in generated comments
Simulink 블록 설명Insert descriptions of blocks as comments in generated code
Simulink 데이터 객체 설명Include descriptions of Simulink data objects as comments in generated code
블록 주석에 연결되는 주석Include connected annotations as custom comments in generated code (R2024b 이후)
사용자 지정 주석(MPT 객체만 해당)Include comments for MPT signal and parameter data in generated code
사용자 지정 주석 함수Specify a file that contains comments for MPT signal and parameter data objects
Stateflow 객체 설명Include descriptions of Stateflow objects in generated comments
블록의 요구 사항 주석Include requirement descriptions in generated comments
MATLAB 사용자 주석Include MATLAB user comments in generated code
Polyspace 주석 삽입Include code comments for Polyspace block annotations
주석 스타일Specify comment style in generated code

자동 생성된 식별자 명명 규칙

전역 변수Customize generated global variable identifiers
전역 유형Customize generated global type identifiers
전역 유형의 필드 이름Customize generated field names of global types
서브시스템 메서드Customize generated function names for subsystems and Simulink functions
서브시스템 메서드 인수Customize generated function argument names for subsystems and Simulink functions
로컬 임시 변수Customize generated local temporary variable identifiers
로컬 블록 출력 변수Customize generated local block output variable identifiers
상수 매크로Customize generated constant macro identifiers
최소 변형 길이Specify the minimum number of characters for name-mangling
시스템 생성 식별자Specify whether to use shorter names for the $N token in system-generated identifiers
Generate scalar inlined parameter asExpress scalar inlined parameter values in the generated code as literals or macros

고급 파라미터

공유 체크섬 길이Specify character length of $C token
EMX 배열 유틸리티 함수 식별자 형식Customize generated identifiers for emxArray utility functions
EMX 배열 유형 식별자 형식Customize generated identifiers for emxArray types
공유 유틸리티 식별자 형식Customize shared utility identifiers
사용자 지정 토큰 텍스트Specify text to insert for $U token
신호 명명Specify rules for naming Simulink.Signal and mpt.Signal objects in generated code
M-functionSpecify rules for naming identifiers in generated code
#define 명명Specify rule for naming #define parameters in generated code
M-functionSpecify rule for naming identifiers in generated code
파라미터 명명Specify rules for naming Simulink.Parameter and mpt.Parameter objects in generated code
M-functionSpecify rules for naming identifiers in generated code

소프트웨어 환경

코드 대체 라이브러리Libraries that define code optimizations for specific target environment
Support: floating-point numbersCode generation for floating-point data
Support: complex numbersCode generation for complex data
Support: absolute timeCode generation for model that includes blocks that depend on absolute or elapsed time
Support: continuous timeCode generation for blocks that use continuous time
Support: variable-size signalsCode generation for signals that vary in size

코드 인터페이스

실시간 모델 데이터 구조체에서 오류 상태 필드 제거Whether to log error status
생성 코드에서 MATLAB 네임스페이스 유지Specify whether generated code for enumeration in MATLAB namespace includes the namespace in the type definition (R2025a 이후)
루트 수준 I/O 전달 형식Specify how generated code passes root-level input and output to reusable execution entry-point function
루트 수준 I/O를 다음으로 구현Specify how generated code passes root-level input and output to nonreusable subcomponent execution entry-point function (R2025a 이후)
모델 클래스에 모델 유형 포함Whether code generator places model type definitions in model class

고급 파라미터

인라인이 아닌 S-Function 지원Whether to generate code for noninlined S-functions
멀티워드 유형 정의Whether to define multiword data types as system- or user-defined types
모델 초기화에 동적 메모리 할당 사용Whether to allocate dynamic memory for initializing model data
종료 함수 필요함Whether to generate terminate entry-point function
신호/상태 구조체 결합Whether to combine global block signal and state data into one structure
진입점 함수별로 별개의 내부 데이터 생성Whether to place variables representing signals and states operated on at same rate in same data structure (R2021a 이후)
MAT 파일 변수 이름 수정자Prefix or suffix to add to MAT-file variable names
기존 공유 코드Folder that contains shared code to use instead of generated shared utility code
비활성화 함수 제거Removal of unreachable instances of disable functions from generated code
재설정 함수 제거Removal of unreachable instances of reset functions from generated code
사용자 지정 스토리지 클래스 무시Whether to apply predefined storage classes
테스트 지점 신호 무시Whether to allocate memory buffers for test points
각 Data Store 블록을 고유한 액세스 지점으로 구현Whether to generate unique variable for each read and write operation on Data Store Memory block
괄호 수준Parenthesization style for generated code
표현식의 피연산자 순서 유지Preserve order of operands in expressions
if 문의 조건식 유지Preserve empty primary conditions in if statements
if-elseif-else 패턴을 switch-case 문으로 변환Generate code for if-elseif-else logic as switch-case statements
함수 선언에 extern 키워드 유지Include extern keyword in function declarations
함수 선언에 정적 키워드 유지Include static keyword in function declarations
도달할 수 없는 경우 Stateflow switch 문에 대한 default case의 코드 생성 차단Whether to generate default cases for switch-case statements for Stateflow charts
2의 거듭제곱이 곱해지는 연산을 부호 있는 비트 단위 시프트로 바꾸기Replace multiplications by powers of two with signed bitwise shifts
부호 있는 정수에 대한 오른쪽 시프트 허용Allow right bitwise shifts on signed integers
형변환 모드Method of casting data types for variables
정적 배열 컨테이너 유형Container type for static arrays
동적 배열 컨테이너 데이터형Container type for dynamic arrays (R2024b 이후)
들여쓰기 스타일Style for placement of braces
들여쓰기 크기Size for indents in generated code
새 줄 스타일Newline character in generated code
최대 라인 너비Maximum line width for wrapping generated code
태스크 실행 시간 측정Execution-time profiling of generated code
함수 실행 시간 측정Execution-time profiling of functions in generated code
작업 공간 변수Workspace variable for execution-time measurements
저장 옵션Options for saving execution-time measurements
태스크 스택 사용량 측정Stack usage profiling of generated code (R2022a 이후)
스택 작업 공간 변수Workspace variable for stack usage measurements (R2022a 이후)
타사 툴Tool for code coverage analysis
이식 가능한 워드 크기 사용Portability across development computer and target processors
SIL에 대한 소스 수준 디버그 활성화Generated code debugging during SIL or PIL simulation
블록 생성SIL or PIL block creation
Code templates: Source file (*.c) templateSource code file template
Code templates: Header file (*.h) templateTemplate for generated code header
Data templates: Source file (*.c) templateTemplate for generated data source file
Data templates: Header file (*.h) templateTemplate for generated data header file
파일 사용자 지정 템플릿Template for custom file processing
예제 메인 프로그램 생성Control generation of example main program
타깃 운영 체제Target operating system for example main program
전체 파일 배너 생성Include code generation information in header file banner
사용자 지정 파일 배너 사용Control whether to use configurations for code and data templates
데이터 정의Placement of global variable definitions
데이터 정의 파일 이름File to contain data definitions
데이터 선언Location for data declarations
데이터 선언 파일 이름File to contain deta declarations
#include 파일 구분 기호Type of delimiter for include file
데이터 정의 배치를 위해 데이터 객체의 소유자 사용Whether to use data ownership setting for definition in code
신호 표시 수준Persistence level for MPT signal data objects
파라미터 조정 수준Persistence level for MPT parameter data objects
파일 패키징 형식Method of file packaging for generated code files
헤더 파일Custom name for header files
소스 파일Custom name for source files
데이터 파일Custom name for data files
Rate Transition 블록 코드Format for rate transition block code and data

유형 교체 및 이름

데이터형 대체Method for replacing built-in data type names in generated code (R2023a 이후)
사용자 지정 데이터형 이름 지정Option to replace built-in data type names in generated code
Replacement Name: doubleName for double data type in generated code
Replacement Name: singleName for single data type in generated code
Replacement Name: int32Name for int32 data type in generated code
Replacement Name: int16Name for int16 data type in generated code
Replacement Name: int8Name for int8 data type in generated code
Replacement Name: uint32Name for uint32 data type in generated code
Replacement Name: uint16Name for uint16 data type in generated code
Replacement Name: uint8Name for uint8 data type in generated code
Replacement Name: booleanName for boolean data type in generated code
Replacement Name: intName for int data type in generated code
Replacement Name: uintName for uint data type in generated code
Replacement Name: charName for char data type in generated code
Replacement Name: uint64Name for uint64 data type in generated code
Replacement Name: int64Name for int64 data type in generated code

고급 파라미터

부울 false 식별자Identifier for Boolean false
부울 true 식별자Identifier for Boolean true
64비트 정수 최대 식별자Identifier for 64-bit integer maximum
16비트 정수 최대 식별자Identifier for 16-bit integer maximum
32비트 정수 최대 식별자Identifier for 32-bit integer maximum
8비트 정수 최대 식별자Identifier for 8-bit integer maximum
64비트 부호 없는 정수 최대 식별자Identifier for 64-bit unsigned integer maximum
16비트 부호 없는 정수 최대 식별자Identifier for 16-bit unsigned integer maximum
32비트 부호 없는 정수 최대 식별자Identifier for 32-bit unsigned integer maximum
8비트 부호 없는 정수 최대 식별자Identifier for 8-bit unsigned integer maximum
64비트 정수 최소 식별자Identifier for 64-bit integer minimum
16비트 정수 최소 식별자Identifier for 16-bit integer minimum
32비트 정수 최소 식별자Identifier for 32-bit integer minimum
8비트 정수 최소 식별자Identifier for 8-bit integer minimum
유형 제한 식별자 대체 헤더 파일Header file that defines Boolean and data type limit identifiers
Coder typedef 호환성Option to force generation of rtwtypes.h file (R2023a 이후)
OpenCV Mat 클래스를 사용하여 이미지 구현Option to represent images as OpenCV Mat class (R2021b 이후)

클래식 플랫폼

스키마 버전에 맞는 XML 파일 생성Generate AUTOSAR Classic XML files for specified schema version
최대 SHORT-NAME 길이Maximum length for SHORT-NAME elements generated in XML files
AUTOSAR 컴파일러 추상화 매크로 사용Use compiler abstraction macros
1차원 배열을 사용하여 루트 수준 행렬 I/O 지원Use one-dimensional C arrays to support root-level matrix I/O

적응형 플랫폼

스키마 버전에 맞는 XML 파일 생성Generate AUTOSAR Adaptive XML files for specified schema version
최대 SHORT-NAME 길이Maximum length for SHORT-NAME elements generated in XML files
전송 계층Transport layer used by XCP
IP 주소IP address of the machine on which the AUTOSAR adaptive application (XCP Server) executes
포트Network port on which the AUTOSAR adaptive application (XCP Server) serves XCP Client commands
세부 정보 표시Enable verbose messages for XCP Server
사용자 지정 XCP 서버 사용Use custom or default XCP Server

객체

모두 확장

rtw.codegenObjectives.ObjectiveCustom code generation objective

블록

모두 확장

Custom MATLAB fileUpdate active configuration parameters of parent model by using file containing custom MATLAB code
ERT (optimized for fixed-point)Update active configuration parameters of parent model for ERT fixed-point code generation
ERT (optimized for floating-point)Update active configuration parameters of parent model for ERT floating-point code generation
GRT (debug for fixed/floating-point)Update active configuration parameters of parent model for GRT fixed-point or floating-point code generation
GRT (optimized for fixed/floating-point)Update active configuration parameters of parent model for GRT fixed-point or floating-point code generation

도움말 항목

코드 생성 구성

모델 구성 파라미터: 코드 생성

추천 예제