Method for programming a software module associated with a firmware unit of a device

By introducing a namespace into a register transfer-level program and linking it with the namespace of the software module, the time-consuming and error-prone problem of manual generation of register interface modules is solved, and the rapid development of software modules and the accuracy of register operations are achieved.

CN115885252BActive Publication Date: 2025-03-25SIMENS INDASTRI SOFTVEAR INK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202080103467.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-28
Publication Date
2025-03-25
Estimated Expiration
2040-08-28

AI Technical Summary

Technical Problem

In the prior art, manual generation of register interface modules is time-consuming and prone to manual errors, resulting in incorrect register writing operations, resulting in unauthorized rewriting of register values.

Method used

By introducing a namespace into a register transfer-level program and linking it with the namespace of the software module, the software module allows the software module to directly reference register variables, avoiding dependence on the register interface module.

Benefits of technology

The rapid and error-free development of software modules is achieved, which significantly reduces the possibility of manual errors in the register interface module and improves the accuracy of register operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115885252B_ABST
    Figure CN115885252B_ABST
Patent Text Reader

Abstract

The present disclosure describes a method for programming a software module associated with a firmware unit of a device. The method includes obtaining a register transfer level program associated with the firmware unit, the register transfer level program including a plurality of register variables indicating a plurality of registers in the firmware unit, the plurality of register variables being defined within a first namespace of the register transfer level program; and linking the first namespace associated with the register transfer level program to a namespace associated with the software module for referencing at least one register variable from the plurality of register variables. The register transfer level program includes a design level description of one or more operations associated with the firmware unit in a high-level programming language.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the design and programming of firmware, and more particularly, to register transfer level based firmware design using high-level synthesis tools. High-level synthesis tools enable programmers to use high-level languages ​​such as System C or ANSI C / C++ to provide high-level descriptions of one or more operations associated with relevant firmware units. From these high-level descriptions, the high-level synthesis tools can then generate production quality RTL, which can then be used to generate lower-level representations and ultimately the actual wiring of the firmware units. Background Art

[0002] The present invention relates to the design and programming of the firmware unit (also referred to as firmware module) of the device. Generally, the development of software for firmware devices occurs in two stages. In the first stage, the operations to be performed by the firmware are described using RTL (register transfer level) modules by the programmer. After creating the RTL module, the programmer must manually create a register module (also referred to as a register interface module) for the corresponding RTL module to implement register read and write operations. The register interface module includes the definition of the register address, bit offset and bit width of each configuration in the RTL module. In the second stage, one or more application programming interfaces related to the RTL module are developed. During this stage, the programmer uses the register interface module to enable the API to access (i.e., read and write) registers. In addition, the programmer needs to define the software using the register interface module. In this software, the register address and bit mask identical to those in the register interface module are required.

[0003] Currently, the manual generation of register interface modules is time consuming and prone to manual errors. The programmer must define the register address and bit mask for each configuration in the RTL module. Errors in the register interface module may lead to incorrect write operations, which result in unauthorized rewriting of the values ​​in the registers. Therefore, a method and apparatus for solving the above problems are needed. Summary of the invention

[0004] Thus, the present invention describes a method, a programming device and a non-transitory storage medium that addresses the above aspects.

[0005] Therefore, the present invention describes a method for programming a software module associated with a firmware unit of a device. The method includes obtaining a register transfer level program associated with the firmware unit, the register transfer level program including a plurality of register variables indicating a plurality of registers in the firmware unit, the plurality of register variables being defined within a first namespace of the register transfer level program; and linking the first namespace associated with the register transfer level program to a namespace associated with the software module for referencing at least one register variable of the plurality of register variables. The register transfer level program includes a design level description of one or more operations associated with the firmware unit in a high-level programming language.

[0006] By introducing a namespace in a register transfer level program using a high-level language and by linking the namespace of the register transfer level program with the namespace of the software module, the present invention allows the programmer of the software module to directly reference the register variables defined and used in the register transfer level program without a register interface module. Therefore, since the development of the software module is no longer dependent on the register interface module, the present invention provides fast and error-free development of the software module.

