| 68060 + 68050/70 N Core | page 1 2 3 4 5 6 7
|
|---|
|
|---|
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 01 Sep 2010 19:02
| Marcel Verdaasdonk wrote:
| n cores would add n interrupts with would halt the main CPU several times.
|
Who says this? Marcel Verdaasdonk wrote:
| The Idea slave is bad. if you would use a clone core to do loop and repeatative task acceleration you would cause less trouble.(suffice it be independent)
|
As a Clone core is the same as slave core - where is your point? Marcel Verdaasdonk wrote:
| IMHO i think it is more important to actually finish the 68050 core and then start work on the 68070 as this would be a clean and clear solution.
|
What are you talking about? Of course the 070 will befinished before cloning the core. Marcel you really need to try to read more careful before you post. The whole point of the "clone" idea is. When the 070 is finished there might be lot of space available to use... Expecially in NATAMI2. Cloning the 070 is simple, take no time and allows scaling in performance.
| |
Matt Hey USA
| | Posts 733 01 Sep 2010 21:00
| Gunnar von Boehn wrote:
| I think one of the challenges to make AMIGA OS SMP working is that internal structures are sometimes protected by usages FORBID and PERMIT. In an FPGA based system like the NATAMI one could solve this by simply freezing all cores except the one calling the FORBID. Then FORBID would be SMP save. This could be done in the FPGA backward compatible without needing to patch the OS.
|
I had thought of doing exactly this already too. It's an excellent idea that easily solves the hardest problem of adding multiprocessing. There are plenty of other problems (stack problems?) though and would likely require changes to the OS. How many non-memory protected processes can be done too?
| |
Thomas Richter Germany
| | (MX-Board Owner) Posts 1425 01 Sep 2010 21:08
| Matt Hey wrote:
| I had thought of doing exactly this already too. It's an excellent idea...
|
...and its a non-working idea. Please see my post above. Forbid() is a makro. Many Os functions and programs do not call Forbid(). They simply do a SysBase->TDNestCnt++. Now, how do you want to trap this?[Sigh. Is nobody reading my posts or is nobody understanding my posts?] Greetings, Thomas
| |
Claudio Wieland Germany
| | (Natami Team) Posts 703 01 Sep 2010 21:18
| Both, Thomas, both.
| |
SID Hervé France
| | Posts 663 01 Sep 2010 21:42
| Gunnar von Boehn wrote:
| Can you rephrase your post please? I do not understand what you ask. |
It is a general question that does not aim to influence the current development and future. The OS 3.x supports a single CPU. This does not mean: that there should be only one CPU. the CPU must have only one core. Please correct me again if I'm wrong: Support for multiple cores could be achieved by a master-slave configuration. A program does not support the presence of multiple cores would only be executed by the master. A program that supports multiple cores would be managed by the master and executed by the cores. When a backup request is asked, the master core stops the slave cores, logs its register,PC, etc... and,if necessary, logs register,PC, etc... of cores. When a restoration request is asked, the master core restore,if necessary, the register,PC, etc... of the slave cores, and restore its register,PC, etc... I guess the overall operation is not disrupted : "FORBID", "PERMIT" and the OS speak only to one core, the master. But a wired logic is needed. All this is speculation and I ask an informed opinion. Thanks for your patience
| |
SID Hervé France
| | Posts 663 01 Sep 2010 22:01
| Thomas Richter wrote:
| [Sigh. Is nobody reading my posts or is nobody understanding my posts?]
|
It is harder for me. Sometimes I think I'm the only one who understands my English. Weird ...I understand what you write but I don't understand the relationship or dependency between the operating system and hardware Please persevere
| |
Marcel Verdaasdonk Netherlands
| | Posts 3976 01 Sep 2010 22:08
| I got most of it i think. On the basis it means without creating a brittle system that would stop it's (co-processor) slave core at the drop of a hat. A hardware solution wouldn't do the specific trick and would cost a lot of space in the process. Forbid() is a locking mechanism. But most of the software indirectly use it in the form. SysBase->TDNestCnt++ If you would bus snoop on this you will lock more times then you need to. If you only check on Forbid() you undershoot your target.
| |
SID Hervé France
| | Posts 663 01 Sep 2010 22:42
| In the end, "Forbid ()" and "SysBase-> TDNestCnt + +" will be compiled into a series of 68k instructions. They will be executed by the CPU. Why intervention before the execution would be a problem? And how can we be sure of the space needed? For now, I still think that a hardware solution is the best approach. The "OS" should not be changed, but expanded, and I still think that a master-slave configuration is a good deal.
| |
Marcel Verdaasdonk Netherlands
| | Posts 3976 01 Sep 2010 23:05
| SID capturing the instruction order in which the compiler uses it is close to Heruculian in task form. Which is none conclusive at best since part of the pattern could exist in other code too.
| |
Deep Sub Micron Germany
| | (MX-Board Owner) Posts 567 01 Sep 2010 23:24
| Thomas Richter wrote:
|
Matt Hey wrote:
| I had thought of doing exactly this already too. It's an excellent idea... |
...and its a non-working idea. Please see my post above. Forbid() is a makro. Many Os functions and programs do not call Forbid(). They simply do a SysBase->TDNestCnt++. Now, how do you want to trap this? [Sigh. Is nobody reading my posts or is nobody understanding my posts?] Greetings, Thomas
|
I think what Gunnar proposed is something like a conditional memory breakpoint on SysBase->TDNestCnt address (implemented by hardware).
| |
SID Hervé France
| | Posts 663 01 Sep 2010 23:32
| Marcel Verdaasdonk : By inserting a delay, it should be a less onerous than checking instructions. examples probably stupid to intercept interrupt request to intercept a hardware or software interrupt code.
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 01 Sep 2010 23:43
| Thomas Richter wrote:
| Matt Hey wrote:
| I had thought of doing exactly this already too. It's an excellent idea... |
...and its a non-working idea. Please see my post above. Forbid() is a makro. Many Os functions and programs do not call Forbid(). They simply do a SysBase->TDNestCnt++. Now, how do you want to trap this? |
I think I did not explain this good enough. Let me retry this. Maybe its simpler to explain if I try to do it in simple logic steps: TDNestCnt is a variable in memory. Is this correct? Important for the multitasking is whether this variable is 0 or not. Correct? The trick of using FORBID is prohibiting that that another task could disturb the running task in doing or changing something important. Therefore to do an ATOMIC operation we have to call FORBID, then do it, and then we can permit the multitasking again. This forbid ensures that noone else can mess up our operation. To get this effect, for a single core multitasking system this means FORBID has to disable the taskswitch. For an SMP system this also means not only that the taskswitch has to be disabled but also that all other running cores need to pause to prevent any accidently "messing". Can we do this in hardware? Yes we can. Its simple! The "magic" variable has a certain fixed position in memory. If our CPU Core knows where this address is then it can simply react on any access to this address. Lets say we create 1 byte of intelligent memory. This 1 byte of intelligent memory is part of our CPU cores. Now lets say we put 4 CPU corse in the FPGA. (Bigger FPGA have plenty space we could also add 8 or 16 cores) On reboot the sytem will boot with only the first Core being active. All other cores will sleep. The OS will need to wake up all the other cores. This will be done with some new MOVEC commands. Part of this "wake-up" procedure will be informing the CPU with a MOVEC where in memory the magic token lies. Now that the CPU knows which address to snoop - it will snoop it and "keep" the value of the token inside the FPGA. If one of the CPU Cores changes the value away from zero then all other cores will freeze automaticely. Only if the magic token becomes zero again the other cores will continue runnning. This solution is quite simple. And dont think that its expensive! This s not expensive! We can code the VHDL for this on a weekend and its will take only peanuts of FPGA space. I hope this explanation is clearer now. If you think that it would not work then please tell me what I've overlooked. Cheers
| |
Matt Hey USA
| | Posts 733 01 Sep 2010 23:51
| deep sub micron wrote:
| Thomas Richter wrote:
| Matt Hey wrote:
| I had thought of doing exactly this already too. It's an excellent idea... |
...and its a non-working idea. Please see my post above. Forbid() is a makro. Many Os functions and programs do not call Forbid(). They simply do a SysBase->TDNestCnt++. Now, how do you want to trap this? [Sigh. Is nobody reading my posts or is nobody understanding my posts?] Greetings, Thomas |
I think what Gunnar proposed is something like a conditional memory breakpoint on SysBase->TDNestCnt address (implemented by hardware). |
Exactly! @Thor I read you post and I didn't see how it excluded Gunnar's idea. I know some programs use the macros instead of the Forbid()/Permit() exec calls. This causes a problem on most processors but we have a fpga. Gunnar and I are talking about turning a memory location in SysBase into a master register that temporarily switches off any other processors. It does not solve all the problems but it is a big step in the right direction. @Gunnar Wouldn't such a register/trapped memory location have to always be at the same (static) address? This would mean that the OS would have to be modified so that SysBase would always be loaded at a particular address? Edit: I typed my post as Gunnar was explaining in his post above. It looks like the address can even be dynamically placed in memory. Nice :).
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 02 Sep 2010 00:14
| Matt Hey wrote:
| @Gunnar Wouldn't such a register/trapped memory location have to always be at the same (static) address? This would mean that the OS would have to be modified so that SysBase would always be loaded at a particular address?
|
No, the addres could be configured. I think the logical flow would be the following. 1) The systems reboots. Only the first core is active. 2) The OS does boot. 3) On Workbench you launch a tool to enable all the cores. This tool will poke the magic address in the Cores. From now on all the cores are active and all will sleep if FORBID is called (except the calling core) Does this make sense to you?
| |
SID Hervé France
| | Posts 663 02 Sep 2010 00:54
| Correct me if I'm wrong please but everything has been said seems valid in the context of a respectful use of the operating system. But for a bad program which work directly in hardware, what would be the impact? Merci
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 02 Sep 2010 01:06
| SID Hervé wrote:
| But for a bad program which work directly in hardware, what would be the impact? |
A programmer can NOT work around such a HW check. To me such a HW solution seems foolprove from a programming standpoint.One of the dirty ways of getting full control of the System is to disable the interrupts. This will of course work. And has of course to disable the other cores too. Simple and fully backward compatible.
| |
Matt Hey USA
| | Posts 733 02 Sep 2010 01:21
| @Gunnar Yes, it makes sense to me. The hardware part might be as simple as 1,2,3 but the software is a little more difficult. The libraries/devices are already resident/pure code so there shouldn't be any problem loading multiple copies into different processors while sharing the same memory. There would probably need to be some kind of arbitration system for actual hardware devices/resources though. Exec would have to be modified to detect idle processors and create a task/process and stack for it. Many legacy programs would likely have problems but it's an idea for the future. Legacy programs that wouldn't work could still run on one processor.
| |
SID Hervé France
| | Posts 663 02 Sep 2010 01:27
| Gunnar von Boehn wrote:
| Simple and fully backward compatible.
|
My first idea was related to some old demos. There are old games that run from the desktop of WB1.3. It is unnecessary to answer, since by default only one core is active.
| |
Thomas Richter Germany
| | (MX-Board Owner) Posts 1425 02 Sep 2010 07:53
| Gunnar von Boehn wrote:
|
SID Hervé wrote:
| But for a bad program which work directly in hardware, what would be the impact? |
A programmer can NOT work around such a HW check. To me such a HW solution seems foolprove from a programming standpoint. One of the dirty ways of getting full control of the System is to disable the interrupts. This will of course work. And has of course to disable the other cores too. Simple and fully backward compatible.
|
Sorry, but even with this hack it will still not work.For example, in the current multitasking system, operations like cmp.l (a0),a0 beq.s listisempty ...
are atomic - and in use by the Os, for example in exec/GetMsg(). It is an atomic check used there whether a list is empty. A similar trick: bset #0,lib(a6) bne.s isIsUse ; some critical code goes here isInUse
will detect whether a certain code-piece is in use by another task simply because the bset is an atomic instruction in a single-core environment - task switching can either interrupt before or after the bset, but not in between. And, believe it or not, such code exists. Even in the Os. They are perfectly fine as they are, nothing wrong with them. Now, this situation changes dramatically in a multi-core environment. Instead of the first construction, one would have to use "cas", instead of the second, one would have to use "tas". Instructions you should *not* have used in the original Amiga hardware, though. Please, forget this crazy idea - believe me, it won't work. So long, Thomas
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 02 Sep 2010 09:33
| Thomas Richter wrote:
| Sorry, but even with this hack it will still not work.
|
But you agree that we would have s solution for the FORBID case? Lets look at each case step by step. Thomas Richter wrote:
| For example, in the current multitasking system, operations like cmp.l (a0),a0 beq.s listisempty ...
are atomic - and in use by the Os, for example in exec/GetMsg(). It is an atomic check used there whether a list is empty.
|
Hmm, I fail to see where the ATOMIC part is. Between the CMP and the BEQ is already a gab. Can you explain this? Thomas Richter wrote:
| A similar trick: bset #0,lib(a6) bne.s isIsUse ; some critical code goes here isInUse
will detect whether a certain code-piece is in use by another task simply because the bset is an atomic instruction in a single-core environment - task switching can either interrupt before or after the bset, but not in between.
|
I understand this. This should be no probel to support in a multicore environment. The point is that for a pipelined CPU the above operatio would actually not ATOMIC. To make it ATOMIC the CPU needs logic to avoid write/read hazards. The challenge is that the READ is in the pipeline above the WRITE. This means an instruction write could be "overtaken" by the next instruction doing a read on this address. A good CPU has logic to take care of this. If done properly this logic works like this: For each instruction doing a WRITE the address is remembered for all following instructions in the pipe that do a READ the address will be compared and if matches the instructions will either stall or the results will be forwarded inside the pipe. I think what you ask for is simply to share this logic between two or multiple cores. This means if CPU CORE 1 is doing a write or read/write operation on a certain address it will block other cores from accessing this address simultaniously. Sharing this logic between all cores should do what you want. It should also make ALL read/write instruction ATOMIC from a SMP/CPU perspective. Cheers
| |
|