Abstract:
A method and apparatus for optimizing sample fetching in a peripheral component interconnect (PCI) environment. In one embodiment the present invention generates a sample page base address corresponding to a first part of a first address received from a digital signal processor (DSP). The generated sample page base address is then stored in a sample page base address cache which can be accessed by the DSP without accessing a PCI bus. The first part of the first address is compared to a first part of a second address. Provided that the first part of the first address and the first part of the second address are the same, the present invention combines a second portion of the second address sent from the DSP with the generated sample page base address stored in the sample page base address cache. In so doing, the present invention generates a complete address of a sample to be fetched without accessing the PCI bus.

Description:
TECHNICAL FIELD 
     The present claimed invention relates to the field of sample fetching. More specifically, the present claimed invention relates to fetching wavetable samples in a peripheral component interconnect (PCI) environment. 
     BACKGROUND OF THE INVENTION 
     Wavetable audio is a widely used and well known technique in the audio processing art for generating or recreating audio sounds. In the past, an audio processing component such as, for example, an audio card would have dedicated read only memory (ROM) associated therewith. Audio samples referred to as &#34;wavetable samples&#34; would be stored in the dedicated ROM. In order to recreate a particular sound (typically referred to as a &#34;voice&#34;), the audio card fetched the desired wavetable samples from the dedicated ROM, processed the sample, and created the desired voice. Commonly, numerous samples have to be fetched and processed in order to create a desired voice. Although dedicated ROM facilitates the rapid acquisition of numerous wavetable samples, permanently dedicating a specific portion of memory to a particular application is not always a cost effective or desired implementation. 
     Some prior art approaches to wavetable audio now store the avetable samples in system memory, for example, dynamic random access memory (DRAM). By storing the wavetable samples in system DRAM, the need to have a permanently dedicated memory space allocated for audio processing purposes is eliminated. That is, a particular memory space can be allocated storing wavetable samples at one time, and can then be used for another purpose at a different time. Also, by storing the wavetable samples in system memory, more space is available to store the samples. The use of system memory for storing wavetable samples is not without complications, however. In order to access wavetable samples stored in system memory, the digital signal processor of the audio card must access a PCI bus. 
     As shown in Prior Art FIG. 1A, when dedicated ROM is used to store the wavetable samples, the DSP 10 directly accesses the dedicated ROM 12. On the other hand, as shown in Prior Art FIG. 1B, DSP 10 must first access a PCI bus 14 before accessing wavetable samples stored in system memory 16. Thus, in such an instance, the DSP must request access to the PCI bus, receive a grant to the PCI bus, and traverse the PCI bus in order to fetch a wavetable sample from system memory. Such required actions prolong the sample fetching time, thus increasing audio processing latency. As a result, the quality of generated audio voices can suffer. 
     Additionally, wavetable samples stored in system memory are typically stored in a discontiguous manner. That is, in dedicated ROM applications, for example, an entire megabyte of wavetable samples is stored in a single contiguous block of memory space. In system memory applications, however, wavetable samples are typically stored in numerous discontiguous blocks of memory space. The numerous discontiguous blocks of memory space are referred to as &#34;sample pages&#34;. With reference now to Prior Art FIG. 1C, a schematic diagram showing numerous wavetable sample pages, typically shown as 18, is given. By storing the numerous wavetable sample pages in separate discontiguous blocks of memory space, the sample pages can be stored in various locations within the system memory. In so doing, the need to allocate or reserve a single large contiguous block of system memory solely for wavetable samples is eliminated. Hence, effective use of the system memory is achieved. 
     Although, storing wavetable samples in various discontiguous locations permits effective use of system memory, such an approach necessitates an intricate addressing scheme. Referring now to Prior Art FIG. 2, a schematic diagram of a conventional architecture employed to fetch wavetable samples from system memory is shown. In the prior art architecture of Prior Art FIG. 2, a DSP 10, of Prior Art FIGS. 1A-1C, generates an address 200 corresponding to a respective wavetable sample. A sample page address table (SPAT) base address register 202 is disposed to receive part of address 200. An adder 204 then combines a SPAT base address with the received part of address 200. The combined address points to a particular location in a SPAT 206 residing in system memory. SPAT 206, in turn provides a sample page base address. The sample page base address points to the base of a particular wavetable sample page, typically shown as 208, residing in system memory. Thus, DSP 10 must access a PCI bus 14, of Prior Art FIGS. 1B and 1C, in order to fetch the base address of a given sample page. Hence, prior art schemes require &#34;one trip&#34; across PCI bus 14 simply to fetch the base address of a sample page. 
     Referring still to Prior Art FIG. 2, after the sample page base address has been fetched, another adder 210 combines the sample page base address with a sample page offset address. The sample page offset address comprises another portion of address 200 generated by DSP 10 of Prior Art FIGS. 1A-1C. The combined sample page base address and sample page offset address point to a particular entry in one of the wavetable sample pages, typically shown as 208. Thus, DSP 10 is then able to fetch a particular entry from the collection of wavetable sample pages 208. As mentioned above, wavetable sample pages 208 reside in system memory. Thus, after generating the complete wavetable sample page entry address, DSP 10 must make yet another trip across PCI bus 14 of Prior Art FIGS. 1B and 1C in order to fetch a respective wavetable sample page entry. Therefore, prior art sample fetching schemes require a first trip across a PCI bus to fetch a sample page base address, and then a second trip across the PCI bus to fetch a desired wavetable sample page entry. Hence, prior art sample fetching methods require at least two trips across a PCI bus. As mentioned above, each of the trips across the PCI bus requires the DSP to request access to the PCI bus, receive a grant to the PCI bus, and then traverse the PCI bus. Furthermore, if the grant to the PCI bus is lost, interrupted, or otherwise deasserted before the DSP has successfully fetched either the sample page base address or the wavetable sample page entry, the DSP must again regain access to the PCI bus. As a result, it is possible in prior art sample fetching schemes, that more than two trips across the PCI bus will be required to fetch a single wavetable sample page entry. 
     Additionally, it will be understood by those of ordinary skill in the art that a DSP will typically desire to consecutively fetch several wavetable sample page entries. As a result, the sample fetching latency incurred by repeatedly accessing the PCI bus can become a performance limiting factor. 
     Thus, a need exists for an apparatus and method which expedites sample fetching from system memory. A further need exists for an apparatus and method which decreases the need to access a PCI bus when fetching samples from system memory. 
     SUMMARY OF THE INVENTION 
     The present invention provides a method and apparatus which expedites sample fetching from system memory, and which decreases the need to access a PCI bus when fetching samples from system memory. The present invention accomplishes the above achievements with a method and apparatus which utilizes a localized cache memory to store the most-recently used sample page table address. 
     Specifically, in one embodiment, the present invention generates a sample page base address corresponding to a first part of a first address received from a digital signal processor (DSP). The generated sample page base address is then stored in a sample page base address cache which can be accessed by the DSP without accessing a PCI bus. The first part of the first address is compared to a first part of a second address. Provided that the first part of the first address and the first part of the second address are the same, the present invention combines a second portion of the second address sent from the DSP with the generated sample page base address stored in the sample page base address cache. In so doing, the present invention generates a complete address of a sample to be fetched without accessing the PCI bus. 
     The present invention also describes in detail the apparatus for performing the steps of the above described method. 
     These and other advantages of the present invention will no doubt become obvious to those of ordinary skill in the art after having read the following detailed description of the preferred embodiments which are illustrated in the various drawing figures. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The accompanying drawings, which are incorporated in and form a art of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention: 
     Prior Art FIG. 1A is a schematic diagram of a conventional wavetable sample storing configuration in which a DSP has dedicated memory allotted thereto. 
     Prior Art FIG. 1B is a schematic diagram of a conventional wavetable sample storing configuration in which a DSP must access a PCI bus before accessing wavetable samples stored in system memory. 
     Prior Art FIG. 1C is a schematic diagram of the conventional wavetable sample storing configuration of Prior Art FIG. 1B in which numerous discontiguous wavetable sample pages are stored in system memory. 
     Prior Art FIG. 2 is a schematic diagram of a conventional architecture employed to fetch wavetable samples from system memory. 
     FIG. 3 is a schematic diagram of an architecture employed to expedite the fetching of wavetable samples from system memory in accordance with one embodiment of the present claimed invention. 
     FIGS. 4A and 4B comprise a flow chart of steps performed in accordance with the present claimed invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Reference will now be made in detail to the preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. While the invention will be described in conjunction with the preferred embodiments, it will be understood that they are not intended to limit the invention to these embodiments. On the contrary, the invention is intended to cover alternatives, modifications and equivalents, which may be included within the spirit and scope of the invention as defined by the appended claims. Furthermore, in the following detailed description of the present invention, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be obvious to one of ordinary skill 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. 
     With reference now to FIG. 3, a schematic diagram of an architecture employed to expedite the fetching of wavetable samples from system memory in accordance with one embodiment of the present claimed invention is shown. The following description of the present invention will begin with a detailed description of the physical structure and architecture of the present invention. This description will then be followed by a detailed description setting forth the operation of the present invention. Regarding the structure and architecture of the present invention, a DSP, not shown, generates an address 300 corresponding to a particular wavetable sample page entry which the DSP desires to fetch. Address 300 of the present embodiment is a 20 bit address having an eight bit first portion 302, and a twelve bit second portion 304. Eight bit first portion 302 corresponds to a specific one of 256 wavetable sample pages, typically shown as 306. Twelve bit second portion 304 corresponds to a specific entry in a particular wavetable sample page. Each of the 256 wavetable sample pages 306 of the present embodiment is comprised of 4 K bytes. Therefore, a 20 bit address 300 is used in the present embodiment to access the 1 megabyte of system memory occupied by the 256 wavetable sample pages. The present invention is also well suited to accommodating a larger or smaller address when a respectively larger or smaller amount of system memory space is occupied by the wavetable sample pages. 
     Referring still to FIG. 3, the present embodiment includes an address tag register 308 which is adapted to store a first portion of an address such as, for example, first portion 302 of address 300 therein. Hence, in the present embodiment, address tag register is an eight bit register for accommodating the eight bits of first portion 302 of address 300. The present invention is, however, well suited to having a larger or smaller address tag register when the first portion of the address generated by the DSP is accordingly larger or smaller than eight bits. The present embodiment also includes a valid bit register 310 and a comparator 312 which is coupled to the output of address tag register 308. 
     With reference still to FIG. 3, the present invention also includes a sample page address table (SPAT) base address register 314 coupled to an adder 316 which, in turn, is coupled to a SPAT 318. SPAT 318 contains 256 pointers to respective base addresses of particular wavetable sample pages 306. SPAT 318 resides in system memory. The present invention further includes a sample page base address cache 320 coupled to SPAT 318. In the present embodiment, sample page base address cache 320 is a 20 bit register adapted to store the 20 most significant bits of a 32 bit sample page address passed to sample page base address cache 320 from SPAT 318. Again, the present invention is also well suited to varying the size of sample page base address cache 320 when a larger or smaller amount of system memory space is occupied by the wavetable sample pages. The present embodiment also includes a multiplexor 322 adapted to receive inputs from comparator 312 and either SPAT 318 or sample page base address cache 320. The embodiment of FIG. 3 also includes an adder 324 coupled to the output of multiplexor 322 and adapted to receive as an input the second portion 304 of address 300. 
     Referring yet again to FIG. 3, in the present embodiment, only SPAT 318 and wavetable sample pages 306 reside in system memory. That is, all other components reside locally with respect to the DSP. For example, in one embodiment, all of the components except SPAT 318 and wavetable sample pages 306 reside on the same audio card as the DSP. In another embodiment, all components except SPAT 318 and wavetable sample pages 306 reside on the same audio chip as the DSP. Hence, in the present invention, all of the components except SPAT 318 and wavetable sample pages 306 can be accessed by the DSP without accessing a PCI bus. Additionally, although a DSP is said to fetch the wavetable sample page address and the particular wavetable sample page entry, it will be understood that in some applications, the DSP merely generates a 20 bit address such as address 300. In such applications, a state machine or other device performs the steps required to fetch the particular wavetable sample page entry, and then returns the fetched entry to the DSP. In such applications, the state machine or other fetching device is still delayed by PCI accessing requirements. Furthermore, although such a specific architecture is shown in the embodiment of FIG. 3, the present invention is also well suited to using various alternatives, modifications, and equivalents, which are included within the spirit and scope of the present claimed invention. 
     IN OPERATION 
     The following is a detailed description of the operation of the present invention. With reference now to FIGS. 4A and 4B, a flow chart of steps performed in accordance with the present claimed invention is shown. The steps of FIGS. 4A and 4B will be described in conjunction with the embodiment of FIG. 3. As shown in step 400, upon initial operation of the present invention, an address 300 is generated by a DSP, not shown. The first eight bit portion 302 of address 300 is loaded into eight bit address tag register 308. Additionally, in step 402 the contents of valid bit register 310 are set to indicate that the contents of address tag register 308 are valid. 
     In step 404, adder 316 combines first portion 302 of address 300 with a 32 bit address generated by SPAT base address register 314. The combined address points to a specific location within SPAT 318 which resides in system memory. As mentioned above, SPAT 318 contains pointers to respective base addresses of particular wavetable sample pages 306. 
     At step 406, the present invention fetches a desired wavetable sample page base address and loads the wavetable sample page base address into sample page base address cache 320. More specifically, the particular wavetable sample page base address corresponding to the combined first portion 302 of address 300 and the 32 bit address generated by SPAT base address register 314 is loaded into sample page base address cache 320. In the present embodiment, only the 20 most significant bits of the wavetable sample page base address are loaded into sample page base address cache 320. The present invention is also well suited to using a 21 bit sample page base address cache or a 22 bit sample page base address cache for 2 Mb and 4 Mb applications, respectively. 
     In step 408, the present invention combines the wavetable sample page base address with second portion 304 of address 300. That is, multiplexor 322 outputs the 20 bit sample page base address to adder 324. 12 bit second portion 304 of address 300 is also input to adder 324. Adder 324 combines the sample page base address with 12 bit second portion 304 to form a complete 32 bit wavetable sample page entry address. 
     As shown in step 410, the complete 32 bit address allows the DSP to fetch the desired wavetable sample page entry from system memory. Again, although a DSP is said to fetch the wavetable sample page address and the particular wavetable sample page entry, it will be understood that in some applications, the DSP merely generates a 20 bit address such as address 300. In such applications, a state machine or other device performs the steps required to fetch the particular wavetable sample page entry, and then returns the fetched entry to the DSP. 
     At step 412, the DSP generates another 20 bit address, hereinafter referred to as the newest address. In the present embodiment, the newest address, like previously received address 300 is comprised of an eight first portion, and 12 bit second portion. 
     Next, at step 414, the present invention checks the status of the contents of valid bit register 310. 
     As shown in step 416, if the contents of valid bit register 310 indicate that the contents of address tag register 308 are not valid, then the present invention returns to step 402 and performs steps 402 through 410 in order to fetch the wavetable sample entry corresponding to the newest received address. If the contents of valid bit register 310 indicate that the contents of address tag register 308 are valid, then the present invention proceeds to step 418. 
     Referring now to step 418, comparator 312 of the present invention compares the contents of address tag register 308 with the first portion of the newest address. If the contents of address tag register 308 are not the same as the first portion of the newest address, the present invention proceeds to step 422. 
     At step 422, the present invention load the first portion of the newest address into address tag register 308. Additionally, in step 422 the contents of valid bit register 310 are set to indicate that the contents of address tag register 308 are valid. 
     In step 424, adder 316 combines first portion of the newest address with a 32 bit address generated by SPAT base address register 314. 
     At step 426, the present invention fetches a desired wavetable sample page base address and loads the wavetable sample page base address into sample page base address cache 320. 
     In step 428, the present invention combines the wavetable sample page base address with second portion 304 of the newest address. That is, multiplexor 322 outputs the 20 bit sample page base address to adder 324. The 12 bit second portion of the newest address is also input to adder 324. Adder 324 combines the sample page base address with the 12 bit second portion of the newest to form a complete 32 bit wavetable sample page entry address. 
     As shown in step 430, the complete 32 bit address allows the DSP to fetch the desired wavetable sample page entry from system memory. 
     If, in step 420, the contents of address tag register 308 and the first portion of the newest address are the same, the present invention proceeds to step 432. 
     In step 432, the present invention combines the wavetable sample page base address stored in sample page base address cache 320 with the second portion of the newest address. That is, multiplexor 322 outputs the 20 bit sample page base address stored in sample page base address cache 320 to adder 324. The 12 bit second portion of the newest address is also input to adder 324. Adder 324 combines the previously stored sample page base address with the 12 bit second portion of the newest address to form a complete 32 bit wavetable sample page entry address. Thus, the present invention is able to generate a complete 32 bit wavetable sample page entry address without accessing system memory. Instead of accessing a SPAT residing in system memory, the present invention uses the previously stored sample page base address stored in a cache which resides locally with respect to the DSP. 
     In audio processing, numerous proximately stored wavetable samples are often fetched successively. Hence, numerous entries stored on the same wavetable sample page may be fetched successively. Therefore, the first portion of successive addresses sent from the DSP will often be identical. By storing the sample page base address in a locally disposed sample page base address cache, the present invention eliminates the need for the DSP to access the PCI bus to reach a SPAT in system memory. Instead, the present invention compares the first portion of a newest received address with the first portion of the most-recently used address. If the two address portions are the same, the present invention retrieves the sample page base address from a sample page base address cache instead of from system memory. Thus, the present invention reduces latency and improves bandwidth. In fact, by eliminating one of the two PCI bus trips typically required to fetch a single wavetable sample entry, the present invention can reduce fetching latency by almost as much as 50 percent over prior art systems. 
     As shown in step 434, the complete 32 bit address allows the DSP to fetch the desired wavetable sample page entry from system memory. 
     By reducing the required number of times the DSP needs to access the PCI bus, the present invention increases the number of voices which the DSP can fetch and process in a given time period. As a result, the present invention dramatically increases DSP sound performance. 
     Thus, the present invention provides a method and apparatus which expedites sample fetching from system memory, and which decreases the need to access a PCI bus when fetching samples from system memory. 
     The foregoing descriptions of specific embodiments of the present invention have been presented for purposes of illustration and description. They are not intended to be exhaustive or to limit the invention to the precise forms disclosed, and obviously many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, to thereby enable others skilled in the art to best utilize the invention and various embodiments with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the Claims appended hereto and their equivalents.