Method and processor for solving bit filling problem during creation of virtual controller
By checking and splitting bit fill variables, the normal working problems and abnormal operation risks caused by bit fill during creation of virtual controllers are solved, and the stable and compatible operation of virtual controllers is achieved in any environment.
Patent Information
- Application Number
- CN202411831539.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-13
- Filing Date
- 2024-12-12
- Publication Date
- 2025-06-13
AI Technical Summary
When creating a virtual controller, due to bit fill problems, the virtual controller may not work properly and there is a risk of abnormal operation.
By checking whether bit padding occurs when compiling the source code, split the bit padding variable so that it does not have a blank in memory, and package it into a variable, compile and link the split source code to create a virtual controller.
Ensure that the virtual controller works properly in any environment, prevent abnormal operations caused by bit padding, and resolve bit padding issues in a highly stable and compatible way.
Smart Images

Figure CN120144131A_ABST
Abstract
Description
[0001] Cross - reference to related applications
[0002] This application claims the benefit and priority of Korean Patent Application No. 10 - 2023 - 0180778, filed on December 13, 2023, the entire content of which is incorporated herein by reference. Technical Field
[0003] The present disclosure relates to a method, a processor, and a storage medium for solving the bit - filling problem when creating a virtual controller. Background Art
[0004] Source code refers to the plain - text code used when writing a computer program. Generally, source code (which is a set of instructions written in a programming language) is in a form that can be understood and written by humans. Source code includes the syntax and rules for giving instructions to a computer.
[0005] A variable is a space in memory that has a name for storing and managing data used in a program. A variable can be used to store, reference, or manipulate data. A variable can store different types of data, such as numbers, text, and objects. The value of a variable can change according to the size of the data stored.
[0006] A structure refers to the concept used when combining multiple variables together to define a single new data type in a programming language. Through a structure, variables of different data types can be grouped together and managed as a single unit.
[0007] A bit - field refers to a structure that has bits as members.
[0008] Variables included in a structure are placed continuously in memory and can have specific values according to the data type of each variable and the basic alignment policy of the compiler. However, there are embodiments where the value of a variable is changed or the alignment of a variable is adjusted to adjust the size of the structure and optimize memory usage.
[0009] In the case where there is some remaining space when storing data in memory, extra bits can be inserted into the memory to fill the remaining space, which can be referred to as bit - filling.
[0010] A virtual controller refers to a control system implemented in software in a computer system or a simulation environment, rather than a control system implemented with actual hardware. Such a virtual controller can replace or simulate actual physical hardware to control a specific task or process and is used for simulation, etc.
[0011] Such a virtual controller can be created through the process of building source code. However, during the process of building source code, the occurrence of bit stuffing may depend on which build tool is used, and thus, the virtual controller may not work properly. Summary of the Invention
[0012] One aspect of the present disclosure is to provide a technology capable of creating a virtual controller that works properly in any environment.
[0013] Another aspect of the present disclosure lies in providing a technology capable of preventing bit stuffing caused by variables in a structure.
[0014] Yet another aspect of the present disclosure provides a technology applicable to CAN DB (Controller Area Network Database).
[0015] According to an embodiment of the present disclosure, a method is provided, which includes: checking whether bit stuffing occurs when compiling source code including a structure containing one or more variables. The method further includes splitting the bit-stuffed variables in the source code when the occurrence of bit stuffing is verified.
[0016] Splitting the bit-stuffed variables may include splitting the bit-stuffed variables such that there is no blank in the memory.
[0017] The split bit-stuffed variables can be packed into one variable.
[0018] The method may further include compiling and linking the split source code and creating a virtual controller.
[0019] The virtual controller can be a virtual model of an ECU (Electronic Control Unit).
[0020] According to another embodiment of the present disclosure, another method is provided, which includes: checking whether bit stuffing occurs when compiling source code including a structure containing one or more variables. The method further includes changing the maximum number of bytes of the structure when it is verified that bit stuffing has occurred. The method also includes checking whether bit stuffing occurs in the source code with the changed maximum number of bytes of the structure. The method additionally includes splitting the bit-stuffed variables in the source code with the changed maximum number of bytes in the structure declaration when it is verified that bit stuffing has occurred.
[0021] Splitting the bit-stuffed variables may include splitting the bit-stuffed variables such that there is no blank in the memory.
[0022] The method may further include compiling and linking the split source code and creating a virtual controller.
[0023] The virtual controller can be a virtual model of an ECU (Electronic Control Unit).
[0024] Changing the maximum number of bytes may include increasing the maximum number of bytes.
[0025] The split bit - stuffed variables can be packed into one variable.
[0026] According to another embodiment of the present disclosure, a computer - readable storage medium storing a program is provided. When the program is executed by a processor, the processor is caused to: check whether bit stuffing occurs when compiling source code including a structure containing one or more variables; when it is confirmed that bit stuffing occurs, change the maximum number of bytes of the structure; check whether bit stuffing occurs in the source code where the maximum number of bytes of the structure is changed; and when it is confirmed that bit stuffing occurs, split the bit - stuffed variables in the source code where the maximum number of bytes of the structure declaration is changed.
[0027] When the program is executed by the processor, the processor can split the bit - stuffed variables so that there is no blank in the memory.
[0028] When the program is executed by the processor, the processor can further be caused to: compile and link the split source code and create a virtual controller.
[0029] The virtual controller can be a virtual model of an ECU (Electronic Control Unit).
[0030] When the program is executed by the processor, the processor can change the maximum number of bytes by increasing the maximum number of bytes.
[0031] The split bit - stuffed variables can be packed into one variable.
[0032] According to another embodiment of the present disclosure, a processor is provided. The processor includes: a checking unit configured to check whether bit stuffing occurs when compiling source code including a structure containing one or more variables. The processor further includes a processing unit configured to, when bit stuffing occurs, perform one or more of changing the maximum number of bytes of the structure and splitting the bit - stuffed variables in one or more variables.
[0033] The processing unit can be configured to split the bit - stuffed variables so that there is no blank in the memory.
[0034] The processing unit can be configured to change the maximum number of bytes by increasing the maximum number of bytes.
[0035] According to another embodiment of the present disclosure, another method is provided. The method includes: checking whether bit stuffing occurs when compiling source code including one or more bit - field declarations; and the method further includes, when it is confirmed that bit stuffing occurs, splitting the bits where bit stuffing occurs in the bit - field.
[0036] Splitting the bits may include splitting the bits where bit stuffing occurs so that there is no blank in the memory.
[0037] The split bits where bit stuffing has occurred can be packed into a variable.
[0038] The method may further include compiling and linking the split source code and creating a virtual controller.
[0039] The virtual controller can be a virtual model of an ECU (Electronic Control Unit).
[0040] As described above, according to an embodiment of the present disclosure, a virtual controller that can operate properly in any environment can be created.
[0041] According to an embodiment of the present disclosure, abnormal operation of the virtual controller caused by bit stuffing can also be prevented.
[0042] Furthermore, according to an embodiment of the present disclosure, the problems caused by bit stuffing can be solved in a highly stable and compatible manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a diagram for illustrating the process of creating a virtual controller according to an embodiment of the present disclosure.
[0044] Figure 2 is a diagram for illustrating the construction process according to an embodiment of the present disclosure.
[0045] Figure 3 is a diagram for illustrating a method for solving the bit stuffing problem according to a first embodiment of the present disclosure.
[0046] Figure 4 is a diagram for illustrating a method for solving the bit stuffing problem according to a second embodiment of the present disclosure.
[0047] Figures 5 to 7 is a diagram for illustrating an example of bit stuffing according to an embodiment of the present disclosure.
[0048] Figure 8 is a diagram showing the implementation of a method for solving the bit stuffing problem according to a second embodiment of the present disclosure.
[0049] Figure 9 is a diagram for illustrating a processor that executes a method for solving the bit stuffing problem according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0050] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In addition, for the reference numerals of the components in the respective drawings, even when the components are shown in different drawings, the same reference numerals are given to the same components. Further, when describing the present disclosure, detailed descriptions of well-known configurations or functions have been omitted so as not to obscure the gist of the present disclosure.
[0051] In addition, terms such as "first", "second", "A", "B", "(a)", "(b)", etc. may be used to describe the components of the present disclosure. These terms are only used to distinguish the corresponding components from other components, and the nature, order, or sequence of the corresponding components is not limited to these terms. In the case where a component is described as being "coupled", "combined", or "connected" to another component, it should be understood that the corresponding component can be directly coupled or connected to the other component, or the corresponding component can also be "coupled", "combined", or "connected" to the component through another component disposed therebetween.
[0052] In addition, in this specification, terms such as "module", "component", "device", etc. may be intended to refer to a function or a structural combination of hardware or software driven by the corresponding hardware or used to drive the hardware. For example, the hardware herein may be a data processing device including a central processing unit (CPU) or another processor. In addition, the software driven by the hardware may refer to running processes, objects, executable files, execution threads, programs, etc.
[0053] When a component, device, module, element, etc. of the present disclosure is described as having a purpose or performing an operation, function, etc., the component, device, or element should be considered herein as being "configured to" meet the purpose or perform the operation or function.
[0054] Figure 1 is a diagram for explaining a virtual controller creation process according to an embodiment of the present disclosure.
[0055] See Figure 1 , a virtual controller can be created by using the written source code.
[0056] Specifically, the source code can be written in various programming languages. The source code can include various variables and various structures including various variables.
[0057] In addition, the source code may include bit fields containing one or more bits.
[0058] In addition, the source code can include syntax and rules for issuing instructions to a computer.
[0059] Such source code can be built by a build tool. Here, the term "build" may refer to a process in which the source code is converted into software, libraries, etc. that can be executed by a computer. The term "build tool" may refer to software used to compile or build source code.
[0060] The source code can be built and converted into a virtual controller file. Here, the virtual controller can be a vECU (virtual electronic control unit) that is a virtual model of an ECU (electronic control unit).
[0061] DLL is an abbreviation for Dynamic Link Library, and the vECU can create a DLL file as an FMU (Functional Mock-up Unit) file using FMI (Functional Mock-up Interface).
[0062] As an example, the virtual controller can be applied in the development stage of automotive software. The virtual controller can construct a hardware-independent development environment. The virtual controller can be used for logic verification. The virtual controller can be used as a simulation tool.
[0063] Figure 2 is a diagram for explaining a build process according to an embodiment of the present disclosure.
[0064] See Figure 2 , the written source code can be preprocessed by a preprocessor. Here, preprocessing may refer to a process in which additional processing is performed on the source code before the source code is compiled by a compiler.
[0065] In the preprocessing step, macro expansion, insertion of header files, conditional compilation, use of preprocessor instructions, etc. can be performed.
[0066] The preprocessed source code can be compiled by a compiler.
[0067] Here, compilation may refer to a process of converting source code into assembly code or a process of translating source code into machine language that can be understood by a computer. The software that performs compilation may be called a compiler.
[0068] During the compilation process, for example, executable code optimization and code-to-assembly code conversion can be performed.
[0069] Alternatively, the compilation process may refer to a process of directly converting source code into machine language, through which an executable program can be directly created.
[0070] Assembly code (also known as assembly language) is a language encoded into machine language that has a strong association with the function of instructions, rather than machine language that is difficult for users to understand.
[0071] The assembly code written through the compilation process can be written in machine language by an assembler.
[0072] Machine code written in machine language can be created as an object file, and the object file can be changed by a linker into an output file.
[0073] Depending on the environment in which the process is executed, such a build process can be applied differently. Depending on the environment in which the build process is executed, bit stuffing (i.e., filling blanks, which are free spaces in the memory, with bits) may or may not occur.
[0074] Therefore, the occurrence of bit stuffing can depend on the environment in which the program is executed, and bit stuffing can cause abnormal operations of the virtual controller. To solve this problem, it may be necessary to modify the source code in advance.
[0075] Figure 3 is a diagram for explaining a method for solving the bit stuffing problem according to the first embodiment.
[0076] See Figure 3 , a method for solving the bit stuffing problem according to the first embodiment may include the step or operation S210 of preparing the source code; the step or operation S220 of checking whether bit stuffing occurs; and the step or operation S230 of splitting the bit stuffing variable.
[0077] The step or operation S210 of preparing the source code may include preparing the source code written in various programming languages. Here, the source code may include data on an actual controller (ECU) and data on a virtual controller (e.g., vECU).
[0078] The step or operation S220 of checking whether bit stuffing occurs may include checking whether bit stuffing occurs when compiling the source code. In the step or operation S220 of checking whether bit stuffing occurs, bit stuffing can be checked by checking the structures included in the source code and the variables included in the structures and checking the maximum number of bytes in the structure declaration. In addition, whether bit stuffing occurs can be checked by checking the maximum number of bits in the bit field.
[0079] The step or operation S230 of splitting the bit stuffing variable may include splitting and declaring the variable that causes bit stuffing among the variables included in the source code.
[0080] In addition, when the bit field is the target to be processed, the step or operation S230 may include splitting and declaring the bits that cause bit stuffing among the bits included in the bit field in the source code.
[0081] Here, splitting the bit stuffing variable may refer to splitting and declaring the variable so that there is no blank in the memory. This will be described in more detail below with reference to Figures 5 to 8 to be described further in more detail.
[0082] In addition, the method for solving the bit stuffing problem according to the first embodiment may further include steps or operations of compiling source code and creating a virtual controller.
[0083] Here, compiling the source code may include converting the source code into a machine language understandable by a computer or expressing the source code in assembly language. In addition, the virtual controller may refer to a virtual model of an ECU (Electronic Control Unit).
[0084] The method for solving the bit stuffing problem according to the present embodiment can be applied to a CAN DB (Controller Area Network Database). In addition, as an example, the method for solving the bit stuffing problem according to the present embodiment can be applied to a generator for generating a CAN DB in C code.
[0085] Figure 4 is a diagram for illustrating the method for solving the bit stuffing problem according to the second embodiment.
[0086] See Figure 4 , the method for solving the bit stuffing problem according to the second embodiment may include steps or operations of preparing source code S310; checking whether bit stuffing occurs S320; changing the maximum number of bytes of a structure S330; checking whether bit stuffing occurs S340; and splitting bit stuffing variables S350. The step S310 or operation of preparing source code may include preparing source code written in various programming languages. Here, the source code may include data about an actual controller (ECU) and data about a virtual controller (vECU).
[0087] The step or operation S320 of checking whether bit stuffing occurs may include checking for bit stuffing when compiling the source code. In the step or operation S320 of checking whether bit stuffing occurs, it is possible to check whether bit stuffing occurs by checking the structure included in the source code and the variables included in the structure and checking the maximum number of bytes in the structure declaration.
[0088] In addition, it is possible to check whether bit stuffing occurs by checking the maximum number of bytes in a bit field.
[0089] The step or operation S330 of changing the maximum number of bytes of a structure may also be referred to as the step or operation of changing the size of a structure.
[0090] The size of a structure may represent the total size of the space occupied by the structure in memory. In an example, the larger the size of the structure, the higher the value of the variables placed continuously in memory.
[0091] As an example, the step or operation S330 of changing the maximum number of bytes of the structure may include the step of increasing the maximum number of bytes, which may mean increasing the size of the structure. Thereby, the bit stuffing problem can be solved.
[0092] In addition, the size of the structure can be reduced to prevent the occurrence of bit stuffing.
[0093] As an example, the size of the structure can be increased from 32 bits to 64 bits or reduced from 32 bits to 16 bits. In various embodiments, the size of the structure can be changed as needed as long as bit stuffing can be avoided.
[0094] In addition, when processing a bit field, a step or operation of issuing a statement to change the maximum number of bits in the bit field in the source code can be performed.
[0095] The step or operation S340 of checking whether bit stuffing occurs may include the step of re-checking whether bit stuffing occurs when compiling the source code in which the maximum number of bytes in the structure declaration is changed.
[0096] In addition, it is possible to re-check whether bit stuffing occurs by checking the maximum number of bits in the bit field.
[0097] Therefore, although the size of the structure is changed, the step or operation S340 may include checking whether bit stuffing occurs.
[0098] The step or operation S350 of splitting the bit stuffing variable may include splitting and declaring the bit stuffing variable among the variables included in the source code.
[0099] Splitting the bit stuffing variable may include splitting and declaring the variable such that there is no blank in the memory. This will be described in further detail below with reference to Figures 5 to 8 Further detailed description.
[0100] In addition, when the bit field is the target to be processed, it is possible to perform splitting and declaring the bits that cause bit stuffing among the bits included in the bit field included in the source code.
[0101] In addition, the method for solving the bit stuffing problem according to the second embodiment may further include the steps of compiling the source code and creating a virtual controller.
[0102] Here, compilation may include the step of converting the source code into a machine language understandable by a computer or the step of expressing the source code in assembly language. In addition, the virtual controller may refer to a virtual model of an ECU (Electronic Control Unit).
[0103] The method for solving the bit stuffing problem according to the present embodiment can be applied to a CAN DB (Controller Area Network Database). In addition, as an example, the method for solving the bit stuffing problem according to the present embodiment can be applied to a generator for generating a CAN DB in C code.
[0104] Figure 5 and Figure 6 are diagrams for illustrating examples of bit stuffing according to an embodiment.
[0105] Figure 5 and Figure 6 are diagrams for illustrating an example of splitting variables to prevent bit stuffing from occurring in a structure of 32-bit (4-byte) size.
[0106] Refer to Figure 5 and Figure 6 , one or more variables can be arranged in order in the structure. As an example, as shown in Figure 5 and Figure 6 , variable 1 can have a size of 16 bits, variable 2 can have a size of 8 bits, variable 3 can have a size of 14 bits, variable 4 can have a size of 12 bits, and variable 5 can have a size of 12 bits. In addition, variables 1 to 5 can be arranged in order in the structure.
[0107] When variables 1 and 2 are allocated, 8-bit storage space is left in the memory. Since the next variable 3 to be declared is 14 bits, the 8-bit blank can be filled with bit stuffing, and variable 3 can be allocated to a new memory. Then, when variable 4 is declared, 4-bit storage space is left in the memory. Since variable 5 has a size of 12 bits, the 4-bit blank will be filled with bit stuffing, and variable 5 can be allocated to a new memory.
[0108] Therefore, variable 5 can be allocated to a new memory, which can be called a stuffed byte.
[0109] In this case, due to bit stuffing, the program may not work correctly.
[0110] Therefore, variable 3 (as a bit stuffing variable) can be split (i.e., split and packed) to avoid blanks so that bit stuffing does not occur. Thus, the program can work correctly in any environment.
[0111] According to Figure 6 , variable 3, as a bit stuffing variable, can be split into 8 bits and 6 bits and packed, and accordingly bit stuffing may not occur during the compilation process.
[0112] In addition, when a bit field is the target to be processed, bit stuffing can be prevented by splitting and packing the bits that cause bit stuffing.
[0113] Figure 7 is a diagram for illustrating bit stuffing according to an embodiment. Figure 8 is a diagram showing the implementation of a method for solving the bit stuffing problem according to an embodiment.
[0114] See Figure 7 , the structure called test_s contains variables a, b, c, e, f, g, h, and i, and has a size of 4 bytes (32 bits).
[0115] Int and UInt represent the types of variables. Int can represent an integer, and UInt can represent a non-negative integer, that is, 0 and positive integers.
[0116] The size of variable a is 16 bits, the size of variable b is 8 bits, the size of variable c is 14 bits, the size of variable e is 14 bits, the size of variable f is 12 bits, the size of variable g is 16 bits, the size of variable h is 16 bits, and the size of variable i is 16 bits.
[0117] When these variables are arranged in order in a 32-bit structure, bit stuffing occurs. Therefore, the method shown in Figure 8 can be executed.
[0118] First, bit stuffing can be prevented by changing the size of the structure. Although variable c is a bit stuffing variable in a 32-bit structure, by changing the size of the structure to 64 bits, the bit stuffing caused by variable c can be avoided.
[0119] However, in this case, due to the change in the size of the structure, variable f becomes a bit stuffing variable. In this case, bit stuffing can be prevented by splitting variable f. As depicted in Figure 8 , variable f can be split into variable f_1 and variable f_2, each having a size of 8 bits, and the two variables can be packed into one variable, thereby preventing bit stuffing.
[0120] Therefore, bit stuffing can be prevented by splitting and packing bit stuffing variables.
[0121] Figure 9 is a diagram for illustrating a processor that executes a method for solving the bit stuffing problem according to an embodiment of the present disclosure.
[0122] See Figure 9 , according to this embodiment, the processor 400 may include an inspection unit 410 and a processing unit 420.
[0123] The processor 400 can also be a central processing unit (CPU) and can perform arithmetic, control, execution, and input / output operations. In other words, the processor can be a key device for executing instructions and processing data in a program or software.
[0124] The checking unit 410 can be a component for checking whether bit stuffing has occurred. In an example, the checking unit 410 can be a component for checking whether bit stuffing occurs when compiling source code including a structure containing one or more variables.
[0125] The processing unit 420 can be a component for modifying the source code. In an example, when it is confirmed that bit stuffing has occurred, the processing unit 420 can perform one or more of changing the maximum number of bytes of the structure and splitting the bit-stuffed variables among one or more variables.
[0126] Here, splitting can refer to splitting the bit-stuffed variables so that there is no blank in the memory.
[0127] In addition, the change in the maximum number of bytes can involve increasing or decreasing the maximum number of bytes.
[0128] The processor 400 in the present embodiment can play the role of modifying the source code so that bit stuffing does not occur when compiling the source code.
[0129] In addition, the processor 400 according to the present embodiment can perform the steps of compiling the source code and creating a virtual controller.
[0130] Here, compiling can refer to the step of converting the source code into a machine language that can be understood by a computer or the step of representing the source code in assembly language. In addition, the virtual controller can refer to a virtual model of an ECU (electronic control unit).
[0131] The processor according to the present embodiment can be applied to a CAN DB (controller area network database). In addition, as an example, the processor according to the present embodiment can be applied to a generator for generating a CAN DB in C code.
[0132] Unless otherwise specified, terms such as "include", "contain", "comprise", or "have" mean that the corresponding components can exist, and thus should be interpreted as not excluding other components, but can further include other components. Unless otherwise defined, all terms including technical or scientific terms have the same meaning as commonly understood by those skilled in the art to which this disclosure belongs. Commonly used terms (such as terms defined in a dictionary) should be interpreted as consistent with the context meaning of the related art and should not be interpreted as an ideal or overly formal meaning unless clearly defined in this disclosure.
[0133] The above description is only an illustration of the technical concept of the present disclosure, and those skilled in the art to which the present disclosure pertains can make various modifications and changes without departing from the basic features of the present disclosure. Therefore, the embodiments disclosed in the present disclosure are not intended to limit, but to explain the technical concept of the present disclosure, and the scope of the technical spirit of the present disclosure is not limited to these embodiments. The protection scope of the present disclosure should be interpreted by the appended claims, and all technical spirits within the scope equivalent to the scope of the claims should be interpreted as being included within the scope of the claims of the present disclosure.
Claims
1. A method for solving bit stuffing, comprising: checking whether bit stuffing occurs when compiling source code including a structure containing one or more variables; as well as When it is confirmed that bit stuffing occurs, the bit stuffing variables in the source code are split.
2. The method according to claim 1, wherein: Splitting the bit stuffing variable includes splitting the bit stuffing variable such that there are no gaps in memory.
3. The method according to claim 1, wherein: The split bit-stuffing variables are packed into one variable.
4. The method according to claim 1, further comprising: The split source code is compiled and linked, and a virtual controller is created.
5. The method according to claim 4, wherein: The virtual controller is a virtual model of an electronic controller unit (ECU).
6. A method for solving bit stuffing, comprising: When bit stuffing occurs during compilation of source code including a structure containing one or more variables, changing the maximum number of bytes of the structure; as well as When bit stuffing occurs in the source code in which the maximum number of bytes of the structure has changed, splitting the bit stuffing variables in the source code in which the maximum number of bytes of the structure has changed.
7. The method according to claim 6, wherein: Splitting the bit stuffing variable includes splitting the bit stuffing variable such that there are no gaps in memory.
8. The method according to claim 6, further comprising: The split source codes are compiled and linked to create a virtual controller.
9. The method according to claim 8, wherein: The virtual controller is a virtual model of an electronic controller unit (ECU).
10. The method according to claim 6, wherein: Changing the maximum number of bytes includes increasing the maximum number of bytes.
11. The method according to claim 6, wherein: The split bit-stuffing variables are packed into one variable.
12. A processor, comprising: a checking section configured to check whether bit stuffing occurs when compiling a source code including a structure including one or more variables; as well as The processing unit is configured to, when it is confirmed by the checking unit that bit stuffing occurs, perform one or more of the following operations: changing the maximum number of bytes of the structure and splitting the bit stuffing variable in the one or more variables.
13. The processor of claim 12, wherein: The processing section is configured to split the bit stuffing variable so that there are no gaps in the memory.
14. The processor of claim 12, wherein: The processing section is configured to change the maximum number of bytes by increasing the maximum number of bytes.
15. A method for solving bit stuffing, comprising: Checks whether bit stuffing occurs when compiling source code that includes one or more bit-field declarations; as well as When it is confirmed that bit stuffing occurs, the bits in the bit field where the bit stuffing occurs are split.
16. The method according to claim 15, wherein: Splitting the bits includes splitting the bit filling variable so that there are no gaps in the memory.
17. The method according to claim 16, wherein: The split bit-stuffing variables are packed into one variable.
18. The method according to claim 15, further comprising: The split source code is compiled and linked, and a virtual controller is created.
19. The method according to claim 18, wherein: The virtual controller is a virtual model of an electronic controller unit (ECU).