Abstract:
A pseudo dual-port memory device is disclosed. One embodiment provides an internal data RAM for a microprocessor, and a method for operating a memory device. In one embodiment, a memory device for a microprocessor or microcontroller comprises: a first part with memory cells that are single-port memory cells; and a second part with memory cells that are dual-port memory cells. In another embodiment, a method for operating a memory device is provided, the memory device including at least one single-port memory and at least one dual-port memory, the method including: accessing the single-port memory of the memory device when a non-conflicting access is to be carried out at the memory device; and accessing the dual-port memory of the memory device when a conflicting access is to be carried out at the memory device.

Description:
BACKGROUND 
       [0001]    The invention relates to a memory device, in particular, an internal data RAM (iRAM) for a microcontroller or microprocessor, to a microcontroller or microprocessor system, and to a method for operating a memory device. 
         [0002]    Conventional microcontroller or microprocessor systems include one or several CPUs (central processing units). The CPU(s) are connected to one or several memory devices, e.g., a program memory, and a data memory, etc. 
         [0003]    The memory devices may be provided on the same chip, as the CPU(s) (“embedded” microcontroller or microprocessor system, with respective “internal” memories), or alternatively separately from the CPU(s). 
         [0004]    The program memory e.g., may store the sequence of instructions to be executed by the CPU(s)—i.e., the program—, and the data memory e.g., respective variables, e.g., variables to be changed by the CPU(s) when executing the program. 
         [0005]    In the case of conventional memory devices, in particular conventional semiconductor memory devices, one differentiates between functional memory devices (e.g., PLAs, PALs, etc.), and table memory devices, e.g., ROM devices (ROM=Read Only Memory)—in particular PROMs, EPROMs, EEPROMs, flash memories, etc.—, and RAM devices (RAM=Random Access Memory or read-write memory), e.g., DRAMs and SRAMs. 
         [0006]    In conventional microcontroller or microprocessor systems, as data memory, e.g., a RAM device is used, for instance, an internal dual-port SRAM device with e.g., up to 256 byte or more storage capacity. Alternatively, instead, e.g., an array of flip-flops may be used as data memory. 
         [0007]    A RAM device is a memory for storing data under a predetermined address and for reading out the data under this address again later. 
         [0008]    Since as many memory cells as possible are to be accommodated in a RAM device, one has been trying to realize them as simple as possible. 
         [0009]    In the case of SRAMs (SRAM=Static Random Access Memory), the individual memory cells consist e.g., of few, for instance 4 transistors for the storing of data (in addition to 2 access transistors), and in the case of DRAMs (DRAM=Dynamic Random Access Memory) in general only of one single, correspondingly controlled capacitive element (e.g., a trench capacitor) with the capacitance of which one bit can be stored as charge. 
         [0010]    This charge, however, remains for a short time only. Therefore, a “refresh” must be performed regularly, e.g., approximately every 64 ms. 
         [0011]    In contrast to that, no “refresh” has to be performed in the case of SRAMs, i.e. the data stored in the memory cell remains stored as long as an appropriate supply voltage is fed to the SRAM. 
         [0012]    As the above, in conventional microcontroller or microprocessor systems, as a data memory, e.g., a dual-port SRAM device might be used. A dual-port SRAM (DPSRAM) is a type of SRAM that allows multiple reads or writes to occur at the same time, or nearly the same time, unlike a single-port SRAM which only allows one access at a time. The memory cells of a dual-port SRAM e.g., include 8 transistors, i.e., require more space than single-port SRAM memory cells. 
         [0013]    Hence, sometimes it is tried to use SRAMs with single-port memory cells for the implementation of dual-port functionality (“pseudo dual-port SRAMs”, such as e.g., described in U.S. Pat. No. 6,259,648 B1, U.S. Pat. No. 6,778,462 B1, U.S. Pat. No. 6,288,970 B1, US 2004/0190364 A1, JP 9081449A1). 
         [0014]    For instance, SRAMs with a partitioned array, and single-port memory cells may be used. Such SRAMs may be provided with two (external) SRAM ports; if the two ports simultaneously attempt to access the same partition (“collision”), then one of the accesses must be delayed. 
         [0015]    However, the extra code required due to the partitioning, and the above collision detection lead to relatively high costs. 
         [0016]    Further, an SRAM with single-port memory cells might be used, which is accessed at twice the speed of an external clock. Such an SRAM may be provided with two (external) SRAM ports; the first SRAM port might be accessed during the first portion of the clock cycle, and the second SRAM port during the second portion of the clock cycle. However, in this technique, an SRAM with relatively high speed performance is required. 
         [0017]    For these or other reasons, there is a need for the present invention. 
       SUMMARY 
       [0018]    According to one embodiment of the invention, a memory device for a microprocessor or microcontroller includes a first part with memory cells that are single-port memory cells and a second part with memory cells that are dual-port memory cells. 
         [0019]    According to a further embodiment, a method for operating a memory device is provided. The memory device includes at least one single-port memory and at least one dual-port memory. The method includes accessing the single-port memory of the memory device when a non-conflicting access is to be carried out at the memory device and accessing the dual-port memory of the memory device when a conflicting access is to be carried out at the memory device. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0020]    The accompanying drawings are included to provide a further understanding of embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain principles of embodiments. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale relative to each other. Like reference numerals designate corresponding similar parts. 
           [0021]      FIG. 1  illustrates a schematic, exemplary representation of an electronic system, including a memory in accordance with one embodiment. 
           [0022]      FIG. 2  illustrates a more detailed representation of the CPU and the data memory illustrated in  FIG. 1 . 
       
    
    
     DETAILED DESCRIPTION 
       [0023]    In the following Detailed Description, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. In this regard, directional terminology, such as “top,” “bottom,” “front,” “back,” “leading,” “trailing,” etc., is used with reference to the orientation of the Figure(s) being described. Because components of embodiments can be positioned in a number of different orientations, the directional terminology is used for purposes of illustration and is in no way limiting. It is to be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present invention. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims. 
         [0024]    It is to be understood that the features of the various exemplary embodiments described herein may be combined with each other, unless specifically noted otherwise. 
         [0025]      FIG. 1  illustrates a schematic, exemplary representation of an electronic system  1  including a memory  6  in accordance with one embodiment. 
         [0026]    In accordance with one embodiment, the memory  6  is arranged on the same semiconductor chip, as the corresponding microcontroller or microprocessor  3 , or a corresponding microcontroller or microprocessor chip, respectively. 
         [0027]    In alternative, not illustrated embodiments, the memory  6  may also be arranged separately from the microcontroller or microprocessor  3 , in particular on a (further) chip that is provided separately from the microcontroller or microprocessor  3 . 
         [0028]    The microcontroller or microprocessor  3  may include one single Central Processing Unit  8  (CPU), or CPU “core”. Alternatively, the microcontroller or microprocessor  3  may include several Central Processing Units  8 ,  9 , e.g., two or four Central Processing Units  8 ,  9 , etc. 
         [0029]    The Central Processing Unit or Units  8 ,  9  may be connected to the memory  6  via one or several respective bus systems  10 . 
         [0030]    Apart from the memory  6 , the microcontroller or microprocessor system  1  may include one or several additional memories  7 , also connected to the Central Processing Unit  8  or Units  8 ,  9 . 
         [0031]    The (additional) memory  7  or memories may also be provided on the same chip, as the memory  6  and/or Central Processing Unit  8  or Units  8 ,  9 , or in alternative, not illustrated embodiments, may be arranged on a separate chip. 
         [0032]    The memory  7  e.g., may serve as program memory, and the memory  6  e.g., as internal data memory. 
         [0033]    The program memory  7  e.g., may store the sequence of instructions to be executed by the CPU(s)—i.e., the program—, and the data memory  6  e.g., respective variables, e.g., variables to be changed by the CPU(s) when executing the program. 
         [0034]    As program memory  7 , e.g., an appropriate, non-volatile memory device, e.g., an EPROM (Erasable PROM) or EEPROM (Electrically Erasable PROM), in particular e.g., a flash EEPROM, may be used. Alternatively, a RAM (RAM=Random Access Memory), in particular e.g., a DRAM (DRAM=Dynamic Random Access Memory), may be used as program memory  7 . 
         [0035]    Further, in the present embodiment, and as will be described in further detail below, the data memory  6  is formed by a special pseudo multi-port memory  6 , here: a specially designed pseudo multi-port internal data RAM (iRAM (RAM=Random Access Memory)). 
         [0036]    In particular, and as will be described in further detail below, the data memory  6  may include a RAM  6   a , in particular a SRAM  6   a  (SRAM=Static Random Access Memory)—or several RAMs, in particular, SRAMs. In addition, the data memory  6  in the present embodiment includes one or a plurality of flip-flops  6   b.    
         [0037]    The data memory  6  in total may e.g., include a storage capacity of e.g., between 64 byte and 2048 byte, in particular, for instance between 128 byte and 512 (or 1024 byte), e.g., about 320 byte or 256 byte, etc., or any other suitable storage capacity. 
         [0038]    The flip-flop(s)  6   b  may be comprised in a respective array, and e.g., may include a storage capacity of e.g., between 1 byte and 32 byte (or 64 byte), or e.g., between 2 byte and 16 byte (or 8 byte), e.g., a storage capacity of 2×4 byte (or e.g., 4×4 byte or e.g., 4×2 byte, etc.), or any other suitable storage capacity. 
         [0039]    The array of flip-flop(s)  6   b  is dual-ported, in particular, allows multiple reads or writes to occur at the same time, or substantially the same time. 
         [0040]    In one or more embodiments, instead of the dual-ported array of flip-flops  6   b , other suitable dual-port memory devices may be used, e.g., an SRAM with dual-ported SRAM memory cells. 
         [0041]    As the above, the data memory  6  in addition to the flip-flop(s)  6   b  includes one or a plurality of RAMs  6   a , in particular, one or a plurality of SRAMs  6   a . The RAM  6   a , in particular SRAM  6   a  includes a plurality of memory cells, arranged in respective rows and columns. Each of the memory cells of the RAM or SRAM  6   a  may be single-port memory cells. Hence, the RAM or SRAM  6   a  is a single-port RAM or SRAM  6   a , respectively, with each of the memory cells of the RAM or SRAM  6   a  only allowing one access at a time. 
         [0042]    As is illustrated in  FIG. 2 , a clock signal (CLK-signal) is provided via respective lines  11   a ,  11   b ,  11   c  to both the Central Processing Unit  8  (CPU) (CPU “core”), and the data memory  6 . 
         [0043]    The Central Processing Unit  8  (CPU), or CPU “core” may e.g., be an 8051 or an 8051 compatible CPU core, e.g.,—as in the present embodiment—an 8051 compatible CPU core of Infineon®, or any other suitable CPU core. 
         [0044]    The above instructions to be executed by the Central Processing Unit  8  (CPU), or CPU “core” may e.g., be 1, 2, or 3 bytes long (or longer), and may take e.g., 1, 2 or 4 CPU cycles to execute. 
         [0045]    A CPU machine cycle of the Central Processing Unit  8  (CPU), or CPU “core” may e.g., include two clock periods, defined by the above clock signal (CLK-signal). 
         [0046]    Memory accesses to the data memory  6  may take place during one or both phases of the machine cycle. 
         [0047]    As the above, the Central Processing Unit  8  is connected to the data memory  6  (here: the above pseudo multi-port internal data RAM  6  (iRAM)) via the above bus system  10 . 
         [0048]    To read data from the data memory  6 /pseudo multi-port internal data RAM  6  (here: the single-port SRAM  6   a  or the dual-ported array of flip-flops  6   b ) (“read access”), a signal /RE (Read Enable) on a line  10   c  of the bus system  10  is activated by the Central Processing Unit  8 . 
         [0049]    In response thereto, the memory location of the data memory  6  addressed by an address signal Addr R  (Address, Read) provided on respective lines  10   a  of the bus system  10  will be read, and the data stored at the memory location will be sent via a respective data signal Data R  (Data, Read) on respective lines  10   b  of the bus system  10  from the data memory  6  to the Central Processing Unit  8 . 
         [0050]    Correspondingly similar, to write data into the data memory  6 /pseudo multi-port internal data RAM  6  (here: the single-port SRAM  6   a  or the dual-ported array of flip-flops  6   b ) (“write access”), a signal /WE (Write Enable) on a line  10   f  the bus system  10  is activated by the Central Processing Unit  8 . 
         [0051]    In response thereto, data sent via a respective data signal Data W  (Data, Write) on respective lines  10   e  of the bus system  10  from the Central Processing Unit  8  to the data memory  6  will be stored at the memory location of the data memory  6  addressed by an address signal Addr W  (Address, Write) provided on respective lines  10   d  of the bus system  10 . 
         [0052]    Analysis indicated that all data memory  6 /(pseudo multi-port) internal data RAM (iRAM)  6  access related instructions can e.g., be classified according to (Infineon® nomenclature used): 
         [0053]    the addressing mode:
       Rn accesses, e.g., ADD A, Rn   Direct iRAM accesses, e.g., ADD A, dir   Direct iRAM bit accesses, e.g., ANL C, bit   Stack accesses, e.g., PUSH, dir   Indirect memory accesses via Ri, e.g., ADD A, @Ri       
 
         [0059]    and/or the iRAM accessing type:
       Read only, e.g., MOV A, dir   Write only, e.g., MOV R0, A   Read_Modify_Write, e.g., INC Rn   Read and Write, e.g., MOV dir, dir   Read Ri, then one of the above accesses, e.g., MOV A, @Ri       
 
         [0065]    and/or the iRAM access times within an instruction cycle:
       One time accesses, e.g., read or write, e.g., ADDC A, Rn   Two times accesses, e.g., read and write, e.g., XCH A, dir   Three times accesses, e.g., read, read and write, e.g.,       
 
         [0069]    XCH A, @Ri 
         [0070]    Further analysis indicated that: 
         [0071]    The iRAM is accessed as dual-port memory only with one read access and one write access simultaneously; 
         [0072]    All iRAM access related instructions could be executed individually in a single-port iRAM without resource conflict if a NOP was added between each instruction in the instruction flow; in this case, there would not be any resource conflict any more; 
         [0073]    Except instructions with an @Ri, all other iRAM access related instructions are executed only within their own respective instruction cycle; 
         [0074]    All indirect addressing instructions are actually converted into direct addressing instructions when the instruction cycles are started; 
         [0075]    Except Ri early fetching and RET/RETI, a normal iRAM read access happens only in the first phase of a cycle, and a write access happens only in the second phase of a cycle; 
         [0076]    Within the instruction cycle of an instruction, as a maximum 2 times an iRAM access occurs; the access mode can only be read only, write only or read and write. 
         [0077]    From the above, it follows that an iRAM resource conflict—where at the same time (or the same clock period or periods, defined by the above clock signal (CLK-signal)) a read access and a write access occurs—only happens in a special case (“conflict case”): with an indirect addressing instruction when in its previous instruction there is a write access to the iRAM. 
         [0078]    In the present embodiment, in the above “conflict case”, the above dual-port memory device  6   b  (here: the dual-ported array of flip-flops  6   b ) of the data memory  6  is accessed, but not the single-port RAM  6   a , in particular single-port SRAM  6   a  of the data memory  6 . 
         [0079]    As the array of flip-flops  6   b  is dual-ported, at the same time or substantially the same time (or the same clock period or periods), a read and a write access might be carried out. Therefore, in the “conflict case”, the signal /RE (Read Enable) on the line  10   c  of the bus system  10 , and the signal /WE (Write Enable) on the line  10   f  the bus system  10  might be activated simultaneously or substantially simultaneously (or at the same clock period or periods). Further, the memory location of the array of flip-flops  6   b  from which data is to be read out might be indicated by a respective address signal Addr R  (Address, Read) provided on the lines  10   a  of the bus system  10 , and—at the same time or substantially the same time—the memory location of the array of flip-flops  6   b  into which data is to be written might be indicated by a respective address signal Addr W  (Address, Write) provided on the lines  10   d  of the bus system  10 . Hence, the above conflict is solved. 
         [0080]    In all other cases (“non-conflict cases”), instead of the dual-ported array of Flip-Flops  6   b , the above single-port RAM  6   a , in particular single-port SRAM  6   a  of the data memory  6  is accessed. 
         [0081]    In more detail, in the “non-conflict case”,—depending on whether a read or a write access is to be carried out at a particular time (or a particular clock period or periods, defined by the above clock signal (CLK-signal))—either the signal /RE (Read Enable) on the line  10   c  of the bus system  10  is activated, but not the signal /WE (Write Enable) on the line  10   f  the bus system  10 , or the signal /WE (Write Enable) on the line  10   f  the bus system  10 , but not the signal /RE (Read Enable) on the line  10   c  of the bus system  10 . 
         [0082]    Further,—also depending on whether a read or a write access is to be carried out at the particular time/the particular clock period or periods—either the memory location of the single-port RAM  6   a , in particular single-port SRAM  6   a  from which data is to be read out is indicated by a respective address signal Addr R  (Address, Read) provided on the lines  10   a  of the bus system  10 , or the memory location of the single-port RAM  6   a , in particular single-port SRAM  6   a  into which data is to be written is indicated by a respective address signal Addr W  (Address, Write) provided on the lines  10   d  of the bus system  10 . 
         [0083]    The sequence of instructions stored in the program memory  7  may be programmed such to ensure that in the above conflict case, the dual-ported array of flip-flops  6   b  of the data memory  6  is accessed (as described above), and in the non-conflict case, the single-port RAM  6   a /SRAM  6   a  of the data memory  6  is accessed (as also described above). 
         [0084]    Alternatively, in the conflict case, the address/addresses accessed by the respective instruction(s) may be mapped from a memory location/memory locations that form(s) part of the single-port RAM  6   a /SRAM  6   a  of the data memory  6  to an address addresses of (a) memory location(s) that form(s) part of the dual-ported array of flip-flops  6   b . This e.g., might be achieved by a corresponding conflict detection and address mapping logic provided in the CPU  8 , or any other suitable control circuitry. 
         [0085]    Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that a variety of alternate and/or equivalent implementations may be substituted for the specific embodiments shown and described without departing from the scope of the present invention. This application is intended to cover any adaptations or variations of the specific embodiments discussed herein. Therefore, it is intended that this invention be limited only by the claims and the equivalents thereof.