02 September 2016, 21:35 | #101 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
but back to those pesky RMWs... well which instructions fit that bill anyway? Any operation with <ea> as destination, i suppose. Such as "addq #1,<ea>", that could be useful for thead safe stuff, right? Well, give each core a priority (which might rotate on a per-cycle basis), the highest priority core that encounters a destination <ea> gets to set a busy bit that blocks all other memory reads (on this address?) until it clears it again at the end of the instruction. (How does the 68060 pipeline cope with such potential RAM-based data hazards, anyway? Just stall?) As for TAS/CAS &c, found a thread about that very issue here on EAB, well i can see the problem when using it on chip RAM, because DMA doesn't respect it, which can lead to incorrect results. However on fast RAM, the situation is different. The Amiga only lives on one side of the expansion socket. Accelerators might have their own DMAs for various things, however, if we are designing an accelerator of our own, we have control over that. |
|
02 September 2016, 23:09 | #102 | ||
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
Quote:
When reading from memory the data can be 1) in the local cache 2) in the cache of another processor 3) in main memory. If it is in the local cache the data will be locked (will not change coherency state until the instruction retires), if it is in a remote cache it will be fetched to the local cache and then locked. If it is in main memory it will be fetched and then locked when in the local cache. In this way other processors can still continue to run programs unless they happen to access a cache-line that is locked. Last edited by Megol; 02 September 2016 at 23:21. |
||
03 September 2016, 01:01 | #103 | |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 851
|
Quote:
And for once you really _need_ to have a per-cpu cache :-) |
|
05 September 2016, 21:25 | #104 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
lately i've been musing about the possibility of doing massive hyperthreading/massive ILP instead of having multiple cores, but coming back to ISA stuff... or maybe this should go back in the "other thread"...
but something i've wondered before, if it could be possible to have a "fork" instruction, have some really simple hardware scheduler allowing one to create another thread directly from asm code. |
06 September 2016, 22:02 | #105 | ||
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
There would be no more ping-pong effect compared to other systems with cache coherency, a remote processor that want to access a local cacheline always have to request it before continuing execution. Well, one could do a very complicated design where the remote processor can execute an instruction on the local processor but for real workloads it would be slower. The extra cost is mostly in the coherency logic itself however that is a cost one have to bear to make a user-friendly system. (here local processor = the processor that currently owns the cacheline, remote processor = the processor that want to access the same cacheline) Quote:
|
||
06 September 2016, 22:11 | #106 | |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
Some other related design ideas for speculative threading etc. have equivalent of fork instructions to spin of a speculative thread. |
|
06 September 2016, 22:59 | #107 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 851
|
I've seen some of the states for modern Power caches and I think they have more than 20 different possible ones. Shared read-only is one of them (IIRC). That can of course be converted to local-rw plus far-purge on first write. Or if the caches aren't exclusive as local-rw plus far-ro.
But I still don't know how the OS should behave as it considers itself alone. |
07 September 2016, 21:19 | #108 | ||
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
A common coherency design uses four states/cacheline, MESI or Modified/Exclusive/Shared/Invalid. In short: Modified: The cacheline have the current data which have been modified (not matching main memory). Exclusive: The cacheline have the only copy of the data. Shared: This cacheline have a copy of the data, other processors may also have it. Invalid: Well, the line is invalid. Making RMW instructions atomic can be done either by adding external logic not modifying the states themselves (just changing how state changes happen), by slightly redefining the Modified state (such as a RMW instruction changing the state to modified before actually modifying it and not allowing the state to change until the instruction is retired) or by adding a new state similar to modified that can only change to modified (Locked? Atomic? Something like that). Quote:
|
||
10 September 2016, 17:19 | #109 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
As for inter-process communication, a thing that didn't get mentioned when it should have been: as Maynaf says, on modern OS different processes are quite isolated from each other in their own address space so can't just write to each other's data structures. Well that is true for different processes but it is not true for different threads, which one can spawn (with, for instance, std::thread in C++11). All the threads of one process exist in the same address space so you can do exactly what Amiga applications to, and write to shared memory. It is sometimes difficult to get right but there is no hardware problem. The programmer doesn't know, or need to know, whether the other threads are running on a different core or not. 68k actually should make this sort of thing easier if atomicity of <ea> destination instructions can be guaranteed. The only difficulty i can see is with interrupts. When an interrupt happens, the program it belongs to might reasonably assume the interrupt routine cannot be interrupted by anything else, so it could cause trouble if that program can carry on executing even when the interrupt is happening. One would need either, to know which process set up the interrupt and pause that one, or cautiously suspend all processes during servicing of any interrupt. For instance if i try to stop a Protracker module while the playroutine interrupt is happening on another hardware thread, it might cause trouble. This is not a situation anyone currently needs to worry about. Last edited by Mrs Beanbag; 10 September 2016 at 17:26. |
|
10 September 2016, 19:47 | #110 | |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Yes.
Quote:
That RMW instructions are virtually atomic on a one-processor system is solved by making them actually atomic on multiprocessor systems. The disable/forbid etc. routines and their in-line macros can be handled by snooping changes of the two relevant addresses and stall other processors. A more optimized way to handle it would be to support "virtual stalling", as long as other processors doesn't disturb the one calling forbid etc. they can be allowed to continue execution. Programs executing under Amiga OS can assume that they will not be preempted by lower priority ones and can use this as a kind of synchronizing mechanism. The simple way to handle this is making sure all processors are executing programs of the same priority, it isn't optimal though. There are certainly some other problems that have to be handled however I think multiprocessing is possible and a way to provide Amiga systems with a nice speed boost. Could be wrong of course, I often am. |
|
10 September 2016, 20:48 | #111 | ||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Quote:
|
||
11 September 2016, 10:09 | #112 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,190
|
The AROS source has an experimental project called "Silly SMP" that didn't help much on Intel because of the scheduler. The way they were doing it required high priority tasks to be non-blocking like the third-party Executive utility on AmigaOS.
|
09 December 2021, 06:28 | #113 | |
Registered User
Join Date: Dec 2020
Location: Philippines
Posts: 45
|
Quote:
Virtual Vector Method Data Cache: https://groups.google.com/g/comp.arc...m/yYCLvOSqCgAJ Other methods: https://web.archive.org/web/20211101...flaws-of-simd/ |
|
09 December 2021, 09:46 | #114 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
|
|
09 December 2021, 13:41 | #115 |
Registered User
Join Date: Dec 2020
Location: Philippines
Posts: 45
|
|
09 December 2021, 14:49 | #116 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
Quote:
The ISA is more or less finished. I'm more focused on making it work in real life, and actually it even works - though not being able to do HW implementation, i did it in pure SW. |
|
09 December 2021, 14:59 | #117 |
WinUAE 4000/40, V4SA
Join Date: Apr 2020
Location: East of Oshawa
Posts: 538
|
|
09 December 2021, 15:09 | #118 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
|
|
12 December 2021, 21:20 | #120 | |
Registered User
Join Date: Dec 2020
Location: Philippines
Posts: 45
|
Quote:
About your VM: Currently, I am interested on fantasy consoles: programs which simulate classic consoles/computers and provides tools to make games for it. The problem I have with those is they use scripting languages to program instead of assembly. Only a few actually tries to be similar to classic machines, like this one http://www.vircon32.com/index.html. And so, I'm throwing out the idea to extend your VM to a fantasy console and maybe some people would be interested to program in your ISA. Or if you don't want to, maybe I could have the source code of your VM to create a fantasy console as it would be an interesting project for me. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
BOOM (DOOM Enhanced) port to 68k | NovaCoder | News | 155 | 05 May 2023 12:26 |
ISA Ethernet Cards | jmmijo | support.Hardware | 13 | 03 February 2015 11:04 |
Any ISA Mach64 Information? | CU_AMiGA | support.Hardware | 21 | 09 September 2007 22:17 |
Help converting an 8bit ISA slot to 16bit ISA slot | Smiley | support.Hardware | 4 | 25 April 2006 11:20 |
A2000 ISA slots | Unknown_K | support.Hardware | 1 | 20 March 2005 09:48 |
|
|