Hi,
... in brief:
yes, it is possible to use designs with multiple Nios II CPUs. And it is possible to handle data sharing between the CPUs trasparently without changing too much the source code of your application. It is also possible to choose the partitioning of the tasks on the CPUs during the development cycle of your application -without- changing the hardware design, and without a great impact on the application source code (in many cases you do not need to chande the code at all).
To do that, you need some hardware and some software support... If you are looking for a demo and some documentation that explains how that can be done, try the 2-CPU demo we released at the following address:
http://www.evidence.eu.com/nios2 (
http://www.evidence.eu.com/nios2).
--- Quote Start ---
originally posted by lucky@Nov 7 2005, 10:06 AM
1 have you used the multi-core cpu in the pfga ? when i used the multi-
core cpu ,i had some problem about it . i had used the mailbox for the my
multi-core cpu design. i found the mailbox is equality to the two mutexs,
and then , when i one cpu read the address and the other cpu write the
same address at the same time . whether or not can the mailbox protect
the address and harmonize the two cpu to run right . if the mailbox can
not protect the address , and then how to protect the address by the
software ?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10814)
--- quote end ---
--- Quote End ---
Yes, the mailbox is basically equal to two mutexes. The usage of a mailbox is useful when you know the pattern of communication between the two CPUs.
However we think that when you developing your application, it is probably better to focus on the relationships between the various tasks in the system, and in particular the focus should be on the behavior implemented by each task, and on how each behavior implemented by a task should communicate.
Then, you should be able to partition the tasks to the various CPUs and the source code should automatically remap to multiprocessor things like mutual exclusion, cache disabling (because Nios II does not have a cache coerency hardware), and task activation.
To that extent, using Mailbozes tend to fix the data pattern you are using in the hardware design, that is fine if you know exactly what each task that is mapped to a particular CPU does, but it is not perfect if you are developing an application and you are only guessing
- how many CPUs you need to do your job
- how many task you need
- which functionality you need to put on each task
- to wich CPU each task should be partitioned
If you look at the demo I cited before, you can define a multiprocessor global data structure that is designed to be shared among -tasks- (note: not CPUs); then, depending on the partitioning you choose on the hardware, the mutual exclusion mechanism will use scheduling techniques that are local to the CPU (if all the task are allocated to the same CPU) or that are shared among the various CPUs (and in that case the RTOS will automatically use an underlying Altera Mutex to do the Job; moreover, cache disabling will be automatically enabled). All that without changing your source code :-)
--- Quote Start ---
originally posted by lucky@Nov 7 2005, 10:06 AM
2 when use the multi-core cpu, how to programme the bootloader for the
multi-core cpu? in the sopc builder , the each cpu have the respective
software system for itself. the each cpu reset from the 0x00 address,
however, the shared flash has one ox00 address . and then, how to i will
plan flash for the multi-core cpu ?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10814)
--- quote end ---
--- Quote End ---
The CPUs reset addresses should not be -all- at address 0x0, but a different addesses. Take a look at the Multiprocessor Tutorial from Altera (on the Altera web page), or to the ERIKA Enterprise documenation at the following address:
http://www.evidence.eu.com/nios2/literature.asp (
http://www.evidence.eu.com/nios2/literature.asp).
They explain in detail how to obtain a working multiprocessor system...
bye
Paolo