[0007] In one example, the method further comprises generating a register interface module based on a plurality of register variables of the register transfer level program. Thus, by automating the generation of the register interface, the possibility of manual errors in the register interface is significantly reduced. In one example, the method is performed using a high-level synthesis tool.

[0008] In one example, the method further comprises converting the description of one or more operations in the register transfer level program from a high-level programming language into a hardware description language associated with the firmware unit. Thus, the converted register module of the hardware description language can be directly used by any firmware simulation tool.

[0009] In one example, the register interface module is based on at least one of a header file and a source file. In one example, the software module includes one or more of a top module and an application programming interface. In one example, the high-level programming language is a class-based programming language.

[0010] In another aspect, the present invention describes a programming device for programming a software module associated with a firmware unit of an industrial device. The programming device includes one or more processors connected to a memory module. The one or more processors are configured to obtain a register transfer level program associated with the firmware unit, the register transfer level program including a plurality of register variables indicating a plurality of registers in the firmware unit, the plurality of register variables being defined within a first namespace of the register transfer level program, and linking the first namespace associated with the register transfer level program to a namespace associated with the software module for referencing at least one register variable of the plurality of register variables. The register transfer level program includes a design level description of one or more operations associated with the firmware unit in a high-level programming language.

[0011] On the other hand, the present invention describes a non-volatile storage medium for programming a software module associated with a firmware unit of a device. The non-volatile storage medium includes a plurality of instructions, which, when executed by one or more processors, cause the one or more processors to obtain a register transfer level program associated with the firmware unit, the register transfer level program including a plurality of register variables indicating a plurality of registers in the firmware unit, the plurality of register variables being defined within a first namespace of the register transfer level program; and linking the first namespace associated with the register transfer level program to a namespace associated with the software module for referencing at least one of the plurality of register variables. The register transfer level program includes a design-level description of one or more operations associated with the firmware unit in a high-level programming language. The advantages of the method are applicable to the devices described herein. These aspects are Figure 1-Figure 4 Further described in . BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The following detailed description refers to the accompanying drawings, in which:

[0013] Figure 1 A programming environment for a device including firmware units and software modules is shown;

[0014] Figure 2 A method for programming a software module associated with a firmware unit of a device is shown;

[0015] Figure 3 An example register transfer level program and example modules that reference register variables from the register transfer level program are shown; and

[0016] Figure 4 A programming device for programming software modules associated with a firmware unit of a device is shown. DETAILED DESCRIPTION

