A computer system with multiple masters and slaves may include bus fabric for purposes of communicating data between initiating bus agents called “masters” (a processor, for example) and target bus agents, or “slaves” (memory devices, for example). In a typical bus operation, a master initiates a bus operation (such as a read or write operation) to a given slave by driving the address signals onto a bus to target the slave, along with the appropriate control signals and data signals (if data is being written to the slave). The slave that is the target of the bus operation responds by generating the appropriate signals onto the bus for such purposes as transferring data to or from the master; indicating an error; or signaling the master to retry the bus operation.
The bus is a limited system resource, which typically couples a single master to a single slave at any one time. Therefore, when multiple masters try to access the same slave at the same time, the bus matrix may time-multiplex their requests and may include a bus arbitration circuit, or “arbiter,” which performs arbitration among requesting masters to regulate which master (out of potentially multiple masters contending for bus access) has access to the bus.
In an example embodiment, a method includes receiving a request from a master device to access a slave device of a plurality of slave devices that are associated with a slave port of bus switching fabric. The slave port is shared among the slave devices. The method includes, in response to the request, multiplexing use of the slave port among the slave devices.
In another example embodiment, an apparatus includes a slave multiplexer; and bus matrix circuit that includes a slave port and a master port. The slave port is shared among a plurality of slave devices. The slave multiplexer is adapted to respond to a request initiated by a master coupled to the master port for access to a slave device of the slave devices to selectively couple the first slave device to the slave port.
In yet another example embodiment, an apparatus includes an integrated circuit that includes a processing core; a non-volatile memory device; a volatile memory device; a multiplexer; and a bus matrix circuit. The processing core is adapted to communicate with the non-volatile and volatile memory devices. The bus matrix circuit includes a slave port, and a master port that is coupled to the processing core. The multiplexer is adapted to selectively couple one of the non-volatile and volatile memory devices to the slave port in response to a request from the processing core to access the memory device.
Advantages and other desired features will become apparent from the following drawings, description and claims.
A microcontroller unit (MCU) may include a processing core, which accesses machine executable instructions (“programs,” for example) that are stored in a non-volatile memory devices of the MCU, such as flash memory devices, for example. As a result of the program execution, the processing core may further access (i.e., write data to and read data from) program data, such as stacks, heaps, temporary variables, and so forth, which may be stored in volatile memory devices, such as static random access memories (SRAMs) of the MCU. Techniques and systems are disclosed herein, which permit a processing core to efficiently access program instructions and program data in a manner, which may be advantageous for purposes of minimizing or preventing arbitration cycles due to a processing core switching between non-volatile and volatile memory accesses.
As a more specific example,
As discussed in further detail below, the MCU 24 includes a bus matrix circuit, or module 200, which regulates communications between master (a processing core, for example) and slaves (volatile and non-volatile memory devices, for example) of the MCU 24. A slave side multiplexer 282 of the MCU 24 is constructed to allow some of the slaves of the MCU 24 to share a port of the bus matrix module 200 in common, which, in turn, may provide the advantage of allowing a master, such as a processing core of the MCU 24, to incur few, if any, bus arbitration cycles, while switching between non-volatile and volatile memory accesses.
Referring to
In accordance with an example embodiment disclosed herein, the non-volatile memory device 165 stores data 220 representing program instructions for execution by the processing core 150; and the volatile memory devices 167-0 and 167-1 store program data 224 that may be updated and read by the processing core 150 due to the execution of the program instructions. In this manner, the program data 224 may be associated with a stack, a heap, variables, arrays, and so forth. It is noted that the processing core 150 may read and write program instructions data and program data to other volatile and non-volatile memory devices of the MCU 24.
It is noted that the MCU 24 may contain masters and slaves other than the ones depicted in
The MCU 24 includes a bus switching matrix, or bus switching fabric, which is generally referred to as the “bus matrix circuit” or “bus matrix module 200” herein. In an example embodiment, the bus matrix module 200 may be an integrated circuit (fabricated on a single die or on multiple dies, for example); and in further embodiments, the bus matrix module 200 may be a set of integrated circuits. The bus matrix module 200 regulates communications between a set of masters and a set of slaves of the MCU 24. For the example embodiment of
The bus matrix module 200 further contains slave ports 252 (specific slave ports S0, S1, S2 and S3 being depicted in
A given master, such as the processing core 150, may request access to one of the slaves, and provide a corresponding address to the bus matrix module 200 to select one of the slave ports 252 so that the bus matrix module 200 couples a slave that is associated with the selected slave port to the master. In accordance with an example embodiment, indications of the slave ports selected by the masters appear as corresponding signals at corresponding slave selection ports 250 of the bus matrix module 200. These indications may be, for example, derived from decoded address bits, so that a particular address space may be identifiable with a given slave port (and associated slave). Because multiple masters may attempt to concurrently access the same slave port, the bus matrix module 200, in accordance with an example embodiment, performs a time-multiplexed arbitration (a fairness-based policy, such as a round robin-based policy, a priority-based policy or a policy that takes into account a combination of fairness and priority, as examples) among multiple masters that are requesting the same slave port. In other words, the arbitration-controlled access to the slaves accommodates the scenario in which multiple masters are concurrently contending for access to a given slave. Due to the ability of the bus matrix module 200 to form multiple, concurrent master-slave connections, concurrent, or parallel, accesses are allowed between pairs of masters and slaves, in accordance with example embodiments.
In accordance with systems and techniques that are disclosed herein, the MCU 24 allows multiple slaves to be accessed using a single slave port 252 of the bus matrix module 200, which is shared in common among these slaves. Such an arrangement has the particular advantage of decreasing latency that may otherwise be incurred as the processing core 150 switches access from one slave port to another if the accessed slaves were, for example, assigned to individual slave ports. For the example embodiment that is described herein, the MCU 24 executes program instructions, which are stored as program instruction data 220 in the non-volatile memory device 165; and the MCU 24 processes program data 224 that resides in the volatile memory devices 167-0 and 167-1. The multiplexing of the slave devices onto a single slave port 252 has the particular advantage of preventing the bus matrix module 200 from stalling for one or multiple cycles as a given master switches from one slave to the next. In accordance with the systems and techniques that are disclosed herein, the address decoding scheme combines the multiple slave address ranges to the address range of the slave port 252, which the slaves share due to the slave port multiplexing. When programmed this way, the bus matrix module 200 perceives a given master as switching between slaves, although such switching may be occurring, thereby avoiding “stalling” the bus matrix module 200. It is noted that the slave side multiplexer 282 contains additional decode logic not depicted in
As the processing core 150 executes a particular program or application, the processing core 150 may access both non-volatile memory devices, such as the non-volatile device 165 depicted in
More specifically, in accordance with an example embodiment, the MCU 24 may employ a “von Neumann”-type architecture, which means that the MCU 24 communicates signals representing both program instructions and data using a single bus. With such an architecture, the processing core 150 uses time-multiplexed bus operations (read cycles, write cycles, and so forth) on the bus to access the non-volatile memory devices 165 and volatile memory devices 167. Because each program instruction may include both instruction fetching and data fetching, the slave device multiplexing technique disclosed herein has the particular advantage of generally avoiding consuming bus cycles due to the data and instruction fetching, as can be appreciated by the skilled artisan.
In accordance with example embodiments, the MCU 24 includes a slave address decoder 270 and the slave side multiplexer 282. In general, the slave address decoder 270 is coupled to slave selection ports 250 (example slave selection ports S0, S1, S2 and S3 being depicted in
In general, the slave side multiplexer 282 controls the coupling of the slaves to the slave ports 252 and the multiplexing of multiple slaves with a slave port that is shared in common. For the example embodiment of
More specifically, in accordance with an example embodiment, the register data 266 may be programmable by the processing core 150 and contain respective bits that have associated logic levels that may be used to selectively program slave port assignments. For the example embodiment described herein, the register data 266 controls at least which slaves share the S0 slave port 252, with given bits of the register data 266 individually corresponding to the slaves. For the example embodiment of
Turning now to an example embodiment for the slave address decoder 270, in accordance with some embodiments, the slave address decoder 270 controls the selective assertion of the slave request ports 250 of the bus matrix module 200 based on address space signals: an NVMD_ADDR_SPACE signal that is asserted (driven to a logic one value, for example) to indicate a master access that targets an address within the address space of the non-volatile memory device 165; an APB_ADDR_SPACE signal that is asserted (driven to a logic one value, for example) to indicate a master access that targets the address of the system configuration register 264; an VMD0_ADDR_SPACE signal that is asserted (driven to a logic one value, for example) to indicate a master access that targets an address within the address space of the volatile memory device 167-0; and an VMD1_ADDR_SPACE signal that is asserted (driven to a logic one value, for example) to indicate a master access that targets an address within the address space of the volatile memory device 167-1. These signals may be decoded address line signals, as an example.
In general, the slave address decoder 270 responds to the SHARE_VMD0 and SHARE_VMD01 signals such that these signals may be used to selectively effectively map the address ranges of the volatile memory devices 167-0 and 167-1 to the address range of the non-volatile memory device 165 for purposes of slave port selection.
More specifically, in accordance with an example embodiment, the slave address decoder 270 includes an OR gate 272 that has its output signal coupled to the S0 slave selection port 250. The OR gate 272 receives the NVMD_ADDR_SPACE signal and a signal that is provided by the output terminal of an AND gate 274 that receives the VMD0_ADDR_SPACE signal and the SHARE_VMD0 signal. The OR gate 272 also receives an output signal that is provided by an AND gate 276 that receives the VMD1_ADDR_SPACE signal and the SHARE_VMD1 signal. Thus, the OR gate 272 asserts (drives to a logic one value, for example) the S0 selection port to thereby select the S0 slave port 252 in response to either a master request that targets the address space of the non-volatile memory device 165, a master request that targets the address space of the volatile memory device 167-0 (assuming the volatile memory device 167-0 is configured to share the S0 slave port 252), or a master request that targets the address space of the volatile memory device 167-1 (assuming the volatile memory device 167-1 is configured to share the S0 slave port 252).
The slave address decoder 270 further includes an AND gate 278 that has its output signal coupled to the S1 slave selection port 250. The AND gate 278 receives the VMD0_ADDR_SPACE signal and the inverted SHARE_VMD0 signal. Thus, the AND gate 278 asserts (drives to a logic one value, for example) the S1 selection port to thereby select the S1 slave port 252 in response to a master request targeting the address space of the volatile memory device 167-0 and the volatile memory device 167-0 being assigned to the S1 slave port 252 instead of sharing the S0 slave port 252.
The slave address decoder 270 also includes an AND gate 280 that has its output signal coupled to the S2 slave selection port 250. The AND gate 280 receives the VMD1_ADDR_SPACE signal and the inverted SHARE_VMD1 signal. Thus, the AND gate 280 asserts (drives to a logic one value, for example) the S2 selection port to thereby select the S2 slave port 252 in response to a master request targeting the address space of the volatile memory device 167-1 and the volatile memory device 167-1 being assigned to the S2 slave port 252 instead of sharing the S0 slave port 252. Lastly, for the embodiment depicted in
In accordance with an example embodiment, the slave side multiplexer 282 selectively couple slaves (such as the non-volatile memory device 165, the volatile memory device 167-0 and the volatile memory device 167-1) to the slave ports 252. The slave side multiplexer 282 includes an OR gate 288 that has multiple output terminals that provide the address, control and data signals for a selected slave device to the S0 slave port 252. More specifically, the OR gate 288 includes a first set of input terminals that receive gated address, control and data signals 166 from the non-volatile memory device 165. These gated signals are provided by the multiple output terminals of an AND gate 284. The AND gate 284 includes a set of input terminals coupled to the signals 166 and an input terminal that is coupled to the output terminal of an AND gate 286 to control the gating, i.e., control when the signals 166 are coupled to the S0 slave port 252. The AND gate 286 receives a signal called “REQ_S0,” which is asserted when a master requests one of the slave devices associated with the S0 slave port 252 and the arbiter of the bus matrix module 200 granting the access. The AND gate 286 also receives the NVMD_ADDR_SPACE signal, which is asserted (driven to a logic one value, for example) when the master is requesting the address space associated with the non-volatile memory device 165.
The OR gate 288 includes a second set of input terminals that receive gated address, control and data signals 168 from the volatile memory device 167-0. These gated signals are provided by the multiple output terminals of an AND gate 290. The AND gate 290 includes a set of input terminals coupled to the signals 168 and an input terminal that is coupled to the output terminal of an AND gate 292 to control the gating. The AND gate 292 receives the REQ_S0 signal and receives signal “VMD0_ADDR_SPACE,” which is asserted (driven to a logic one value, for example) when the master is requesting the address space associated with the volatile memory device 167-0. The AND gate 292 also receives the SHARE_VMD0 signal. Therefore, the AND gate 290 couples the signals 168 from the volatile memory device 167-0 to the OR gate 288 (and to the S0 slave port 252) when a master requests access to the volatile memory device 167-0, the access is granted and the MCU 24 is configured (via the system configuration register 264) to share the S0 slave port 252 with the volatile memory device 167-0.
The OR gate 288 includes a third set of input terminals that receive gated address, control and data signals 169 from the volatile memory device 167-1. These gated signals are provided by the multiple output terminals of an AND gate 294. The AND gate 294 includes a set of input terminals coupled to the signals 169 and another include input terminal that is coupled to the output terminal of an AND gate 296 to control the gating. The AND gate 296 receives the REQ_S0 signal and receives signal “VMD1_ADDR_SPACE” which is asserted (driven to a logic one value, for example) when the master is requesting the address space associated with the volatile memory device 167-1. The AND gate 296 also receives the SHARE_VMD1 signal. Therefore, the AND gate 294 couples the signals 169 from the volatile memory device 167-1 to the OR gate 288 (and to the S0 slave port 252) when a master requests access to the volatile memory device 167-1, the access is granted and the MCU 24 is configured (via the system configuration register 264) to share the S0 slave port 252 with the volatile memory device 167-1.
As depicted in
Other variations are contemplated, which are within the scope of the appended claims. For example, in accordance with a further embodiment, two slaves may share the S0 slave port 252 and not have an alternate path to the S1 slave port 252. As a more specific example, in accordance with a particular embodiment, the non-volatile memory device 165 and a math accelerator slave device may both share the S0 slave port 252 (with one or more volatile memory devices 167, for example), and the non-volatile memory device 165 and math accelerator device may not have alternative paths to another slave port 252. Such an arrangement may have the advantage of eliminating an arbitration cycle as a master transitions from the non-volatile memory device 165 to the math accelerator and back.
As another example, in accordance with further embodiments, two slaves may share the S1 slave port. For example, in accordance with an example embodiment, the volatile memory devices 167-0 and 167-1 may share the S1 slave port 252 using multiplexing circuitry of the slave side multiplexer 282. This embodiment has the advantage of combining the two volatile memory devices 167-0 and 167-1 so that the devices 167-0 and 167-1 behave like a single memory device (a single SRAM device, for example), thereby reducing arbitration latency as master accesses transition between their address ranges.
Referring to
Referring to
While a limited number of embodiments have been disclosed herein, those skilled in the art, having the benefit of this disclosure, will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations.