주요 콘텐츠

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

모델 구성 세트 사용자 지정

코드 생성기의 코드 생성 방법을 사용자 지정

모델 구성 세트에는 코드 생성기가 모델에서 코드를 생성하는 방법을 제어하는 파라미터가 포함되어 있습니다. 생성 코드의 코드 최적화, 인터페이스, 코드 스타일, 빌드 옵션 및 기타 측면을 제어하려면 구성 파라미터를 사용합니다. 여러 모델에 동일한 설정을 사용하려는 경우, 하나의 구성 세트를 여러 모델 간에 공유할 수 있습니다. 스크립트를 사용하여 프로그래밍 방식으로 코드 생성을 위해 모델을 구성할 수도 있습니다.

모델 설정

모두 확장

타깃 선택

시스템 타깃 파일File that controls code generation stage of build process
언어Programming language of generated code
언어 표준Language standard supported by compiler

빌드 프로세스

코드만 생성Generate code versus an executable program
툴체인Toolchain to use when building executable program or library
툴체인 세부 정보Baseline toolchain settings
코드 및 아티팩트 패키징Package generated code and artifacts in ZIP file
빌드 구성Build configuration defined by toolchain
컴파일러 최적화 수준Control application of compiler optimizations
사용자 지정 컴파일러 최적화 플래그Compiler optimization flags
makefile 생성Enable generation of makefile to use for compiling generated code
Make 명령Make command and options for initiating build process
템플릿 makefileTemplate makefile to use to generate makefile for specified system target file

코드 생성 목표

목표 선택Code generation objective
코드 생성 전에 모델 검사Choose whether to run Code Generation Advisor checks

고급

내장 FFTW 라이브러리 콜백Use built-in callback for FFTW library usage (R2023a 이후)
사용자 지정 FFT 라이브러리 콜백Callback for custom FFT library usage
사용자 지정 BLAS 라이브러리 콜백Callback for custom BLAS library usage
사용자 지정 LAPACK 라이브러리 콜백Callback for custom LAPACK library usage
세부 정보 표시 빌드Enable display of build process stages and compiler output
.rtw 파일 유지Retain generated model.rtw file
TLC 프로파일링Profile execution of TLC files used to generate code for model
TLC 어설션 활성화Produce TLC stack trace
코드 생성 시 TLC 커버리지 시작Log coverage of TLC code during code generation
코드 생성 시 TLC 디버거 시작During code generation, start TLC debugger
ZIP 파일 이름Name of ZIP file
MATLAB 함수에서 큰 상수의 생성Whether to write large deep learning constants to binary data files (R2024a 이후)
MATLAB 함수에서 큰 상수에 대한 임계값(바이트)Threshold above which the code generator writes DNN constants to binary data files (R2024a 이후)
Show Custom Hardware App in Simulink ToolstripShow Custom Hardware App in Simulink Toolstrip
Show Embedded Hardware App in Simulink ToolstripShow Embedded Hardware App in Simulink Toolstrip
디폴트 파라미터 동작Represent numeric block parameters in generated code
벡터 할당에 memcpy 사용Optimize code generated for vector assignments
Memcpy threshold (bytes)Specify minimum array size for which memcpy and memset function calls replace for loops for vector assignments
루프 풀기 임계값 Specify minimum array size width for generating for loops
최대 스택 크기(바이트)Specify maximum stack size for local variables in model
불변 신호 인라인 처리Transform symbolic names of Invariant signals in generated code
신호 저장공간 재사용Reuse signal memory
로컬 블록 출력 활성화Declare block signals locally or globally
로컬 블록 출력 재사용Reuse local output variables
불필요한 지역 변수 줄이기(표현식 접기)Specify to fold expressions into single expression
memset를 사용하여 부동소수점 및 double형을 0.0으로 초기화Control generation of code that explicitly initializes floating-point data to 0.0
NaN을 0으로 매핑하는 코드를 부동소수점에서 정수로 변환하는 코드에서 제거Control generation of protective code that handles floating-point to integer conversion for NaN values
범위를 벗어나는 값을 래핑시키는 코드를 부동소수점에서 정수로 변환하는 부분에서 제거Control generation of wrapping code that handles out-of-range floating-point to integer conversion values
재사용 가능 서브시스템을 위한 버퍼Buffers to enhance reuse of subsystems
상태 구성 저장에 bitset 사용Bitsets for storing state configuration variables
부울 데이터 저장에 bitset 사용Bitsets to store Boolean data
자동으로 생성된 열거형의 기본 스토리지 유형Specify storage type and size of enumerations for state outputs
코드 생성 리포트 만들기Document generated code in an HTML report
자동으로 리포트 열기Display code generation reports automatically
주석 포함Include comments in generated code
Simulink 블록 주석Include Simulink block comments
Stateflow 객체 주석Include Stateflow object comments
MATLAB 소스 코드를 주석으로 삽입Include MATLAB source code as comments
제거된 블록 표시Include eliminated blocks' comments
Verbose comments for 'Model default' storage classReduce code size or improve code traceability
최대 식별자 길이Specify maximum number of characters in identifiers
시뮬레이션 타깃과 동일한 예약 이름 사용Specify whether to use reserved names from the Simulation Target pane
예약된 이름Avoid name conflicts with custom code
헤더 가드 접두사Custom text to prepend to generated header guards (R2024a 이후)
중복된 열거형 멤버 이름Specify the action to take if the code generator detects two enumeration types with same member names
[시뮬레이션 타깃]과 동일한 사용자 지정 코드 설정 사용Use custom code settings from the Simulation Target > Custom Code pane
include 헤더Include custom code in the generated model header file
include 디렉터리Add folders to the include path
소스 파일Compile and link additional source files with the generated code
라이브러리Link additional libraries with the generated code
정의Add preprocessor macro definitions to the compiler command line
초기화 코드Include custom code in the generated model initialize function
종료 코드Include custom code in the generated model terminate function
추가 코드Include custom code in the generated model source file

