Abstract:
A computer system having a processor and at least one peripheral has a programmable shared memory system and method that selectively dedicates a first potion of memory to use by the processor and allocates a second portion of memory to shared use by the processor and any peripherals in the system. The programmable memory architecture is implemented using a dual bus architecture having a first-bus connected to the processor and a second bus coupled to the processor by a system controller and to the peripherals by a peripheral controller. The programmable memory architecture additionally has a configuration controller coupled to each configurable memory bank in the system. Each configuration controller is additionally coupled to both the first and second buses. Under programmed control, the each configuration controller couples the associated memory to either the first or second bus, responsive to configuration information stored in the system controller. Memory coupled to the first bus operates as dedicated processor memory and memory coupled to the second bus operates as shared memory, accessible by the processor and any peripherals in the system.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates generally to memory architectures in a computer system and more particularly to architectures for sharing memory among central processing units and peripherals. 
     2. Description of the Related Art 
     Computer system performance and costs are affected by the system&#39;s memory architecture. Some conventional memory architectures have a fixed memory architecture wherein a certain amount of memory is dedicated to and coupled to a central processing unit (CPU) for exclusive use by the CPU while other memory is dedicated to and coupled to a peripheral such as a computer display. One typical configuration has several megabytes of dynamic random access memory (DRAM) dedicated to the CPU and separate DRAM dedicated for use by a peripheral such as a display device. FIG. 1A illustrates this conventional fixed memory architecture. Under the illustrated architecture, a CPU 101 is coupled to a memory 104 by processor bus 102 and system controller 103. Memory 104 is for example, a conventional DRAM bank dedicated for use by the CPU 101. In the illustrated architecture, system controller 103 is also coupled to a peripheral bus 105 such as a peripheral component interconnect (PCI) bus. Peripheral bus 105 couples CPU 101 to a conventional peripheral controller 106. Under this conventional architecture, peripheral controller 106 is coupled to dedicated peripheral memory 107. Thus, memory 104 is dedicated for use by CPU 101 and peripheral memory 107 is dedicated for use by an associated peripheral controller 106. In this architecture, the peripheral memory 107 (such as memory used as a frame buffer for graphics) dedicated to peripheral controller 106 can be quite large and is often times under-utilized if the peripheral associated with peripheral controller 106 does not require use of the entire memory space provided by memory 107. This under utilization of memory degrades system capability and increases the overall memory cost in a computer system. 
     Another conventional memory architecture is a unified memory architecture (UMA). Systems having a unified memory architecture generally have decreased system costs and improved memory utilization. These benefits are realized by eliminating peripheral-dedicated memory. One conventional unified memory architecture is shown in FIG. 1B. The illustrated conventional unified memory architecture has a single shared memory bus 108 for coupling CPU 101 and peripheral controllers 106 to memory 104. The illustrated conventional unified memory architecture additionally has a system controller 103 coupled to memory request outputs of CPU 101 and peripheral controllers 106. System controller 103 arbitrates access of memory 104 by peripheral controllers 106 and CPU 101 to eliminate memory collisions. This memory access arbitration, however, can take several clock cycles and thus degrades system performance. 
     Thus, there is a need for a memory architecture that improves memory utilization, decreases overall system memory requirements and costs and does not degrade system performance. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, there is provided a programmable shared memory system and method that improves memory utilization, decreases overall system memory requirements and costs and does not degrade system performance. The programmable shared memory system and method selectively dedicates a first portion of memory to use by a processor and allocates a second portion of memory to shared use by the processor and any peripherals in the system. The programmable memory architecture is implemented using a dual bus architecture and a plurality of configurable memory banks. The dual bus architecture has a first bus connected to the processor and a second bus coupled to the peripherals by peripheral controllers and also coupled to the processor by a system controller. 
     Also in accordance with the invention, the programmable memory architecture has a configuration controller coupled to each configurable memory bank. Each configuration controller is additionally coupled to both the first and second buses. Under programmed control, each configuration controller couples the associated memory to either the first or second bus, responsive to configuration information stored in the system controller. Memory coupled to the first bus (the processor bus) operates as dedicated processor memory and memory coupled to the second bus (the shared memory bus) operates as shared memory, accessible by the processor and any peripherals in the system. 
     Further in accordance with the invention, the system controller stores a memory configuration control word and arbitrates access of the shared memory to avoid collision on the shared memory bus. Because memory coupled to the processor bus is accessed by only the processor and not by any peripherals, the processor can perform peripheral independent processing simultaneous with peripheral access of the shared memory. 
     In another aspect of the invention, the programmable shared memory system and method dynamically configures the memory during system start-up in response to a received memory configuration request. Thus, responsive to the memory configuration request, a selected amount of system memory is configured as dedicated processor memory and a selected amount of memory is configured as shared memory (accessible by both the host processor and any system peripherals). Under this programmable architecture, the host processor is provided a dedicated memory space in addition to a memory space shared with system peripherals (a shared memory space). 
     Preferably, the memory allocation as between processor-dedicated memory (memory coupled to the processor bus) and shared memory (memory coupled to the shared memory bus) is user-selected on system start-up to achieve efficient system operation given the number of and types of peripheral devices in the system and the amount of physical memory included in the system. 
     In one embodiment, the memory configuration controller includes a data multiplexer, an address multiplexer and a control multiplexer for selectively coupling data, address and control signals associated with each memory to either the processor bus or to the shared memory bus. 
     The features and advantages described in the specification are not all-inclusive, and particularly, many additional features and advantages will be apparent to one of ordinary skill in the art in view of the drawings, specification, and claims hereof. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter, resort to the claims being necessary to determine such inventive subject matter. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1A illustrates a prior art fixed memory architecture; 
     FIG. 1B illustrates a prior art unified memory architecture; 
     FIG. 2 is a functional block diagram of a computer system having a programmable shared memory architecture in accordance with the present invention; 
     FIG. 3 is functional block diagram of a memory configuration controller in accordance with the present invention; 
     FIG. 4 is a functional block diagram of a system controller in accordance with the present invention; and 
     FIG. 5 illustrates an array of registers included in the system controller in accordance with the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 2 illustrates a computer system 200 having a programmable shared memory architecture in accordance with the present invention. Computer system 200 includes a host central processing unit (CPU) 101, a system controller 201, a plurality of memory configuration controllers 202 each coupled to an associated memory (or memory bank) 104, conventional peripheral controllers 106 and a basic input/output system stored in a read only memory (a ROM BIOS) 109. System 200 has a dual bus architecture including a host processor bus (HPB) 203 and a shared memory bus (SMB) 206. Host processor bus 203 couples CPU 101 to the system controller 201 and to each memory configuration controller 202. Shared memory bus 206 is coupled to peripheral controller 106, to the system controller 201 and to each memory configuration controller 202. System 200 additionally preferably includes a PCI bus 205 coupled to each peripheral controller 106 and to the ROM BIOS 109. In the preferred embodiment, there are six banks of memory 104 (thus N=6 in FIGS. 2 and 4). The principles of the present invention apply, however, to systems having a different number of memories 104. 
     In a preferred embodiment, CPU 101 is a Pentium® microprocessor manufactured by Intel Corporation. Other processors such as the &#39;486 microprocessor manufactured by Intel Corporation, the K5 processor manufactured by Advanced Micro Devices, Inc. or the M1 processor manufactured by Cyrix Corporation may alternatively be used. Also in the preferred embodiment, memory 104 is a dynamic random access memory (DRAM) manufactured by NEC Electronics. 
     System controller 201 (described in reference to FIG. 4 below) is preferably a customized application specific integrated circuit having circuit modules for performing system control functions including: (i) providing a bridge interface to PCI bus 105; (ii) storing system configuration information including memory configuration information; (iii) decoding addresses; (iv) controlling cache memory (not shown); (v) providing an interface to each memory 104; and (vi) arbitrating memory access. 
     Peripheral controller 106 is a conventional peripheral device controller and couples to an associated peripheral. ROM BIOS 109 is a conventional read only memory (ROM) device programmed to store a BIOS program in accordance with the present invention. In the illustrated embodiment, HPB 203 and SMB 206 are busses having 64 bit wide data paths. It should be understood, however, that the principles of the present invention apply to systems having other bus widths, other memory types, other memory sizes and other controller configurations. 
     In accordance with the present invention, each of the memories 104 (collectively referred to as &#34;system memory&#34;) are configured to operate as either dedicated host processor memory or as shared memory to be accessed by either a peripheral device (through peripheral controller 106) or the host processor (CPU 101). In one embodiment, the memories 104 are configured during the boot-up (system start-up) process. In other embodiments, the memories are configured during a higher level system or operating system configuration process. For example, in one embodiment with an operating system that provides a window-based user interface, memory set-up occurs during the configuration of the window properties. The specific memory configuration is specified by a user or is programmed based on system parameters such as the total amount of system memory, the types of peripherals coupled to the system 200 and the type of task or tasks to be performed by the system and their corresponding demand on memory. Thus, under programmed control, memory is dynamically allocated as either host processor memory or shared memory. This flexibility in system memory configuration allows for the selecting of the size of each memory space (host processor memory and shared memory) to improve memory utilization given the current peripheral configuration and the type of tasks to be performed. Thus, the programmable memory architecture advantageously provides efficient memory utilization and thus decreases overall system cost without degrading system performance. 
     Referring now again to FIG. 2, CPU 101 configures each memory 104 using system controller 201 and memory configuration controllers 202. On boot-up, a BIOS program is uploaded from the ROM BIOS 109 to local memory on CPU 101. Preferably, the BIOS program performs memory tests, determines the total system memory available in computer system 200 and reports memory availability to a user on a computer display (not shown). Alternatively, memory is configured during a higher level configuration process such as during operating system configuration. In a preferred embodiment, a user is prompted to specify a desired memory allocation as between the amount of memory to dedicate to CPU 101 and the amount to allocate as shared memory, to be shared by CPU 101 and peripheral controller 106. The memory configuration information is written to and stored in system controller 201. System controller 201 is coupled to each memory configuration controller 202 to configure each memory 104 to operate as either dedicated host processor memory or shared memory as selectively programmed by the user. 
     Memory configuration controller 202 has a first input and output (I/O) port coupled to the processor bus, a second I/O port coupled to the shared memory bus and a third I/O port coupled to an associated memory 104. Each memory configuration controller 202 receives a mode select control signal from system controller 201. The mode select signal indicates the particular allocation (shared or dedicated host processor) associated with each memory 104. Responsive to the received mode select signal being in either a first or second digital state, memory configuration controller 202 couples the memory I/O port to either the SMB 206 or to the HPB 203 respectively. In addition to being coupled to a mode select control signal, memory configuration controllers 202 are also coupled to the host memory control outputs of system controller 201 to receive the HMA --  CTRL control signal set and to the shared memory control outputs of system controller 201 to receive the SMA --  CTRL signal set. The mode select, SMA --  CTRL and HMA --  CTRL signals are generated by system controller 201 and are used by memory configuration controller 202 to generate read, write and enable control signals for each associated memory 104. 
     Referring now to FIG. 3, there is shown a functional block diagram of a memory configuration controller 202 in accordance with the present invention. Memory configuration controller 202 has a data router 301, a control multiplexer 302, an address multiplexer 304 and a controller 303. 
     Data router 301 is a multiplexer/selector having first and second I/O ports for selectively coupling to a third I/O port responsive to control signals received from controller 303. The first I/O port is coupled to the HPB 203 and the second I/O port is coupled to SMB 206. Thus, data router 301 couples the data bus associated with memory 104 (and thus memory 104) to either HPB 203 or to SMB 206 in response to the control signals generated by controller 303. 
     Controller 303 is coupled to system controller 201 and receives the HMA --  CTRL, SMA --  CTRL and mode select control signals from the system controller 201. Controller 303 decodes the received control signals to generate a set of control signals to control the operation of data router 301. Specifically, controller 303 generates an output enable (OE) signal and a bus select (SEL) signal. Responsive to the output enable and bus select signals having the following states (as shown in Table 1), the data router is placed in the following modes of operation (also shown in Table 1). 
     
                       TABLE 1______________________________________OE     SEL         Mode of Operation______________________________________0      0           memory not coupled to either bus0      1           memory not coupled to either bus1      0           memory coupled to SMB1      1           memory coupled to HPB______________________________________ 
    
     Controller 303 decodes the HMA --  CTRL, SMA --  CTRL and mode select control signals to generate the output enable (OE) and bus select (SEL) control signals shown in Table 1. The HMA --  CTRL control signals are a set of control signals including a read enable (RD) and a write enable (WR) signal. The SMA --  CTRL control signals also include a read enable (RD) and a write enable (WR) signal. The HMA --  CTRL and SMA --  CTRL control signal sets are determined by the control signals needed to operate memory 104. Other memory types have different control requirements and thus require different control signal sets and different decoding by controller 303. Table 2 illustrates the state of output signals OE and SEL that are generated by controller 303, responsive to the HMA --  CTRL, SMA --  CTRL and mode select control signals generated by system controller 201. 
     
                       TABLE 2______________________________________Mode    HMA.sub.-- CTRL                SMA.sub.-- CTRLSelect  RD      WR       RD    WR     OE   SEL______________________________________0       *       *        0     0      0    *0       *       *        0     1      1    00       *       *        1     0      1    01       0       0        *     *      0    *1       0       1        *     *      1    11       1       0        *     *      1    1______________________________________ 
    
     The mode select signal has a first state (a digital &#34;0&#34; or low state) where the SMB 206 is selected and has a second state (a digital &#34;1&#34; or a high state) where the HPB 203 is selected. When the SMA 206 bus is selected (mode select=0), the HMA --  CTRL control signals are not used to generate the OE and SEL signals and thus the HMA --  CTRL control signals are shown as don&#39;t care (*) states in Table 2. Similarly, when the HPB 203 is selected (mode select=1), the SMA --  CTRL control signals are not used to generate the OE and SEL signals and thus the SMA --  CTRL control signals are shown as don&#39;t care (*) states in Table 2. 
     Control multiplexer 302 is a multiplexer/selector having first and second I/O ports for selectively coupling to a third I/O port responsive to a mode select control signal. The first I/O port is coupled to the HMA --  CTRL control signals (received from system controller 201) and the second I/O port is coupled to the SMA --  CTRL control signals (also received from system controller 201). Thus, control multiplexer 302 couples the control inputs associated with memory 104 to either the HMA --  CTRL or the SMA --  CTRL control signals, in response to the mode select signal being in either a first or second state, for example a digital &#34;1&#34; or a digital &#34;0&#34;. 
     Similarly, address multiplexer 304 is a multiplexer/selector having first and second I/O ports, that are selectively configured to couple to a third I/O port in response to a control signal. The first I/O port is coupled to the HMA --  Addr signals generated by system controller 201, the second I/O port is coupled to the SMA --  Addr signals also generated by system controller 201 and the third I/O port is coupled to the address inputs of memory 104. Thus, address multiplexer 304 couples the address inputs associated with memory 104 to either the HMA --  Addr address signals or to the SMA --  Addr address signals responsive to the state of the mode select signal generated by system controller 201. 
     FIG. 4 illustrates a system controller 201 in accordance with the present invention. System controller 201 includes a CPU interface 401 adapted to couple to CPU 101 and further adapted to provide an interface between system controller 201 and CPU 102. System controller 201 also includes a DRAM buffer 402 coupled to the CPU interface 401 for read and write buffering of information received from or being written to either a peripheral controller 106 or memory 104. DRAM buffer 402 is coupled to the PCI bus 105 via bridge 405 and buffers 406, 407 to enable buffering of information being written to or read from a peripheral. DRAM buffer 402 is additionally coupled to SMB 206 to enable buffering of information being written to or read from memory 104 that has been configured as shared memory. 
     System controller 201 also includes a configuration register 414 coupled to the CPU 101 by bridge 405 and the CPU interface 401. Configuration register 414 receives and stores system configuration information including cache information, PCI interface information and memory configuration data. In the preferred embodiment, configuration register 414 is an array of 8 bit wide registers. FIG. 5 illustrates an array of registers that relate to memory configuration and that are included in configuration register 414 in accordance with the present invention. 
     Register 501 is a mode select register for storing the status of the selected mode (shared or host) for each memory 104. Bits 0-5 of register 501 each correspond to a memory 104. Table 3 shows the decoding of register 501. 
     
                       TABLE 3______________________________________Bit   Default     Function______________________________________7:6   0h          Reserved.5     0           1: Bank 5 is on the host bus.             0: Bank 5 is on the shared memory bus.4     0           1: Bank 4 is on the host bus.             0: Bank 4 is on the shared memory bus.3     0           1: Bank 3 is on the host bus.             0: Bank 3 is on the shared memory bus.2     0           1: Bank 2 is on the host bus.             0: Bank 1 is on the shared memory bus.1     0           1: Bank 1 is on the host bus.             0: Bank 1 is on the shared memory bus.0     0           1: Bank 0 is on the host bus.             0: Bank 0 is on the shared memory bus.______________________________________ 
    
     A bit having a first state (a digital &#34;0&#34; or a low state) indicates that shared mode is selected for the corresponding memory 104. A bit having a second state (a digital &#34;1&#34; or a high state) indicates that host mode is selected for the corresponding memory 104. Bits 6 and 7 of register 501 are not used in the system. Output bits 0-5 of register 501 each form a static mode select signal that is coupled to each memory configuration controller 202. 
     Register 502 is a memory status register for storing the stating (whether memory is present and enabled) of system memory. The decoding of register 502 is shown in Table 4. 
     
                       TABLE 4______________________________________Bit    Default        Function______________________________________7:6    Oh             Reserved.5      0              Bank 5                 1: Enabled and Present                 0: Disabled or not Present4      0              Bank 4                 1: Enabled and Present                 0: Disabled or not Present3      0              Bank 3                 1: Enabled and Present                 0: Disabled or not Present2      0              Bank 2                 1: Enabled and Present                 0: Disabled or not Present1      0              Bank 1                 1: Enabled and Present                 0: Disabled or not Present0      0              Bank 0                 1: Enabled and Present                 0: Disabled or not Present______________________________________ 
    
     In the preferred embodiment, bits 0-5 each correspond to a bank of memory (such as memory 104) which may be used in the system. A bit having a first state indicates that the corresponding bank of memory 104 is present and enabled and a bit having a second state indicates that the corresponding bank of memory 104 is either not present or not enabled. 
     Registers 503-505 store information indicating the size of each memory 104. The decoding of registers 503-505 are shown in Tables 5, 6 and 7. 
     
                       TABLE 5______________________________________Register 503Bit     Default        Function______________________________________7       0              Reserved.6:4     Oh             Bank 5 SDRAM Size                  000: 1Mx16 SDRAM                  001: 2Mx8 SDRAM                  010: 4Mx4 SDRAM                  others: reserved3       0              Reserved.2:0     Oh             Bank 4 SDRAM Size                  000: 1Mx16 SDRAM                  001: 2Mx8 SDRAM                  010: 4Mx4 SDRAM                  others: reserved______________________________________ 
    
     
                       TABLE 6______________________________________Register 504Bit     Default        Function______________________________________7       0              Reserved.6:4     Oh             Bank 3 SDRAM Size                  000: 1Mx16 SDRAM                  001: 2Mx8 SDRAM                  010: 4Mx4 SDRAM                  others: reserved3       0              Reserved.2:0     Oh             Bank 2 SDRAM Size                  000: 1Mx16 SDRAM                  001: 2Mx8 SDRAM                  010: 4Mx4 SDRAM                  others: reserved______________________________________ 
    
     
                       TABLE 7______________________________________Register 505Bit     Default        Function______________________________________7       0              Reserved.6:4     Oh             Bank 1 SDRAM Size                  000: 1Mx16 SDRAM                  001: 2Mx8 SDRAM                  010: 4Mx4 SDRAM                  others: reserved3       0              Reserved.2:0     Oh             Bank 0 SDRAM Size                  000: 1Mx16 SDRAM                  001: 2Mx8 SDRAM                  010: 4Mx4 SDRAM                  others: reserved______________________________________ 
    
     Configuration register 414 is also coupled to cache controller 411, to a host DRAM controller 408, to a shared DRAM controller 409 and to address and command decoder 410. 
     The host and shared DRAM controllers, 408 and 409 respectively are coupled to the configuration register 414 and to the address and command decoder 410 to receive configuration control and decoded address information. Host and shared DRAM controller 408 and 409 each manage DRAM functions by generating the appropriate read, write and refresh signals for the associated memory 104. 
     The shared memory DRAM controller 409 is coupled to each memory configuration controller 202 and generates control signals for configuring each memory configuration controller 202 to couple associated memory 104 to the shared memory bus 206. Shared DRAM controller 409 additionally generates read and write control signals responsive to the type of memory access (read or write) requested by either CPU 101 or by a peripheral controller 106. 
     The host DRAM controller 408 is coupled to each memory configuration controller 202 and generates control signals for configuring each memory configuration controller 202 to couple the associated memory 104 to the host processor bus 203. Host DRAM controller 408 additionally generates read and write control signals responsive to the type of memory access (read or write) requested by CPU 101. 
     Address and command decoder 410 is coupled to bridge 405 and to configuration register 414. Address and command decoder 410 has a host memory decoder and a shared memory decoder. The host memory decoder decodes the address received from bridge 405 to determine whether the address corresponds to host processor memory or to shared memory. If, at the start of a new memory access cycle, address and command decoder 410 determines that the address corresponds to host memory, address and command decoder 410 generates a trigger control signal to activate host DRAM controller 408. If, at the start of a new memory cycle, address and command decoder 410 determines that the address corresponds to shared processor memory, address and command decoder 410 generates a trigger control signal to activate shared DRAM controller 409. 
     Address and command decoder 410 additionally generates HMA --  CTRL and SMA --  CTRL control signal sets, each coupled to each memory configuration controller 202. 
     System controller 201 additionally includes a PCI master interface 406 and a PCI slave interface 407. PCI master interface 406 is a conventional PCI bus interface adapted to interface with PCI bus masters. PCI master interface 406 preferably includes a read prefetch buffer and a write buffer. PCI slave interface 407 is a conventional PCI bus interface adapted to interface with PCI slave peripherals. 
     System controller 201 preferably also includes a cache controller 411 for controlling any RAM cache 412 with associated tag RAM 413 optionally included in the system. 
     System controller 201 also includes an arbitration unit 403. Arbitration unit 403 is coupled to shared DRAM controller 409 and to each peripheral controller 106. Arbitration unit 403 receives a memory request signal generated by each peripheral controller 106 when memory access is needed. Arbitration unit 403 determines which requesting bus master is granted access to the shared memory. After selecting a bus master for access grant, arbitration unit 403 sends a &#34;GRANT&#34; signal back to the corresponding peripheral controller 106. 
     Thus during operation, for example a first memory 104 may be configured to operate as dedicated host processor memory while the remaining memories 104 are configured to operate as shared memory. With this configuration, the CPU 101 accesses the first memory 104 without requiring arbitration, as no memory collision can occur with dedicated host processor memory. Simultaneous to CPU 101 accessing first memory 104, peripherals can access any of the shared memory 104. Thus, while CPU 101 is performing peripheral independent operations, and thus is accessing only dedicated host memory, peripherals having bus master capability can independently access shared memory. 
     The foregoing discussion discloses and describes merely exemplary methods and embodiments of the present invention. As will be understood by those familiar with the art, the invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.