Model creation system and model creation method
Patent Information
- Application Number
- JP2022190529
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-11-29
AI Technical Summary
【0013】 本開示の一態様に係るモデル作成システムなどによれば、モデルと自動生成コードとの等価性の検証における生産性をあげることができる。
Smart Images

Figure 0007915664000001 
Figure 0007915664000002 
Figure 0007915664000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a model creation system and a model creation method for verifying equivalence between the operational behavior of a model in model-based development and code automatically generated from the model. [Background Art]
[0002] In embedded software development, a development method is often used in which required specifications are verified using an executable specification model, and source code is automatically generated as-is from the model. Such a development method is called model-based development. In model-based development, there may be a discrepancy between the model execution environment and the environment for further binarizing and verifying code automatically generated from the model by an automatic code generator (also referred to as automatically generated code), so it is necessary to verify the equivalence between the model and the binary code.
[0003] Patent Document 1 discloses a code inspection tool and a code inspection method.
[0004] Patent Document 2 discloses a program verification device, a program verification method, and a program for executing a verification function. [Prior Art Documents] [Patent Documents]
[0005] [Patent Document 1] Japanese Unexamined Patent Publication No. 2021-117666 [Patent Document 2] Japanese Unexamined Patent Publication No. 2020-4036 [Summary of the Invention] [Problem to be Solved by the Invention]
[0006] Patent documents 1 and 2 disclose devices for verifying the equivalence between a model and automatically generated code. The devices disclosed in patent documents 1 and 2 presuppose that the correspondence between any block described in the model and the source code must be fully understood.
[0007] However, mechanically understanding the correspondence between a model and source code is extremely difficult, limiting its applicability and lacking versatility. This is because automatic code generators and the modeling tools that manage the models are implemented in high-level languages, and depending on how the model is constructed, the number of source code generation patterns that the automatic code generator produces becomes countless, making perfect prediction difficult and resulting in numerous limitations.
[0008] Furthermore, there is a commercially available tool called MBT option that links a series of steps for verifying equivalence: the model's behavior is verified using a modeling tool simulator, and the automatically generated code is further converted to binary and verified using a simulator (for example, CoverageMaster winAMS®). However, for the reasons mentioned above, there are many limitations, and when these limitations apply, it is necessary to manually map the input / output signals of the model to the input / output variables and input / output arguments of the code, which results in a significant amount of effort and time.
[0009] Therefore, this disclosure provides a model creation system and the like that can improve productivity in verifying the equivalence between a model and automatically generated code. [Means for solving the problem]
[0010] The model creation system according to this disclosure is a model creation system that creates a second model file from a first model file showing a data flow, and comprises: a determination unit that determines a function block which is a block to be functionized from one or more blocks included in the first model file; a decomposition unit that determines whether the input parameters and output parameters of the function block are grouped by parameter elements and decomposes the grouped input parameters and grouped output parameters into a plurality of elements; a creation unit that creates a grouping block into which the plurality of elements decomposed from the grouped input parameters are input and which outputs the grouped input parameters, a reverse grouping block into which the grouped output parameters are input and which outputs the plurality of elements decomposed from the grouped output parameters, and connects the grouped input parameters from the grouping block to the function block and the grouped output parameters from the function block to the reverse grouping block, and outputs information showing the connected grouping block, function block and reverse grouping block as the second model file.
[0011] The model creation method relating to this disclosure is a model creation method executed by a model creation system that creates a second model file from a first model file showing a data flow, and includes the process of determining a function block which is a block to be functionized from one or more blocks included in the first model file, determining whether the input parameters and output parameters of the function block are grouped by parameter elements, decomposing the grouped input parameters and grouped output parameters into a plurality of elements, creating a grouping block which is input to the plurality of elements decomposed from the grouped input parameters and outputs the grouped input parameters, creating an inverse grouping block which is input to the grouped output parameters and outputs the plurality of elements decomposed from the grouped output parameters, making connections such that the grouped input parameters are input from the grouping block to the function block and the grouped output parameters are input from the function block to the inverse grouping block, and outputting information indicating the grouping block, the function block and the inverse grouping block which have been connected as the second model file.
[0012] These comprehensive or specific embodiments may be implemented as a system, method, integrated circuit, computer program, or recording medium such as a computer-readable CD-ROM, or as any combination of a system, method, integrated circuit, computer program, and recording medium. [Effects of the Invention]
[0013] According to one aspect of this disclosure, a model creation system, etc., can be used to increase productivity in verifying the equivalence between a model and automatically generated code. [Brief explanation of the drawing]
[0014] [Figure 1]It is a block diagram showing an example of a model creation system according to an embodiment. [Figure 2] It is a diagram showing an example of an input model file according to an embodiment. [Figure 3] It is a diagram for explaining that source code generation patterns automatically generated from an input model file can be innumerable. [Figure 4] It is a flowchart showing an example of the operation of a determination unit according to an embodiment. [Figure 5] It is a flowchart showing an example of the operation of a decomposition unit according to an embodiment. [Figure 6A] It is a diagram showing an example of input parameters decomposed into a plurality of elements. [Figure 6B] It is a diagram showing an example of output parameters decomposed into a plurality of elements. [Figure 7] It is a diagram showing an example of a creation target model file according to an embodiment. [Figure 8] It is a diagram showing another example of connections in the creation target model file. [Figure 9] It is a diagram showing another example of connections in the creation target model file. [Figure 10] It is a diagram showing an example of source code automatically generated from a creation target model file. [Figure 11] It is a flowchart showing an example of a model creation method according to another embodiment. Mode for Carrying Out the Invention
[0015] Hereinafter, embodiments will be specifically described with reference to the drawings.
[0016] All of the embodiments described below are illustrative or specific examples. Numerical values, shapes, materials, constituent elements, arrangement positions and connection forms of constituent elements, steps, order of steps, and the like shown in the following embodiments are merely examples, and are not intended to limit the present disclosure.
[0017] (Embodiment) The following describes the model creation system according to the embodiment.
[0018] Figure 1 is a block diagram showing an example of a model creation system 100 according to an embodiment. In addition to the model creation system 100, Figure 1 also shows an input model file 200 that is input to the model creation system 100, a target model file 300 that is output from the model creation system 100, and an automatic code generator 400. The automatic code generator 400 generates source code and the like from the model (model file).
[0019] Input model file 200 is an example of a first model file that shows the data flow. Input model file 200 is a model that represents the processing content used in model-based development. In model-based development, models are generally described using blocks that represent units of processing.
[0020] Figure 2 shows an example of an input model file 200 according to the embodiment. For the sake of simplicity, the input model file 200 is shown here as a model consisting of a single block.
[0021] One block included in the input model file 200 is a block that is converted into a function, as described later, and this block is called the function block 201. For example, the function block 201 is associated with three input parameters In1 to In3 and four output parameters Out1 to Out4. When verification (MILS (Model In the Loop Simulation) verification) is performed on the input model file 200, and the automatic code generator 400 generates automatically generated code from the input model file 200, and PILS (Processor In the Loop Simulation) verification is performed, the number of generated patterns for the automatically generated code can be infinite, making PILS verification difficult.
[0022] Figure 3 illustrates that there can be countless generation patterns for source code automatically generated from input model file 200.
[0023] As shown in Figure 3, the source code automatically generated from the input model file 200 contains countless patterns that need to be assumed, making it difficult to establish a one-to-one correspondence between the input / output signals and the input / output variables of the automatically generated code. Therefore, strict constraints are required when implementing the model.
[0024] Therefore, this disclosure provides a model creation system 100 that creates a target model file 300, which is separate from the input model file 200.
[0025] The model creation system 100 is a system that creates a target model file 300 from an input model file 200. The target model file 300 is an example of a second model file that shows the data flow.
[0026] The model creation system 100 comprises a determination unit 101, a decomposition unit 102, and a creation unit 103. The model creation system 100 is a computer including a processor and memory. The memory is ROM (Read Only Memory) and RAM (Random Access Memory), and can store programs executed by the processor. The determination unit 101, the decomposition unit 102, and the creation unit 103 are implemented by the processor and other components that execute the programs stored in memory.
[0027] For example, the model creation system 100 may be a computer consisting of a single enclosure. For example, the model creation system 100 may be a server. The components of the model creation system 100 may be located on a single server or distributed across multiple servers.
[0028] The determination unit 101 determines a function block 201 from among one or more blocks included in the input model file 200, which is a block to be converted into a function. The details of the operation of the determination unit 101 will be explained in Figure 4 below.
[0029] The decomposition unit 102 decomposes the input and output parameters of the function block into multiple elements. The operation of the decomposition unit 102 will be explained in detail in Figure 5 below.
[0030] The creation unit 103 creates and outputs the target model file 300. The operation of the creation unit 103 will be explained in detail in Figure 7 below.
[0031] First, the operation of the decision unit 101 will be explained in detail using Figure 4.
[0032] Figure 4 is a flowchart showing an example of the operation of the decision unit 101 according to the embodiment.
[0033] The determination unit 101 determines whether each of the one or more blocks included in the input model file 200 is the top-level block of the model (step S101). As shown in Figure 2, if the input model file 200 contains only one block, this block is the top-level block of the model.
[0034] The decision unit 101 determines whether or not a block that is not the top-level block of the model (a block that was determined to be No in step S101) is configured to be a function (step S102). In other words, the decision unit 101 determines whether or not a block from the second level onward is configured to be a function. For example, the setting of whether or not to configure each block to be a function may be done through the model development tool.
[0035] The decision unit 101 determines that a block will be turned into a function (step S103) if it determines that the block is the highest-level block in the model (a block determined to be Yes in step S101), or if it determines that the block has been configured to be turned into a function (a block determined to be Yes in step S102). Here, the decision unit 101 determines the function block 201 from among one or more blocks included in the input model file 200.
[0036] The decision unit 101 determines that blocks that are not the top-level blocks of the model (blocks that were determined to be No in step S101) and that have not been set to be function-ified (blocks that were determined to be No in step S102) will be designated as blocks that will not be function-ified (step S104).
[0037] For example, blocks that perform detailed operations such as arithmetic operations or logical operations will not be converted into functions.
[0038] Next, the operation of the disassembly unit 102 will be explained in detail using Figure 5.
[0039] Figure 5 is a flowchart showing an example of the operation of the disassembly unit according to the embodiment.
[0040] First, the decomposition unit 102 determines whether the input parameters and output parameters of the function block 201 are grouped by parameter elements (step S111). As shown in Figure 2, the function block 201 is associated with three input parameters In1 to In3 and four output parameters Out1 to Out4. For example, the decomposition unit 102 determines whether each input / output parameter is grouped by parameter elements by checking the data type of each input / output parameter. The method for checking the data type is not particularly limited, but if the data type is predetermined for each input / output parameter, the decomposition unit 102 checks the predetermined data type. Alternatively, the decomposition unit 102 may check the data type for each input / output parameter by checking the data that is actually flowing.
[0041] For example, if the decomposition unit 102 determines that the data type of the input / output parameters is an array type, in other words, that the input / output parameters are vector signals, then it determines that the input / output parameters are grouped by their element. Also, for example, if the decomposition unit 102 determines that the data type of the input / output parameters is a structure, in other words, that the input / output parameters are bus signals, then it determines that the input / output parameters are grouped by their element. For example, if the input parameters In2 and In3 and the output parameter Out2 are vector signals, and the output parameters Out3 and Out4 are bus signals, then the decomposition unit 102 determines that these input / output parameters are grouped by their element.
[0042] The decomposition unit 102 decomposes the grouped input parameters and grouped output parameters (the input parameters and output parameters determined to be Yes in step S111) into multiple elements (step S112). For example, an element is a single variable. Here, examples of input parameters and output parameters decomposed into multiple elements will be explained using Figures 6A and 6B.
[0043] Figure 6A shows an example of an input parameter broken down into multiple elements.
[0044] Figure 6B shows an example of output parameters broken down into multiple elements.
[0045] As shown in Figure 6A, for example, the input parameter In2, which is a vector signal, is decomposed into three elements (variables) shown in input blocks 2-4, and the input parameter In3, which is a vector signal, is decomposed into four elements (variables) shown in input blocks 5-8. As shown in Figure 6B, the output parameter Out2, which is a vector signal, is decomposed into eight elements (variables) shown in output blocks 2-9, the output parameter Out3, which is a bus signal, is decomposed into four elements (variables) shown in output blocks 10-13, and the output parameter Out4, which is a bus signal, is decomposed into eight elements (variables) shown in output blocks 14-21.
[0046] For example, since the input parameter In1 and the output parameter Out1 are not vector signals or bus signals, the decomposition unit 102 determines that these input and output parameters are not grouped into parameter elements. The decomposition unit 102 does not decompose ungrouped input parameters and ungrouped output parameters (input parameters and output parameters determined to be No in step S111) into multiple elements.
[0047] Next, the operation of the creation unit 103 will be explained in detail using Figure 7.
[0048] Figure 7 shows an example of a model file 300 to be created according to the embodiment.
[0049] The creation unit 103 creates a grouping block that takes multiple elements decomposed from a grouped input parameter as input and outputs the grouped input parameter. As shown in Figure 7, for example, the creation unit 103 creates a grouping block 301 that takes input blocks 2 to 4 as the decomposed elements as input and outputs the grouped input parameter In2. Also, for example, the creation unit 103 creates a grouping block 302 that takes input blocks 5 to 8 as the decomposed elements as input and outputs the grouped input parameter In3. In this way, the creation unit 103 creates a block that processes multiple inputs to output a single input signal.
[0050] The creation unit 103 takes a grouped output parameter as input and creates an inverse grouping block that outputs multiple elements decomposed from the grouped output parameter. As shown in Figure 7, for example, the creation unit 103 takes a grouped output parameter Out2 as input and creates an inverse grouping block 303 that outputs output blocks 2 to 9 as multiple decomposed elements. Also, for example, the creation unit 103 takes a grouped output parameter Out3 as input and creates an inverse grouping block 304 that outputs output blocks 10 to 13 as multiple decomposed elements. Also, for example, the creation unit 103 takes a grouped output parameter Out4 as input and creates an inverse grouping block 305 that outputs output blocks 14 to 21 as multiple decomposed elements. In this way, the creation unit 103 creates a block that processes and outputs a single grouped signal.
[0051] The creation unit 103 makes connections so that grouped input parameters are input from the grouping block to the function block 201. As shown in Figure 7, for example, the creation unit 103 makes connections so that grouped input parameter In2 is input from the grouping block 301 to the function block 201. Also, for example, the creation unit 103 makes connections so that grouped input parameter In3 is input from the grouping block 302 to the function block 201.
[0052] As shown in Figure 7, for example, the creation unit 103 performs the connection by creating signal lines 311 and 312. Signal lines 311 and 312 are examples of first signal lines. For example, signal line 311 directly connects grouping block 301 and function block 201 so that the grouped input parameter In2 is input from grouping block 301 to function block 201. For example, signal line 312 directly connects grouping block 302 and function block 201 so that the grouped input parameter In3 is input from grouping block 302 to function block 201.
[0053] The creation unit 103 connects the grouped output parameters so that they are input from the function block 201 to the inverse grouping block. As shown in Figure 7, for example, the creation unit 103 connects the grouped output parameter Out2 so that it is input from the function block 201 to the inverse grouping block 303. Also, for example, the creation unit 103 connects the grouped output parameter Out3 so that it is input from the function block 201 to the inverse grouping block 304. Also, for example, the creation unit 103 connects the grouped output parameter Out4 so that it is input from the function block 201 to the inverse grouping block 305.
[0054] As shown in Figure 7, for example, the creation unit 103 performs the connection by creating signal lines 313 to 315. Signal lines 313 to 315 are examples of second signal lines. For example, signal line 313 directly connects function block 201 and inverse grouping block 303 so that the grouped output parameter Out2 is input from function block 201 to inverse grouping block 303. Also, for example, signal line 314 directly connects function block 201 and inverse grouping block 304 so that the grouped output parameter Out3 is input from function block 201 to inverse grouping block 304. Also, for example, signal line 315 directly connects function block 201 and inverse grouping block 305 so that the grouped output parameter Out4 is input from function block 201 to inverse grouping block 305.
[0055] In this way, data can be transferred between blocks by directly connecting them with signal lines.
[0056] The creation unit 103 then outputs information indicating the connected grouping blocks 301 and 302, the function block 201, and the inverse grouping blocks 303, 304, and 305 as the model file 300 to be created.
[0057] Note that the method of wiring is not limited to directly connecting the blocks with signal lines as shown in Figure 7. Other examples of wiring will be explained using Figures 8 and 9.
[0058] Figures 8 and 9 show another example of wiring in the model file 300 to be created. In Figures 8 and 9, the explanation focuses on the wiring between the grouping block 301 and the function block 201, and the wiring between the function block 201 and the inverse grouping block 303. The wiring method explained in Figures 8 and 9 can also be applied to the wiring between the grouping block 302 and the function block 201, and between the function block 201 and the inverse grouping blocks 304 and 305.
[0059] As shown in Figure 8, for example, the creation unit 103 may perform the connection by creating tags 321 to 324 and signal lines 331 to 334. Tag 321 is an example of a first tag, tag 322 is an example of a second tag, tag 323 is an example of a third tag, and tag 324 is an example of a fourth tag. Signal line 331 is an example of a third signal line, signal line 332 is an example of a fourth signal line, signal line 333 is an example of a fifth signal line, and signal line 334 is an example of a sixth signal line.
[0060] For example, signal line 331 connects tag 321 to grouping block 301 so that the grouped input parameter In2 is input from grouping block 301 to tag 321. For example, signal line 332 connects tag 322 to function block 201 so that the grouped input parameter In2 is input from tag 322 to function block 201. Since tags 321 and 322 are connected by a virtual signal line, by connecting signal lines 331 and 332 and tags 321 and 322 as described above, it becomes possible to exchange data between grouping block 301 and function block 201 in the same way as when grouping block 301 and function block 201 are directly connected by signal line 311 (see Figure 7).
[0061] For example, signal line 333 connects tag 323 to function block 201 so that the grouped output parameter Out2 is input from function block 201 to tag 323. For example, signal line 334 connects tag 324 to inverse grouping block 303 so that the grouped output parameter Out2 is input from tag 324 to inverse grouping block 303. For example, tag 323 and tag 324 are connected by a virtual signal line. By connecting signal lines 333 and 334 and tags 323 and 324 as described above, it becomes possible to exchange data between function block 201 and inverse grouping block 303 in the same way as when function block 201 and inverse grouping block 303 are directly connected by signal line 313 (see Figure 7).
[0062] In this way, data can be exchanged between blocks via tags connected by virtual signal lines.
[0063] As shown in Figure 9, for example, the creation unit 103 may perform the wiring by creating storage blocks 341 and 343, reference blocks 342 and 344, and signal lines 351 to 354. Storage block 341 is an example of a first storage block, and storage block 343 is an example of a second storage block. Reference block 342 is an example of a first reference block, and reference block 344 is an example of a second reference block. Signal line 351 is an example of a seventh signal line, signal line 352 is an example of an eighth signal line, signal line 353 is an example of a ninth signal line, and signal line 354 is an example of a tenth signal line.
[0064] For example, signal line 351 connects storage block 341 to grouping block 301 so that the grouped input parameter In2 is input from grouping block 301 to storage block 341. For example, signal line 352 connects reference block 342 to function block 201 so that the grouped input parameter In2 is input from reference block 342 to function block 201. For example, storage block 341 is a block that temporarily stores data in the memory area, and reference block 342 is a block that references the data temporarily stored in the memory area by storage block 341. In this way, by connecting signal lines 351 and 352, storage block 341 and reference block 342 as described above, it becomes possible to pass data between grouping block 301 and function block 201 in the same way as when grouping block 301 and function block 201 are directly connected by signal line 311 (see Figure 7).
[0065] For example, signal line 353 connects the storage block 343 to the function block 201 so that the grouped output parameter Out2 is input from the function block 201 to the storage block 343. For example, signal line 354 connects the reference block 344 to the inverse grouping block 303 so that the grouped output parameter Out2 is input from the reference block 344 to the inverse grouping block 303. For example, the storage block 343 is a block that temporarily stores data in the memory area, and the reference block 344 is a block that references the data temporarily stored in the memory area by the storage block 343. In this way, by connecting signal lines 353 and 354, the storage block 343 and the reference block 344 as described above, it becomes possible to transfer data between the function block 201 and the inverse grouping block 303 in the same way as when the function block 201 and the inverse grouping block 303 are directly connected by signal line 313 (see Figure 7).
[0066] In this way, data can be passed between blocks by utilizing the storage of data in memory and the retrieval of data stored in memory.
[0067] Furthermore, the model file 300 to be created may combine the connection methods described in Figures 7 to 9. For example, the function block 201 and the inverse grouping block 303 may be connected by a direct signal line, the function block 201 and the inverse grouping block 304 may be connected via a tag, and the function block 201 and the inverse grouping block 305 may be connected using memory.
[0068] Next, we will explain an example of automatically generated code that is automatically generated from the target model file 300 using Figure 10.
[0069] Figure 10 shows an example of source code automatically generated from the target model file 300.
[0070] As shown in Figure 10, the source code generation pattern automatically generated from the target model file 300 is fixed and consists of only one pattern.
[0071] As explained above, for the function block 201 in the input model file 200, grouping blocks 301 and 302 are created to group multiple elements in input parameters In2 and In3, and inverse grouping blocks 303 to 305 are created to decompose multiple elements in output parameters Out2 to Out4. These blocks are then connected to the function block 201 to create the target model file 300. With the creation of grouping blocks 301 and 302 and inverse grouping blocks 303 to 305, each input and output signal in the target model file 300 becomes a unique variable in the automatically generated code, allowing for a one-to-one correspondence between the input and output signals of the input model file 200 and the input and output variables of the automatically generated code. In this way, by providing a model creation system 100 that creates a target model file 300 separate from the input model file 200, problems that arose with complex verification methods can be solved, and productivity in verifying the equivalence between the model and the automatically generated code can be increased.
[0072] (Other embodiments) The model creation system 100 according to one or more embodiments of this disclosure has been described above based on embodiments, but this disclosure is not limited to these embodiments. Without departing from the spirit of this disclosure, various modifications that a person skilled in the art can conceive of may be applied to each embodiment, and forms constructed by combining components from different embodiments may also be included within the scope of one or more embodiments of this disclosure.
[0073] For example, this disclosure can be implemented not only as a model creation system 100, but also as a model creation method that includes steps (processes) performed by the components constituting the model creation system 100.
[0074] Figure 11 is a flowchart showing an example of a model creation method according to another embodiment.
[0075] The model creation method is a method executed by a model creation system that creates a second model file from a first model file that shows the data flow, as shown in Figure 11, which involves determining a functionalized block from among one or more blocks included in the first model file (step S11), determining whether the input parameters and output parameters of the functionalized block are grouped by parameter elements (step S12), decomposing the grouped input parameters and grouped output parameters into multiple elements (step S13), and inputting the multiple elements decomposed from the grouped input parameters, and The process includes creating a grouping block that outputs looped input parameters (step S14), creating an inverse grouping block that takes grouped output parameters as input and outputs multiple elements decomposed from the grouped output parameters (step S15), connecting the grouped input parameters so that they are input from the grouping block to the function block and the grouped output parameters are input from the function block to the inverse grouping block (step S16), and outputting information indicating the connected grouping block, function block, and inverse grouping block as a second model file (step S17).
[0076] For example, this disclosure can be implemented as a program that causes a computer (processor) to execute the steps included in the model creation method. Furthermore, this disclosure can be implemented as a non-temporary computer-readable recording medium, such as a CD-ROM, on which the program is recorded.
[0077] For example, if this disclosure is implemented in a program (software), each step is executed by the program using hardware resources such as the computer's CPU, memory, and input / output circuits. In other words, each step is executed by the CPU obtaining data from memory or input / output circuits, performing calculations, and outputting the calculation results to memory or input / output circuits.
[0078] In the above embodiment, each component included in the model creation system 100 may be implemented by dedicated hardware or by executing a software program suitable for each component. Each component may also be implemented by a program execution unit such as a CPU or processor reading and executing a software program recorded on a recording medium such as a hard disk or semiconductor memory.
[0079] Some or all of the functions of the model creation system 100 according to the above embodiment are typically implemented as an LSI, which is an integrated circuit. These may be individually integrated onto a single chip, or some or all of them may be integrated onto a single chip. Furthermore, the implementation of integrated circuits is not limited to LSIs; it may also be implemented using dedicated circuits or general-purpose processors. An FPGA (Field Programmable Gate Array) that can be programmed after LSI manufacturing, or a reconfigurable processor that can reconfigure the connections and settings of circuit cells inside the LSI, may also be used.
[0080] (Note) Based on the above description of embodiments, the following technologies are disclosed.
[0081] (Technical 1) A model creation system that creates a second model file from a first model file showing a data flow, comprising: a determination unit that determines a function block which is a block to be functionized from one or more blocks included in the first model file; a decomposition unit that determines whether the input parameters and output parameters of the function block are grouped by parameter elements and decomposes the grouped input parameters and grouped output parameters into a plurality of elements; a creation unit that creates a grouping block into which the plurality of elements decomposed from the grouped input parameter are input and which outputs the grouped input parameter; a reverse grouping block into which the grouped output parameter is input and which outputs the plurality of elements decomposed from the grouped output parameter; a connection unit that makes connections such that the grouped input parameter is input from the grouping block to the function block and the grouped output parameter is input from the function block to the reverse grouping block, and outputs information showing the connected grouping block, function block and reverse grouping block as the second model file.
[0082] According to this method, for each function block in the first model file, a grouping block is created that groups multiple elements in the input parameters, and an inverse grouping block is created that decomposes multiple elements in the output parameters. These blocks are then connected to the function block to create the second model file. The creation of the grouping and inverse grouping blocks means that each input / output signal in the second model file becomes a unique variable in the automatically generated code, allowing for a one-to-one correspondence between the input / output signals of the first model file and the input / output variables of the automatically generated code. By providing a model creation system that creates a second model file separate from the first model file in this way, problems that arose with complex verification methods can be solved, and productivity in verifying the equivalence between the model and the automatically generated code can be increased.
[0083] Furthermore, when both input and output parameters exist in the function block of the first model file, and automatic generation code is generated from the first model file, the number of generated automatic code patterns increases compared to when automatic generation code is generated from a model file containing only one of the input or output parameters (e.g., only input parameters), making it more difficult to establish a one-to-one correspondence between input / output signals and input / output variables in the automatic generation code. In contrast, in this disclosure, even when both input and output parameters exist, a grouping block is created for the input parameters and an inverse grouping block is created for the output parameters. Therefore, each input / output signal in the second model file becomes a unique variable in the automatic generation code, enabling a one-to-one correspondence between the input / output signals of the first model file and the input / output variables in the automatic generation code.
[0084] (Technology 2) The model creation system according to Technology 1, wherein each of the grouped input parameters and the grouped output parameters is a vector signal, and the element is a single variable.
[0085] According to this, the decomposition unit can decompose each element of the vector in the vector signal (array) into a variable.
[0086] (Technology 3) The model creation system according to Technology 1, wherein each of the grouped input parameters and the grouped output parameters is a bus signal, and the element is a single variable.
[0087] According to this, the decomposition unit can decompose each member of any hierarchy in the bus signal (structure) into a variable.
[0088] (Technical 4) The model creation system according to any one of Technical 1 to 3, wherein the creation unit performs the connection by creating a first signal line and a second signal line, the first signal line connects the grouping block and the function block so that the grouped input parameters are input from the grouping block to the function block, and the second signal line connects the function block and the inverse grouping block so that the grouped output parameters are input from the function block to the inverse grouping block.
[0089] According to this, data can be transferred between blocks by directly connecting them with signal lines.
[0090] (Technical 5) The creation unit performs the connection by creating a first tag, a third signal line, a second tag, a fourth signal line, a third tag, a fifth signal line, a fourth tag, and a sixth signal line, the third signal line connects the first tag and the grouping block so that the grouped input parameters are input from the grouping block to the first tag, the fourth signal line connects the second tag and the function block so that the grouped input parameters are input from the second tag to the function block, and the fifth A model creation system according to any one of the technologies 1 to 3, wherein a signal line connects the third tag and the function block so that the grouped output parameters are input from the function block to the third tag, a sixth signal line connects the fourth tag and the inverse grouping block so that the grouped output parameters are input from the fourth tag to the inverse grouping block, the first tag and the second tag are connected by a virtual signal line, and the third tag and the fourth tag are connected by a virtual signal line.
[0091] According to this, data can be transferred between blocks via tags connected by virtual signal lines.
[0092] (Technical 6) The creation unit performs the connection by creating a first storage block, a seventh signal line, a first reference block, an eighth signal line, a second storage block, a ninth signal line, a second reference block, and a tenth signal line, the seventh signal line connects the first storage block and the grouping block so that the grouped input parameters are input from the grouping block to the first storage block, the eighth signal line connects the first reference block and the function block so that the grouped input parameters are input from the first reference block to the function block, and the ninth signal line connects the grouped output parameters from the function block to the second storage block A model creation system according to any one of the techniques 1 to 3, wherein the second storage block and the functionization block are connected so that they are input to the signal line, the tenth signal line is connected to the second reference block and the inverse grouping block so that the grouped output parameters are input from the second reference block to the inverse grouping block, the first storage block and the second storage block are blocks that temporarily store data in a memory area, the first reference block is a block that references the data temporarily stored in the memory area by the first storage block, and the second reference block is a block that references the data temporarily stored in the memory area by the second storage block.
[0093] According to this, data can be passed between blocks by utilizing the storage of data in memory and the retrieval of data stored in memory.
[0094] (Technical 7) A model creation method executed by a model creation system that creates a second model file from a first model file showing a data flow, comprising: determining a functional block from among one or more blocks included in the first model file, determining whether the input parameters and output parameters of the functional block are grouped by parameter elements, decomposing the grouped input parameters and grouped output parameters into a plurality of elements, creating a grouping block into which the plurality of elements decomposed from the grouped input parameters are input and which outputs the grouped input parameters, creating an inverse grouping block into which the grouped output parameters are input and which outputs the plurality of elements decomposed from the grouped output parameters, making connections so that the grouped input parameters are input from the grouping block to the functional block and the grouped output parameters are input from the functional block to the inverse grouping block, and outputting information showing the grouping block, the functional block and the inverse grouping block with the connections made as the second model file.
[0095] This method provides a model creation method that can increase productivity in verifying the equivalence between models and automatically generated code. [Industrial applicability]
[0096] This disclosure can be applied to systems for verifying the equivalence between the operational behavior of a model in model-based development and the code automatically generated from that model. [Explanation of Symbols]
[0097] 100 Model Creation Systems 101 Decision Section 102 Disassembly section 103 Creation Department 200 input model files 201 Function Block 300 Model files to be created 301, 302 Grouping Blocks 303, 304, 305 Reverse grouping blocks 311, 312, 313, 314, 315, 331, 332, 333, 334, 351, 352, 353, 354 signal lines 321, 322, 323, 324 tags 341, 343 Storage Blocks 342, 344 Reference Blocks 400 Automatic Code Generators
Claims
1. A model creation system that creates a second model file from a first model file that shows the data flow, A determination unit that determines a functional block from among one or more blocks included in the first model file, which is a block to be functionalized, A decomposition unit determines whether the input parameters and output parameters of the function block are grouped by parameter elements, and decomposes the grouped input parameters and grouped output parameters into a plurality of elements, A grouping block is created that takes as input multiple elements decomposed from the grouped input parameters and outputs the grouped input parameters, A reverse grouping block is created that takes the grouped output parameters as input and outputs a plurality of elements decomposed from the grouped output parameters. The grouped input parameters are input from the grouping block to the function block, and the grouped output parameters are input from the function block to the inverse grouping block, Information indicating the grouping block, the function block, and the inverse grouping block, for which the aforementioned connections have been made, is output as the second model file. A creation unit, comprising Model creation system.
2. Each of the grouped input parameters and the grouped output parameters is a vector signal, The aforementioned element is a single variable, The model creation system according to claim 1.
3. Each of the grouped input parameters and the grouped output parameters is a bus signal, The aforementioned element is a single variable, The model creation system according to claim 1.
4. The creation unit creates the first signal line and the second signal line, thereby performing the connection. The first signal line connects the grouping block and the function block so that the grouped input parameters are input from the grouping block to the function block. The second signal line connects the function block and the inverse grouping block so that the grouped output parameters are input from the function block to the inverse grouping block. A model creation system according to any one of claims 1 to 3.
5. The creation unit performs the aforementioned connection by creating the first tag, the third signal line, the second tag, the fourth signal line, the third tag, the fifth signal line, the fourth tag, and the sixth signal line. The third signal line connects the first tag and the grouping block so that the grouped input parameters are input from the grouping block to the first tag. The fourth signal line connects the second tag and the function block so that the grouped input parameters are input from the second tag to the function block. The fifth signal line connects the third tag and the function block so that the grouped output parameters are input from the function block to the third tag. The sixth signal line connects the fourth tag and the inverse grouping block so that the grouped output parameters are input from the fourth tag to the inverse grouping block. The first tag and the second tag are connected by a virtual signal line. The third tag and the fourth tag are connected by a virtual signal line. A model creation system according to any one of claims 1 to 3.
6. The creation unit performs the connection by creating the first storage block, the seventh signal line, the first reference block, the eighth signal line, the second storage block, the ninth signal line, the second reference block, and the tenth signal line. The seventh signal line connects the first storage block and the grouping block so that the grouped input parameters are input from the grouping block to the first storage block. The eighth signal line connects the first reference block and the function block so that the grouped input parameters are input from the first reference block to the function block. The ninth signal line connects the second storage block and the function block so that the grouped output parameters are input from the function block to the second storage block. The tenth signal line connects the second reference block and the inverse grouping block such that the grouped output parameters are input from the second reference block to the inverse grouping block. The first storage block and the second storage block are, respectively, blocks that temporarily store data in a memory area. The first reference block is a block that references data temporarily stored in the memory area by the first storage block, The second reference block is a block that references data temporarily stored in the memory area by the second storage block. A model creation system according to any one of claims 1 to 3.
7. A model creation method performed by a model creation system that creates a second model file from a first model file that shows the data flow, From among the one or more blocks included in the first model file, a functional block is determined, which is a block that will be turned into a function. Determine whether the input and output parameters of the function block are grouped by parameter elements, The grouped input parameters and grouped output parameters are each decomposed into a plurality of such elements, A grouping block is created that takes as input multiple elements decomposed from the grouped input parameters and outputs the grouped input parameters, A reverse grouping block is created that takes the grouped output parameters as input and outputs a plurality of elements decomposed from the grouped output parameters. The grouped input parameters are input from the grouping block to the function block, and the grouped output parameters are input from the function block to the inverse grouping block, Information indicating the grouping block, the function block, and the inverse grouping block, for which the aforementioned connections have been made, is output as the second model file. Model creation method.
Citation Information
Patent Citations
Device and method for inspecting connection of electric circuit in electric CAD drawing
JP1997223165A
Log acquiring method and program, and storage medium
JP2004038314A
Program development support device for safety controller
JP2008310478A
Plant model creating system and plant model creation method
JP2011034179A
Source code generation device
JP2015161983A