소프트웨어 환경

코드 대체 라이브러리Library that defines code optimizations for specific target environment
공유 코드 배치Location of generated code that is shared
Support: non-finite numbersCode generation for nonfinite data

코드 인터페이스

코드 인터페이스 패키징(컴포넌트)Package generated code interface as reusable or nonreusable functions or as a C++ class
코드 인터페이스 패키징(하위 컴포넌트)Package generated code interface for model subcomponent as reusable or nonreusable functions or as a C++ class (R2025a 이후)
다중 인스턴스 코드 오류 진단Severity level of diagnostics for when model violates requirements for generating multi-instance code

데이터 교환 인터페이스

배열 레이아웃Layout (column-major or row-major) code generator uses for array data
행 우선 코드 생성을 위한 외부 함수 호환성Diagnostic action for functions that use multidimensional arrays and do not specify array layout
Generate C API for: signalsGenerated C API interface code for signals in signal structure
Generate C API for: parametersGenerated C API interface code for tunable parameters in parameter structure
Generate C API for: statesGenerated C API interface code for states in state structure
Generate C API for: root-level I/OGenerated C API interface code for root-level inports and outports in root-level I/O structure
외부 모드Generated external mode data interface
전송 계층Transport protocol for external mode communication
MEX 파일 인수Arguments to pass to external mode interface MEX-file
정적 메모리 할당Dynamic or static memory allocation for external mode communication
정적 메모리 버퍼 크기Size of static memory buffer for external mode communication
정적 메모리 자동 할당Automatic static memory buffer allocation for external model communication (R2022b 이후)
최대 기간Maximum number of base rate steps for which external mode logs data after trigger event (R2022b 이후)
MDF 파일에 신호 기록Log signal and output data from generated code to MDF file (R2024a 이후)

딥러닝

타깃 라이브러리Deep learning library to use during code generation for target environment
학습 가능 압축Compression type, specified as "none" or "bfloat16" (R2023b 이후)
ARM Compute Library 버전Version of ARM Compute Library to use during code generation
ARM Compute Library 아키텍처ARM architecture supported by target hardware
자동 조정Code generation that uses cuDNN library with auto tuning enabled (R2021a 이후)

고급 파라미터

최대 워드 길이Maximum word length for generated multiword type definitions
동적 크기 문자열의 버퍼 크기(단위: 바이트)Size of buffer for signals that have dynamic string data type
전체 파일 배너 생성Include code generation information in file banner
단일 출력/업데이트 함수Execution entry-point function that includes code for output and update functions
MAT 파일 기록Exported data saved in MAT-file
고정소수점 워드 크기 검사에 대한 코드 생성 차단Control generation of preprocessor directives that perform fixed-point word size checks (R2024a 이후)
균일 간격으로 지정하기 위한 LUT 객체 구조체 순서Order of fields in structure generated for lookup table object with even spacing breakpoint specification
명시적인 값 사양에 대한 LUT 객체 구조체 순서Order of fields in structure generated for lookup table object with explicit values breakpoint specification
동적 크기 문자열의 버퍼 크기(단위: 바이트)Size of buffer for signals that have dynamic string data type
행 우선 코드 생성을 위한 외부 함수 호환성Diagnostic action for functions that use multidimensional arrays and do not specify array layout
Target derived from slrealtimeIndicates whether or not the currently selected target is derived from the slrealtime target (R2022b 이후)

도움말 항목

코드 생성 구성 세트

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

코드 주석

식별자

  • Construction of Generated Identifiers
    For generic real-time (GRT) and rapid simulation (RSim) targets, the code generator automatically constructs identifiers for variables and functions in the generated code.
  • Reserved Keywords
    If you use the code generator to produce C or C++ code, your model must not contain keywords that are reserved for internal use.

추천 예제