U.S. patent application entitled, “Microcontroller Programmable System on a Chip,” application Ser. No. 10/033,027, filed on Oct. 22, 2001, inventor Warren Snyder, is hereby incorporated herein by reference.
1. Field of the Invention
The present invention relates to the field of programming and configuring programmable electronic devices. More particularly, the present invention relates to using a design system for (i) displaying choices for user-selected functions; (2) displaying choices for where and how to implement the selected function; and (3) automatically generating computer code, that when executed, will configure the electronic device to perform the selected function.
2. Related Art
A microcontroller is an integrated circuit device (“chip”) composed of functional units or “blocks,” input/output pins, internal busses and programmable interconnections among these components. Many of these configurable components can be programmed to perform a specific function or connect to another specific sub-system by loading a particular bit pattern into a particular register in the actual chip. Recently, a microcontroller having programmable analog and digital blocks has been introduced.
In addition, a microcontroller also has a central processing unit (“CPU”) and a memory system for storing data and instructions. The CPU and the memory system can interact with a programmable block, e.g., a configurable component, by reading and writing registers associated with that component. The configurable blocks are therefore programmed by setting their configuration registers with certain values. Thus, by writing a program for the CPU, a user can specify the function the configurable component will perform as well as the connections among configurable components. The user can also write programs that interact with the configurable components once those components have been initialized. The programs also do this by reading and writing registers associated with the configurable components.
Configuring and programming a microcontroller requires specifying and setting an enormous number of bits. It is common for engineers who need to configure and program a microcontroller to develop and use software for that purpose such as design tools, databases, assemblers, compilers, linkers, and debuggers. However, conventional microcontroller programming and configuring requires that the engineer incorporate the literal binary codes and addresses associated with the configurable components into the microcontroller source code.
This conventional technique therefore requires many manual steps and is error-prone and tedious. In other words, if a designer wants to program a configurable block to implement a circuit, then the designer manually determines the configuration registers of the hardware resource. The circuit designer then manually develops code to program those registers in such a way to realize the circuit (e.g., an amplifier). The designer then has to manually write code to operate the circuit in the desired fashion, e.g., give the amplifier a specific gain, etc. When dealing with physical addresses of configuration registers and the specific configuration data needed to program them, the data and information are often expressed as a series of numbers in decimal and/or hexadecimal and/or binary formats. Unfortunately, these numbers and number formats are very complex and hard to read and remember. Any small error in syntax, or a typographical error, or a transposition error can be fatal for the overall program. Manual programming and mapping leads to such errors.
Accordingly, what is needed is a design system for automatically generating source code that incorporates configuration information for the programming of hardware resources to implement and program circuits. What is needed is such a system that can be used to program programmable electronic devices, e.g., microcontrollers. What is needed yet is a system and method for automatically generating source code to program hardware resources once a designer selects a desired circuit design and a hardware resource to implement that circuit design. The present invention provides these advantages and others not specifically mentioned above but described in sections to follow.
A method and system of automatically generating assembly code (or other source code) for configuring a programmable microcontroller are presented. Source code files are automatically generated for: (1) realizing the user module in a hardware resource; and also (2) to configure the user module to behave in a prescribed manner.
The method involves displaying virtual blocks in a computerized design system where the virtual blocks correspond to programmable circuit blocks in a programmable electronic device, e.g., a microcontroller chip. The user selects a user module (e.g., a circuit design) that defines a particular function to be performed on the microcontroller. The user module is represented, in part, by XML data which defines the way in which configuration registers need to be programmed in order to implement the circuit design thereon. The user then assigns or allocates virtual blocks to the user module, e.g., “placement of the user module.” The programmable hardware resources include both programmable analog blocks and programmable digital blocks. A user module may span multiple blocks. The hardware resources are also represented, in part, by XML data defining the physical addresses of the configuration registers.
The design system then automatically generates source code for configuring the programmable blocks to perform the desired function. This process involves a mapping of the XML data from the user module and from the selected hardware resources. The source code can then be assembled, linked and loaded into the microcontroller's memory system. When executed on the microcontroller, the executable code will then set configuration registers within the blocks to implement the function.
Two different types of configuration are discussed herein with respect to the user module. Automatic generation of source code for “personalization” of a user module is the process (performed by embodiments of the present invention) of generating source code that sets configuration registers to implement or “realize” the circuit design in the hardware resource, e.g., to implement an amplifier circuit. On the other hand, automatic generation of source code for “parameterization” of a user module is the process (performed by embodiments of the present invention) of generating source code that sets configuration registers to cause an already implemented circuit design to behave in particular way, or to adopt some characteristic, e.g., to program the amplifier with a particular gain, etc., or to make some clocked digital circuit level sensitive or edge sensitive, etc.
More specifically, an embodiment of the present invention is directed to a method (and computer system) for generating assembly code to configure a microcontroller with programmable circuit blocks, the method comprising: displaying a collection of virtual blocks in a design system with each virtual block in the collection corresponding to a programmable block in the microcontroller; selecting a user module defining a function; assigning a virtual block taken from the collection to the user module; and automatically constructing a source code table file comprising configuration information for a programmable block of the microcontroller corresponding to the virtual block wherein the configuration information is used to cause the programmable block to implement the function.
Embodiments include the above and wherein the function can be a timer, a counter, an analog-to-digital converter, a digital-to-analog converter, a pulse-width modulator, a signal amplifier, or a serial communication unit.
Embodiments include the above and wherein the design system computes a register address for the programmable block corresponding to the virtual block assigned to the user module, devising a symbolic name for that register address and placing the symbolic name into a table file, an include file or an assembly code file.
In the following detailed description of the present invention, a design system providing automatic source code generation for personalization and parameterization of user modules, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be obvious to one skilled in the art that the present invention may be practiced without these specific details. In other instances well known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects of the present invention.
Some portions of the detailed descriptions that follow are presented in terms of procedures, steps, logic blocks, processing, and other symbolic representations of operations on data bits that can be performed on computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. A procedure, computer executed step, logic block, process, etc., is here, and generally, conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those utilizing physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing terms such as “checking,” “comparing,” “accessing,” “processing,” “computing,” “suspending,” “resuming,” “translating,” “calculating,” “determining,” “scrolling,” “displaying,” “recognizing,” “executing,” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
Aspects of the present invention, a design system for automatically generating assembly code to configure a microcontroller, are discussed in terms of steps executed on a computer system. Although a variety of different computer systems can be used with the present invention, an exemplary computer system 112 is shown in
Exemplary computer system 112 comprises an address/data bus 100 for communicating information, a central processor 101 coupled with the bus for processing information and instructions, a volatile memory 102 (e.g., random access memory) coupled with the bus 100 for storing information and instructions for the central processor 101 and a non-volatile memory 103 (e.g., read only memory) coupled with the bus 100 for storing static information and instructions for the processor 101. Computer system 112 also includes a data storage device 104 (“disk subsystem”) such as a magnetic or optical disk and disk drive coupled with the bus 100 for storing information and instructions and a display device 105 coupled to the bus 100 for displaying information to the computer user.
Also included in computer system 112 is an alphanumeric input device 106 including alphanumeric and function keys coupled to the bus 100 for communicating information and command selections to the central processor 101. Generally, alphanumeric input device 106 is called a keyboard or keypad. System 112 also includes a cursor control or directing device 107 coupled to the bus for communicating user input information and command selections to the central processor 101. Within the context of the present invention, the cursor directing device 107 can include a number of implementations including a mouse device, for example, a trackball device, a joystick, a finger pad (track pad), an electronic stylus, an optical beam directing device with optical receiver pad, an optical tracking device able to track the movement of a user's finger, etc., or any other device having a primary purpose of moving a displayed cursor across a display screen based on user displacements.
Computer system 112 of
In a preferred embodiment, a computer implemented design system provides the capability of automatically generating source code that, when compiled or assembled, linked and loaded, initializes, specifies and controls configurable elements within a programmable electronic device, e.g., a microcontroller to perform a user-selected function.
In a preferred embodiment of a microcontroller, some of the configurable elements are grouped into programmable blocks (“blocks”). The blocks can be grouped into families. Every block in the same family is substantially analogous. In a preferred embodiment, there is a family of blocks supporting analog functions and a family of blocks supporting digital functions. Each block has one or more registers. Each block can be programmed to perform different functions and connect to other blocks by specifying values for each configuration register in the block. This initial specification of the components is typically performed as soon as the microcontroller “boots-up”. This is referred to as “personalization” of the microcontroller to realize a user module design in selected hardware resources. In addition, a block can be configured to have registers that are used to adjust, control or measure the performance of the personalized block. This is referred to as “parameterization.”
US patent application entitled, “Microcontroller Programmable System on a Chip,” having Ser. No. 10/033,027, filed on Oct. 22, 2001, inventor Warren Snyder, is hereby incorporated herein by reference and describes such a programmable microcontroller.
In general, the design system 310 models the actual configurable elements and blocks found in microcontroller 200 with corresponding virtual elements and blocks. In the discussion that follows, the term “block” as used in context of a design system means “virtual block,” while the same term used in the context of a microcontroller means an actual block or “hardware resource.”
More specifically, a user module is the collection of information necessary to implement a particular function using one or more generic blocks. This would include the specific values that need to be loaded into a block's registers to implement the circuit design. The design system can load the information about user modules from a file when the design system is initialized. In one embodiment, the information necessary to represent a user module is formatted using XML data.
In step 710, one or more assembly code files are generated for each instance of a user module. Each file is constructed from a data file, e.g, a template file, by substituting the symbolic names constructed in step 700 for generic names in the template file. A sample portion of a template file is shown in
In step 720, one or more assembly code files are generated that refer to all of the user modules (“global files”). These can include assembly code table files, include files, header files, as well as interrupt service routine code. These files can also be generated from a template file.
The preferred embodiment of the present invention, a system and method for automatically generating assembly code to configure programmable elements of a microcontroller, is thus described. While the present invention has been described in particular embodiments, it should be appreciated that the present invention should not be construed as limited by such embodiments, but rather construed according to the below claims.
Number | Name | Date | Kind |
---|---|---|---|
4061987 | Nagahama | Dec 1977 | A |
4134073 | MacGregor | Jan 1979 | A |
4138671 | Comer et al. | Feb 1979 | A |
4272760 | Prazak et al. | Jun 1981 | A |
4344067 | Lee | Aug 1982 | A |
4689740 | Moelands et al. | Aug 1987 | A |
4692718 | Roza et al. | Sep 1987 | A |
4827401 | Hrustich et al. | May 1989 | A |
4868525 | Dias | Sep 1989 | A |
4947169 | Smith et al. | Aug 1990 | A |
5050168 | Paterson | Sep 1991 | A |
5128871 | Schmitz | Jul 1992 | A |
5140197 | Grider | Aug 1992 | A |
5150079 | Williams et al. | Sep 1992 | A |
5155836 | Jordan et al. | Oct 1992 | A |
5175884 | Suarez | Dec 1992 | A |
5200751 | Smith | Apr 1993 | A |
5202687 | Distinti | Apr 1993 | A |
5258760 | Moody et al. | Nov 1993 | A |
5304955 | Atriss et al. | Apr 1994 | A |
5319370 | Signore et al. | Jun 1994 | A |
5331571 | Aronoff et al. | Jul 1994 | A |
5345195 | Cordoba et al. | Sep 1994 | A |
5371860 | Mura et al. | Dec 1994 | A |
5399922 | Kiani et al. | Mar 1995 | A |
5414308 | Lee et al. | May 1995 | A |
5426378 | Ong | Jun 1995 | A |
5428319 | Marvin et al. | Jun 1995 | A |
5430687 | Hung et al. | Jul 1995 | A |
5438672 | Dey | Aug 1995 | A |
5440305 | Signore et al. | Aug 1995 | A |
5479643 | Bhaskar et al. | Dec 1995 | A |
5546433 | Tran et al. | Aug 1996 | A |
5552748 | O'Shaughnessy | Sep 1996 | A |
5557762 | Okuaki et al. | Sep 1996 | A |
5559502 | Schutte | Sep 1996 | A |
5563526 | Hastings et al. | Oct 1996 | A |
5574892 | Christensen | Nov 1996 | A |
5590354 | Klapproth et al. | Dec 1996 | A |
5594734 | Worsley et al. | Jan 1997 | A |
5600262 | Kolze | Feb 1997 | A |
5604466 | Dreps et al. | Feb 1997 | A |
5614861 | Harada | Mar 1997 | A |
5630102 | Johnson et al. | May 1997 | A |
5633766 | Hase et al. | May 1997 | A |
5670915 | Cooper et al. | Sep 1997 | A |
5680070 | Anderson et al. | Oct 1997 | A |
5684434 | Mann et al. | Nov 1997 | A |
5689196 | Schutte | Nov 1997 | A |
5699024 | Manlove et al. | Dec 1997 | A |
5703871 | Pope et al. | Dec 1997 | A |
5710906 | Ghosh et al. | Jan 1998 | A |
5745011 | Scott | Apr 1998 | A |
5781747 | Smith et al. | Jul 1998 | A |
5828693 | Mays et al. | Oct 1998 | A |
5870004 | Lu | Feb 1999 | A |
5870345 | Stecker | Feb 1999 | A |
5872464 | Gradinariu | Feb 1999 | A |
5880598 | Duong | Mar 1999 | A |
5889936 | Chan | Mar 1999 | A |
5898345 | Namura et al. | Apr 1999 | A |
5903718 | Marik | May 1999 | A |
5939949 | Olgaard et al. | Aug 1999 | A |
5968135 | Teramoto et al. | Oct 1999 | A |
5982229 | Wong et al. | Nov 1999 | A |
6018559 | Azegami et al. | Jan 2000 | A |
6140853 | Lo | Oct 2000 | A |
6144327 | Distinti et al. | Nov 2000 | A |
6157270 | Tso | Dec 2000 | A |
6166367 | Cho | Dec 2000 | A |
6188975 | Gay | Feb 2001 | B1 |
6191660 | Mar et al. | Feb 2001 | B1 |
6202044 | Tzori | Mar 2001 | B1 |
6211741 | Dalmia | Apr 2001 | B1 |
6225866 | Kubota et al. | May 2001 | B1 |
6249167 | Oguchi et al. | Jun 2001 | B1 |
6263302 | Hellestrand et al. | Jul 2001 | B1 |
6272646 | Rangasayee | Aug 2001 | B1 |
6294962 | Mar | Sep 2001 | B1 |
6304101 | Nishihara | Oct 2001 | B1 |
6314530 | Mann | Nov 2001 | B1 |
6332201 | Chin et al. | Dec 2001 | B1 |
6338109 | Snyder et al. | Jan 2002 | B1 |
6356862 | Bailey | Mar 2002 | B2 |
6369660 | Wei | Apr 2002 | B1 |
6377646 | Sha | Apr 2002 | B1 |
6434187 | Beard | Aug 2002 | B1 |
6445211 | Saripella | Sep 2002 | B1 |
6460172 | Insenser Farre et al. | Oct 2002 | B1 |
6507214 | Snyder | Jan 2003 | B1 |
6525593 | Mar | Feb 2003 | B1 |
6535946 | Bryant et al. | Mar 2003 | B1 |
6542025 | Kutz et al. | Apr 2003 | B1 |
6553057 | Sha | Apr 2003 | B1 |
6560306 | Duffy | May 2003 | B1 |
6563391 | Mar | May 2003 | B1 |
6567426 | van Hook et al. | May 2003 | B1 |
6575373 | Nakano | Jun 2003 | B1 |
6598178 | Yee et al. | Jul 2003 | B1 |
6601236 | Curtis | Jul 2003 | B1 |
6603330 | Snyder | Aug 2003 | B1 |
6604179 | Volk et al. | Aug 2003 | B2 |
6608472 | Kutz et al. | Aug 2003 | B1 |
6611220 | Snyder | Aug 2003 | B1 |
6611276 | Muratori et al. | Aug 2003 | B1 |
6614320 | Sullam et al. | Sep 2003 | B1 |
6664978 | Kekic et al. | Dec 2003 | B1 |
6667642 | Moyal | Dec 2003 | B1 |
6681280 | Miyake et al. | Jan 2004 | B1 |
6718533 | Schneider et al. | Apr 2004 | B1 |
6765407 | Snyder | Jul 2004 | B1 |
6771552 | Fujisawa | Aug 2004 | B2 |
6784821 | Lee | Aug 2004 | B1 |
6798299 | Mar et al. | Sep 2004 | B1 |
6823282 | Snyder | Nov 2004 | B1 |
6823497 | Schubert et al. | Nov 2004 | B2 |
6825689 | Snyder | Nov 2004 | B1 |
6854067 | Kutz et al. | Feb 2005 | B1 |
6859884 | Sullam | Feb 2005 | B1 |
6865429 | Schneider et al. | Mar 2005 | B1 |
6868500 | Kutz et al. | Mar 2005 | B1 |
6892310 | Kutz et al. | May 2005 | B1 |
6892322 | Snyder | May 2005 | B1 |
6898703 | Ogami et al. | May 2005 | B1 |
6901563 | Ogami et al. | May 2005 | B1 |
6910126 | Mar et al. | Jun 2005 | B1 |
6950954 | Sullam et al. | Sep 2005 | B1 |
6952778 | Snyder | Oct 2005 | B1 |
6957242 | Snyder | Oct 2005 | B1 |
6967511 | Sullam | Nov 2005 | B1 |
6981090 | Kutz et al. | Dec 2005 | B1 |
6996799 | Cismas et al. | Feb 2006 | B1 |
7005933 | Shutt | Feb 2006 | B1 |
7023257 | Sullam | Apr 2006 | B1 |
7055035 | Allison et al. | May 2006 | B2 |
7086014 | Bartz et al. | Aug 2006 | B1 |
7092980 | Mar et al. | Aug 2006 | B1 |
7103108 | Beard | Sep 2006 | B1 |
7127630 | Snyder | Oct 2006 | B1 |
7149316 | Kutz et al. | Dec 2006 | B1 |
7150002 | Anderson et al. | Dec 2006 | B1 |
7180342 | Shutt et al. | Feb 2007 | B1 |
7185162 | Snyder | Feb 2007 | B1 |
7185321 | Roe et al. | Feb 2007 | B1 |
7221187 | Snyder et al. | May 2007 | B1 |
7283151 | Nihei et al. | Oct 2007 | B2 |
7386740 | Kutz et al. | Jun 2008 | B2 |
7406674 | Ogami et al. | Jul 2008 | B1 |
20020108006 | Snyder | Aug 2002 | A1 |
20020121679 | Bazarjani et al. | Sep 2002 | A1 |
20020156998 | Casselman | Oct 2002 | A1 |
20040054821 | Warren et al. | Mar 2004 | A1 |
Number | Date | Country |
---|---|---|
0308583A2 | Mar 1989 | EP |
368398 | May 1990 | EP |
0450863A2 | Oct 1991 | EP |
0499383A2 | Aug 1992 | EP |
0639816A2 | Feb 1995 | EP |
1170671A1 | Jan 2002 | EP |
1205848 | May 2002 | EP |
1191423A2 | Feb 2003 | EP |
404083405 | Mar 1992 | JP |
405055842 | Mar 1993 | JP |
06021732 | Jan 1994 | JP |
404095408 | Mar 2002 | JP |
9532478 | Nov 1995 | WO |
PCTUS9617305 | Jun 1996 | WO |
PCTUS9834376 | Aug 1998 | WO |
PCTUS9909712 | Feb 1999 | WO |