US 6,055,619 AGrant
Circuits, System, and Methods for Processing Multiple Data Streams
Issue Date:2000-04-25
•30 Claims
•64 Drawing Sheets
Abstract
An audio information processing subsystem 200 is disclosed which includes a stream processor 100 for simultaneously processing multiple streams of audio data. Processing subsystem 200 also includes a program memory 202 coupled to stream processor 100 for storing instructions for controlling processing system 200 and a data memory 203/204 also coupled to stream processor 100. Additionally, a direct memory access circuitry 208 is provided for controlling direct memory accesses to a selected one of program memory 202 and data memory 203/204.
Metadata
Assignee
- Cirrus Logic, Inc.
Inventors
- Gregory Allen North
- Douglas D. Gephardt
- James D. Barnette
- James D. Austin
- Scott Thomas Haban
- Thomas Saroshan David
- Brian Christopher Kircher
Application Information
Application Number:US 7972326
Filing Date:1997-02-07
Priority Date:1997-02-07
Art Unit:273
Classifications
IPC:
G06F 1700
Field of Search:
71270435;36270
Patent Drawings (64 sheets)
Description
Background of the Invention
1. Field of the Invention
The present invention relates in general to digital data processing and in particular to circuits, systems, and methods for processing multiple data streams.
2. Description of the Related Art
The ability to process audio information has become increasingly important in the personal computer (PC) environment. Among other things, audio is important in many multimedia applications, such as gaming and telecommunications. Audio functionality is typically available on most conventional PCs, either in the form of an add-on audio board or as a standard feature provided on the motherboard itself. In fact, PC users increasingly expect not only audio functionality but high quality sound capability.
Although PC manufacturers are sensitive to meeting their customers' demands for enhanced audio capability, they must also be aware of the tight price margins imposed on their products. In order to balance these competing interests, system designers must strive to provide as much audio functionality as possible while minimizing the number of components required to perform a given function. From the functionality point of view, a state-of-the-art digital audio processing subsystem should provide for such diverse processing techniques as wavetable synthesis, 3-D audio, and sample rate conversion. Sound Blaster compatibility and compatibility with future systems not relying on Sound Blaster technology must also be considered. Further, such a subsystem should be capable of integration on a PC system motherboard through the now widely used PCI bus with its higher bandwidth. From a cost and efficiency point of view, a single chip solution would be optimal. Additionally, the next generation of games will require the processing of simultaneous streams of audio data and thus any system should address the multiple streaming requirements of game designers.
Thus, the need has arisen for an audio processor solution for simultaneously processing multiple streams of digital audio information. Among other things, there is a need for an audio processor that provides for wavetable synthesis operations, including general MIDI wavetable synthesis, and voice channel effects like reverb and chorus. Further, there is a need for such a device to provide 3-D audio processing and direct sound support. Additionally, there is a need for such a device to perform processing functions, such as Dolby.TM. AC-3 audio decoding. There is also a need for such a solution to account for such factors as varying potential system configurations. For example, there is a need for such a device to interface directly with a codec or through an additional audio processing device, such as an audio motherboard. There is also a need for such a device to interface with a PCI bus.
Summary of the Invention
According to an embodiment of the principles of the present invention, an audio information processing subsystem is provided which includes a stream processor for simultaneously processing multiple streams of audio data. A program memory is coupled to the stream processor by a first bus for storing instructions for controlling the processing system. A data memory is coupled to the stream processor by a second bus. Direct memory access circuitry is included for controlling direct memory accesses to a selected one of the program and data memories.
All systems, circuits, and methods embodying the principles of the present invention provide substantial advantages over the prior art. Among other things, such principles provide for the construction and operation of audio accelerators, although such principles are not limited thereto. With regards to the design and operation of audio accelerators, these principles allow for the processing of multiple streams of data in multiple formats. Among other things, such an accelerator can be advantageously used in applications requiring wavetable synthesis, 3D audio processing and direct sound. Additionally, these principles allow an accelerator to efficiently process such audio applications as Dolby AC/3 audio decoding. Further, such principles allow for an audio accelerator to be efficiently interfaced with a PCI bus as well as with a Codec or audio motherboard.
Brief Description of the Drawings
For a more complete understanding of the present invention, and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a diagram of stream processor 100 according to the present invention;
FIG. 2A is a block diagram of digital audio data accelerator controller 100 including the stream processor 101 according to the present invention;
FIG. 2B is a diagram depicting selected operating cycles demonstrating foreground and background partitioning;
FIG. 2C is a diagram depicting a typical software operation performed on the system of FIG. 2A according to the present invention;
FIG. 2D is a diagram illustrating a general method of executing software tasks according to the present invention;
FIG. 2E is a diagram representing the execution of the tasks of FIG. 2C by accelerator 200;
FIG. 2F is a diagram of a first information processing system in which accelerator 200 can be suitably employed;
FIG. 2G is a diagram of a second information processing system in which accelerator 200 can be suitably employed;
FIG. 3A is a diagram of a Mop,aop and ALUop instruction formats;
FIG. 3B is a diagram of an exemplary parallel extended load/store and ALUop instructions format;
FIG. 3C is a diagram of a wideop instruction format;
FIG. 3D is a diagram of the format for a dual packed ALUop instruction format;
FIG. 4 is a diagram of 16-bit ALU 104;
FIG. 5 is a more detailed diagram of parameter/coefficient address generation unit 102;
FIG. 6A is a block diagram of sample AGU 103;
FIG. 6B is a diagram illustrating the organization of the requester array;
FIG. 6C is a diagram depicting operation of the requester;
FIG. 7 is a diagram of fields of an exemplary DMA channel;
FIG. 8 is a diagram of the fields of the sample memory address (rsa) and sample memory address increment (rsi) registers of the sample address generation unit;
FIG. 9 is a diagram of the fields of a DMA sample doubleword address string;
FIG. 10 is a diagram of a modulo buffer and various pointers;
FIG. 11 is a diagram of dual multiply-accumulate units 105;
FIG. 12A is diagram of the DMA controller 109 structure;
FIG. 12B is a diagram of the address storage functions of DMA engine 209;
FIGS. 13A is a diagram of the fields in the host source address register (HSAR) when the host is the source and accelerator 200 is the destination in a host initiated DMA transfer;
FIG. 13B is a diagram of the fields in the host source address register (HSAR) when the host is the destination and accelerator 200 is the destination in a host initiated DMA transfer;
FIGS. 13C is a diagram of the fields in the host destination register (HDAR) when the host is the destination and accelerator 200 is the source during a DMA initiated transfer;
FIG. 13D is a diagram of the fields in the host destination register (HDAR) when the host is the source and accelerator 200 is the destination during a DMA initiated transfer;
FIG. 14 depicts the format for the host DMA register (HDMR);
FIG. 15 is a diagram of the fields of the host DMA control register (HDCR);
FIG. 16 depicts the fields of the DMA status register, (DMSR);
FIG. 17A is a diagram of an address string to parameter RAM 203;
FIG. 17B is a diagram of a destination address word;
FIG. 17C is a diagram of a host source byte address;
FIG. 17D is a diagram of the source byte address word, if the source is in a DSP memory;
FIG. 17E is a diagram of the destination address word when the host is the destination;
FIG. 17F is a diagram of the destination address word when the destination is in an accelerator 200 memory;
FIG. 17G is a diagram of a next page address word defining the next page in memory to be accessed;
FIG. 17H is a diagram of the next page control word;
FIG. 17I is a diagram of the physical byte address loop-begin address word;
FIG. 17J is a diagram of the physical byte address of the page after loop-begin;
FIG. 17K is a diagram of an address to the scatter/gather page table;
FIG. 18 is a diagram illustrating a problem caused by arbitrary loop points when the optimization mode is disabled;
FIG. 19A is a diagram illustrating playback of the same looped sample stream shown in FIG. 18 in the optimized 16-dword mode where the minimum dword count is set to 15;
FIG. 19B is a diagram illustrating the playback of the same looped sample stream of FIG. 18 where the minimum dword count has been set to 14;
FIG. 20 is a diagram illustrating a data sample containing a looped segment which spans three full memory pages to illustrated the operation of the scatter/gather DMA abilities;
FIG. 21A is a diagram illustrating a representative data transfer between 32-bit memories;
FIG. 21B is a diagram illustrating a representative data transfer between 40-bit memories;
FIGS. 22A is a diagram of the situation where 16-bit stereo is being transferred between 32-bit memories in a little-endian format and no conversion is necessary;
FIG. 22B is a diagram of a transfer between 32-bit memories with conversion from 16-bit stereo big-endian to 16-bit stereo little-endian;
FIG. 22C is a diagram of the transfer between 32-bit memories with conversion from 16-bit mono, little-endian into 16-bit stereo, little-endian;
FIG. 22D is a diagram of a transfer between 32-bit memories with conversion from 16-bit mono, big-endian to 16-bit stereo, little-endian;
FIG. 22E is a diagram of a transfer between 32-bit memories with conversion from 8-bit stereo, signed to 16-bit stereo, little-endian, signed;
FIG. 22F is a diagram of a conversion from 8-bit stereo, unsigned to 16-bit stereo, signed;
FIG. 22G is a diagram of a typical transfer between 32-bit memories with conversion from 8-bit mono, signed to 16-bit stereo, signed;
FIG. 22h is a diagram of a transfer between 32-bit memories with conversion from 8-bit mono, unsigned to 16-bit stereo, signed;
FIG. 22i is a diagram of circuitry for implementing the data manipulations depicted in FIGS. 21A and 21B and FIGS. 22A-22H;
FIG. 23 is a diagram of the memory space of accelerator 200;
FIG. 25 is a top plan view of accelerator 200 depicting a packaging (pin-out);
FIG. 26A is a diagram of the primary serial input and output ports;
FIG. 26B is a diagram of the auxiliary output ports;
FIG. 26C is a diagram of a diagram of the auxiliary input port;
FIG. 26D is a more detailed diagram emphasizing the timing inputs and outputs to the serial ports 207;
FIG. 27A is a diagram depicting a configuration where accelerator 200 is functioning as a PCI accelerator on a audio motherboard;
FIG. 27B is a diagram depicting selected clocks and signals to demonstrate the typical exchange of clocks and signals between Codec and accelerator 200 in the configuration of FIG. 27A;
FIG. 28 is a diagram of an expanded version of the configuration option depicted in FIG. 27A;
FIG. 29 is a timing diagram illustrating the typical operation of the expanded configuration shown in FIG. 28;
FIG. 30 is a diagram of the interconnection of an AC 97 Codec 2800 with accelerator 200 where accelerator 200 is driving multiple DACs;
FIG. 31 is a diagram of a further configuration possibility for accelerator 200 where accelerator 200 is driving multiple DACs;
FIG. 32 is a diagram of the serial port master control register 1;
FIG. 33 is a diagram of a conceptual serial port master control register 2 (SERMC 2);
FIG. 34 is a diagram of the bitfields for the serial port configuration register (SERC 1);
FIG. 35 is a diagram of a serial port configuration register 2 (SERC 2);
FIG. 36 is a diagram of the bitfields for the serial port configuration register 3 (SERC 3);
FIG. 37A is a diagram of the bitfields for serial port configuration register 4 (SERC 4);
FIG. 37B is a diagram of serial port configuration register 5 (SERC 5);
FIG. 38 is a diagram of a simple two pin connection used when the EEPROM serial clock (EECLK) is exchanged to EEPROM 3800;
FIG. 39 is a diagram of the configuration register (CFGI) that contains the control bits for host-software based manipulation of an external EEPROM subsystem, when attached;
FIG. 40 a diagram of a minimum timing relationship between the clocks and data during an exchange with the optional EEPROM subsystem;
FIG. 41 is a diagram of a read access sequence to the optional EEPROM;
FIG. 42 is a diagram of the configuration register (CFGI) that contains the control bits for host-software based manipulation of the external EEPROM, when attached;
FIG. 43 is a diagram representing clock control register 1 (CLKCR 1);
FIG. 44 diagrammatically describes the clock control register 2 (CLKCR 2);
FIG. 45 is a diagram of the phase lock loop multiplier register (PLLM);
FIG. 46 is a diagram of the feature reporting register (FRR);
FIG. 47 is a diagram of configuration load register 1 (CLFR 1);
FIG. 48 is a diagram of configuration load register 2 (CLFR 2);
FIG. 49 is a diagra, of the interrupt model of accelerator 200;
FIG. 50 is a diagram of the host interrupt status (HISR) register;
FIG. 51 is a diagram of the host signal (HSRO) register;
FIG. 52 is a diagram of the host interrupt control (HICR) register;
FIG. 53 is a block diagram of a performance modeling subsystem for accelerator 200 which allows for real-time monitoring key internal system and device performance indicators;
FIG. 54 a diagram of the performance control register (PFMC);
FIG. 55A is a diagram of the performance counter one value register (PFCV 1);
FIG. 55B is a diagram of performance counter 2 value register (PFCV 2);
FIG. 56 is a diagram of the bitfields of the stream processor control register (SPCR);
FIG. 57 is a diagram of the bitfields for the debug register index (DREG) register;
FIG. 58 diagrams the bitfields of the group register 1 (FGR 1);
FIG. 59 diagrams the register controlling the DMA stream requestor array state write port (DSWP);
FIG. 60 is a diagram of the stream processor clock status register (SPCS);
FIG. 61 is a diagram of the stream processor DMA requester status register (SDSR);
FIG. 62 a diagram of the trap write port register (TWPR);
FIG. 63 a diagram of the stack pointer write register (SPWR);
FIG. 64 is a diagram of the bitfields for the frame timer register (FRMT);
FIG. 65A, 65B, 65C are is a diagram of the frame time current count (FRCC) register;
FIG. 66 is a diagram representing the host interface programming model;
FIG. 67A depicts the serial port backdoor sample pointer (SERBSP);
FIG. 67B is a diagram of the serial port backdoor status (SERBST) register;
FIG. 67C is a diagram of the serial port backdoor command register (SERBCM);
FIG. 67D is a diagram of the serial port backdoor address (SERBAD) register;
FIG. 67E is a diagram of the serial port backdoor configuration register (SERBCF);
FIG. 67F is a diagram of the serial port backdoor write port (SERBWP) register;
FIG. 67G is a diagram of the serial port backdoor read port (SERBRP) register;
FIG. 68A is a diagram of the AC 97 control register (ACCTL);
FIG. 68B is a diagram of the AC 97 status register (ACSTS);
FIG. 68C is a diagram of the AC 97 output slot valid register (ACOSV);
FIG. 68D is a diagram of the AC 97 command address register (ACCAD);
FIG. 68E is a diagram of the AC 97 command data register (ACCDA);
FIG. 68F is a diagram of the AC 97 input slot valid register (ACISV);
FIG. 68G is a diagram of the AC 97 status address register (ACSAD);
FIG. 68H is a diagram of the AC 97 status data register (ACSDA);
TABLE 68i generally describes the features available through the AC 97 interface;
FIG. 69A is a diagram of the MIDI input/output port 6900;
FIG. 69B is a diagram of the MIDI control register (MIDCR);
FIG. 69C is a diagram of the host MIDI status register (MIDSR);
FIG. 69D is a diagram of the SPMIDI status register;
FIG. 69E is a diagram of the MIDI write port (MIDWP) register;
FIG. 69F is a diagram of the MIDI read port (MIDRP) register;
FIG. 70A is a diagram of the joystick poll/trigger register (JSPT);
FIG. 70B is a diagram of the joystick control register (JSCTL);
FIG. 70C is a diagram of the joystick coordinate register 1 (JSC 1);
FIG. 70D is a diagram of the joystick coordinate register 2 (JSC 2);
FIG. 70E is a diagram of the joystick GPIO register (JSIo);
FIG. 71A is an electrical schematic diagram of synchronizer circuitry 7101 embodying the principles of the present invention;
FIG. 71B is a timing diagram illustrating the operation of synchronization circuitry shown in FIG. 71A;
FIG. 71C is a diagram of the address and data pipelines provide for the exchange of data between accelerator 200 and PCI bus and the exchange of addresses from the PCI bus to accelerator 200;
FIG. 71D illustrated the typical timing of data and address flow through the circuitry of FIG. 71C;
FIG. 72A is a diagram of a FIRST-IN-FIRST-OUT register system;
FIG. 72B illustrates an initialized portion of a selected one of the pointer rings shown in FIG. 72A;
FIG. 72C shows the overlap of the source and destination pointers when a near empty signal is generated;
FIG. 72D shows the overlap of the source and destination pointers when an approaching full signal is generated;
FIG. 72E is a diagram of one possible embodiment of the destination pointer ring and the gating which generates the near-empty signal; and
FIG. 72F is a diagram of one possible organization for the source pointer ring.
Description of the Preferred Embodiments
The principles of the present invention and their advantages are best understood by referring to the illustrated embodiment depicted in FIG. 1-72 of the drawings, in which like numbers designate like parts.
FIG. 1 is a more detailed functional block diagram of a stream processor (core) 100 embodying the principles of the present invention. The primary functional components of stream processor 100 include a register file 101, a parameter/coefficient address generation unit (AGU) 102, a sample address generation unit (AGU) 103, a 16-bit arithmetic logic unit (ALU) 104, a dual 20- by 16-bit multiply accumulate unit (MAC) with 40-bit adder 105, and a 40-bit barrel shifter 106. Each of these subsystems will be discussed in further detail below.
In the illustrated embodiment, register file 101 comprises a 16-entry register file, with registers accessible either as individual 16-bit registers (r0, r1, . . . , rF) or as pairs of 32-bit registers (r10, r32, r54, r76, r98, rBa, rDC, rFE). Stream processor 100 further includes a number of additional command and data registers which are discussed further below. A brief description of substantially all of the available data (non-command) registers within stream processor (core) 100 is provided in TABLE 1 and a similar description of the stream processor command registers is provided in TABLE 2.
Stream processor 100 is a very long instruction word (VLIW) machine operable to decode and execute two or three instructions concurrently. TABLE 3 briefly designates and describes each of the instruction fields. The instruction field encodings for the preferred embodiment are given in TABLE 4. The instruction pipeline is preferably a 4-stage pipeline with a visible multiply-accumulate unit. Preferably, while it takes four cycles to complete execution of any single instruction, four instructions are pipelined together to provide an effective throughput of one instruction per cycle. TABLE 5 is a pipeline diagram of various signal processing operations available in the illustrated embodiment. Conditions (orthogonality)on the use of the registers in the instruction set are similarly set forth in TABLE 6.
Referring to FIG. 2A, a direct memory access (DMA) signal processing accelerator 200 according to the principles of the present invention is shown. In the illustrated embodiment, signal processing accelerator 200 is fabricated as an integrated circuit (chip) device on a single substrate, although the principles of the present invention are not limited thereto. For example, those skilled in the art would recognize that the accelerator 200 could be constructed as a multi-chip module on an integrated rigid structure. It should also be noted that system 200 is only one possible application of stream processor.
DMA accelerator 200 implements a stream processor core 100, which will be discussed in further detail below, and a number of memory subsystems. The memory subsystems include a coefficient read-only memory (ROM) 201, a program memory 202, parameter random access memory (RAM ) 203, and a sample RAM 204. Connected to stream processor core 100 and program memory 202 is a trap unit 205 which monitors program addresses being transferred from program memory 202 to stream processor core 100 over bus 211.
For purposes of this document, the following terms and definitions apply. "Doubleword" (dword) is preferably a 32-bit data word for use in defining PCI and DMA bus width, and stream processor 100 word size. "Word" will denote 16-bit data and "byte" will denote 8-bit data. The host will be defined as the CPU of a host personal computer (PC) system such as an Intel x 86.TM. or Pentium system.TM.. "PCI transfer" shall mean the movement of a single doubleword across the peripheral components interface (PCI) bus in accordance with the industry standard. "PCI transaction" denotes a series of consecutive PCI transfers which occur during a single ownership of the bus (i.e., the time between being granted the bus and being forced to relinquish the bus). "DMA transaction" means the movement of all requested data via direct memory access (DMA), which, if accessing host memory, can require one or more PCI transactions to complete. "DMA read-transaction" defines a transaction in which data is transferred from the host CPU's memory to on-chip memory within system 200 (i.e., data is read from host memory). "DMA write transaction" denotes a transaction in which data is transferred from on-chip memory within system 200 to the host CPU's memory (i.e., data is written to host memory). A "DMA local transaction" denotes a DMA transaction in which data is transferred between two of the random access on-chip memories within system 200, such as program memory 202, parameter memory 203, and sample RAM 204. Internal debug registers may also be accessed via the DMA data bus during a local transaction.
Accelerator 200 is preferably adapted to interface with a PCI bus and therefore further includes a PCI bus interface 206. PCI interface 206 is also coupled to input/output ports 207 which provide for the exchange of serial audio data, MIDI commands and joystick information. A DMA engine (controller) 208 controls direct memory accesses between host memory and program memory 202, parameter RAM 203, and sample RAM 204, as well as between the on-chip memories 202/203/204 themselves, via 32-bit DMA bus 209.
Coefficient ROM 201 is preferably a 6K word by 32-bits/word device which generally maintains coefficients and parameters required for the execution of various signal processing algorithms. For example, coefficients for sample rate conversion, a sine wavetable for music synthesis, .mu.-law and A-law decompression tables, Dolby filtering coefficients and an ADPCM decoding table are maintained in coefficient ROM.
Accelerator 200 is based upon a Harvard architecture having a program memory 202 and associated program bus 111 separate from the data memory and its associated data bus. Preferably, program memory 202 is organized as 3.5K words.times.40 bits per word. The data memory is arranged in two address spaces, with each providing operands to stream processor (core). One address space includes parameter RAM 203 along with coefficient ROM 201, previously discussed. Parameter RAM 203 preferably has a 3.2-K word.times.32-bit per word organization. Parameter RAM 203 contains, among other things, stream parameters for audio sample streams, wavetable parameters for voice, 3-D sound parameters and 3-D sound head related transfer function (HRTF) filtering parameters. A second address space includes sample RAM 105 which receives and manages data over DMA bus 211 and PCI interface 207, and also receives data to and from stream processor 100 across bus 213.
Each of these memories 203/204 possesses two interfaces, one for stream processor 100, and the other for DMA engine 208. DMA 208 is responsible for providing instructions and data to stream processor 100 via the DMA memory interface, and for transferring results from these memories back out to the host. Each of the functional memories 202/203/204 is structurally composed of two physical memories, with all data and instructions to odd addresses residing in one memory and all data and instructions to even addresses residing in the other memory. of the two memory interfaces included with each physical memory, the SP interface is the higher priority interface, with the DMA interface being of lower priority. It should be noted that each of these memories is not truly two-ported, rather, they are single port RAMs having two control and data interfaces.
RAM may be accessed only one time each clock cycle, either by SP 100 or DMA engine 208, but not by both. If an access is made by SP 100 to one of these memories at the same time that a DMA request is issued, the DMA request is not serviced, while the SP access proceeds. However, in the next clock cycles in which the SP makes no request, the DMA access will proceed, and indication is supplied to the DMA via a "done" signal. A "done" signal is supplied from each of the RAMs. When DMA 208 makes an accesses, it must continue to request the same access until the "done" signal is returned from the RAM being accessed. At this point, a RAM write via the DMA interface has completed, or valid READ data is available on the DMA interface.
The fact that the memories are interleaved insures that, on average, the DMA will be capable of getting access to any one RAM every other cycle. Further, code profilers can guarantee that the DMA will never be starved with regard to each of these memories.
The second data address space includes sample RAM 204. In the illustrated embodiment, the sample RAM 204 has a 3K word.times.32-bits per word organization. Sample RAM 204 includes sample rate conversion buffers, wavetable FIFO buffers, wavetable effects (chorus and reverb) buffers, 3-D sound buffers and 3-D sound SRC buffers.
Either the host CPU or stream processor (core) 100 can initiate direct memory accesses to any of accelerator 200 on-chip RAM. In each case, the requesting device or subsystem loads registers within DMA engine 208. DMA engine 208 provides the loading device with priority to perform automatic block transfers to and from internal RAM 202/203/204. DMA engine 208 also provides an ability for the host to perform one-by-one accesses ("peeks and pokes") to accelerator RAM 202/203/204. These accesses are essentially conventional reads and writes to individually addressed memory locations within RAMs 202/203/204.
The host cannot directly read and write to program memory to modify code that may be executing (although it can request a direct memory access to copy data to program memory). For example, the host cannot write to program memory to insert a break point. Thus, trap unit 205 is provided coupled to the program memory bus. Preferably, trap unit 205 is integrated into stream processor (core) 100, but is shown in FIG. 2 as a separate block to emphasize its operation. Trap unit 205 monitors the address bus for the transmission of one of up to eight predetermined addresses. When one of the specified addresses appears on the bus, a trap is issued which causes stream processor 100 to branch during program code execution. Those skilled in the art will recognize that trapping could also be provided for ROM 201, since code in ROM 201 cannot be modified to perform similar tasks, such as inserting breakpoints.
Stream processor core 100 is essentially a 16-bit machine; however, its accumulator is full width to handle the full product, along with guard bits. Coefficient ROM 201, parameter RAM 203, and sample RAM 204 are consequently 32-bit wide devices to provide read and write bandwidth and to support simultaneous multiplies and adds within the dual multiply-accumulate units discussed below. This feature advantageously provides for the processing of stereo audio. In general, coefficients are accessed from ROM 201 in 20-bit words and sample data pipelined as two 16 bit words and paired into single 32-bit sample memory locations.
When the host accesses accelerator 200 memory, such as during peeks and pokes, accelerator 200 acts as a slaved device on the PCI bus (i.e. slave accesses are being performed). When accelerator 200 is driving the PCI bus during a DMA operation (initiated by either the host or accelerator 200), accelerator 200 is the bus master, no matter if data is being sent to, or being received from, host memory.
DMA engine 208 provides the base capability filling and draining buffers set-up in sample RAM 204. Up to 96 such buffers can be set-up to support 96 individual data streams. Specifically, DMA engine 208 defines a modulo buffer for each stream in sample memory 204 (for example) and corresponding circular buffers within host memory. Typically, stream processor 100 requests that DMA engine 208 to fill the modulo buffers in sample memory 204 when it has become less than half full when reading out 16 words at a time.
A stream processor 100 based request to DMA engine 208 is initiated with the addressing of a requestor structure stored in parameter memory 203. The requester defines such things as the size of the transfer, the beginning address (assume in the host memory) and a destination (assume in sample memory). While in this example it is assumed that the host memory is the source and sample memory 204 the destination, other combinations of memories involved in a DMA transfer are always possible. Thereafter, DMA engine 208 can update both source and destination information, only the source or only the destination, as defined by the requestor. Advantageously, a circular buffer that moves in sample memory 204 and a buffer that advances in the host can be set up which are not required to be locked together during the transfer.
DMA engine 208 advantageously includes the facility that in the event it is transferring data between accelerator memory 202/203/204 and the PCI bus, DMA engine 208 can selectively interrupt and allow the host to perform peeks and pokes. DMA engine 208 also supports scatter/gather accesses to host memory which allows the access to data which are logically contiguous in host memory but physically discontiguous in physical memory. In this case, a table is resident in host memory which identifies the location of scattered pages. When DMIA engine 208 reads a page in host memory, it determines that it is reading a stream and therefore immediately sets a request for the next page, including the request to the page table. The request for the next page is normally serviced before access to the current page is complete. Then, when the DMA completes the current page, it checks to see if the page table request for the next page has been completed, and if it has, DMA engine 208 simply skips generating the request to the next page. The advantage to this process is that the priority of page table reads can be pushed down since it takes a relatively long time to move through a page of data during an access (a page is typically 4K bytes long, or with regards to stereo samples, 1K samples). In other words, it takes long enough, reading 16 samples at a time, that the scatter/gather page table reads can be delayed until higher priority operations are performed to host memory since they do not need to be performed immediately.
For purposes of the present discussion, the basic characteristics of a PCI bus are an important consideration. PCI real-time bandwidth available to a device coupled to a PCI bus is specified not in bytes per second or words per second but in transactions per second. This implies that a transaction involving a small amount of information may consume as much time as a transaction involving a large amount of data. In most PCI transactions, information is transferred in bursts.
In the present audio applications, audio streams are in some cases presented in bursts to an accelerator 200 at a relatively high rate, which determines the rate at which data must be read off the bus into memory. One means of optimizing system performance is by keeping unnecessary transactions off the PCI bus during times when a significant number of very quick transactions are required to fill the buffers in sample RAM 204. Buffer size in sample memory must also be minimized since the larger each buffer is for storing an audio stream, the smaller the total number of streams which can be handled. For example, in applications such as music synthesis, 32 or 64 streams may be required just for the music synthesis itself, not to mention perhaps 16 to 20 streams required for other tasks being performed. In other words, the total number of streams may be quite large and therefore attempting to support all of those streams without making the buffers too large is a significant design challenge.
The scatter/gather feature according to the principles of the present invention, at least in part, is directed to the problems of transferring bursts of data into the sample memory buffers. In particular, the instantaneous bandwidth can be increased by pushing down the priority of the page table reads. By initiating the next request for access early, the next page table read can be performed at anytime during the current page accesses, the page table read priority reduced, and the bus freed to transfer bursts of audio stream data. A PCI bus, although it has an aggregate, best case bandwidth of 133 Mbytes per second, may make available bandwidth to a single device on the bus as little as 10 Mbytes per second. Among other things, a given device on the bus may have to compete with 6 or more other devices on the bus which also require bandwidth.
A typical host initiated DMA transfer according to the principles of the present invention generally proceeds as follows. The host writes information defining the transfer into a set of register in host memory. At the same time, stream processor core 100 initiates the host DMA at PCI interface 206 and when the PCI interface is ready, signals DMA engine 208 to fetch the set up information from the registers in host memory. In response to the set-up information, DMA engine 208 issues a request to access the PCI bus via PCI interface 206. Once the request is granted and DMA engine 208 has control of the bus, DMA engine 208 begins transferring data from host memory in accordance with the set-up information.
Once the host has granted the PCI bus to DMA engine 208, but before DMA engine 208 has made a request for data, DMA engine 208 sends an address to the host for host comparison. The host confirms that the address is within the address space of the host and then accepts the transaction. The host then checks its cache to determine if the required data has already been encached or whether the access must proceed from the host system memory. When the data has been located, the controller in the host PCI bridge begins reading data from memory and delivering it onto the PCI bus.
In the case of a write to accelerator 200 program memory, the request which is issued defines the number of 32-bit words to be loaded into RAM, up to a limit of 2014 32-bit words. Preferably, DMA engine 208 sends requests to the PCI bus in bursts of 64 32-bit words and then alternates between reading from the PCI bus and writing to memory until it completes the full transaction. Upon completion of the access, DMA engine 208 signals the accelerator 200 interrupt control logic to transmit an interrupt to the host indicating that the host DMA is completed.
It should be noted that depending on what program file is being executed on the host, an initial value may be loaded into parameter memory or sample memory. Generally, parameter memory 203 will be initialized by a driver rather than by a program per se; initialization is application specific and is done by proxy for the DSP application running on the host. For example, one of the algorithms which may be installed in parameter memory is the AC 3 Dolby filtering algorithm. Assuming that the Dolby AC 3 algorithm has already been loaded, code within the host signals a driver within accelerator 200 and that driver in effect initializes memory for the AC#3.
Once all subsystems have been initialized, accelerator 200 is ready to start and therefor releases reset and stream processor core (SP) 100 begins running. SP first starts executing at a "background task" which in is addressed on program memory address 0040h; however, the background task preferably always starts at the beginning of a frame time and therefore the first word executed actually is the foreground interrupt vector which is at program memory address 0020h. The "foreground task" then executes to completion and processing returns to background task. In other words, from a software standpoint, the division of tasks (operations) performed by stream processor 100 is between the foreground and background tasks.
The background tasks in run at an 8 kilohertz rate and the foreground tasks run on an 8 kilohertz frame interrupt. Algorithms such as Dolby AC#3 audio filtering for example operate on audio blocks which are not fractions of a millisecond but maybe 32 or 48 milliseconds long. Such operations become fairly inconvenient to do at an 8 kilohertz frame interrupt rate since the program must be broken into very small pieces for execution. Advantageously, such operations are run in the background. During the foreground, the bulk of the processing takes place, with the exception of the processing of time consuming algorithms like Dolby AC#3 audio filtering.
FIG. 2B is an execution diagram depicting a selected number of operating cycles for discussion purposes. In FIG. 2B the lower level lines labelled BG indicate background tasks and the higher level lines labelled FG indicate foreground tasks. After processor reset, processing starts in the background and then immediately transitions to the foreground. The foreground tasks then run to completion and processing returns to the background. This sequence repeats itself with each processing frame initiated by a frame interrupt.
The time required for the foreground and background tasks may vary. For example, assume for discussion purposes that the frame rate is 8 kilohertz. If a data stream is incoming at 44.1 kilohertz (which is not a multiple of 8), processing may have to vary between 5 and 6 sample processing and therefore the timing of the foreground tasks may consequently also vary as required to process the changing numbers of samples taken per frame. It should be noted that other streams may be running at every different rates, such as 32 kilohertz or 22.05 kilohertz, all of which will be integrated into a single sound and thus foreground time may also vary between streams.
Sample rate conversion mixing preferably is the primary operation upon which the structure of the foreground task is based. In sample rate conversion mixing, samples are combined at a given sample rate. For example, the samples may be mixed together, subjected to volume control at a given level, and then the mixed up to the 44.1 kilohertz rate (the final rate set up by the host software). Alternatively, the final rate may be 32 kilohertz and therefore, if data is already running at the 32 kilohertz rate, the mixing up step can be eliminated and processor overhead saved. From a digital signal processing standpoint, rate conversion from 8 kilohertz to 44.1 kilohertz or from 32 kilohertz to 44.1 kilohertz is the equivalent operation. A polyphase filtering approach is implemented in software. The input samples are passed to 128 polyphase filters and an interpolation is performed between the two nearest responding filters to achieve high resolution. In other words, the process physically interpolates by 128 and then linear interpolates to up to 44.1 kilohertz, with one of the points from the linear interpolation is chosen to map to the output. A phase increment is specified as an increment over time and additionally a small correction factor is applied since a power of two interpolation has been used; when mixing from 8 kilohertz to 44.1 kilohertz, an insufficient number of multiples of two are involved as coefficients (factors) and therefore some interpolation factors (coefficients) such as 7,3,1 close degree, around 44.0995 kilohertz which is less than 30 parts per million off the target rate of 44.1 kilohertz.
A preferred method is provided according to the principles of the present invention to account for the creeping error which occurs because the interpolation generally only employs coefficients which are powers of two. With every frame, a correction of a selected number of LSBs is added to the phase which maintains the phase accumulation, over a selected number of frames. For example, assume an interpolation between 8 kilohertz and 44 kilohertz. Analysis of the prime factors reveals that over 80 8-kilohertz frames there are 441-44.1 kilohertz samples. From this, a common divisor can be extracted. The equivalent amount of time is then computed and the error resulting over that time is calculated. Correction is then made on a 8-kilohertz basis, wherein every 8 kilohertz a small correction is added until the end of the period for 80 frames has passed. After 80 frames, the correction process is repeated.
The foreground is an interrupt in the traditional sense. As is shown in FIG. 2B, the foreground/background partition results from a frame interrupt, with the foreground task initiated on the interrupt and return made to the background on completion of the foreground task. In the typical case, there is no processing to run in the background and the background task runs momentarily, determines that there are no operations to be performed and then enters sleep. During sleep, clocks can be stopped to reduce power. The background can be revived by a processor interrupt; otherwise, processing returns to the foreground task at the next frame interrupt.
However, if a determination is made that a task must be performed during the background, for example the host has written a word to memory that requires processing or continued execution of an algorithm initiated before the interrupt is required, the processing occurs during the background. The background task is interrupted with the next frame, even if it is still executing a task, and enters sleep. In this case, the foreground tasks runs, and if relatively simple operations are being performed, CPU cycles are saved. The background task is then basically able to consume CPU cycles not consumed in the foreground. The ability to use unused cycles from the foreground for performing background operations allows the processing of algorithms in the background which require substantial amounts of processing time, while still maintaining real time processing for high data rate sample processing. For example, the AC3 algorithm has a frame period of between 32 and 48 milliseconds. 32 milliseconds, for example, is the equivalent of 256 foreground frames. Over that amount of time the foreground interrupts (tasks) require a certain number of the processor MIPs. Therefore, for a MIPs standpoint, a computation is made for the background task to determine whether adequate MIPs remain from the foreground task to complete the contemplated background task in time. The time allocated to the foreground task can then be varied as required to accommodate the background tasks.
It is also possible for the foreground task to use more than its allotted time for a given frame. In this case however, during the next frame the foreground task must use less than its allotted time. In effect, the foreground task starts with an interrupt of the background and then continues on in the foreground until it finishes, at which point in returns to the background task. The third cycle in FIG. 2B illustrates this feature.
This flexible framing feature is advantageous when tasks are run at very low rates. This may occur for example during the processing of 8 kilohertz or 4 kilohertz samples. If 4 kilohertz samples are being processed and a very long filter is being used, filtering may only be necessary on every other frame. The filtering task can then be allotted a time period very near the average task time instead of allotting it a worst case time. Allotting the average case time works so long as the given task has the property that it requires more time during one frame and less time in the immediately following frame. A single frame overrun is typically allowable, however if two frame overruns occur, error conditions may be created. For example, it may become impossible to fill the input/output pipelines.
At the end of the frame interrupt a return from interrupt occurs. During each frame everything in the foreground task may executed. Wherein the background task maintains continuity across frame interrupts, the foreground task executes programs during each frame independently. Tasks that run in the foreground may perform some work one frame and not the next, although the opportunity is provided for every foreground task to be executed on every frame.
The preferred software supporting the foreground tasks implements a tree structure using a global pointer. FIG. 2C is block diagram illustrating this principle. In this case an output is calling for two 32 kilohertz and one 22.05 kilohertz streams to be retrieved from sample memory 204, up-converted to 44.1 kilohertz and mixed for output. Generally, the program first calls the first task on the sublist, the first task in turn calling for all the required inputs necessary for its execution. In the illustrated operation, first task is the output task at block 220 which calls for mixed 44.1 kilohertz data streams and volume control, including amplitude envelope generation. Initially a null and return occurs at 221 since no data is available to output; the host guarantees that any raw inputs are always on the end of the task list.
Data for mixing and output is first called from 32 kilohertz sample rate conversion (SRC) and stream mixing task 222. In the case of the raw 32 kilohertz data, the mixing task requires two streams of data from the corresponding sample buffers in sample RAM 204. In the illustrated operation, raw 32 KHz data for stream 1 is read at block 223 followed by a read for stream 2 at block 224. When the samples are read, the sample address generation unit generates requests to retrieve data whenever space is available in the sample buffer for the next buffer full of data to be input. This task is preferably allocated to the conversion/mixer task because the mixer is also responsible for advancing the input pointer as it retrieves data from the in sample RAM. The sample buffers are sized appropriately as a function of the stream rates. When the 32 kilohertz buffers are filled at blocks 223 and 224, processing reaches a null 225 and returns to the mixing/conversion task 222 for mixing.
The results of the mixing of the 32 kilohertz streams are stored in an intermediate buffer. Sample rate conversion (block 222) is then performed on the 32 kilohertz samples retrieved from the intermediate buffer to convert the mixed data stream from 32 kilohertz to 44.1 kilohertz. The preferred sample rate converter is a 24 tap filter implemented with twenty-four 128 polyphase filters or 3K filter coefficients. The results of the sample rate conversion are then sent to an output buffer.
The next task called is the 22.05 KHz to 44.1 KHz sample rate conversion at block 226. This task in turn calls for the input of raw 22.05 KHz data at block 227 (in this case only a single 22.05 KHz stream is being processed). The 22.05 kilohertz input sample buffers are filled with raw data and processing continues until a null is reached at 228. With the input data available, processing returns to the sample rate conversion task at 226. The 22.04 kilohertz streams are retrieved from buffer, mixed and then converted to a 44.1 kilohertz rate using sample rate conversion. This processing preferably uses the same code as for the 32 kilohertz but a different control block and different data. The results of the mixing and conversion of the 22.05 KHz data is stored in an output buffer.
Once all the sample rate conversions have been performed, a null is reached at 229 and processing returns to output mixing task 220. The data is mixed and then sent to an output buffer for transmission, for example, to the host, and the next task is performed.
The processing discussed immediately above follows a tree structure. A child task is pointed to, and then under the child task, pointers point to siblings. This allows implementation of a multi-branch tree with only two pointers required per node. An exemplary generalized tree structure is shown in FIG. 2D. The processing starts a Node 1, and proceeds to Node 2 which requires its input from a sublist. Node 2 calls Node 3 for its input. Node 3 requires input and in turn calls on Node 4. Node 4 performs the necessary processing to obtain the required data and returns to Node 3. Node 3 completes its output to Node 2 and then branches to Node 6. Node 6 completes its processing and a null is reached which returns to Node 2.
Node 2 then branches to Node 5 and the process is repeated similar to that performed at Node 3. After Node 2 completes its tasks and return is made to Node 1, Node 1 branches to Node 9 and processing repeats similar to that performed at Node 2 through the remaining nodes.
FIG. 2E is a filter diagram of the implementation of the processing procedure depicted in FIG. 2C by stream processor 100, where like numbers represent like operations. Two 32 kilohertz raw data streams are input to sample rate converter 222 and a 22.05 kilohertz raw data stream is input into second sample rate converter 226. The 44.1 kilohertz outputs from the sample rate converters are input to a mixer/output 220.
The tree structure requires priority of execution. In the processing discussed above, tasks execute through the tree shown in FIG. 2D from left to right. The tree structure advantageously provides a means of organizing the tasks. A task is executed and then the processing falls down the tree, as each task higher up the tree calls on the tasks lower on the tree for input. It should be recognized that the amount of data required by the higher level tasks will differ from that required by the lower tasks on the tree. For example, if six output samples are required at the top of the tree and 32 to 44.1 kilohertz converting is being performed, only 4 input samples may be required at the bottom of the tree. Thus, by appropriately organizing the tree, it is possible to drive multiple processing paths from the master output.
The host software is responsible for constructing the trees, which is a link structure in SP program memory 202. The trees then reside in program memory and when an application running on the host requests a stream at a given sample rate, the host checks to determine whether the sample rate converter tree, such as the one shown in FIG. 1C, required to convert the sample in sample memory to the required output is available. If the required sample rate converter is available, that converter is used, otherwise the host creates a sample rate converter tree and links it to the rest of the system. In this case, the tree is traversed twice, one for sample rate conversion and once for mixing. Thus, extra samples have to provided to the output task to insure that the output needs are met.
The host can only write in 32-bit words. For example, for volume control, the host writes an entire volume value, with 16 bits for the left channel and 16 bits for the right channel. These two 16-bit words cannot become separated. Accelerator 200 then updates the left and right channel volume words, which the host can change at any time by writing a 32-bit word to accelerator 200. It should be noted that the left and right channels do not have to be set to the same volume. In other words, the two volume control words are unique to their respective channels, although paired together into a single doubleword. To obtain a larger range of volume the left/right volume doubleword is multiplied by a left/right sample pair in a single multiplier-accumulator. For stereo volume control the dual multiply-accumulate units are used.
FIGS. 2F and 2G depict two exemplary information processing systems in which accelerator 200 can be suitably employed. Those skilled in the art will recognize that accelerator 200 is applicable in a number of information processing systems and thus the principles of the present invention are not limited to systems such as those shown in FIGS. 2F and 2G.
In system 230, shown in FIG. 2F, accelerator 200 is coupled to a PCI bus 231 as discussed in detail above. This system is preferably employed in systems where Sound Blaster capability is not required. Accelerator 200 is also directly coupled to an AC-'97 audio Codec 232 by a serial data link. System 230 also includes a CPU such as an Intel X86.TM. or Pentium.TM., ULTRASPARC, or PowerPC class processor which is coupled to a PCI bus 231 through a host bridge/memory controller 234. CPU 233 is also coupled to host memory 235 through host bridge/memory controller 234.
The serial link between accelerator 200 and Codec 232 supports 12 channels in each direction, with a 12 megahertz clock and a 48 KHz frame rate. This interconnection advantageously provides for telephony based audio, including telegaming, and other communications applications which cannot be supported with current modems.
A second system 236 is shown in FIG. 2G. In system 236, audio is input and output to the system through the audio motherboard, preferably a Crystal Semiconductor CS4237B motherboard audio 237. Motherboard audio 237 is coupled directly to accelerator 200 through a digital link and is further coupled to PCI bus 231 through an ISA bus 238 and an ISA bus bridge 239. System 236 generally supports Sound Blaster processing and similar operations which are more easily performed using an ISA bus. In this configuration, accelerator 200 resides on the PCI bus primarily to achieve high bandwidth and low latency accesses with host memory, which are not available through the ISA bus. The digital link primarily provides a bidirectional link between accelerator 200 and motherboard 237. Preferably, the link includes a link from accelerator into the digital mixer on motherboard 237 and a post-mix and audio data input links from motherboard 237 to accelerator 200. All the data required for echo cancellation using algorithms on accelerator 200 can be provided by motherboard 237 via the digital link.
FIGS. 3A-3D depict the four basic instruction formats available in the illustrated embodiment along with thed TABLES 7a-7 are corresponding Opcode maps; each instruction word is 40-bits long.
FIG. 3A depicts a preferred mOp, aOp and ALUop instruction format. The move operation code (mOp) field is preferably decoded and executed concurrently with the specified aOp and ALUop fields. The mOp field along with the associated move operand filed (mpy/mem/moveOperands) specifies a multiply, parameter 203 memory load/store, accumulator load (multiply-accumulator unit 105) or sample 204 memory store operation. The multiply-accumulate (aOp) field along with its associated multiply-accumulate operand field (addOpers) specifies a 40-bit bit operation within multiply accumulate unit 105. This operation either adds or subtracts two accumulators or adds the product from the multiplier to an accumulator or a rounding constant. The map for the mOpcode field is given in TABLE 7a and the map for the aOp field is given in TABLE 7b.
The ALU operation codes/operands, "ALUop", fields include the ALU operation code (aluOpcode) and ALU operands (aluOperands) fields, which specify 16-bit ALU 104 arithmetic instructions, 16-bit ALU 104 shift instructions, and 16-bit ALU 104 logic instructions. The map for the ALUop fields are given in TABLE 7c. The arithmetic instructions include add/subtract with optional saturation on overflow, add/subtract with carry/borrow and optional saturation on overflow, compare, and conditional add. Preferably, each of these instructions may be executed conditionally on a test bit and a special conditional add may be executed conditionally upon any ALU status flag. The shift instructions include shift-left up to 15-bits with optional saturation on overflow and shift-right up to 15-bits with optional sign extension. These shifts may be executed conditionally on a test bit. The 16-bit logical instructions include AND, ANDNOT, OR, XOR, test, and conditional-move (each of which may be executed conditionally on a test bit). Conditional-move, like the special conditional-add instruction, may be executed conditionally upon any ALU status flag.
Further, move, load and store instructions in the ALUop fields provide partial doubleword load/store capability and may be executed conditionally on a test bit. Only one load/store and one move may be performed concurrently.
FIG. 3B depicts an exemplary parallel extended load/store and ALUop instructions format. In this case, the mOp field is preferably decoded and executed concurrently with the specified operation in the ALUop field. Either the mOp or the ALUop specifies an indexed parameter memory load or store, the index for the load/store being extended from four bits unsigned to eight bits signed.
FIG. 3C depicts a wideOp instruction format. Table 7d is a preferred mapping of the wideOp instruction field. The wideOpcode/sideOperands fields are preferably decoded and executed singly. This instruction format is used to specify the program control instructions such as conditional branches, calls, returns and zero-overhead FOR loops, 16-bit immediate ALU arithmetic and logical instructions, load and store using direct addressing mode, and special purpose instructions that are only occasionally needed. These instructions hold off the completion of the immediately previous multiply instruction, if a multiply was already pending when the previous multiply instruction was issued. Advantageously, this permits these instructions to be interspersed through the pipelined multiply/add processing.
FIG. 3D depicts the format for a dual packed ALUop instruction format. The aluOpcode2 and aluOperands2 (ALUop2) fields are decoded and executed one cycle after the aluOpcode1 and aluOperands1 (ALUop1) fields are decoded and executed. Advantageously, this form allows for efficient packing of control code. Both ALUop1 and ALUop2 fields execute as a unit, (i.e., an interrupt cannot be taken between the two packed instructions fields).
FIG. 4 is a functional block diagram of 16-bit ALU 104. In the illustrated embodiment, ALU 104 includes a 16-bit adder 400, a 16-bit barrel shifter 401, a 16-bit logic unit 402, and an output selector 403. The arithmetic function instructions of ALU 104 are provided in APPENDIX 1 hereto. The basic instructions include add, subtract, compare and conditional add instructions. The majority of the instructions are in the aluOp and wideOp formats. Among other things, instructions are given for add (no saturation on overflow), add with saturation on overflow, add with carry (no saturation on overflow), add with carry and saturation on overflow, conditional-add with saturation on overflow, compare and set test bit according to desired condition, subtract (no saturation on overflow), subtract with saturation on overflow, subtract with borrow (no saturation on overflow) and subtract with borrow and saturation on overflow.
The ALU shift instructions are set out in Appendix 2. The basic shift operations include shift left logical, (no saturation on overflow), shift left logical with saturation on overflow, shift right logical (unsigned right shift, insert zero bits) and shift right arithmetic (signed right shift, extends sign bit).
The logical instructions for ALU 104 are given in APPENDIX 3 hereto. The basic logical operations include logical AND, logical ANDNOT, logical inclusive-OR, logical exclusive-OR, bit set and clear, logical test and optionally set test bit according to desired condition, logical bit test and optionally set bit according to desired condition, and conditional move.
ALU 104 takes receives all of its source data from register file 101, although it can also take immediate data from an instruction and write back the result to the register file. ALU 104 operates on 16-bit data, therefore, two concurrent inputs are provided to ALU 114 from the register file, with a register from the left column of register file 101 sourcing one input and a register from the right column of register file 101 sourcing the second input. The results are written back to a single 16-bit destination in register file 101. For example, the contents of register R4 can be added to the contents of register R8 and the result stored in register R3. In addition to an adder, ALU 104 includes barrel shifter 401 such that right or left barrel shifts can be performed in saturation. Further operations such as AND/OR--store are also supported in the logic unit 403. The ALU also sets flags in a flag register as part of the results of given operations.
FIG. 5 is a more detailed functional block diagram of parameter/coefficient address generation unit 102. Parameter/coefficient address generation unit 104 allows parameter RAM 203 and coefficient ROM to be accessed using alternate address modes. Three such modes are provided: indirect post-increment addressing, register indirect index addressing, or direct addressing, where the address is specified directly in the instruction.
Index addressing is a very useful for accessing the data structure used for parameter RAM and coefficient ROM data storage. In index addressing, a pointer points to the beginning of the structure and by indexing by a given value from the pointer, data can be randomly accessed within that structure. Most DSP's require that data be organized in memory in the order it will be required and then a post-increment performed to move through each data structure. However, data structures which include a number of different parameters which require random accessing, post-increment addressing is inefficient. Thus, index addressing is provided for parameter RAM and coefficient ROM. Index addressing is also valuable in accessing special registers. The programmer has two instructions available, one which moves to the index register and one which moves from the index register. Using these instructions, the programmer can access specific registers through index addressing.
The addressing mode is selected through a multiplexer 504, the output of which is presented to a first input of adder 502. For increment addressing, multiplexer 504 selects between one the values in increment registers 500 for increment addressing and for index addressing passes the value in index register 501. Adder 502 then adds selected increment or index value passed by multiplexer 504 to an address received from the read port of a selected one of the file registers r0-r3.
The output of adder 502 is returned back to the post-modify writeback port of the selected register r0-r3 which provided the original address. Multiplexer 503 also allows for direct addressing. Specifically, multiplexer 503 selects between the output of adder 502 or the address received directly from the selected register in register file 101.
FIG. 6A is a functional block diagram of sample address generation unit (AGU) 103. Sample address generation unit 103 includes a 32-bit modulo/reverse carry adder 600, a DMA check 601 and a series of registers, which are more fully described in TABLE 1. These include sample memory address registers (rsa) 602, sample memory increment registers (rsi) 603, sample AGU configuration registers (rsConFig) 604, sample AGU DMA address registers 605, and sample AGU data registers 606. DMA requestor 607 which will be discussed in further detail below, also forms a part of sample address generator unit 103.
A Codec is generally coupled to serial I/O ports 207 for direct inputting and outputting of serial audio data. Accelerator 200 is also capable of sending that data back to the PCI bus.
An address is loaded into address registers 602 defining where the next DMA to sample memory 204 will be performed. That address is updated each time DMA engine 208 issues a DMA request. Sample RAM AGU 103 determines from the first address, along with information indicating whether stream processor 100 is reading or writing, whether there is enough data already available in sample memory 204 for a write to the host or during a read from host, whether there is enough space in sample memory to read the next data in. If these conditions are met, the DMA request is issued. Sample RAM AGU 103 evaluates these conditions based on parameters provided as part of the sample address. This advantageously allows a programmer to essentially ignore when a DMA occurs; all that must be done is to load the appropriate registers and after the address has been advanced for the last time during the current processing frame, trigger a DMA if requested to do so by the programmer.
When sample RAM AGU 103 determines that a request can be serviced, the DMA request is issued to requestor 607, which prioritizes the requests being output to DMA engine 208. Only one DMA request can be issued at a time, although 96 entries are available in the requestor array to support the 96 possible streams of audio going to or from the host (although not bidirectionally). The requestor block retrieved from parameter memory specifies the direction of all the addresses in host memory and accelerator 200 memory.
Both DMA requester 607 and sample address generator unit 103 advantageously support multiple types of data streams. DMA requestor 607 and sample AGU 103 support 16-bit/8-bit stereo/mono pulse code modulated (PCM) streams for sampling and playback and 16-bit/8-bit looped samples for wavetable synthesis playback. Preferably, each DMA channel consumes sixteen 32-bit words and stream processor 100 can process up to 96 DMA channels. 1536 32-bit words (DMA channels) support 96 streams.
Increment registers 603 include 32-bit register rsi0, and 16-bit registers rsi1 and rsi2. Register rsi2 is loaded with the low 16 bits from parameter memory via bus sp.sub.-- pd, but is read as if those bits were the upper 16 bits of a 32-bit register.
Address registers 602 include 32-bit registers rsa0 and rsa1 and 16-bit registers rsa2 and rsa3. An address retrieved from a selected one of address registers 602 is incremented with a value from a corresponding increment register 603 by adder 600. The post-increment address can be written back to the address register from which the original address came, or directly presented back to the input of adder 600. Further, sample AGU 103 has the additional capability of incrementing a given address from address registers 602 by 1 byte, 1 word or 1 doubleword, under control of bits set in the configuration registers 604.
FIG. 7 depicts the preferred fields of an exemplary DMA channel. In FIG. 7, DMAprio stands for DMA priority (wherein 1,1=high, 1,0=mid-high, 0,1=mid-low, and 0,0=low priority). The D field is the DMA enable field. The maxDMAsize field defines the maximum DMA transfer size in doublewords. The streamNUM field defines the stream number identifying the given stream. The dir field defines the direction of DMA transfer (wherein preferably 0 defines a transfer to sample RAM and 1 defines a transfer from sample RAM). The ds field specifies the size of data in the sample FIFO buffer pointed to the sample phase accumulator. A preferred decoding of the ds field is shown in TABLE 8.
The shr1 field in FIG. 7 defines a shift first word right. This is a non-sign extending shift to enable double precision arithmetic using the dual multiply-accumulate units 105. The revCy field is the reverse carry mode select bit and when selected, the MODULO is ignored and only the upper 14 bits of the address register are computed using reverse carry mode, the lower eighteen bits of the result are cleared. The MOD field is encoded as defined in TABLE 9.
The functions of the registers of sample address generation unit 103 can generally be described as follows with regards to FIG. 8, with further reference to TABLE 1. Generally, the upper fourteen bits of registers rsa 0-3 specify the current address into 32-bit sample RAM 204. If 16-bit signed data size is selected, then the next least significant bit (rsa 0-3 [17] or sample byte PTR [1]) specifies whether the current 16-bit sample is in the low or high 16-bit word of the specified doubleword location in sample RAM 204. Samples are stored least significant bit first (little-endian), so if rsa 0-3 [17]=0, the least significant 16-bit word is selected; otherwise, the most significant 16-bit word is selected. Similarly, if 8-bit signed data is selected, then the next two least significant bits (rsa 0-3 [17:16] or sampleBytePtr [1:0]) specify which of the four bits contained in the current 32-bit doubleword is to be selected.
In FIG. 8, sampleBytePtr represents the pointer into sample RAM 204 capable of resolving down to byte samples. The fracBytePtr field is the fractional part of a pointer into sample RAM 204 used to accumulate a fractional phase for sample rate conversion (either polyphase or linear interpolation). The sample ByteIncr field defines an increment down to byte resolution (integer part of phase increment). The fracByteIncr field defines the fractional part of the increment (for sample rate conversion).
Configuration register rsConfig01 is used to, among other things, configure the data stream modulo, data size and data type for data addressed in address registers rsa0 and rsa1. Configuration register rsConfig23 does the same for data addressed through address registers rsa2 and rsa3. With regards to data size, it should be noted that four data sizes are available, 8-bit signed data, which is typically used for input of samples stored in sample memory, dual 8-bit mode data which provides for 8-bit stereo samples paired together, 16-bit mono mode data, and 32-bit mode data which is essentially 16-bit stereo mode. These data size definitions are mode supporters, with the actual use of the data, for example mono or stereo, determined by the application. In other words, the data size definition allows for the more efficient storage and processing of samples, the programmer needing only to select the data size to set-up the sampling and processing.
Bits written into configuration registers 604 also enable and disable DMA operation. The stream number is sent to DMA requestor 607 to generate a request for the corresponding data stream. The stream number is preferably the address of the external stream control block shifted right by 4 bits. The stream number is 8 bits, although the overall design is implemented to only process 96 streams.
DMA registers 605 includes registers rsDMA01 and rsDMA23, respectively associated with address registers rsa 0-1 and rsa 2-3, hold the next DMA addresses.
DMA check unit 601 checks for underflow and overflow, underflow being measured with regards to the input stream and overflow with regards to the output stream. The configuration registers set-up information about the relevant data stream. When data is accessed from sample memory, the address from the selected address register is post-incremented, using a value from a selected increment register, by adder 600. The output of adder 600 goes to post-increment register 608 and to DMA check unit 601. DMA check unit then takes the DMA address from the corresponding DMA register, which is the address for next the DMA, and the address which was just generated, and determines whether a write-back to one of the registers, rsa [0-3] of the newly generated address should be allowed. If an overflow condition exists, the access is held until the destination memory is ready to accept data. This prevents looping and unwanted write-overs. Essentially, DMA check unit 601 determines whether or not the addressed location after post-increment is already filled.
The sp.sub.-- sd bus returns 32-bits data from sample RAM 204 and presents it the three multiplexers which select between a single byte, an up-shifted byte, a 16-bit word (which is shifted into the upper 16 bits of the 32-bit doubleword), or a full 32-bit doubleword. Multiplexers 609 select bytes or words as a function of the low order address bits from the address registers 602 and the actual data width is selected as a function of data size bits set-up in the corresponding configuration register 604.
All data received on the sp.sub.-- sd bus is then loaded into a data register 606 acting as a first pipeline stage. On the next cycle, the data is sent via the sp.sub.-- yd bus to an accumulator or the multiplier in multiply-accumulate unit 105. The data holding section provided by data registers 606 is substantially advantageous. For example, if data is required multiple times, the data registers 606 are used for the access rather than by a re-read of sample memory. This in turn frees up processing cycles to be used as store cycles.
DMA requestor 607 is preferably a block of logic which receives DMA requests, stores those requests, and then reissues them asynchronously. A preferred FIG. 6B is preferred layout of the requestor array and FIG. 6C is preferred diagram of the operation of requestor 607. In FIG. 6C, the signals are preferably described as follows:
Advantageously, when DMA requests are generated faster than DMA engine 208 and PCI bus interface 206 can service the, DMA requestor 607 is able to account for the difference.
Generally, DMA requestor 607 is designed around an array of 96 bit field locations each for storing a 4-bit value which describes the DMA request for a corresponding stream. Each 4-bit value is stored in a location in the array corresponding to the stream number of the associated stream. Each stream number is represented by 8-bits, although only 7 bits are actually used. The most significant 4 bits of the 7 used bits identify the row in the array and the least significant 3 bits identify the column in the array. Each 4-bit stored value includes a request pending bit, 2 bits representing the priority level and 1 bit representing a page table request bit. Those skilled in the art will recognize that the requestor array can be expanded such as to 128 or 256 streams.
DMA requester 607 is controlled by registers rsCONFIG01 and rsCONFIG23. The preferred fields loaded into these registers are depicted in FIG. 7. In particular, when these registers are loaded, DMA requestor 607 performs a test to determine whether there is a pending request for the stream number loaded. If there is a current pending request, a flag is set and all DMA requests for that stream are masked until these registers are re-loaded. DMA requestor preferably already has this information about the next transfer to trigger the next request.
In FIG. 9, the DMA sample doubleword (Dword) address contains a doubleword address to sample RAM 204 loaded into DMA registers 605. The SE flag is set to one after DMA engine 208 fetches the last sample in the current data stream. The E flag (bit) is set to indicate that an error has occurred. A logical OR of the SE and E flags masks any DMA requests for the current stream.
By adding the maxDMAsize specified in registers reCONFIG01/23 to the next DMA address, according to the modulo specified in the mod field, a pointer is obtained pointing past the ending address for the next DMA transaction. Thus, a determination is preferably made if the base sample address lies outside of this range and if so, a DMA request for the stream (contingent upon any masking being set) is triggered.
FIG. 10 depicts a modulo buffer 1001 and various pointers implemented in DMA engine 109. Modulo buffer 1001 includes a stack of registers 0-15. Among the pointers are the pointer to the sample address registers rsa0-3 after filtering, a pointer to the most recent sample stored in buffer, a pointer at the value in register rsDMA01/23, a pointer to the base value from registers rsa 0-3, and a pointer to the value in register rsDMA01/23 plus the value in register maxDMAsize. These pointers are shown for a given instance in time and relationship between pointers and registers corresponds to the values loaded into the registers at that point in time.
In addition to triggering a DMA request whenever the base rsa 0-3 is past the end of the block to be filled (or drained), it is also necessary to prevent the rsa 0-3 pointers from advancing beyond the most recent sample in the buffer. Typically, this could occur when the last sample in a wavetable sample buffer has been played or if the DMA engine 208 is unable to keep up with the DMA requests for the current channel. For Example, sample AGU 103 will cancel any increment which results in the advancing the current sample pointer from outside the advancing the current sample pointer from outside the region defined by rsDMA 01/23 and maxDMAsize to that region (this corresponds to buffer underflow for input buffers and overflow for output buffers). The data read will be that at the unincremented address. If the current stream is enabled for DMA requests, an error is signaled to the host via a special interrupt signal. The DMA requestor includes a number of internal registers, including a pending DMA request register array which is as wide as the maximum number of streams to be supported by stream processor 100 (e.g. 96 streams). As indicated above, each element contains four bits including one request pending bit, two DMA priority bits, and one page-table request pending bit. The request pending field is set to one to indicate a pending request for data/samples on the corresponding stream. The DMA priority field specifies the priority to be given for a pending request on the identified stream. The DMA priority bit is set upon each request from the DMA priority field in the rsCONFIG01/23 register. The page table request pending field is set to one to indicate a pending request for the next page-map entry to be read for the corresponding stream. DMA engine 208 informs stream processor 100 upon completion of a direct memory access in which the next page-map entry should be read ahead.
The 96 available streams also correspond to an array of 96 stream control blocks based at address zero in parameter memory 203. Each stream control block begins with a DMA description, a data structure that is interpreted by DMA engine 208 and describes the stream data source, destination transfer size, and signalling.
The state machine of DMA requestor 607 constantly scans the internal DMA requestor register array shown in FIG. 6B for the highest priority pending request (i.e., the next request to be served). When DMA engine 208 completes a transaction, it signals requestor 607 which then passes the stream number of the next stream on to DMA engine 208 to initiate the next DMA transfer. Sample AGU 103 reads the DMA requestor block in the specified stream control block in parameter RAM 203 and then performs the next transfer (normally to replenish an on-chip FIFO buffer). On completion, DMA engine 208 updates the DMA requestor block in parameter memory 203 before reporting DMA complete to DMA requestor 607. Specifically, the request pending and priority bits are cleared for the array register corresponding to serviced stream. DMA requestor 607 then continues by sending the next request according to priority until all the current requests have been served. It should be noted that after all the "regular" priority requests are complete, the state machine steps through the page table (map) request bits, and if any active page table request bits are found, services those requests. As discussed above, the page table requests have the lowest priority for bandwidth reasons.
FIG. 11 is a functional block diagram of the dual multiply-accumulate units 105. The primary circuits forming each multiply accumulate unit include a 20-bit by 16-bit two's complement multiplier array 110, a sum vector register 2091, a carry vector register 2092, a 40-bit carry-save-adder 2093, a 40-bit adder 2094 and a set of accumulators/registers 2095.
In the present inventive system architecture, two multiply-accumulate units (MACs) operate concurrently on parallel data to allow processing of 3-D sound with low sample rate conversion. The need for unique left and right coefficients and the processing of left and right channels for 3-D sound determines also the size of the parameter and sample memories. In the preferred 16-bit 3-D sound processing, the sample size is 16 bits and the coefficients are also 16 bits each. Those skilled in the art will recognize that since left and right channels are concurrently being processed, 2 16-bit coefficients and 2 16-bit samples are required at a time. As a result, the parameter and sample memories are each 32 bits wide and each MAC performs parallel 16-bit operations.
Dual multiply-accumulate units are further advantageous in implementing sample rate conversion. In sample rate conversion of 16-bit data, the coefficients which are multiplied with the data must be quantized at a higher resolution than 16-bits. Thus, the present architecture can also perform a 20-bit by 16-bit multiplication for sample rate conversion. Since both the right and left channel data are multiplied by the same coefficients, the same 32-bit doubleword retrieved from memory can provide 20-bit coefficients to both MAC units simultaneously or a pair of 16-bit coefficients to each MAC unit when two data words are sent individually to each MAC unit.
The performance requirements of 3-D and separate wavetable conversion dictate a highly pipelined architecture where the multiply-accumulate units require at least two cycles to perform multiply and add operations. According to the principles of the present invention, the dual multiply-accumulate units, which provide for left and right channel serial processing, operate concurrently in the same cycle. Both units are fully pipelined such that only one multiply-accumulate cycle is required. This architecture has substantial advantages for applications such as 3-D processing which may consume 50 MIPs; using dual multiply-accumulate units for stereo processing in the present system is the equivalent of 200 MIPs on a traditional processor.
In wavetable synthesis (typically music synthesis), there are further considerations. For example, volume control and filter cut-off coefficient updates occur at the same rate, additional filtering is required, and more accumulate operations must be performed. In general, wavetable synthesis requires substantially different processing. 40-bit instructions are employed to provide the flexibility required to perform both 3-D sound processing and a wavetable synthesis. From these instructions, the multiply-accumulate units allow for parallel multiplication and addition.
Further, generally during wavetable synthesis a different type of parallelism is required. Among other things, multiply-accumulates are required in parallel with general purpose data movement and conditional operations. General purpose ALU 104 provides for the processing of data in parallel with MAC units 105. The multiply/add fields of the ALU instructions provide the flexibility required to code for wavetable synthesis. ALU instruction field generalization further allows stream processor core 100 to execute additional signal processing algorithms, as required.
Multiplier 110 inputs may be provided from either the register file 101, parameter/coefficient AGU 102 or sample AGU 103. Dual multiply accumulate units 105 are driven in a single instruction multiple data (SIMD) fashion which permits dual data parallel operations such as stereo audio, complex, or double precision data processing to be processed efficiently. Multiply and add instructions may be issued to either unit independently or both concurrently. The MAC-unit mode change instruction controls the mode of multiply/add instructions. Results computed in a given MAC unit are read out for storing or further processing through 40-bit barrel shifter 106 which provides optional saturation on overflow. A preferred instruction set for dual multiply accumulate units 105 is given as APPENDIX 4.
Data is received by MAC units 105 from sample AGU 103 on the sp.sub.-- yd bus and is presented to multipliers 110. Multipliers 2091 do not produce a final product, but rather sum and carry vectors which are then added by the 40-bit carry-save adders 2093. This helps save a pipeline stage and a adder flag but makes it more difficult to subtract the product from a value in the accumulators. However, the Y inputs can be inverted such that, along with inverting a bit below the LSB which is used in the multiplier (not shown), a negative product can be generated such that the product of two numbers can be subtracted.
The sp-yd bus primarily configures Y registers 2096, although data from the sp.sub.-- yd bus is presented to both the X registers 2096 and the Y registers 2097 such the multipliers 110 can square the y input. Accumulators 2095 can also be loaded directly from the sp.sub.-- yd bus.
The sp.sub.-- pd bus presents data directly from parameter ROM to X input registers 2096. Data can also be presented to the X inputs from register file 101 across the sp.sub.-- gx bus and from the special purpose bus sp.sub.-- xd. The X registers are loaded from parameter memory with single router file registers or register pairs. Preferably, X registers 2096 are 20 bits wide to provide precision for various operations. 20 bits in this case come from bits 31 to 12 of the sp.sub.-- gx bus, which carries either the upper 20 bits of a register pair or the upper 20 bits from parameter memory.
One feature of MACs 105 is the ability to multiply a fractional part of data retrieved from the sample memory address registers (rsa) 602, which is useful for linear interpolation (for linear interpolation, the multiplication by fractional part and one minus the fractional part produces two of the required factors). Sample address generator 103 passes the fractional part of, for example, register rsa0, to MACs 105 via the sp.sub.-- yd bus.
Trap unit 205 comprises a built-in interrupt controller and de-bugger trap mechanism which provides for up to eight vectored interrupts and eight traps. The eight available trap vectors are maintained in program memory 202. Each trap vector contains up to four instruction words of code for execution when the corresponding trap is encountered (typically a branch with register saves in the afterclause of the branch). In addition, eight trap address registers are provided to hold the desired program memory address at which to trap. The eight interrupt vectors are preferably located at program memory 202 addresses 0x20-0x3F in steps of four 40-bit instruction words. Similar to the traps, each interrupt vector contains up to four instruction words of code to be executed when the corresponding interrupt is triggered.
Interrupts may be inhibited under certain circumstances. Among other things, interrupts are inhibited for one cycle when the first instruction of a dual, packed aluOp instruction pair is decoded, for three cycles when a branch, call, or return is decoded, or four to six cycles when a multiply instruction is decoded. Interrupts may also be inhibited for one cycle when the rsCONFIG01/rsCONFIG23 registers are loaded using indexed or post-increment addressing (direct load/store and direct IO addressing do not inhibit interrupts in the preferred embodiment).
An interrupt inhibit occurs for six cycles when a multiply instruction is decoded to allow code to use the product register (which cannot be saved/restored by an interrupt service routine). Thus, there is a maximum length of time during which interrupts may be disabled during a background task. The upper bound typically is less than the periodic framing period.
A parameter memory load may not take advantage of the delay in loading an address register, r0/3, or an increment register, rci0/1, before becoming valid in the parameter/coefficient AGU. Similarly, a sample memory load or store may not take advantage of the delay in loading a sample address register, rsa0-3, or increment register rsia-0, before becoming valid in the sample AGU.
The traps are provided to aid in debugging RAM- or ROM- resident program code. Each of the traps consists of a trap address register (iAGUtrapN) and a trap vector (address 4*N in program memory). Additionally, a global trap enable is available under host control.
The debugger can use traps to implement breakpoints and to insert code "snippets" to implement scopes and probes. If the traps are enabled and the instruction pointer comes to match any of the trap address registers, an unconditional call is inserted into the instruction stream to call the code at the trap vector instead of the instruction at the trap address. Simultaneously, the current interrupt enable status is saved while interrupts are disabled. Stream processor core 100 thereafter begins executing the code in the corresponding trap vector. If this is a breakpoint, this code sets a global variable to indicate which trap (breakpoint) was encountered and branches to a common breakpoint handler. The breakpoint handler would then signal the host and place stream processor 100 in deep sleep. When the host acknowledges the interrupt and determines the cause, it signals the debugger. Under debugger control, the user may single step out of deep sleep and continue executing the program. A return from trap instruction returns to the trapping instruction after restoring the interrupt enable status and inhibiting traps for one cycle (to allow the trapping instructions to be executed).
APPENDIX 6 demonstrates a preferred set of program control instructions for stream processor 100. These instructions control conditional branch column, call, and return, zero overhead looping, interrupt-related, and special instructions, including trap calls and returns. The branch, call, return, zero-overhead looping and interrupt related instructions all require three delay slots before they execute (or begin executing in the case of four-loops). These delays are specified in an "after" clause which specified the sequence of instructions to execute after the desired instruction is coded, but before it completes execution. No instruction requiring delay slots may execute in the delay slot of another instruction. Since it can be difficult to fill three delay slots after a conditional branch, call, or return, an instruction encoding is provided that specifies the first delay slot to be filled by hardware inserted NOP) for loops do not allow this option. Preferred set of move/load/store instructions are provided in the Appendix 5.
FIG. 12A is a diagram of the DMA controller 109 structure. An interface to PCI master/slave controller 1201 is provided which allows the DMA engine to transfer addresses and data to and from the PCI pads, via the internal PCI bus 214. Interface 1201 provides address decoding for access to internal DMA/interrupt registers 1202 and 1203, and interprets control signals from the PCI slave control logic, to allow register reads/writes, and SP 203/204/205 memory peeks/pokes.
Interface to SP memories 1204 allows the DMA to transfer data to and from the SP memories via the internal DMA address and data buses (14 and 32 bits, respectively.) Interface 1204 contains an arbiter to select between access requests for DMA transfers, and single peeks/pokes from the interface to PCI master/slave controller. Interface 1204 also contains a pipelined synchronizer structure (discussed later) which transfers data from the PCI clock domain to the SP clock domain.
DMA registers 1202 and Interrupt registers 1203 contain all host-accessible DMA registers (DMSR, HSAR, HDAR, HDMR, HDCR), and interrupt registers (HISR, HSRO, HICR). Registers 1202/1203 also contain inaccessible registers used by DMA control logic for counting addresses and doubleword count during a DMA transfer.
FIFO controller 1206 contains control and datapath logic for performing all audio conversions as well as an interface to the FIFO RAM. Generally, FIFO controller 1206 controls transfer of DMA data between the FIFO ram, interface to PCI controller, and SP memory interface.
FIFIO RAM 1207 is a single static memory which is organized as 64 entries by 32-bits.
Main DMA state machine 1208 provides high level control for normal and scatter/gather DMA requests. The state machine is shown in FIG. 12B. This state machine responds to a DMA request from either the host or SF 100, reads the DMA information from either the host registers or SP requestor, controls the loading and storing of DMA data (by sending appropriate signals to the PCI master interface 1201, FIFO controller 1206, and the interface to SF memories), and controls the updating of register/requestor information when the transfer is complete. There is also a smaller controller which simplifies the reading/writing of information from the SP requestor.
FIG. 12B is a state diagram depicting the preferred operating sequences of DMA engine 208. A brief description of each of the signals is shown in Table 10A. DMA engine (controller) 208 provides for the transfer of data between any one of the on-chip memories (i.e., program memory 202, parameter RAM 203, or sample RAM 204) and the host system CPU, as well as between the on-chip memory subsystems 202-105 themselves via DMA bus 210. Advantageously, DMA engine 208 eliminates the need for constant involvement in the transfer by any of the processors in the system including the host and stream processor core 100. Data being transferred by DMA is moved across a 32-bit DMA bus 209 coupled to each of the memories 202-105. Additionally, DMA engine 208 includes facilities for reporting access to streaming data buffers scattered across a host memory space of 4096-byte pages. In other words, buffers in host memory are mapped by a host resident page mapping table to which the on-chip DMA requester points providing the "scatter/gather" DMA mechanism.
"Scatter/gather," generally can be described as follows. Specific data structures are discussed further below. Each audio stream which is transferred between host and SP memory 202/203/204 is specified by a scatter/gather DMA Requester structure, resident in SP Parameter memory 203. The first 8 doublewords of the requestor contain information which is used by the DMA controller 208 to transfer the right amount of data between the appropriate buffers in host and SP memory, and additional information which allows the transfer of data with minimal demands on the PCI bus.
During scatter/gather DMA, audio data is spread across one or more 4 Kbyte "pages" in host memory, and a page-mapping table is resident in host memory which specifies the starting byte address on each of these pages, and also identifies a page which contains the end of a loop in the audio stream, and which contains end of the entire audio sample.
Because this page table (containing the starting address for each page) is stored in host memory, each new entry must be transferred to SP memory before it can be used. Once resident in SP memory, it can be relatively quickly retrieved when it is needed (when the DMA reaches the end of a page and must begin the new one). Because it requires a PCI-bus access to transfer the page-table information from host to SP memory, which could require a significant amount of time in a busy system, the DMA mechanism and requestor structure are designed to allow these transfers to occur at any time over a large time period, and at a lower priority than normal DMA of sample data. Specifically, it is designed so that the DMA engine will never require a page-table update to have completed in less time than it takes for the DMA to traverse a full page of sample data for that stream. See FIG. 2.
Normally, the DMA will indicate to the sample-AGU 103 that a page-table update is needed for the next page of the active stream as soon as the stream has begun a new page. This gives the sample-AGU 103 plenty of time to request the page-table DMA, since it won't be needed until the stream reaches the end of the page which was just begun. However, because of the arbitrary positions of loop-begin and loop-end addresses, the stream can sometimes rapidly cross several pages, without providing much time for the required page-table updates to occur for each page traversed. To avoid this problem, additional information is included in the DMA requestor for each stream in SP memory.
In addition to the "normal" DMA information such as doubleword count, source/destination addresses, and scatter/gather state (PM, LS, SS fields) the following additional information is stored in the requestor structure, which is used by the DMA controller to reduce its need to load page-table entries too quickly:
Loop-begin byte address; Because the loop-end point could be located near the beginning of a page, there could be insufficient time to load a new requestor entry from the time the loop-end page is started to the time the loop-end point is reached. Therefore the loop-begin address is stored in the requestor when the stream is initialized, so that upon loop-back, the DMA may continue on the loop-begin page without delay.
Starting byte address on the page after loop-begin; Likewise, because the loop-begin point could be located near the end of a page, there could be insufficient time to load a new requestor entry for the page following the loop-begin page when the DMA loops back and quickly reaches the end of the loop-begin page. Therefore, the starting address of this page (post-loop-begin page) is stored in the requestor also.
Page-map entry offset for 2nd page after loop-begin page; When the post-loop-begin page is started, the DMA resumes its normal behavior of indicating to the sample-AGU that another page-table update is needed. When the sample-AGU requests a page-table DMA, the DMA controller normally uses the information from the previously-loaded page-table entry to determine which index in the host page table to transfer from (the next page of the stream). However, on loop-back DMA controller 208 has skipped two page-table updates, opting instead to get the required addresses from the requestor fields described above. The requestor therefore also stores the index number for the page table which identifies the page-table entry for the 2nd page after loop-begin. When the sample-AGU requests a page-table DMA under these conditions, DMA controller 208 will use this index to find the page-table entry for the next page of the stream.
During operations, such as wavetable synthesis for example, DMA engine 208 is responsible looping. In wavetable synthesis, a sample is played, assume for discussion a piano note. The attack of a note from a piano is unique and must be captured for some period of time. Once the sustained part of the note is reached however the note takes on a relatively regular waveform. At this point, a loop can be created for one period of that waveform and then all that is necessary is to provide an amplitude envelope which will gradually scale the volume of the note waveform in the natural decay of a piano. In other words, a loop is implemented which loops back to the sample point which results in a stream of samples and the amplitude envelope operates on that stream. Thus, during operations such as wavetable synthesis, it is possible to reduce memory requirements by eliminating the need to take up to several seconds to perform samples to emulate the full decay.
Looping by DMA engine 208 additionally aids in the decoupling the processing of data pipelined through accelerator 200 relatively slowly compared with the data exchanged with the PCI bus, which typically occurs in bursts. Generally, problems could arise if a point is reached when data is required but that data is not contiguous in memory with that which is already stored in buffer. Normally, in this case, the buffer would be flushed and reloaded from the beginning of the loop. By passing the looping tasks off to DMA engine 208, stream processor 100 is free to process the bursts of data from the PCI bus. This feature is particularly advantageous of music synthesis and 3-D audio processing, where sample rate conversion is required. For example, 3-D sound requires a high performance filter to be applied with unique coefficients to both the left and the right channel.
Although data may be transferred in 8-, 16- or 32-bit bytes, transaction links are preferably integer numbers of doublewords. For example, in the illustrated embodiment, DMA engine 208 is capable of buffering up to sixty-four doublewords of data in an internal FIFO or can pack 8-bit bytes or 16-bit words into the same space, allowing up to 256 bytes or 128 16-bit words to be buffered.
Although DMA engine 208 controls DMA transfers, either the host CPU or stream processor 100 can initiate a DMA transaction. The host CPU can request a DMA transaction by writing to four 32-bit registers which are mapped into the host system's memory space (the HSAR, HDAR, HDMR, and HDCR registers discussed further below). Preferably, the registers are physically located within DMA engine 208 and may be written to via single-data PCI transactions in which the host's PCI bridge chip is the PCI master, and system 200 is the target. If the transfer involves the host system memory, a new PCI transaction is started to transfer the data, in which accelerator 200 is the master and the host PCI bridge chip is the target. As the transaction progresses, the selected on-chip memory 202/203/204 is continually accessed for read or write via the DMA bus, whenever that memory is available (not currently being accessed by a higher-priority source). At the end of the transfer, after the last data has been written to the destination memory, DMA controller 208 interrupts either the host (via PCI interface 206) or signals DMA requester logic 607 to issue the request with the next highest priority.
Stream processor 100 may request a DMA transaction on a single hardware DMA channel, allowing transactions of up to sixty-four words. In this instance, stream processor core 100 first creates a structure in memory for DMA requester 607 to operate from. Next, the stream number and desired priority is written into the DMA request register array which queries the DMA request for service according to its priority. Direct memory accesses may alternatively be queued through the use of sample address generation unit 103 and a conditional DMA request. When the DMA request is selected for service by DMA requestor logic 607, its address is presented to DMA engine 208. DMA engine 208, then reads the address pointer and uses it to read the DMA requestor structure from on-chip memory to generate the request to the source/destination memory and/or PCI bus interface 206 in order to complete the transaction. At the end of the transfer, after the last data has been written to the destination memory, DMA controller 208 writes the updated source and destination addresses back to the requestor structure, if specified. DMA requestor 607 receives a signal indicating the completion of the current request, at which time it signals the next request, if any are queued.
Scatter/gather direct memory accesses may be initiated in a similar manner by system 200. These transactions preferably require an additional five doublewords to be specified which describe loop points and map the next host page location in the stream.
Both the host initiated requests and stream processor based requests are maintained at an equal priority and are served on a first come, first served basis. Plus, preferably, all DMA requests are executed as a unit and are never pre-preempted.
Data is transferred between the host system DRAM and on-chip memories through the on-chip PCI bus interface 206. 32-bit PCI data is latched in PCI interface 206 for both input/output, and transferred to/from DMA engine 208 using handshaking signals.
Availability of the PCI bus, the readiness of the target (host PCI bus chip) and latency inherent in the host bridge chip may affect PCI and DMA throughput. If a PCI target, such as the host bridge chip encounters large enough delays, it can be forced to either disconnect or terminate (abort) the transaction. If the PCI target generates a simple disconnect, on-chip PCI interface 206 advantageously will automatically attempt to re-start a new transaction at the last untransferred address. If the PCI target aborts the transaction, the entire transaction stops instantly and all buffer data is lost. An aborted transaction represents a catastrophic system error, which PCI interface 206 will indicate by interrupting the host CPU.
For non-scatter/gather streams, data being transferred to/from the host system memory is stored in the host memory in a circular buffer which is constantly filled and drained. Hence, PCI transactions in this situation are burst transfers which range over a contiguous set of doubleword memory addresses, the DMA controller 208 requesting a new PCI transaction each time the position in the circular buffer wraps around to the starting address. The maximum size of these circular buffers is set at 2014 doublewords or one host page.
Scatter/gather streams may transfer data to/from the host system memory locations scattered across multiple host pages. A page mapping table is supplied by the host to map all pages of the buffer after the first two pages. The first two pages along with the loop-begin and endpoint information are included in the DMA requestor array. If page boundaries are encountered, the DMA will access the next page information already in the on-chip DMA requestor block. This page information is refreshed by the stream processor using low priority request in DMA requestor logic 607 which advantageously keeps higher priority transactions from being delayed by page-table reads.
As discussed briefly above, DMA engine 208 includes a set of registers which can be written to by the host processor via the PCI bus. A list of the preferred DMA registers provided with a DMA engine 208 are given in TABLE 10B.
Two independent DMA channels are provided, specifically the host DMA channel and the signal processor DMA channel. Each of these channels can be described in detail as follows.
The host DMA channel is controlled by the host DMA registers HSAR, HDAR, HDMR, and HDCR. Preferably, each of these registers is a 32-bit register physically located within DMA engine 208 and mapped into the host CPU's memory space. Preferably, writes to these registers can only be made by the host CPU via PCI bus interface 206 to provide a means for the host to initiate a DMA transaction.
The host writable 32-bit host source address register (HSAR) allows the user to define the address to be used for the source memory of a host initiated DMA transaction. A preferred register format is shown in FIGS. 13A and 13B respectively, wherein FIG. 13A shows the fields when the host is the source and FIG. 13B the fields when accelerator 200 is the source. A brief description of the HSAR fields are given in TABLE 11. The HDAR register allows the user to define the destination memory for a host initiated DMA transfer. FIG. 13C depicts the HDAR register fields when the host is the destination, and FIG. 13D the fields when the accelerator 200 is the destination. TABLE 12 presents a preferred encoding.
FIG. 14 depicts the format for the host DMA register (HDMR) register. This register defines such parameters as the transfer mode to be used to manipulate the data, and the generation of the virtual channel signal to be generated at the end of the transaction. TABLE 13 sets forth a preferred bit encoding.
The host DMA control register (HDCR) is used to describe several parameters for a host-initiated DMA transaction, such as the source and destinations memory locations and modulo buffer sizes. Also included are bits for enabling the selective write back of the source and destination address registers and a bit to enable optimized 16/32-dword access mode. Further, a field is enabled which specifies the number of doublewords to transfer, from 1-64. Writing to this register automatically causes a host-initiated DMA request. FIG. 15 shows a preferred format for the field/register and TABLE 14 a corresponding bit encoding.
FIG. 16 and corresponding TABLE 15 describe the format encoding for the DMA status register, (DMSR). This is a host readable register which includes two status-bits for both DMA channels. When a transfer action is requested on a given channel, a corresponding pending bit is set to 1. When a transaction begins, the running bit for the given channel is set. Since all transactions execute without interruption, once a running bit is set, it will not be cleared until the transaction is complete. After the given transaction has completed, both pending and running bits for that channel are reset to zero. The host can read this register to determine which DMA channel has requests pending and which channel is currently running. Further, the host can poll this register and monitor the HP bit to determine when its own DMA transaction completes as an alternative to being interrupted at the end of the transaction.
The signal processor DMA channel uses its own DMA requestor structure, which includes the source and destination addresses, memory identifiers and modulo buffer sizes, transfer mode and doubleword count (1-64 dwords). The basic requestor is four dwords long and may specify any non-scatter/gather request. An additional five dwords are required to support scatter/gather request and involve the dwords common to all SF initiated DMA requests. FIGS. 17A through 17K depict a preferred stream processor DMA requestor structure. FIG. 17A depicts an exemplary address to parameter RAM 203, which preferably is the initial address. FIG. 17B depicts the destination address of word issued at initial address plus one. At the initial address plus two, source address word is issued. If the source is the host memory the source address word takes the form shown in FIG. 17C otherwise, if the source is in a DSP memory, the source address word as depicted in FIG. 17D.
At initial address plus three, a destination address word is issued. If the destination is within host memory, the destination address word takes the form shown in FIG. 17E. If the destination is in an accumulator 200 memory, the destination address word takes the form in FIG. 17F.
Additional DMA requestor doublewords are used only for scatter/gather DMA. At initial address plus four, the next page address word defining the next page in memory to be access is issued, preferably as shown in FIG. 17G. At initial address plus five, the next page control word is issued as shown in FIG. 17H. FIG. 17I depicts the loop-begin address word issued at initial address plus six. At initial address plus seven, the next page after loop-begin word is issued. Finally, at initial address plus eight, address to the page containing the page mapping table and a page map tree offset for second page after loop-begin are defined.
The memory address fields used for the source and destination memory addresses specify either host system memory or accelerator 200 memory addresses, depending on how the H and DH bits are set in the DMA control word/register. If Host memory is selected, the full 32-bit words are interpreted as a host-byte address. When an accelerator 200 on-chip memory is, the requestor, word includes a memory ID filed and byte address selected (source or destination) the appropriate on-chip memory and addresses that memory in bytes. For DSP addresses the ERR and END bits provide an error and end of sample flags. The memory ID bits are provided to define which of memories 202-105 being addressed. A preferred memory ID decode is provided in TABLE 16. The DSP byte address specifies the address for the given memory in bytes. Advantageously, this addressing scheme allows a 32-bit address to map a maximum host memory size of up to 40-gbytes and a DSP memory size of 64-K bytes.
The source and destination addresses loaded in the host DMA registers and the stream processor requestors are assumed to point to the starting location within memory buffers located in host RAM or in the on-chip memory 202-105 as specified. A 3-bit field defined in TABLE 17 defines the size of the modulo buffer specified in doublewords (where DMS is the destination modulo buffer size and SMS is the destination modulo buffer address see FIG. 17A). The first option (000) indicates that the buffer is not circular and addressing should proceed progressively through memory until the transaction is complete. The other options will cause the transaction to wrap around to the buffer's starting address (least significant bit=0) when the address crosses the boundary of the buffer of a given size, ranging from 16 to 2014.
A 4-bit audio convert (AC) field (FIG. 17B) defines how audio data is transformed before they are written into the destination memory during a DMA transaction. Bit 0 is used to define 8- to 16 - bit audio conversion wherein each byte of audio-data is padded on the least-significant end with a 0 byte, to form a 16-bit word. Bit 1 is used to perform mono to stereo conversion wherein each 16-bit word of audio data is duplicated (written twice) to convert mono-audio data to stereo format. Bit 2 defines a big- to little-endian conversion wherein each 16-bit word being written has its low and high bytes swapped, to convert incoming bytewise big-endian audio to little-endian audio, or vice versa. Bit 3 defines signed/unsigned conversion in which each 16-bit word being written has its most significant bit inverted, to convert incoming unsigned audio data to signed format, or vice versa.
8-bit data is first converted to 16-bit data, and then the mono data will be duplicated to generate stereo data. Next the bytes of each word are exchanged to convert between little- and big-endian formats. Finally, the most significant bit of each resulting word will be inverted to convert between signed and unsigned formats.
Interrupts within system 200 are supported by a "virtual channel" mechanism within the device. Each stream which is read from or written to a modulo buffer is assigned to a "virtual channel number" (FIG. 17B). The virtual channel number is signaled by DMA engine 208 any time the modulo buffer pointer passes the midpoint or wraps around. An interrupt to the host is triggered when certain virtual channels are signaled (e.g., channel 0-15). This permits immediate signalling of the buffer conditions. Virtual channels are used to set a virtual channel signaling bit which may be read by the host at a later time. A summary of the actions taken by the signal receiver when a virtual channel is signaled is provided in TABLE 18.
For all DMA requestors, 2-bit VSM fields (FIG. 17B) specifies whether and when to signal the specified virtual channel upon completion of the DMA transactions. TABLE 19 describes the various settings for the VSM field. The doubleword count field (FIG. 17A) specifies the number of doublewords for the transaction, minus 1. Thus, a value of 0 will transfer one doubleword, a value of 1 will transfer two doublewords, etc. All DMA transactions involve an integer number of 32-bit doublewords up to a maximum transfer size of 1024 doublewords.
The OPT bit, in the DMA control word (FIG. 17A) is used to select an optimized mode for determining the number of dwords to read at each DMA request. This operating mode is provided to reduce the variance in instantaneous PCI bus transaction rate for such operations as wavetable synthesis. Specifically, optimization insures that the optimal number of doublewords can be transferred across the PCI during a given processing loop. These samples may be 8- or 16-bit wide and they specify arbitrary loop-beginning and endpoints where the sample repeats until the note is released.
FIG. 18 illustrates a problem caused by arbitrary loop points when the optimization mode is disabled. In this example, 16 doublewords are being read at each DMA request during a single PCI transaction. Essentially, because the loop ending point is not anticipated by DMA controller 208, the DMA controller must initiate two PCI transactions to satisfy a DMA request that normally requires only one transaction (when the loop end is not encountered). The second PCI transaction becomes necessary because a PCI transaction must start with a single beginning address and thus to initiate an access only to the data which was cut-off, a new address must be issued. In other words, a loop arbitrarily begins during a DMA request and more significantly, ends during a DMA request; to satisfy the ending DMA request, an additional request and PCI transfer must be made for the doublewords cut-off at the last loop-end point. Similarly, problems can occur when a sample spans pages in host memory. In this case, the page boundary, like the loop end position, is not anticipated and therefore may require an additional PCI transaction when the page boundary is reached and the pending DMA request is not complete.
According to the principles of the present invention, each loop endpoint is aligned to an even 16- or 32- dword boundary. The DMA controller 208 is then given the flexibility to choose a different transaction size based on the alignment to the appropriate 16- or 32-dword boundary in order to optimize the number of requests per loop. Specifically, the programmer specifies the minimum number of doublewords to be read during each DMA transaction in the normal dword count field. Then when the OPT bit is set, DMA engine 208 will read between the specified minimum and a maximum of 18 doublewords, if the specified minimum is less than 16, or a maximum of 36, if the specified minimum is greater than 16. In this fashion, DMA engine 208 insures additional requests are not required when the end of a loop is reached.
FIG. 19A illustrates the playback of the looped sample in the optimized 16-dword mode where the minimum dword count is set to 15. As shown in FIG. 18, in the unoptimized case, an offset of four (4) has been introduced. In the optimized case of FIG. 19A, the loop ends have been aligned to a 16 doubleword boundary, after four DMA requests. The offset is determined by examining the address issued by the DMA requestor to the host. Assume for example, that the address is to host memory (either as a source or a destination). Preferably, bits 5:2 are used to determine the current displacement modulo 16. Then a minimum number of doublewords per request, in this example 15, is selected. A maximum number of doublewords per request is automatically set at 18 since the minimum is below 16. The maximum number of requests required to align is then calculated as: ##EQU1## for 16-doubleword mode.
For the 32-doubleword mode, the maximum number of requests to align is: ##EQU2##
In sum, optimization is based only on the specification of the minimum number of doublewords and knowledge of the current DMA address to the host.
FIG. 19B illustrates the playback of the same sample stream where the minimum dword count is set to fourteen. It should be noted that the lower the minimum is set, the quicker alignment occurs. In this case, alignment is reached after two DMA reads.
FIG. 20 illustrates a data sample containing a looped segment which spans three full memory pages to illustrated the operation of the scatter/gather DMA capabilities according to the principles of the present invention. As briefly indicated above, the page boundary, like the loop end position, is not anticipated by DMA controller 208 and therefore two Pci transactions may be needed to meet a request when the page boundary is reached. While pages are already aligned at doubleword boundaries, the technique of setting a range of words per request and allowing DMA engine 208 to vary the words per request within the range is applicable here.
As discussed above, in FIGS. 17A-K, the requestor words are extended to support the scatter/gather feature. The PM field (FIG. 17A) is a flag indicating a pending read of the next page map (table) entry. The LS field (FIG. 17A) indicates the loop ending DMA state, the SS field (FIG. 17A) indicates the sample - ending DMA state, and SSG field (FIG. 17A) is a flag indicating whether the source is a scatter/gather buffer. The DSG field represents a flag indicating whether the destination is a scatter/gather buffer, the SV loop field (FIG. 17B) maintains virtual channel signaling flags for loop-back and the LF field (FIG. 17B) are the looped flags. TABLE 20 is a preferred encoding of the PM field, TABLE 21 is a decoding of the LS field, TABLE 22 an encoding of the SS field, TABLE 23 an encoding for the LF field, and TABLE 24 is an encoding of the SE field.
DMA engine 208 is operable to pack, unpack and steer data being transferred in several different ways. The AC field in the DMA registers/requestors (FIG. 17B in the case of a requestor and FIG. 14 in the case of a host DMA request) allows special operations on data being transferred to convert them between various types of digital audio data. The options variable are targeted at transforming several different audio formats into the format expected by the signal processor core 100 (e.g., 16-bit stereo, little-endian signed audio data). FIG. 21a and 21b respectively show the transfer between 32- and 40-bit memories. In particular, FIG. 21a shows a 32-bit to 32-bit transfer while FIG. 21b depicts a typical transfer of a 40-bit word from a 40-bit memory to a 32-bit memory.
FIGS. 22A-22H depicts typical audio data transfers between 32-bit memories. FIG. 22A shows the situation where no conversion is needed for 16-bit stereo being transferred in a little-endian format. FIG. 22B depicts an exemplary transfer with conversion from 16-bit stereo big-endian to 16-bit stereo little-endian. FIG. 22C depicts a transfer with conversion from 16-bit mono, little-endian into 16-bit stereo, little-endian. FIG. 22D depicts an exemplary transfer with conversion from 16-bit mono, big-endian to 16-bit stereo, little-endian. FIG. 22E depicts a transfer with exemplary conversion from 8-bit stereo, signed to 16-bit stereo, little-endian signed. FIG. 22F illustrates a transfer with conversion from 8-bit stereo, unsigned to 16-bit stereo, signed. FIG. 22G depicts a typical transfer with conversion from 8-bit mono, signed to 16-bit stereo, signed, while FIG. 22h depicts a transfer with conversion from 8-bit mono, unsigned to 16-bit stereo, signed.
FIG. 22i is a conceptual block diagram of the preferred circuitry 2200 for performing the information manipulations shown in FIGS. 21 and 22. DMA controller 208 is responsible for transferring 32-bit data doublewords between the PCI interface 206 and the 32-bit SP memories 202/203/204. DMA controller 208 allows addresses in host memory and SP memory to be specified as byte addresses rather than requiring that all addresses be aligned to doubleword (32-bit) boundaries. Because data transferred on the PCI bus must always align to a doubleword boundary in host memory (per PCI bus specification) and data transferred to SP memory must address doubleword quantities (it's a 32-bit memory), a mechanism for left and right-shifting the 32-bit data by 0, 1, 2, or 3 bytes during transfer is required. This allows a given byte or bytes to originate at any byte address in host memory, and be transferred to any byte address in SP memory, even though the datapath always transfers 32 bits at a time.
Just before data enters the FIFO memory, and just after it leave the FIFO memory, the data passes through the circuit 2200 shown in FIG. 22i. Each multiplexer 2201 selects between two or more 8-bit quantities and outputs a single 8-bit quantity. When the FIFO is being filled, data comes from either the PCI interface 206 or sp memory 202/203/204, and when the FIFO is being drained, data comes from the FIFO RAM. The first set of four muxes 2201 select among these three inputs. AND gates 2202 allow for 8-bit bytes to be selectively masked.
The second and third rows of muxes 2201 are interconnected in a structure which allows the incoming data to be shifted by 0, 1, 2, or 3, bytes in either direction. This would ordinarily be done with a commonly used circuit called a barrel shifter. This circuit is not a barrel shifter, but a variation which allows the data to be audio-converted at the same time it is shifted.
Audio conversion requires certain input bytes to be replicated on the output (to convert mono to stereo data), requires different bytes to be left-shifted by different amounts at the same time (to convert 8-bit to 16-bit audio) and requires the ability to replace one or more bytes with a "zero" byte.
A complex control circuit is provided (not shown), operating to generate the sequences shown in FIGS. 21 and 22, which controls the select lines on each mux 2201, and allows the datapath to be shifted by one or more bytes while simultaneously routing the bytes as needed to perform the audio conversions.
The 32-bit register 2203 is used to hold the previous doublewords transferred, so that bytes can be combined between successive doublewords to produce a single output doubleword.
In Circuit 2200, all audio conversion is done during the draining of the FIFO only. During the filling of the FIFO, data is simply right-shifted to compensate for an offset of 1, 2, or 3 bytes in the source memory (either host or SP memory). On the draining of the FIFO, data is both left-shifted (to align to a byte offset) and converted to a new audio format if necessary.
FIG. 23 is a block diagram depicting a preferred mapping of the memory system of accelerator 200. As can be seen in FIG. 23, for DMA purposes the entire memory system can be viewed as a single memory space.
FIG. 25 is a top planned view of accelerator 200 depicting a preferred 200-pin PQFP. Functional descriptions of the pins of the pin-outs shown in plan view 25 is provided in TABLES 25A-25D for reference. For purposes of the following discussion, the pin-outs shown on FIG. 25 and the corresponding functional descriptions in TABLE 25 will be assumed. Those skilled in the art will recognize that the physical configuration as well as both the functional and nomenclature may vary.
Serial 10 ports 207 (FIG. 1) provide digital audio data paths in and out of accelerator 200, since the main function of accelerator 200 is to process multiple streams of audio data in various formats (e.g., DirectSound buffers, synthesis voice streams). Advantageously, input/output ports 207 allow for several operational modes in order to support a multiple system and chip configuration.
IO block 207 consists of a set of primary input/output ports, a pair of auxiliary output ports and a master timing and control port. The primary input/output ports comprise a dedicated set of serial data pins while the auxiliary ports port up to four more digital audio output streams as two stereo streams. It should be noted that the auxiliary ports are optional ports which are multiplexed with the joystick button input functions.
FIG. 26A is a conceptual block diagram of the primary serial input and output ports. The primary output port includes a set of first in/first out registers 2600 for pipelining data received from stream processor 100. The data pipelined from output sample FIFOs 2600 are provided to a data shifter/formatter 2601 under the control of command addresses and data presented through port timing and control 2606. Serial data is then output from shifter/formatter 2601 through the serial output port (SDOUT) 2602.
Data is received through the serial data input port (SDIN) 2603. The received data is then passed to a shifter/data extractor 2604 and then the resulting extracted samples are provided to the input sample FIFO 2605. The outputs from input sample FIFOs 2605 is sent on to stream processor 100 along with status address and data. The timing and control of data through the primary serial input is controlled by a port timing and control circuitry 2606 common with the serial output block.
The preferred organization of the auxiliary output ports is provided in FIG. 26B. The first auxiliary output port (OUTPUT PORT 2) includes an output sample first-in-first-out memory 2607 and a shifter/data formatter 2608. The output of shifter/data formatter 2608 is controlled by a multiplexer 2609. Multiplexer 2609 allows serial data and joystick information to be multiplexed through a single pin (JAB1/SDOUT2) 2611. The auxiliary output ports are also controlled by port timing and control circuitry 2606.
The structure of this second auxiliary output port (OUTPUT PORT 3) is similar to that of output port 2. Output port 3 includes output sample FIFO 2611, a shifter/data formatter 2612 and a multiplexer 2613 multiplexing a further IO pin (JAB2/SDOUT3) 2614.
FIG. 26C depicts a preferred structure of the auxiliary input port. The auxiliary input port, which is also timed by port timing and control circuitry 2606, includes a shifter/data extractor 2615 receiving data through multiplexer 2616. Multiplexer 2616 multilpexes IO pin 2617 (SDIN2/GPIO) which receives serial input data or it can be used as a general input/output pin.
FIG. 26D is a more detailed block diagram emphasizing the timing inputs and outputs to the serial ports 207. The clock generation will be discussed further below. Pin 2619 (ABITCLK/SCLK) is primarily for the exchange of the master timing clock for serial audio data. When Accelerator 200 is used with an Intel.TM. AC'97 Codec, pin 2619 receives the bit rate clock from AC'97 Codec. When accelerator 200 is used with an audio motherboard, pin 2619 receives a serial audio data clock (Sclock) from the audio motherboard. In External DAC configurations, pin 2619 can be used to output a serial bit clock.
Pin 2620 (ASYNC/FSYNC) provides for the exchange of the framing clock for serial audio data. In configurations using an AC'97 Codec, pin 2620 is an output which defines the framing for the AC 97 link. In Audio motherboard configurations, pin 2620 is input for receiving the frame synchronization signal FSYNC. In external DAC configurations, pin 2620 is an output for providing the LRCLK frame clock.
Pin 2621 is a multiplexed pin which receives information from the Joystick B, button No. 1. For non-AC 97 Codec system configuration, pin 2621 is used to output an alternate framing clock LRCLK for the auxiliary output ports SDOUT2 and SDOUT3.
Pin 2622 is provided as an input pin for joystick B, button 2. In non-AC 97 Codec system configurations, pin 2622 can be used to provide a master output clock when enabled.
FIG. 27A is a conceptual connection diagram depicting a configuration where accelerator 200 is functioning as a PCI accelerator on a audio motherboard. In this illustration, accelerator 200 is coupled to a Crystal Semiconductor 42373b ISA Codec 2700. In this case, the link sample rate is 44.1 KHz and the phase lock loop clock source is providing an SCLK at 2.822 megaHertz. Preferably, ISA Codec 2700 is the timing master in this configuration. The master timing source in the configuration of FIG. 27A is a 16.9344 MHz crystal oscillator. The serial bit rate clock (SCLK) provided by the PLL/Clock control section of accelerator 200 for internal clock generation, which will be discussed in further detail below.
FIG. 27B is a timing diagram depicting selected clocks and signals to demonstrate the typical exchange of clocks and signals between the Codec and accelerator 200 in the configuration of FIG. 27A. Again, frame synchronization signal FSYNC is running at a fixed 44.1 kHertz, which is the link sample rate. The SCLK is running at 2.822 megaHertz, which provides a 64.times. sample rate (i.e., 64 SCLK periods per FSYNC). An explanation and description of the clocks and signals shown in FIG. 27B is provided in TABLE 26.
In the configuration of FIG. 27A, and as shown in FIG. 27B, the output format is 16-bits per output channel (left and right), MSB first with 16-bits of padded 0's following the output sample. The MSB shift preferably is output the same clock as the transition in the FSYNC signal. The left channel is output with FSYNC rising and the right channel is output with FSYNC falling. The target for the accelerator 200 serial output port is the serial input port to Codec 2700.
The accelerator 200 primary serial input port is enabled in the configuration of FIG. 27A. The input format consists of four data fields in the two (left/right) channels. Preferably, for the left channel data, the first 16-bit ADC data is received MSB first, then the 16-bit DAC data is received, also MSB first. Next, the right channel data, another ADC/DAC pair, is shifted into the serial input port. The left channel is framed by the FSYNC logic high time, and the right channel is framed by the FSYNC logic low time. In this configuration, the auxiliary input and output ports are not required.
FIG. 28 is an expanded version of the configuration option depicted to FIG. 27A. In this case, two digital analog converters 2800a and 2800b are employed for example. Digital-to-analog converters 2800, for example, are Crystal Semiconductor 433x digital-to-analog converters. Accelerator 200 in the configuration of FIG. 28 is functioning as a PCI accelerator for a co-resident multimedia audio subsystem, such as a Crystal Semiconductor 4237B motherboard, with an additional set of stereo DACs. A preferred timing diagram illustrating the typical operation of the configuration shown in FIG. 28 is given in FIG. 29. A brief description of the corresponding signals are given in TABLE 27.
In the system of FIG. 28 the primary serial input and output ports are configured and function as discussed above with regards to configuration of FIG. 27A. However, in the embodiment of FIG. 28, the serial output 2 (FIG. 26B) is also enabled and operates as shown in FIG. 29. The output format is 16-bits per output channel MSB first, with 16-bits of padded zero's preceding the output sample. Preferably, the MSB is output 16 clock periods following the transition of FSYNC. The left channel is output with LRCLK high and the right channel is output with LRCLK low. The target for serial output port 2 is the input of a selected one of the DACs 2800.
Serial output port 3 coupled to the other DAC 2800 provided in the configuration of FIG. 28 and is enabled. The operation of serial port 3 is similar to that of serial output port 2. In this configuration, the second serial input port, serial input port 2, is not used.
FIG. 30 depicts the interconnection of an AC'97 Codec 2800 with accelerator 200. In this case, the link sample rate is preferably 48-kHertz, the PLL clock source, the clock ABITCLK which is running at 12.288 megaHertz. Preferably, Codec 2800 provides the master clocking signals from a 24.576 crystal oscillator.
FIG. 31 shows a further configuration possibility for accelerator 200. IN the configuration of FIG. 31, accelerator 200 is functioning as a "direct sound" accelerator. In this case, accelerator 200 drives three digital-to-analog converts 2900, each of which is preferably a crystal semi-conductor 433x digital-to-analog converter. In this case, the timing is generated by accelerator 200 in response to a master clock from a 12.288 megaHertz crystal oscillator. Preferably, the link sample rate for the configuration of FIG. 31 is 48 kHertz.
Input/output ports 207 are selectively configured and enabled by register set within accelerator 200. For purposes of the discussion below, it will be assumed that all four of the exemplary configurations above can be supported. Those skilled in the art will recognize that the available registers can also support further configurations, as desired.
FIG. 32 is a preferred diagram of the serial port master control register 1. This register includes bits for enabling and disabling input/output serial port functions and for controlling the timing of data transfers through IO ports 207. A brief bit description for the bit field of the serial port master control register of FIG. 32 is given in TABLE 28.
The serial port master control register 2 (SERMC2) is conceptually depicted in FIG. 33. A brief description of the bitfields of the serial port master control register shown in FIG. 33 is provided in TABLE 29. Generally, the bits in this register enable and disable the LRCLK and MCLK clock outputs provide for the selection of the MCLK frequency.
FIG. 34 depicts the bitfields for the serial port configuration register (SERC1). This register controls the configuration of the primary output port including enabling and disabling primary output port (OUTPUT1) and defining the data output format. A brief description of the register bitfields is also given in TABLE 30.
Serial port configuration register 2 (SER2) of FIG. 35 similarly configures the primary input port. This includes enabling primary input port (INPUT1) and defining the data is to be received thereby. A brief bit description corresponding to FIG. 35 is shown in TABLE 31.
FIG. 36 depicts the bitfields for the serial port configuration register 3 (SERC3). This register controls the configuration in enabling of auxiliary serial output port (OUTPUT2). A brief description of the bitfield functions are found in TABLE 32A.
FIG. 37A generally depicts the bitfields for serial port configuration register 4 (SERC4). TABLE 32 generally described the functions of the bits stored in serial port configuration register 4. Generally, this register enables the second auxiliary output (OUTPUT 3) and defines the output data format for the port. The bitfields for this register are provided in FIG. 32B.
FIG. 37B depicts serial port configuration register 5 (SERC5). Generally, this register controls the configuration of the auxiliary input port (INPUT PORT 2) including enablement and input data format definition. A brief description of the functioning of each bitfield is provided in TABLE 33.
Accelerator 200 provides for the interface with an external serial EEPROM memory subsystem which provides power-up configuration information. FIG. 38 is a conceptual functional block diagram emphasizing the connections between accelerator 200 and a serial EEPROM 3800. While EEPROM 3800 is depicted as a single block, it may in actuality be constructed from one or more separate devices. It should be noted that while the serial EEPROM is not required for proper operation of accelerator 200, it may be required to support specific operating system compatibility requirements. For example, it may contain vendor and part ID fields such that the host software can properly configure. If a serial EEPROM is not present, accelerator 200 is generally enabled for use on the PCI bus and the subsystem id fields (ID and vendor ID fields) in the primary configuration registers are set to zero.
The presence of an external EEPROM is detected by attempting to load and check for valid header on power-up. A simple two pin connection is used as shown in FIG. 38 in which serial clock EECLK is exchanged to EEPROM 3800. Serial data IO is exchanged through the EEDAT pin.
Accelerator 200 only accesses EEPROM 3800 after a hard reset or on power-up. In particular, accelerator 200 only reads from EEPROM device 3800; writing to EEPROM 3800 is accomplished using the PCI bus EEPROM access port in the configuration interface register. A preferred minimum timing relationship between the clocks and data is shown in FIG. 40. Preferably, the state on the data line changes only when the clockline is low. A state change on the data line (EEDAT) during the time that the clock time is high in this case is used to indicate START and STOP conditions.
FIG. 41 depicts a preferred read access sequence from EEPROM 3800. The timing generally follows that of a random read sequence. Accelerator 200 first performs a dummy write operation, generating a START condition followed by the slave device address and the byte address of zero. The slave address is made up of a device identifier (0.times.A) and a bank select bits. Bank select bits select from among eight 256-byte blocks of EEPROM devices. The bank select bits may also be used to select from among 256-byte blocks within a single device memory (i.e., a 1-K byte memory comprised of a single 1-K byte EEPROM with four 256-byte banks). Accelerator 200 begins the access at byte address 0 and continues the access a byte at a time. The byte address automatically increments by one until a STOP condition is detected.
FIG. 39 is a diagrammatical representation of the configuration register (CFGI) that contains the control bits for host-software based manipulation of external EEPROM subsystem 3800, when attached. A brief description of the bitfields are defined in TABLE 34.
PCI (host) access to EEPROM 3800 is also enabled via the DIN/EEN bit in the configuration interface register. When the DIN/EEN bit is written to a 1, then the CLK and DOUT bits are enabled at the EECLK and EEDAT pins, respectively. Timing of the clock and data signals preferably are completely determined by the host-based software program.
TABLE 35 describes the contents of EEPROM 3800, when used. The configuration space loads in doubleword alignment.
As discussed above, accelerator 200 includes a programmable clock control, to allow it to interface in various configuration, depending on the functionality of the associated devices. The clocking model is shown in FIG. 42. This clocking design has several advantages. Among other things, it supports an independent timing environment where accelerator 200 is essentially acting as a stand alone system. The design also uses a phased-locked loop (PLL) which generates a variable speed clock in the 60-100 Megahertz range for core processor 100 from the 12.288 MHz or 2.822 MHz incoming clocks. Advantageously, stream processor 100 does not drift from the master incoming clock as a result. The preferred design further provides for clean clock shut-down, as required for power saving when no clock intensive processing is being performed.
The clocking model is based around a crystal oscillator 4200 and a phase lock loop 4201. Multiplexer 4202 allows for the selection between either the input through the crystal oscillator 4200 or output volume up and volume down control information. A second multiplexer 4203, under software control, selects between the output of crystal oscillator 4200, the serial port bit clock, or the PCI bus clock for passage on to pre-dividers 4204. Pre-dividers 4204 and operable to divide the signal input thereto by any divisor in the range of 1 through 16. The output of the predivider is connected to phase lock loop 4201.
The output of phase locked loop 4201 passed through a divide by two circuit 4206 onto a divide by 4 circuit 4207 and a multiplexer 4208. The divide by 4 circuit 4207 provides an output to monitor the phase lock loop for testing purposes. A multiplexer 4208 selects between either the PCI clock, the output from divide by two circuit 4206 and a test SPCLK. The ability to input a test clock advantageously allows for tests of stream processor 100 directly. The output of multiplexer 4208 is simultaneously presented to the inputs of a pair of clock buffers 4209 and 4210.
Clock buffer 4209 drives stream processor core 100 while clock buffer 4210 drives the on-chip memory and DMA engine 208. Clock buffer 4210 further drives frame timer 4211 which provides the 8K kilohertz frame clock. The frame clock defines processing periods; within each 8 kilohertz frame clock period, time allotted to various tasks such as wavetable or synthesizer algorithms execution.
Clocking is controlled by a set of clock registers. Clock control register 1 (CLKCR1) controls the oscillator pin select, oscillator power up, phase lock loop source select, PLL power up and the software clock enable, and output clock select, shown in FIG. 42. FIG. 43 is a diagram representing clock control register 1 and TABLE 36 provides a brief description of the function of each bit in the register bit fields.
FIG. 44 diagrammatically describes the clock control register 2 (CLKCR2), which controls the pre-divide count of the source clock for PLL 4201. Bitfield shown in FIG. 44 is further described in TABLE 37.
FIG. 45 depicts the phase lock loop multiplier register and table 38 describes the functioning of the bitfield therein. In particular, the register holds bits which select the multiplier for the phase lock loop conversion.
Accelerator by 200 includes a feature reporting register and configuration of load registers which contain feedback bits for software based detection of various device and device family configuration options. FIG. 46 is a diagrammatical depiction of the feature reporting register. TABLE 39 is a brief description of the bitfields. Generally, the feature reporting register identifies the type of fabrication processes used to construct accelerator 200 and a field for which identifies up to 8 configuration options available for a given device.
The configuration load register 1 (CLFL 1) and configuration load register 2 (CLFL 2) are depicted in FIGS. 47 and 48 respectively. These registers generally provide a host for reading bytes of device configuration options from or during a BIOS pre-load. General description of the bitfield is provided in TABLES 40 and 41.
Accelerator 200 includes an interrupt controller which receives interrupt requests from multiple sources on chip and in response presents a single interrupt line (INTA) to the host system via the PCI bus. The interrupt control registers provide a host interrupt service routine port for a source identification and methods for clearing the sources and indicating end-of-interrupt (EOI).
FIG. 49 is a general depiction of accelerator 200. The interrupt sources includes virtual channels 0-15, the end of DMA for host initiated transfers, SP interrupt channel 0, SP interrupt channel 1 SP double frame overrun, and MIDI interrupt.
The available registers include the host interrupt status register (HISR) which reports pending interrupt sources, the host signal register 0 (HSR0) which reports virtual channel signals, and host interrupt control register (HICR), which is the command register for end of interrupt control and initialization.
The master interrupt enable bit, INTENA, controls the assertion of the interrupt line (INTA) at a global level. When INTENA is clear, no interrupt will be granted as a result of any of the interrupt sources going active. When INTENA is set, any interrupt source assertions will generate an external interrupt. INTENA is set (i.e. interrupts are enabled) and EOI command is received in the HICR register. INTENA is then cleared (i.e. the interrupts are disabled) in response to a number of conditions; a host read of the HISR register if any interrupt source bits are set; explicit clear by write of the HICR command register; or a device hardware reset. It should be recognized that if the HISR register is read and no interrupt source bits have been set, INTENA is not effected.
The preferred interrupt model is further supported by a "virtual channel" mechanism. Generally, virtual channels are a signalling mechanism used to extend the single interrupt channel for given processor concept into a multi-channel stream handling and messaging architecture. (The register fields for virtual channeling have already been discussed above.) Each stream which is read from or written to a modulo buffer in sample memory is assigned a virtual channel number. The virtual channel number is signaled by the DNA engine 28 anytime the modulo buffer pointer passes the midpoint or wraps around indicating that the buffer is filling or emptying and interrupting the host until data is available.
An interrupt to the host is also triggered when certain virtual channels 0-15 are signalled. This permits immediate signalling of buffer conditions. The other virtual channels set a virtual channel data that may be read by the host or stream process core 100 at a later time. This scheme is advantageously used for 3-D sound and DACSRC source buffers. Any critical buffers in this instance would use a virtual channel that immediately interrupts the destination processor. (e.g. the host CPU).
The virtual channels may also be used for message passing. In this case, each message cue would be assigned to its own virtual channel in software. Some messages are urgent, and are assigned to interrupting virtual channels 0-15; other messages require service eventually and would be assigned to non-interrupting virtual channels. TABLE 43 summarizes the actions taken by the signal receiver in response to given virtual channel signals.
To use the vertical channels to signal when sample stream buffers need servicing, a byte in the DMA requester block reflects whether the selected virtual channel is signaled at the end of each DMA transaction, or only at the end of a DMA transaction which cost a half-way point in a modular buffer. Periodic polling of the signal register bank is provided to determine which buffers need to be refilled and those buffers can be consequently refilled when necessary.
FIG. 50 is a diagrammatical depiction of the HISR register. Generally this host interrupt status register provides interrupt source information to the host interrupt service routine. Reading does not have side effects. A description of each of the byte fields is found in TABLE 44.
FIG. 51 depicts the HSR0 register. This host signal register reports the virtual channels which have been signaled since the last read of the register. The set of virtual signals does not interrupt the processor upon assertion, but depends on the periodic polling by the host. A description of the byte fields for register HSR00 are provided in TABLE 45.
FIG. 52 is similarly a diagrammatical representation of the HICR register. This host interrupt control register provides a host write port for end of interrupt signalling period and discrete masking of interrupts. It also provides a read port for INTENA status of the byte fields of the HICR register are described in TABLE 45.
FIG. 53 is a functional block diagram of a preferred performance monitor model for accelerator 200 which allows for real-time monitoring key internal system and device performance indicators. The performance monitor of FIG. 53 forms a portion of PCI Interface 206. The basic performance monitor model is based on a pair of counters 5301 and 5302 with programmable count sources. The event count sources presented to counters 5301 and 5302 by respective multiplexers 5303 and 5304. These multiplexers are in turned controlled by corresponding set of control registers of 5305 and 5306. The output of counter is held in performance counter value register of 5307 and the output of counter 5302 held in a performance counter value register 5308, respectively. The output of these registers are presented to the host read port.
The performance monitor allows the user to identify such factors as bandwidth use and PCI transactions per second required, by accelerator 200. This monitor can be critical in situations where accelerator 200 is acting as the PCI bus monitor in order to access the host memory. The loading of resources and tasks can more fully be appreciated based on the performance monitor. For example, if accelerator 200 is being used in a lower performance system and the required bandwidth is formed by monitoring not to be available, tasks on accelerator 200 can be re-allocated as required to optimize performance.
The dual counter of the present system allows for different parameters to be compared. For example, one counter may monitor the number of PCI transactions being consumed and the other counter may monitor the number of clocks. From this, a value for the average number of clocks per transaction which is one gauge of system performance, is calculated.
It should be noted that the dual counter approach provides a further advantage. Counters 5301 and 5302 can be used to determine the stability of the phase locked loop discussed above. During the start-up of a phased locked loop there is always a period of instability. By repeatedly counting the number of clocks output from the phase locked loop over a given period of time relative to a known frequency (clock), a determination can be made as to stability. By incorporating this function with the performance monitor, separate counters associated with the clock generation circuitry previously discussed can be eliminated thereby saving silicon.
The performance control register 5305/5306 PFMC diagrammatically depicted in FIG. 54. TABLE 46 is a brief description of the PFMC bitfields. This register generally provides the host control port for the performance monitor counters 5301 and 5302.
FIG. 55A depicts the performance counter one value register (PFCV1) 5308. This register is generally a read back register for counter 5302 results. During active, performance monitoring (C1RS=1), this register is not updated real time and its contents are undefined while counting. This register contains a valid count only when the counting is stopped. TABLE 47 is a description of the bit fields for the performance counter 1 value register of 308.
FIG. 55B is a depiction of performance counter 2 value register (PFCV2) of 5307. Generally, this register is a read back register for counter 2 5301 results. During active performance monitoring (C2RS=1) this register is not updated in real time and its contents are undefined. This register contains a valid count only when counting is stopped, preferably. TABLE 48 is a description of the bit fields of performance counter 2 value register 5307.
Both counters 5301 and 5302 preferably go with the same set of input events for use as count sources. TABLE 49 defines the event select and codings.
Starting a performance monitor consists of selecting count sources for the intended performance metric and enabling counters 5301 and 5302. Initialization and start-up of counters 5301 and 5302 is accomplished as follows. A write is performed to performance monitor control registers 5305 and 5306 with the intended source selects and with bits assuring that both counters are stopped, cleared, and ready to count. In a write performed to the performance monitor control registers with the source selects and both counters are enable. TABLE 50 depicts a preferred set of source selects for performance monitoring.
Stopping and readback to determine system status is accomplished by the following procedure. A write is performed to the performance monitor control registers 5305/5306 with the same source selects used to initiate the monitoring along with bits to stop the counters. On the transition from a logical 1 to a logical 0 in the RS (run-stop) bits, counting stops and the counter contents are transferred to the value registers 5307-5308, and the counter then cleared to 0. The results are then read from the performance count value registers 5307 and 5308.
PCI interface controls the exchange of data between accelerator 200 and the PCI bus. TABLE 51 defines the transfers available through PCI interface 206. These data transfers include transfers initiated by the host for accessing the on-chip memories of accelerator 200 and DMA engine 208 initiated transfers for reading and writing to host-memory. TABLE 52 defines the primary PCI configuration space for accelerator 200.
Accelerator 200 has stream processor capabilities to facilitate start up and shut down of stream processor 100 and for debugging.
The signal processor control features include a soft reset, master run/stop, stop at next frame, run at next frame, "tick" (i.e., stop processor by a single clock), frame boundary emulation during tick stepping, DMA request engine pause/continue, frame divider programmability which sets the number of clocks per frame, and trap registers providing instruction breakpoint capability.
Among the status facilities and status-accessible elements provided in accelerator 200, are registers r0-rF (FIG. 2) accumulators for the multiply-accumulate units, multiplier inputs from the Ybus, instruction trap registers, the top of the stack, sample AGU state, CPU status register, MAC mode register, stack pointer, DO loop counter, and DMA register structures. These facilities are operable in the debug mode with a stream processor 100 stopped.
Also included are stream processor status facilities and status-accessible comments which can be updated and read in real-time. These include a stream processor clock status register, program counter, DMA current stream number and frame timer current count. Additionally, DMA stream requestor array, instruction trap registers, and the stack pointer are state writable by the host.
FIG. 56 is a diagrammatical depiction of the stream processor control register (SPCR). Generally, the steam processor control register maintains bits for controlling stream processor 100 operation, including de-bugging support. A brief description of the functioning of each bitfield as shown in FIG. 57 is given in TABLE 53. Included are master run/stop bit, stop and start at frame bits, a single clock "Tick" bit, DMA request enable bit, and a reset bit.
FIG. 57 depicts the bitfields for the debug register index (DREG) register. This register contains the master debug access enable flag, seven bit register ID indexing field, and 3-bit register block used to specify which debug state register to access. Descriptions of the bitfields as shown in FIG. 57 is provided in TABLE 54. Functional group of register one (FGR1) is a register which is dependent upon the status of the debug bit in the DREG register shown in FIG. 57. If debug=0, then this register provides a real-time in processor program counter monitor. If debug=1, then this register provides processor state formation according to the RGBK and REGID fields in the DREG register. The bitfields for this register are provided diagrammatically in FIG. 58.
When the RGBK field in the debug index register is set to zero, the register file 101 contents are returned in functional group register 1 in response to the REGID field in accordance with TABLE 55.
When the RGBK field is set to a 001, the instruction RAM address generation unit can be accessed for state determination. In particular, the contents of the instructions trap registers and the top of stack register are accessible in accordance with the bits written into the REGID field, as shown in TABLE 56.
When the RGBK register is set to 010, the registers of the sample address generation unit can be accesses as described in TABLE 57.
TABLE 58 shows the CPU state access monitoring instruction which is invoked when the RGBK field is set to 011. Similarly, TABLE 59A describes the available DMA requestor state access invoked when the RGBK field is set to a 200. TABLE 59B describes the case where the RGBK bits have been set to 209, allowing access to the MAC unit state registers.
The DMA stream requestor array state write port (DSWP) is controlled by the register diagrammatically depicted in FIG. 59. This register preferably is a write only port for the DMA stream requestor array. The DRS[3:0] field defines the DMA requestor state. When this field is written, state of the DMA requestor for a given stream is set, with the stream number specified by row and column in the REGID field according to TABLE 60. In this case, the RGBK field is set to 200. For the DRS [3:0] field, bit 3 is defined as the request pending bit, bit 2 is a priority [1], bit 1 is priority [0] and bit 0 represents a background request.
FIG. 60 is a diagrammatical depiction of the stream processor clock status register (SPCS). This register is a read-only status register for the stream processor clock control state machine. Preferably, the SP clock status register is a "real-time" status register that can be read at any time, regardless of the in-process run state or the debug bit state. This register could, for example, be monitored after a write to SPCR to detect when the signal processor state actually changes, since many state machine transitions occur at frame boundaries. TABLE 61 describes the functioning of each of the bitfields in the SP clock status register of FIG. 60.
The stream processor DMA requestor status register (SDSR) is depicted in FIG. 61. The stream processor DMA requestor status register is preferably a read-only status register for the DMA stream requestor engine. Preferably, this register is also a "real-time" status register that can be read at any time, regardless of the stream processor run state and debug bit state. Bitfield description is provided in TABLE 62.
The trap write port register (TWPR) is diagrammatically depicted in FIG. 62. This register provides the write-port for instruction breakpoint trap registers. Individual registers are selected by the value of REGID in the DREG register. The RGBK register is set to a 100. Read access is provided through the functional group register 1 discussed above. Preferably, this register can be written to in "real-time" while stream processor 100 is running. Additionally, the state of signal TRAPEN does not affect the ability to write to this register. TABLE 63 defines the instruction trap register accessed with each relevant value of REGID. The TW[15:0] field receives the trap write of a 16-bit breakpoint address.
The stack pointer write register (SPWR)is diagrammatically depicted in FIG. 63. This register provides access to the stack pointer when DEBUG=1. Where the top of the stack is visible in the debug mode, the entire stack may be examined by sequencing the stack pointer through all 16 principle values. The field STKP[3:0] defines the stack pointer.
FIG. 64 depicts the preferred bitfields for the frame timer register (FRMT). The frame timer register provides a host port for setting a frame timer preload value and can be read to or written from at any time, regardless of the stream processor 100 run state. The bitfield FTV[15:0] defines the frame timer value (i.e., the number of SP clocks between frames).
The frame time current count (FRCC) register is depicted in FIG. 65A. The frame time current count register provides a host port reading the frame timer current value and can be read in "real-time". The field FCC[15:0] defines the frame timer value, the number of SP clocks between frames. FIG. 65B depicts the frame timer (FRSC) register which provides a host port for reading the frame timer's saved value, which is saved when SP 100 enters deep sleep. In the FRSC register shown in FIG. 65B, bits FCS[15:0] hold the frame timer save value.
A number of preferred procedures for controlling stream processor 100 are provided according to the principles of the present invention. Those skilled in the art will recognize that alternate procedures may be used in alternate embodiments.
In the preferred start-up procedure, program memory is loaded through either a host BA1 memory poke mechanism or a host initiated DMA. Then, parameter RAM 202 is loaded with an initialization image (program), is required by the previously loaded SP program image in program memory 203, through either a host memory poke mechanism or host initiated DNA. The RUN and SPRUN bits in the SPCR register are set. Processor 100 then starts running at the next frame boundary. Monitoring of RUNFR can then take place since hardware will reset this bit after is starts running.
A preferred procedure for stopping stream processor operation at the frame boundaries for debugged purposes is also provided. In this case, the STPFR bit in SPCR (FIG. 56) register is set. The STFR bit is monitored in the SPCR register (FIG. 60) for one to zero transitions. Stream processor 100 is now stopped and emulated frame mode is automatically switched on. The STPFR bit in the SPCR register is cleared by hardware when the SP stops at the next frame. Then the SDSR byte is monitored until the current stream equals zero (to make sure all pending DMAs are complete). Next, the DRQEN bit in the SPCR register is cleared to prohibit new DMA request generation. Finally, to verify that the stream processor 100 has stopped at the frame boundary and not in response to a deep sleep instruction, the program memory is examined to assure that deep sleep did not cause the STOP condition.
The SP has four interrupts. These are controlled by the SPIR. Interrupt 0 provides an emulate frame. While SP 100 is stopped, setting this bit to "1" will cause an emulated frame on the next tick.
Interrupt 1 is the double frame overrun interrupt. This bit will be set by hardware when two frame interrupts have been seen before completing the foreground task list. If IP1 is set, then this interrupt will actually interrupt the foreground task so that the task manager can reduce the SP loading dynamically.
Interrupt 2, 3 are general purpose interrupts used to communicate information between the host CPU and the SP. IF IP2/3 is set then the respective interrupt has the ability to interrupt the foreground tasks, otherwise it must wait for a transition to the background tasks.
Interrupt to the SP execute a CALL to an interrupt vector addressed by 0000 0000 001X XX00 B where XXX is the interrupt number.
Advantageously, stream processor 100 after it has been stopped, can be "single stepped" a clock at a time and status can be monitored between steps. In the preferred procedure, the TICK bit in the SPCR register is set to "1" each time a tick is to be performed. The hardware will reset the bit to "0". The emulated frames mode is automatically enabled when stream processor 100 is stopped. Then, the DEBUG bit is set to zero in the DREG register (FIG. 57) and thereafter the TICK bit in the SPCR is set. Stream processor 100 executes a single clock tick on the transitions from zero to 1 of the TICK bit. The DEBUG bit is set to one and the stream processor state is accessed from the registers as described above. During TICK-based stepping, the normal stepping procedure is modified to include setting an FRI bit in the SPIR.
The stream processor clock can also be stepped with the frame boundary procedure. In this case, the TICK bit in the SPCR register is cleared to prepare for transition and the FRI bit in SPRI is set for a frame boundary execution cycle. The DEBUG bit is set to 0 in DREG register and then the TICK bit is set in the SPCR register. Stream processor 100 executes a single clock tick on the 0 to 1 transition in the TICK bit along with a simulated frame boundary. The DEBUG bit is set to 1 and access to the stream processor state can be made, as required, according to the tables set forth above.
The stream processor 100 must be re-started at a frame boundary after it has been stopped and stepped. In the preferred procedure for re-starting at a frame boundary, the SP should be TICKED the number of clock cycles left in the FRSC register to bring it to a frame boundary.
The DEBUG bit is set to 0 is the DREG register. Thereafter the RUNFR bit in the SPCR is set. A check is made also to assure that the STPFR bit is cleared. Processor 100 will begin running at the next frame boundary. The RUNFR bit in the SPCR register monitored for a 1 to 0 transition to indicate the SP has taken the command.
Stream processor 100 may also be stopped at a frame boundary, examine state/register contents, and restart at frame without the use of any TICK commands. Such a stop/examine/restart procedure is as follows. The standard frame boundary stop procedure described above is performed to stop stream processor 100. The DEBUG bit set to 1 and the stream processor state is accessed as required in accordance with the TABLES described above. The DEBUG bit in the DREG register is set to zero. Thereafter, the RUNFR bit and DRQEN bits in the SPCR are set. The STPFR bit is cleared automatically by hardware. Thereafter, stream processor 100 will begin running at the next frame boundary. The RUNFR bit in the SPCR register monitored for a 1 to 0 transition to indicate the SP has taken the command. Exactly one frame can be executed by setting both RUNFR and STPFR in SPCR in the same command.
After the stream processor 100 has been stopped, the stream processor debug registers can be read using the following preferred procedure. It should be noted that the program counter, top of stack register, and the SPDMA requestor status register do not require that the stream processor be stopped or that the DEBUG bit be set, as they can be accessed at any time. At first, the DEBUG bit is set to 1 and a specific word is written into the REGID field and DREG. The functional group register is read to retrieve the desired state information. These two steps are repeated until all the desired state data is acquired. A zero is written to the DREG register to disable the DEBUG mode. Stream processor 100 can be reset at any time by software using the soft reset bit in the SPCR register. Preferably, the RSTSP bit in the SPCR register is set and the RUN, RUNFR, and DRQEN bits are cleared. Stream processor 100 will immediately be reset. Then the RSTSP bit in the SPCR register is cleared and stream processor 100 will be reset but stopped with the run bit cleared to zero.
Stream processor 100 can be placed in a deep sleep, which is essentially a software-initiated clock stop providing for the break points. To exit deep sleep, preferably the procedure used to restart at the next frame, discussed above, is employed.
As discussed above, accelerator 200 contains an instruction level trap mechanism implementing code breakpoints by a debugger. Eight trap address registers are provided which monitor the current in processor program counter in real time and upon detecting a match, BRANCH is substituted for the current instruction. The BRANCH address is a fixed trapped vector of 000h "0000 0000 000TT00" Binary with the trap register number in the bits TTT (i.e. trap zero goes to address 000h, trap 1 goes to address 0004h, and so on). Several trapping rules apply. Among other things, the trap registers can be written to in real time through the debug DREG register access method but the DEBUG bit cannot be set. The trap registers can also be written to when the TRAPEN bit is set to 1 also. The trap register contents consist of a 16-bit trap address with the lower 16 bits of the register, with trapping enabled via a global control bit, TRAPEN in the DREG register. The TRAPEN bit enables program counter comparisons against all 8 trap registers. There are no individual enable/disable per trap register, so unused trap address registers should be set to an address outside of the physical code space of signal processor 100. The trap registers can be manipulated by the host or stream processor 100 itself, although preferably there is no arbitration between the two. The trap registers are not readable in real time, but are readable through an independent DEBUG access register when the stream processor 100 is stopped and DEBUG equals one. All branching rules apply to trap addresses set.
A preferred procedure for setting instruction breakpoints via the trap registers through the host is as follows: DEBUG register is set up to access to the trap register desired through a write in which TRAPEN is set to zero, RGBK is set to 100, DEBUG is set to zero, and REGID is set to select the trap register number. A 16-bit trap address is written to the trap write port register (TWPR). These two steps are repeated until all the trap registers are set. Trapping is then enabled by writing to the DREG register wherein TRAPEN is set to 1 and DEBUG is set to zero. A host debugger can continue to modify the trap registers through the DREG and TWPR registers while TRAPEN is set to one. In addition to being used for breakpoints the trap register can be used to apply patch code to an embedded instruction ROM.
FIG. 66 is a diagram representing the host interface programming model. The accelerator 200 host interface is partitioned into 2 separate interface blocks which are memory mapped into the host memory address space. These interface blocks can be located anywhere in a 32-bit physical address space as defined by the address programmed into the base address registers, BA1 and BA2. These base addresses are set up by a "Plug and Play BIOS" initiated by the host. The first interface block BA0, located at base address zero, contains general purpose configuration, control and status registers for the device. Preferred register map for these registers is found in TABLE 64. The second interface block BA1 located at base address 1, maps all of the accelerator 200 RAMs into host memory space, along with the DEBUG registers. This advantageously allows the host to directly peak and poke the RAM locations on accelerator 200. A memory map for this second interface block is found in TABLE 65.
Accelerator 200 includes registers within I/O port 108 which allows for the host to write to the FIFO RAM 2600 and 2605 (FIG. 26A). Seven registers provide for configuring and statusing the serial audio input and output ports for backdoor operation.
FIG. 67A depicts the serial port backdoor sample pointer (SERBSP). TABLE 67A describes the bitfields for SERBSP register. Generally, this register provides a host and stream processor 100 accessible port for initialization and real time monitoring of the internal sample pointer for the input and output sample pointers.
FIG. 67B is a diagram of the serial port backdoor status (SERBST) register. TABLE 67B describes the bitfields for the SERBST register. Generally, the serial port backdoor status register provides a host port for checking the readiness of the host port for data register to or from the sample FIFOs following a transfer command.
FIG. 67C is a diagram of the serial port backdoor command register (SERBCM). The SERBCM register bitfields are described in TABLE 67C. The SERBCM register generally provides a host port for initiating a data transfer to or from the sample FIFOs.
FIG. 67D is a diagram of the serial port backdoor address (SERBAD) register. THe bitfields for the serial port backdoor address register are described in TABLE 67D. This register provides a host port for specifying the FIFO address for a host backdoor data transfer.
FIG. 67E is a diagram of the serial port backdoor configuration register (SERBCF). Table 67E is a corresponding description of the SERBCF bitfields. Generally, this register provides a host port for configuring the serial ports for backdoor operations.
FIG. 67F is a diagram of the serial port backdoor write port (SERBWP) register. TABLE 67F describes the bitfields of the SERBWP register, which provides a host port for specifying the FIFO data for a host backdoor data transfer.
FIG. 67G is a diagram of the serial port backdoor read port (SERBRP) register. The bitfields for this register are described in TABLE 67G. Generally, the serial port backdoor read port provides a host port for accessing the FIFO RAM data for a host backdoor data transfer.
To initialize the serial ports for host backdoor load operation, the serial ports are first configured by writing to the SERC1-SERC5, and SERMC1 and SERMC2 registers, as described above. The FIFO sample pointer is then initialized in the SERBSP register. The host backdoor bypass bit (HBP) in the SERBCF register is then set. The MSPE bit in the SERMC1 register is then set and the serial ports will now start running, with FIFO transfers occurring. The serial ports are now configured for host read and write operations to the FIFOs.
To write to a 20-bit sample to FIFO RAM, the write busy bit (WBSY) in the SERBST register is set to zero such that the host write port is ready to accept another entry. A FIFO RAM address between 0-255 is written into the SERBAD register followed by a write of the 20-bit sample data into the SERBWP register. A 0000000 2h is written into the command register SERBCM and the write of the sample data into FIFO RAM is synchronized and executed with the internal clocks.
To read a 20-bit sample to a location in FIFO RAM, a FIFO RAM address between 0-255 is written into the SERBAD register. The write command register SERBCM command register is loaded with a 0000000 1h (the read command bit, RDC, is active.) The read operation is then synchronized to the internal clock and execution begins. The post waits for the read data ready bit (RRDY) in the SERBST register to transition to a Logic 1, which indicates that the host read port contains the requested data. The 20-bit sample data is then read out of the SERBRP register by the host.
As discussed above, stream processor 100 and accelerator 200 are compatible with an INTEL AC97.TM. audio Codec. To implement this feature, accelerator 200 includes a set of registers for controlling the interface between accelerator 200 and the AC97 audio c. odec.
FIG. 68A is a diagram of the AC97 control register(ACCTL). TABLE 68A describes the bitfields of the ACCTL register. Generally, this register provides the host control port for the link between the AC97 device and accelerator 200.
FIG. 68B is a diagram of the AC97 status register (ACSTS). The bitfields for the ACSTS register are provided in TABLE 68B. Generally, this register provides a status port for the host and monitor the AC97/accelerator 200 link.
FIG. 68C is a diagram of the AC97 output slot valid register (ACOSV). TABLE 68C describes the bitfields of the ACOSV register. This register provides the host the ability to set the static slot valid signals for the AC97 tag phase (slot0).
FIG. 68D is a diagram of the AC97 command address register (ACCDA). The corresponding bitfields are described in TABLE 68D. This register generally allows the port to set the command address field for an AC97 frame.
FIG. 68E is a diagram of the AC97 command data register (ACCDA). The ACCDA bitfields are described in TABLE 68E. This register allows the host port to set the command data field for an AC97 frame.
FIG. 68F is a diagram of the AC97 input slot valid register (ACISV). TABLE 68F describes the ACISV bitfields. This register allows the host to sense the input slot valid signals for the AC97 tag phase (slot0).
FIG. 68G is a diagram of the AC97 status address register (ACSAD). TABLE 68G describes the ACSAD bitfields. The AC97 status address register allows the host to capture the status address field for an AC97 input frame.
FIG. 68H is a diagram of the AC97 status data register (ACSDA). The bitfields for this register are described in TABLE 68H. The AC97 status data register allows the host to capture the status data field for an AC97 input frame.
Table 68i generally describes the features available through the AC97 interface, as configured by the registers described above.
FIG. 69A is a diagram of the MIDI input/output port 6900. Data from the host is output to a MIDI device through a MIDI output FIFO (16 entries)6901, a shifter/data formatter 6902 and MIDIout port 6903. Data input from a MIDI source is passed through pin 6904, shifter/data extractor 6905 and a 16-entry input FIFO 6906. Loop back 6907 is provided to loop back data from the host through shifter 6905 and FIFO 6906.
MIDI input/output port 6900 has two major roles, depending on the system configuration. In the AC97 configuration, the MIDI port provides a basic bi-directional external MIDI interface for connection to "outside of the box" musical instruments. If an audio motherboard is used, the MIDI input port is used to connect the motherboard output port for the purpose of providing ampu-401 data to the MIDI controller/synthesizer.
FIG. 69B is a diagram of the MIDI control register (MIDCR). The bitfields for this register are described in TABLE 69A. The MIDI control register allows the host to control the MIDI input and output ports.
FIG. 69C is a diagram of the host MIDI status register (MIDSR). TABLE 69B describes the bitfields for the host MIDSR. This register allows the host to check the status of the MIDI input and output ports.
FIG. 69D is a diagram of the SPMIDI status register. Bitfields for this register are described in TABLE 69C. The SPMIDI status register provides the stream processor 100 access to the status for MIDI input port.
FIG. 69E is a diagram of the MIDI write port (MIDWP) register. TABLE 69D describes the MIDWP register bitfields. This register provides the host port for writing to the MIDI transmit FIFO.
FIG. 69F is a diagram of the MIDI read port (MIDRP) register. TABLE 69E describes the bitfields for this register. The MIDI read port register provides the host port for reading the MIDI receive FIFO. A stream processor 100 accessible version of this register is also provided.
The joystick port of I/O ports 108 provide four "coordinate" channels and four "button" channels for input capability. The coordinate channels provide a means for providing positional joystick information to the host system. The button channels provide user event information to the host. This port can operate in a traditional polled mode, or in a "hardware accelerated" mode where counters are provided for coordinate determination.
FIG. 70A is a diagram of the joystick poll/trigger register (JSPT). This register provides the host port for polling the button inputs and coordinate comparator outputs. A write to this port also triggers the coordinate charge/discharge cycle for polled measurements of coordinate values. The bitfields of the joystick poll/trigger register are provided in TABLE 70A.
FIG. 70B is a diagram of the joystick control register (JSCTL). This register provides the host port for controlling joystick port operations. The bitfields for the joystick control register are provided in TABLE 70B.
FIG. 70C is a diagram of the joystick coordinate register 1 (JSC1). This register provides the host port for reading digital assist coordinate counter values for the first joystick coordinate pair. The bitfields for this register are provided in TABLE 70C.
FIG. 70D is a diagram of the joystick coordinate register 2 (JSC2). TABLE 70D describes the bitfields for this register. The joystick coordinate register 2 provides the host port for reading digital assist coordinate counter values for the second joystick coordinate pair.
FIG. 70E is a diagram of the joystick GPIO register (JSIO). This register provides the host port for using the joystick coordinate pins for general purpose input of open-drain outputs in non-AC97 this register.
FIGS. 71A-71D illustrate a preferred system for transferring data between systems, subsystems, or components operating at different clock rates. For example, the circuitry of FIGS. 71A-71D could be employed to control the exchange of data between the accelerator 200, operating on a time base established by own master clock rate and the PCI bus, operating at the PCI bus clock rate. While the circuitry of FIG. 71 can be applied to many applications, for illustrative purposes, the structure and operation of this circuitry will be discussed in the context of exchange between accelerator 200 and the PCI bus, although the principles of the present invention are not limited thereto.
FIG. 71A is an electrical schematic diagram of synchronizer circuitry 7101 embodying the principles of the present invention. Memory read/write requests are received from the PCI bus through an OR gate 7102. The output of OR gate 7102 is gated with the signal READY by an AND gate 7103. As will be discussed further below, synchronizer circuitry 7101 is essentially a loop. The READY signal is basically a return signal or acknowledge which indicates that accelerator 200 memory is ready to accept a new memory request from the PCI bus.
The output of AND gate 7103 drives the control input of a multiplexer 7104 which in turn controls the toggling of a flip-flop 7105. It should be noted that multiplexer 7107 and flip-flop 7105 could be replaced with a single T-flip-flop. In this case, the control line to the mux 7105 toggles the T-flip-flop. When an active memory request is gated through OR gate 7102, and the READY signal is active (logic high), the output of AND gate 7103 is consequently logic high and the Logic 1 input mux 7104 selected. On the next PCI clock, the Logic 1 held at the D input flip-flops 7105 is clocked through to the Q output. On the other hand, if there are no pending memory requests or the signal READY is not active, the output of AND gate 7103 selects the Logic 0 input of multiplexor 7104. In this case, the Logic 0 is maintained at the Q output of flip-flop 7105.
The Q output of 7105 passes to the input of synchronizer 7106 which is clocked by the stream processor (SP) (accelerator 200) master clock. Synchronizer 606 comprises a falling edge triggered flip-flop followed by a rising edge triggered flip-flop. In this case, the output from flip-flop 7105 is clocked through the data inputs of the flip-flops and the clock inputs of the synchronizer flip-flops are controlled by the signal processor clock.
The output of synchronizer 7106 passes to one input of an exclusive OR gate 7107. The other input of exclusive OR gate 7107 is received from the return portion of the loop, also discussed below. Generally, an active signal (logic high) signal out of synchronizer 7106 is only passed by exclusive OR gate 7107 when the memory acknowledge signal (Mem Ack) indicates that the previous access to the target memory has been completed. This function is performed by Logic 7108, one input of which is the output of exclusive OR gate 7107.
The other input to Logic 7108 is a memory DONE signal received from AND gate 7109 and flip-flop 7110. Only when the previous access to accelerator 200 memory is complete is the next request passed through Logic 7108. When a new memory request is available and the last access is complete, Logic 7108 outputs to a series of OR gates 7111. A pair of OR gates 7111 are provided for each accelerator 200 memory, one for gate initiating a read and one gate for initiating a write. In FIG. 71A only two gates controlling reads and writes to memory N are shown for brevity and clarity. The control signal from Logic 7108 gates the output of memory decoder select circuitry 7112. In this example, memory decode select circuitry 7112 decodes the source ID and destination ID fields in the HSAR and HDAR registers. Thus, when Logic 7108 signals that memory request can be serviced, a control signal identifying the accelerator 200 memory to be accessed (as well as whether the access is a read or a write), is gated from decoder 7112 through the corresponding OR gate 7111. The outputs of each OR gate 7111 is output through a corresponding falling edge triggered latch 7113.
The output of Logic 7108 is also input to the set (S) input of flip-flop of 7110. The request acceptance (REQ ACC) signal from Logic 7108 sets flip-flop 7110 and active DONE signal (logic low) resets a flip-flop 7110. In essence, Latch 7110 latches the DONE signal and gate 7109 passes that signal back to Logic 7108 indicating that the previous request is complete and the new request can go forward.
Logic 7108 also provides the request acceptance signal to a multiplexer 7114 in the return loop which controls the toggling of a flip-flop 7115. Flip-flop 7115 is clocked by the stream processor clock.
In addition to being fed back to the Logic 0 input of multiplexer 7114, the Q output of flip-flop 7115 is sent to the second input of OR gate 7107 and a synchronizer 7116. This synchronizer synchronizes the output of flip-flop 7115 (memory acknowledge) with the PCI clock. Synchronizer 7116 also comprises a falling edge triggered flip-flop followed by a rising edge triggered flip-flop clocked by the PCI clock. The output of the synchronizer 7116 is then fed to a first input of an exclusive NOR gate 7117, the second input of which is the output of flip-flop 7105. The output of exclusive NOR gate 7117 is the signal READY which is passed to AND gate 7103 discussed above.
Thus, exclusive OR gate 7107 passes memory requests on to Logic 7108. Signal READY is also output to the PCI bus during reads from accelerator 200 to indicate that accelerator 200 is ready to accept a new DMA request. The READY signal is also gated by gate 7118 and arbitration logic 7119. Arbitration logic 7119 allows the host to arbitrate between the memory request, with peeks and pokes (single-dword accepted) having priority over direct memory burst accesses. Each time a new memory r/w request is accepted (7103 output is high) flip-flops 7105 and 7115 toggle their state, one after the other.
FIG. 71B is a timing diagram illustrating the operation of synchronization circuitry shown in FIG. 71A. Under the principles of the present invention, a read/write signal is sent to the identified accelerator 200 memory when the outputs of flip-flops 7105 and 7115 are both either in a logic low output state or in a logic high output state. The addresses and data shown in FIG. 71B are then passed on to the address and data buses discussed further with regards to FIG. 71C. For a write to accelerator 200 of memory, for example, three steps are essentially overlapped. First is the read of the source memory (host) memory with the PCI clock, synchronization of the data to the signal processing clock, and then a write into the destination memory in accelerator 200 with the signal processor clock.
FIG. 71C shows the data and address pipelines provide for the exchange of data between accelerator 200 and PCI bus and the exchange of addresses from the PCI bus to accelerator 200.
Data is exchanged with the PCI bus through a FIFO RAM 7121. The pipeline consists of three stages of registers. The first register stage (I) comprises a single register 7122 clocked by the PCI clock. Where pairs of 32-bit doublewords can be pipelined, first stage register 7122 acts as a temporary buffer (during transfers into accelerator 200) for the first address in the pair until the second address in the pair is ready for latching into the second stage. The second stage registers (II) 7122a and 7122b comprise two parallel 32-bit registers clocked by the PCI bus clock base. In particular, data being transferred (in either direction), is latched into second stage registers 7122 each time flip-flop 7105 toggles.
The third stage (III) of the pipeline also comprises two parallel 32-bit registers, but are instead clocked by the stream processor (SP) clock base. In particular, third stage registers 7123a and 7123b toggle each time flip-flop 7115 toggles. Registers 7123a and 7123b also interface with the accelerator 200 internal 32-bit data bus 7120, which is preferably a part of the DMA bus 210 (FIG. 1).
The address pipeline which operates in parallel with the data pipeline, is similar. First stage register (I) 7125 provides for temporary storage of the 16-bit address for the first doubleword of each doubleword pair along with corresponding source ID or destined ID bits from the HSAR and HDAR registers. Data are latched into first stage address register 7115 in response to the PCI clock.
The second address/memory ID stage (II) consists of two parallel registers 7126a and 7126b. These registers are clocked on the PCI clock base and receive the first address/ID word held in register 7125 and the second address/ID word received directly from the input. In particular, address/ID information is latched into registers 7126a and 7126b each time flip-flop 7105 toggles. The memory ID bits from the first address/ID word in register 7126a passed on to read/write decoder 7128.
The third stage (III) comprises registers 7127a and 7127b, each clocked signal processor clock base. In particular, addresses are latched into register 7127a and registers and memory ID bits are latched into register 7127b each time flip flop 7115 toggles.
The memory ID bits from register 7127b are presented to read/write decode 7128 and the address bits pipelined through register 7127a on the next toggle of flip-flip 7105. In a register 7127a turn pipeline address bits to the address bus 7129 which is preferably part of DMA bus 210.
FIG. 71D is a timing diagram illustrating the pipelining through the address and data pipelines of FIG. 71C. In this case, data is being read off the PCI bus and written into a selected memory in accelerator 200 for illustrative purposes.
In FIG. 71C, the data path pipeline shows 32-bit data latches, 16-bit address latches, and implies 4-bit memory-identifier latches.
An additional set of bits are also associated with each address latch:
write valid--indicates latch contains address/data for write;
read valid--addr latch contains address for read;
read data valid--data latch contains returning read data;
last--indicates that this request is the last of a series;
rlast--propagates back to PCI clock from sp clock to indicate "last" access has completed.
Read requests and write requests can be paired together, but write requests must be held off for two pipeline advances after a read request, since the returning read data will use up the only data latches (data latches are used to pass data in both directions.)
As shown in FIG. 71C, data and address is read into stage I with each rising edge of the PCI clock. Each time flip flop 7105 with the PCI clock and memory READY, the corresponding memory core is passed to synchronized by, synchronizer 7106 to the stream processor clock. In other words, the first stage advances when the second word of a word pair is being written and the output of exclusive or gates 7107 is high on the rising edge of the PCI clock.
Each time flip flop 7115 toggles the memory acknowledge from the previous request is passed to synchronizer 7116 for synchronization to the PCI clock. The memory access to doublewords 1 and 2 is also initiated with this transition of flip-flop 7115. The actual write occurs several SP clocks later as the address and data are pipelined to the selected memory.
In sum, as shown in FIG. 71D, the reads occur with every PCI clock. The synchronization of the corresponding request occurs each time flip flop 7105 transitions. The corresponding memory accesses and the memory acknowledge synchronization then occur on the transit toggling of flip flop 2.
Those skilled in the art will recognize that the synchronization circuitry of FIG. 71 can be replaced with the first-in-first-out register system shown in FIGS. 72A-72F. In this embodiment, a First-in first-out memory system 7200 includes N number of entries 7201. There are N number of entries 7201, each of which is comprised of an M-bit wide linear array of latches. The entry to be loaded is selected by a source pointer 7202, which is preferably based upon a ring of N number of rising edge flip-flops clocked by the source clock, with one such flip-flop provided for each entry 7201 in FIFO 7200. In the case of data being transferred from the PCI bus to accelerator 200, the source pointer flip-flops would be clocked by the PCI clock.
Readouts from FIFO 7200 are controlled by a destination pointer 7203, which is preferably also based a ring of rising edge flip-flops with one flip-flop corresponding to each entry 7201. In the case of the destination to each entry 7201. In the case of the destination pointer, the flip-flops are clocked by the destination clock. In the example of a PCI to accelerator 200 memory transfer, the destination clock would be from the stream processor clock base.
Both the source 7200 and destination 7203 pointers are initialized to zero, with a short string of Logic 1s loaded as the access (read/write) marker. FIG. 72B illustrates an initialized portion of a selected one of the pointer rings 7202 or 7203. When the leading edge Logic 1 reaches a flip-flop in the given ring 7202 or 7203, the FIFO entry 7201 corresponding to that flip-flop is accessed.
A string of Logic 1s are loaded in to the flip-flops of a given ring, such that when a comparison is made between the destination pointer and the source pointer, an indication of whether the FIFO is approaching an empty or a full state can be determined. FIG. 72C shows the overlap of the source and destination pointers when an approaching empty signal is generated. FIG. 72D shows the overlap when an approaching full signal is generated. In each case, a string of Logic 1s is loaded, with the leading edge of Logic 1 being the read/write marker, since FIFO 7200 cannot be halted instantly. The string of 1s indicate that the full or empty state will be reached within a corresponding number of clock periods. Three Logic 1s are loaded into the pointers to at each marker since the full and empty signals are passed through a two flip-flop synchronizer after generation.
FIG. 72E depicts one possible embodiment of the destination pointer ring and the gating which generates the near-empty signal. The ring preferably is constructed of N number of rising edge triggered flip-flops 7204. It should be noted, that the flip-flops in FIG. 72E wrap around such that the output for the flip-flop corresponding to entry 1 couples to the input of the flip-flop for entry N. A NAND gate 7205 is associated with each flip-flop 7204 for detecting the leading edge Logic 1. To do so, the Q output of the corresponding flip-flop 7204 is input into each NAND gate 7205 along with the Q/ output of the previous flip-flop in the ring. The NAND gate 7205 associated with the first entry receives the Q/ output on the flip-flop associated with the N entry. The destination pointer bits of pointer 1 through pointer N are inverted and passed on to circuitry shown in FIG. 72F to generate the near-full signal discussed below.
The output of each NAND gate 7205 is provided to the corresponding input of an OR gate 7206 along with the inverted source pointers from the circuitry shown in FIG. 72F. The output of OR gate 7206 is inverted by a gate 7207 to become the near-empty indicator.
FIG. 72F depicts one possible organization for the source pointer ring. Similar to the destination pointer ring, the source pointer ring includes a ring of flip-flops 7208 each associated with a corresponding NAND gate 7209. Flip-flops 7208 are clocked by the source clock and the outputs of flip-flops 7208 wrap around to the corresponding flip-flop 7209 or NAND gate 7209.
The output of each NAND gate 7209 is provided to the input of an OR gate 7210. Also provided to the inputs of OR gate 7210 are the destination pointers from the circuitry shown on FIG. 72E, after being inverted. The output of OR gate 7210 is inverted by a gate 7211 to provide the near-full indicator.
Although the invention has been described with reference to a specific embodiments, these descriptions are not meant to be construed in a limiting sense. Various modifications of the disclosed embodiments, as well as alternative embodiments of the invention will become apparent to persons skilled in the art upon reference to the description to the invention. For instance, those skilled in the art will recognize that accelerator 100 may interface with a motherboard through one of several conventional bus connections or protocols such as PCI, ISA, VESA, et cetera. Alternatively, accelerator 100 and/or stream processor 101 may be integrated directly onto a microprocessor or other processor chip. It is therefore, contemplated that the claims will cover any such modifications or embodiments that fall within the true scope of the invention.
Claims
What is claimed is:
1. An audio stream processor comprising: a register file for storing information; an arithmetic logic unit receiving input information from selected registers in said register file and outputing results to selected registers in said register file; a parameter address generator for retrieving parameters and coefficients from parameter memory, said parameter address generator operable to exchange information with said register file; a sample address generator for controlling the exchange of audio sample data with sample memory, said sample address generator operable in response to information received from said parameter memory; and a dual multiply-accumulate unit for operating on first and second channels of sample data received from said sample address generator unit and information received from selected registers in said register file.
2. The stream processor of claim 1 wherein said register file comprises pairs of registers, said registers of each said pair accessible individually and as a pair.
3. The stream processor of claim 1 wherein said arithmetic logic unit comprises: an adder for adding information retrieved from first and second selected registers in said register file; and logic circuitry for performing logic operations on information retrieved from a selected one of said registers in said register file.
4. The stream processor of claim 3 wherein said register file is organized as two columns of registers and said adder operates on data received from a selected register in a first one of said columns and a selected register in a second one of said column.
5. The stream processor of claim 3 wherein said parameter address generation is operable in effectuate addressing in a mode selected from the set including indirect post-increment addressing, register indirect index addressing, and direct addressing.
6. The stream processor of claim 3 wherein said parameter address generation comprises: an increment register for storing an increment value; an index register for storing an index value generated from decoding an instruction; and an adder for adding a value from a selected one of said increment and index registers to an address received from a selected register in said register file.
7. The stream processor of claim 6 and further comprising a multiplexer for selecting between an address output from said adder and an address received directly from a selected one of said registers in said register file.
8. The stream processor of claim 3 wherein said sample address generator comprises: at least one address register for storing an address for a direct memory access to be performed; at least one increment register for storing an increment value; an adder for adding an address from said address register with said increment value to generate a memory request; and a requestor for prioritizing memory requests.
9. The stream processor of claim 8 wherein said requestor comprises: an array of storage locations, each location storing information describing a corresponding data stream; and a state machine for scanning said information in said array to identify a said stream having a highest priority, said requestor passing a stream number to direct memory access circuitry for accessing said data stream corresponding to said stream number.
10. The stream processor of claim 1 wherein said multiply-accumulate unit comprises: a plurality of parallel information processing paths each comprising: a multiplier for multiplying first and second words of input information, said multiplier outputting a sum vector and a carry vector; a carry-save adder for adding said sum vector, said carry vector and a stored value; an adder for adding first and second outputs of said carry-save adder; and at least one accumulator for storing an output from said adder.
11. The stream processor of claim 10 wherein said a selected one of said first and second words of input information comprises a selected fraction of information received from a register in said sample address generator.
12. The stream processor of claim 10 wherein at least one of said plurality of information processing paths comprises circuitry for inverting a selected one of said first and second words of input information such that a negative product can selectively be generated by said multiplier and a product of two words of information can be subtracted.
13. An audio information processing subsystem fabricated on a single-integrated circuit chip comprising: a stream processor for simultaneously processing multiple streams of audio data; a program memory coupled to said stream processor by a first bus for storing instructions for controlling said processing subsystem; data memory coupled to said stream processor by a second bus; and direct memory access circuitry for controlling direct memory accesses to a selected one of said program and data memories, said direct memory access circuitry defining a plurality of buffers in said data memory, each buffer associated with one of said data streams.
14. The audio information subsystem of claim 13 wherein said data memory comprises a sample memory for storing audio data samples and a parameter memory for storing parameters for use by said stream processor.
15. The audio information subsystem of claim 13 and further comprising circuitry for interfacing said processing subsystem with an external PCI bus.
16. The audio information subsystem of claim 14 wherein said stream processor comprises: dual multiply-accumulate units for concurrently processing parallel information; a general arithmetic logic unit for performing arithmetic and logic operations on information in parallel with operations performed by said dual multiply-accumulate units; a register file for providing input information to said multiply-accumulate units and said arithmetic logic unit and for storing information output from said multiply-accumulate units and said arithmetic logic unit; an address generator for controlling the exchange of information between said parameter memory and said register file; and an address generator for controlling the exchange of information between said sample memory and said dual multiply accumulate units.
17. The audio information processing subsystem of claim 13 and further comprising trapping circuitry for monitoring instructions being transferred from said program memory to said stream processor and initiating a program branch in response.
18. The audio information processing subsystem of claim 13 and further comprising input/output ports for exchanging serial audio data with external audio information processing circuitry.
19. The audio information processing subsystem of claim 14 wherein said program memory, said parameter memory, said sample memory and said direct memory access circuitry are coupled to an internal DMA bus.
20. A multiply-accumulate unit comprising: a multiply-accumulate path for processing a channel of audio data comprising: first input circuitry for selectively receiving an M-bit wide coefficient word; second input circuitry for selectively receiving an N-bit wide data word; an M-bit by N-bit two's complement multiplier array receiving data and coefficients from said input circuitry and outputting a sum vector and a carry vector in response; a P-bit wide carry-save adder for adding said sum and carry vectors and an accumulator output; a P-bit wide adder for adding first and second outputs of said carry-save adder; at lest one P-bit wide accumulator for storing data output from said adder; and circuitry for selectively feeding-back data from said at least one accumulator to said carry-save adder.
21. The multiply-accumulate unit of claim 20 wherein M is greater than N.
22. The multiply-accumulate unit of claim 20 and further comprising: a second multiply-accumulate path for processing a second channel of audio data comprising: first input circuitry for selectively receiving an M-bit wide coefficient word; second input circuitry for selectively receiving an N-bit wide data word; an M-bit by N-bit two's complement multiplier array outputting a sum vector and a carry vector; a P-bit wide carry-save adder for adding said sum and carry vectors and an accumulator output; a P-bit wide adder for adding first and second outputs of said carry-save adder; at least one P-bit wide accumulator for storing data output from said adder; and circuitry for selectively feeding-back data from said at least one accumulator to said carry-save adder.
23. The multiply-accumulate unit of claim 22 wherein an R-bit wide coefficient word presented to said multiply-accumulate unit provides an M-bit coefficient word to each of said first and second paths concurrently.
24. The multiply-accumulate unit of claim 20 wherein said first and second paths are concurrently controllable by a single instruction.
25. The multiply-accumulate unit of claim 20 wherein said first and second paths are controllable by separate instructions.
26. The multiply-accumulate unit of claim 20 wherein said first and second paths are controlled in a single instruction multiple data fashion.
27. The multiply-accumulate of claim 20 is operable to multiply fractional data input by said second input circuitry.
28. The multiply-accumulate of claim 20 wherein said multiply-accumulate path includes circuitry for inverting a data word presented at said second input to effectuate a subtraction.
29. A stream processing system comprising: a PCI bus; a host processing subsystem coupled to said PCI bus including: a central processing unit; a host memory; and circuitry for interfacing said central processing unit and said host memory with said PCI bus; and a stream processing subsystem coupled to said PCI bus including: a stream processor for processing a plurality of streams of data simultaneously received, said stream processor including a direct memory access engine operable to exchange information with said host system using direct memory accesses, said direct memory access circuitry controlling a plurality of buffers in memory, each said buffer associated with a corresponding one of said streams of data; and circuitry for interfacing said stream processor with a source of multiple streams of data.
30. The system of claim 29 wherein said circuitry for interfacing said stream processor and said source of streams of data comprises an audio data interface.
Patent Citations (62)
| Patent | Date | Inventor | Cited By |
|---|---|---|---|
| US4135249 | 1979-01-01 | Irwin | |
| US4187549 | 1980-02-01 | Bond et al. | |
| US4276595 | 1981-06-01 | Brereton et al. | |
| US4367525 | 1983-01-01 | Brown et al. | |
| US4410940 | 1983-10-01 | Carlson et al. | |
| US4575812 | 1986-03-01 | Kloker et al. | |
| US4631671 | 1986-12-01 | Kawashifa | |
| US4703449 | 1987-10-01 | Berman | |
| US4716523 | 1987-12-01 | Burus et al. | |
| US4722068 | 1988-01-01 | Kuroda et al. | |
| US4736335 | 1988-04-01 | Barkan | |
| US4748582 | 1988-05-01 | New et al. | |
| US4800524 | 1989-01-01 | Roesgen | |
| US4811269 | 1989-03-01 | Hirose et al. | |
| US4847750 | 1989-07-01 | Daniel | |
| US4876660 | 1989-10-01 | Owen et al. | |
| US4893268 | 1990-01-01 | Denman et al. | |
| US4930069 | 1990-05-01 | Batra et al. | |
| US4991131 | 1991-02-01 | Yeh et al. | |
| US4992934 | 1991-02-01 | Portanova et al. | |
| US4999769 | 1991-03-01 | Costes et al. | |
| US5003465 | 1991-03-01 | Chisholm et al. | |
| US5005121 | 1991-04-01 | Nakuda et al. | |
| US5027374 | 1991-06-01 | Rossmann | |
| US5056010 | 1991-10-01 | Huang | |
| US5142675 | 1992-08-01 | Oi et al. | |
| US5155830 | 1992-10-01 | Kurashige | |
| US5163136 | 1992-11-01 | Richmond | |
| US5179531 | 1993-01-01 | Yamaki | |
| US5293596 | 1994-03-01 | Toyokura et al. | |
| US5333274 | 1994-07-01 | Amini et al. | |
| US5355462 | 1994-10-01 | Rousseau | |
| US5377325 | 1994-12-01 | Chan | |
| US5381360 | 1995-01-01 | Shridhar et al. | |
| US5404522 | 1995-04-01 | Carmon | |
| US5414815 | 1995-05-01 | Schwede | |
| US5448706 | 1995-09-01 | Fleming et al. | |
| US5473756 | 1995-12-01 | Traylor | |
| US5483239 | 1996-01-01 | Arczynski | |
| US5490257 | 1996-02-01 | Hoberman et al. | |
| US5491793 | 1996-02-01 | Somasundarum et al. | |
| US5513374 | 1996-04-01 | Baji | |
| US5517436 | 1996-05-01 | Andreas | |
| US5535417 | 1996-07-01 | Baji | |
| US5550767 | 1996-08-01 | Taborn et al. | |
| US5574934 | 1996-11-01 | Mirashrafi | |
| US5633897 | 1997-05-01 | Fettweis | |
| US5644787 | 1997-07-01 | Nakamura et al. | |
| US5652903 | 1997-07-01 | Weng | |
| US5689691 | 1997-11-01 | Mann | |
| US5889480 | 1999-03-01 | Kim | |
| EPX348113A2 | 1989-12-01 | ||
| EPX378423A2 | 1990-07-01 | ||
| EPX375794A1 | 1990-07-01 | ||
| EPX550163A1 | 1992-07-01 | ||
| EPX576409A1 | 1993-12-01 | ||
| EPX617361A2 | 1994-09-01 | ||
| EPX671691A2 | 1995-09-01 | ||
| EPX798630A1 | 1997-10-01 | ||
| EPX640912A1 | 1998-03-01 | ||
| EPX473805A1 | 1998-03-01 | ||
| EPX282825A | 1998-09-01 |
Non-Patent Literature (7)
- P. Sadayappan et al.: "Task Distribution on a Hierarchical Multicomputer" COM PCON Fall '84. The Small Computer, Whole Document.
- Sohie, G.R.L., et al. "A Digital Signal Processor with IEEE Floating Point Arithmatic" IEEE Micro. vol. 8, No. 6 Dec. 1988 pp. 49-67.
- Kohn, L., et al. "The Visual Instruction Set (VIS) in UltraSparctm" IEEE 1995 pp. 462-469 Conf. 40, Mar. 1995 XP000545454.
- Patent Abstracts of Japan, vol. 7, No. 73 (p-186) Mar. 25, 1983 Takahashi Rikiyoshi/Inventor.
- Gerber, C., et al., "Peripheral Component Interconnect (PCI) Interface with the Quick Logic QL1 16.times.24 B FPGA" Western Elec. Show & Convention, Anaheim, Sep. 27-29, 1994 & IEEE.
- "Software Controlled Wrap-Around Buffer" IBM Tech. Discl. Ball. vol. 28, No. 12, May 1986 pp. 5314-5316.
- Matsushita, U., et. al. "A 32.times.24 Bit Digital Audio Signal Processor" IEEE Transaction on Consumer Elect. vol. 35, No. 4 pp. 785-791, Nov. 1989.