[0017] Figure 1A programming environment 100 for a device 120 (also referred to as an industrial device 120) is shown. The device 120 includes a software module 125 and a firmware unit 127. The design and programming of the firmware unit 127 is performed using a high-level synthesis tool 110. A programmer uses the high-level synthesis tool 110 to develop one or more register transfer level programs (in Figure 1 Each register transfer level program includes a definition and description of one or more operations to be performed by the firmware unit 127 of the device 120. Each register transfer level program is written using a high-level programming language such as ANSI C++.

[0018] In addition, the high-level synthesis tool 110 is connected to a programming tool (not shown in the figure). The programming tool is developing a software module 125. The software module here refers to one or more programs, software codes, etc. related to the device 120, and includes a graphical user interface, an application programming interface, other firmware programs, etc. The software module 125 performs one or more functions in coordination with the firmware unit 127 of the device 120. Therefore, the software module 125 is connected to the firmware unit 127 to call operations in the firmware unit 127 and receive inputs from the firmware unit 127. At this point, during the software module 125, the programmer can refer to one or more variables or functions defined in the RTL program associated with the firmware unit 127. In order to ensure easy access, the namespace of the RTL program and the namespace of the software module 125 are included so that the register variables (also called signal variables) defined in the RTL program can be easily referenced. This will refer to Figure 2 Further explanation.

[0019] Figure 2 A method 200 for programming a software module 125 associated with a firmware unit 127 of a device 120 is shown. The method 200 can be performed by a high-level synthesis tool 110 together with a programming tool. The method 200 includes obtaining a register transfer level program 115 associated with the firmware unit 127. The register transfer level program 115 includes a plurality of operations and functions in a high-level language that are performed by the firmware unit 127. These functions and operations indicate register variables for receiving input values, processing to be performed on the input values, and register variables to store intermediate and final output values. Each register variable corresponds to a corresponding register in the firmware unit 127.

[0020] Since the register transfer level program 117 is written in a high-level programming language, the register transfer level program 117 includes one or more namespaces in which register variables and functions are defined and described. In one example, the high-level programming language is a class-based programming language that allows namespace and class inheritance and hierarchy. The use of namespaces is well known in the prior art and in the present invention involves one or more hierarchical organizations of functions and variables so that all functions and register variables have unique names within the namespaces to which they belong. This uses Figure 3 The example register transfer level program 310 provided in FIG.

[0021] The register transfer level program 310 is an example register transfer level program, and defines a header file "top_module_H". In addition, a top module class is also defined in the register transfer level program 310. Therefore, within the register transfer level program 310, a namespace associated with the top module class is generated. All functions and variables within the class definition of the top module are unique within the namespace and can be referenced using the namespace of the class and the name of the function or variable being referenced. For example, as shown in the figure, the register transfer level program 310 defines a register variable "sRst" for resetting the register transfer level program, and "en" for enabling the register transfer level program.

[0022] Then, at step 220, the first namespace associated with the register transfer level program is linked to the namespace associated with the software module 125 for referencing at least one of the plurality of register variables. In one example, the linking is accomplished by using an operator such as include or import, whereby the contents of the header file are included in the software module development. This uses Figure 3 The example module 320 provided in the example is further explained.

[0023] The example module 320 is an example program associated with the software module 125 of the device 120. The example module 320 relies on one or more register variables declared in the example register-level program 310. Therefore, in order to reference these register variables, the example module 320 includes or imports the header file 'top_module_H' using the include operator. By including the header file, the linking of the execution namespace as mentioned above is performed, so the example module 320 can reference the register variable by creating an instance of the top module class. For example, as shown in the figure, the example module 320 can reference the register variable sRst using the linking of the above-mentioned namespace.

[0024] In one embodiment, the high-level synthesis tool 110 can generate a register interface module 117 based on multiple register variables of the register transfer level program 115. In this example, one or more register variables defined in the register transfer level program can be manually selected by the programmer from a variable list, and the high-level synthesis tool is configured to automatically generate a bit mask for the register transfer level program. In this example, the register interface module 117 is based on at least one of a header file and a source file, and can be automatically linked or included with other software files.

[0025] In one embodiment, a high-level synthesis tool in cooperation with one or more compilers associated with the firmware unit 127 is capable of converting a description of one or more operations in the register transfer level program 115 from a high-level programming language into a hardware description language associated with the firmware unit, such as VERILOG.

[0026] The present invention may take the form of a computer program product including program modules accessible from a computer-usable or computer-readable medium storing program code used by or in conjunction with one or more computers, processing units, or instruction execution systems. For example, methods 200 and 300 may be implemented on one or more programming devices.

[0027] Thus, the present invention describes a programming device 400 for programming software modules associated with a firmware unit of a device. The programming device 400 includes an I / O interface 410 and one or more processors 420 configured to execute a plurality of instructions (433, 436) stored on a memory module or non-transitory storage medium 430. The I / O interface 510 is used to receive input from a programmer for writing or developing a register transfer level program. In addition, via the I / O interface 510, the programming device 400 can be connected to other devices that can host an associated programming environment.

[0028] When executing the namespace link instruction 433, the one or more processors 420 are configured to obtain a register transfer level program associated with the firmware unit, the register transfer level program including a plurality of register variables representing a plurality of registers in the firmware unit, the register variables being defined in a first namespace of the register transfer level program, and linking the first namespace associated with the register transfer level program to a namespace associated with the software module for referencing at least one of the plurality of register variables. The register transfer level program includes a design level description of one or more operations associated with the firmware unit in a high-level programming language. When executing the register interface module generation instruction 436, the one or more processors 420 generate a register interface module based on the plurality of register variables of the register transfer level program.

[0029] For the purposes of this description, a computer-usable or computer-readable non-transitory storage medium may be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The medium may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or its own propagation medium, since signal carriers are not included in the definition of physical computer-readable media, which include semiconductor or solid-state memory, magnetic tape, removable computer disk, random access memory (RAM), read-only memory (ROM), rigid magnetic disks, and optical disks, such as compact disk read-only memory (CD-ROM), compact disk read / write, and DVD. The processing units and program codes used to implement each aspect of the present technology may be centralized or distributed (or a combination thereof) as known to those skilled in the art.

[0030] Although the present disclosure has been described with reference to a few industrial devices, a plurality of industrial devices may be utilized in the context of the present disclosure. Although the present disclosure has been described in detail with reference to certain embodiments, it should be understood that the present disclosure is not limited to those embodiments. In view of the present invention, it will be apparent to those skilled in the art that many modifications and variations will occur without departing from the scope of the various embodiments of the present disclosure as described herein. Therefore, the scope of the present disclosure is specified by the appended claims rather than by the foregoing description. All changes, modifications and variations within the meaning and range of equivalence of the claims should be considered within their scope. All advantageous embodiments claimed for protection in the method claims may also be applied to the device / non-transient storage medium claims.

Claims

1. A method (200) of programming a software module (125) associated with a firmware unit (127) of a device (120), the method (200) comprising: a. obtaining a register transfer level program (115) associated with the firmware unit (127), the register transfer level program (115) comprising a plurality of register variables indicating a plurality of registers in the firmware unit (127), the plurality of register variables being defined within a first namespace of the register transfer level program (115); as well as b. linking the first namespace associated with the register transfer level program (115) to the namespace associated with the software module (125) to reference at least one register variable from the plurality of register variables; The register transfer level program (115) includes a design level description of one or more operations associated with the firmware unit (127) in a high-level programming language.

2. The method (200) according to claim 1, wherein: The register transfer level program (115) further includes a header file, and wherein linking the first namespace associated with the register transfer level program to the namespace associated with the software module (125) further includes using an operator that includes contents of the header file into the software module (125), and wherein the operator is one of an import operator and an include operator.

3. The method (200) according to claim 1, wherein: The method (200) also includes generating a register interface module (117) based on the plurality of register variables of the register transfer level program (115).

4. The method (200) according to claim 1, wherein: The method (200) is performed using a high-level synthesis tool (110).

5. The method (200) according to claim 1, wherein: The method (200) also includes converting the design-level description of the one or more operations in the register transfer level program (115) from the high-level programming language to a hardware description language associated with the firmware unit (127).

6. The method (200) according to claim 3, wherein: The register interface module (117) is based on at least one of a header file and a source file.

7. The method (200) according to any one of claims 1 to 6, wherein: The software module (125) includes one or more of a top module and an application programming interface (130).

8. The method (200) according to any one of claims 1 to 6, wherein: The high-level programming language is a class-based programming language.

9. A programming device (400) for programming a software module (125) associated with a firmware unit (127) of an industrial device (120), the programming device (400) comprising: a. One or more processors (420) connected to a memory module (430), the one or more processors (420) being configured to: i. obtaining a register transfer level program (115) associated with the firmware unit (127), the register transfer level program (115) comprising a plurality of register variables indicating a plurality of registers in the firmware unit (127), the plurality of register variables being defined within a first namespace of the register transfer level program (115); as well as ii. linking the first namespace associated with the register transfer level program (115) to the namespace associated with the software module (125) to reference at least one register variable from the plurality of register variables, The register transfer level program (115) includes a design level description of one or more operations associated with the firmware unit (127) in a high-level programming language.

10. A non-transitory storage medium (430) for programming a software module (125) associated with a firmware unit (127) of a device (120), the non-transitory storage medium (430) comprising a plurality of instructions (433) which, when executed by one or more processors (420), cause the one or more processors (420) to: a. obtaining a register transfer level program (115) associated with the firmware unit (127), the register transfer level program (115) comprising a plurality of register variables indicating a plurality of registers in the firmware unit (127), the plurality of register variables being defined within a first namespace of the register transfer level program (115); and b. linking the first namespace associated with the register transfer level program (115) to the namespace associated with the software module (125) for referencing at least one of the register variables from the plurality of register variables; in, The register transfer level program (115) includes a design level description in a high-level programming language of one or more operations associated with the firmware unit (127).

11. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method for implementing efficient entropy decoder by using high level synthesis

    CN106507698A