I want to migrate dps8m towards a model where the CPUs and I/O devices run as independent processes. This will allow true asynchronous I/O and CPU execution.
The DPS8M h/w features a main memory architecture that allows multiple CPUs and I/O devices direct access to main memory. This suggests that a model where the DPS8M main memory would be implemented as shared memory would be a natural component of the emulator.
The main memory resides in the SCUs (System Control Units); four megawords per SCU, with a maximum configuration of four SCUs.
(The SCUs are simple; they hold memory, and route connect and interrupt signals among the CPUs and IOMs. I suspect that the correct architecture is that the SCUs live in the "main process".)
Features needed:
*SessionnamespaceThearchitectureshouldsupportmorethenoneinstanceoftheemulatorrunningonasystem;theIPCandsharedmemoryneedtoincludesomeformofsessionID,allowingpeacefulcoexistence.*Sharedmemory*Mainmemoryinsharedmemory*Possibly:Cablingandconfigurationinsharedmemory.Thiswouldkeeptheprocessingoftheconfigurationdata(base_system.ini,20184.ini)inthe"main"process,asCPUanddeviceprocessesarestarted,theylookinthissharedmemoryforconfigurationdata.*Possibly:CPUandperipheralstatedatainsharedmemory.ThisgreatlysimplifiesblinkenLights;ratherthenhavingcodescatteredthroughouttheCPUemulatorharvestingdata,itjustlooksinthesharedmemorysegment.Arguably,thegatheringupofalloftheCPUstatedataintoastructureisgoods/wengineeringpractice.*IPC(thislistisoffthetopofmyhead;notdefinitive)TheCPUssend"connect"messagestotheSCUs.TheCPUssend"write register"messagestotheSCUs.TheCPUssend"read register"messagesandexpectasynchronousreply.TheSCUssends"connect"messagestotheIOMsandCPUs.TheSCUssends"interrupt"messagestotheCPUsTheIOMssendI/Ocommandstotheperipherals.Theperipheralssend"list service"messagestotheIOMsTheperipheralssend"indirect list service"messagestotheIOMs(The"list service"islow-bandwidth;itisarequesttobesentthenextI/Ocommand."Indirect list service"ispotentiallyhighbandwidthasitisaDMArequest.)*PortabilityThetargetedplatformsareFedora,Ubuntu,MacOS,Windows(7?).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I like your ideas. After producing a more-or-less stable release we may want to also ponder .....
Do we want to stick with SIMH? or roll our own? Perhaps we would want to extend SIMH to add process management, IPC, SHM, etc? (all in a platform agnostic manner.) Not that the SIMH folks would want to accept our contributions, but we could come up with a SIMH extention library that has the missing bits and pieces we need and make that available for others.
Do we want to stay with C? C++ is wonderful for encapsulation, but alas, SIMH is in C, but we could work around that. Other languages?
Other playforms -- 32-bit? Android? IOS? Windows (Native and/or Cygwin.)?
And there's always optimizing what we have. Surely our 5,000 MIP / core CPUs can emulate a 1.8MIP machine, shall we say, a tad faster than what were getting?
Also don't forget about FNP <=> FNP for Multics internetworking.
What libraries to we want to keep or abandon?
Thoughts?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Caution: these are my personal opinions and thoughts, and are not necessarily
representative of the project members, or for that matter, reality.
What does simh offer?
Theset/showstatemanagementThecodeiscurrentlyheavilydependentonthisforconfigurationmanagement(base_system.ini,20184.ini,butit'slimitationsareshowingupasasignificantamountofhelpercode(cfg_*).Replacingthiswithin-houseora3rdpartyinterpretershouldbequitefeasibleandshouldbeconsidered.The"activate"mechanismforemulationofasynchronouseventsBybreakingtheemulatorupintoactuallyindependentprocesses,weloseallrelianceonthismechanism.Thesim_instr()loop.Thereisaninterestingphilosophicaldistinctionbetweensimh'sviewofCPUsandtheDSP8MCPU.SimhimplicitlybelievesthatCPUshavearun/stopstate;theDPS8MCPUisalwaysrunning--atpoweronwithzero-initializedmemory,itgoesintoatroublefaultcascade;thebootprogram"starts"thebootprocessbydroppingtheentryaddressofthebootprogramintothetroublefaultvectorlocation.Insimh,thesimhcommandprocessorisalwaysrunning;asasideeffectofsomesimhcommands,itwilldecidetostartthesim_instrloop.Toexecutemoresimhcommands,theCPUispausedbysim_instr'sdecisiontoreturntothesimhcommandprocessor.Thisworkedverywellduringdevelopment,butisabitofabrokenparadigmforamulti-core,alwaysrunningmainframeOS.Asanexample,simhwouldhaveyou"mount a tape"onthetapedrivewiththeattachcommand,butpausingtheCPUinamultiuserOStotypeinthecommandisnotattractive.Wesynthesizethecommand,butweloseallofthenicecommandparsing,andhavetoreachintothesimhinternalstodoso.Awkward.Therearesoongoingtomanymoreexamplesofthiskindofcode,andIwonderifweshouldreconsiderthemechanism.Breakpoints/instructiontracing/stateexaminationThishasbeeninvaluableduringdevelopment,butisrapidlybecomingvestigial;theinfrastructureisjustnotuptodealingwiththeasynchronous,multiprocessing,segmented,dynamicallylinked,andlongrunningOS.Theterminalmultiplexor.Idonottrusttheterminalmultiplexor;itistiedintricatelyintothesimharchitecture,andit'scodeisunreadablebyme.Ifullyintendtoreplacetheterminalmultiplexorcodewithlibtelnetand/orssh.Clockmanagement.Ihavealwaysbeenmoreinterestedinamaximumperformanceimplementationasopposedtoanaccuratelytimedemulation,soIhavenointerestintheclockmanagement.
I am of the belief that simh is of decreasing importance to the emulator, and
should be allowed to wither on the vine.
I am contemplating that for the CPU process, shedding simh entirely. The cable and configuration management would be done with simh in the main process, with the data communicated to the CPU processes through shared memory.
I have an rather strong dislike for C++; I think they have lost the narrative thread. (Also, I have philosophical issues with languages that generate more efficient code for "++p" then "p++").
The language feature that I think would help the most is a strictly enforced way of doing 15/18/36/72 signed unsigned math -- specifically no automatic
up-casting.
This is probably doable in C by making the subtypes opaque structure, and defining math functions across the structures, but I fear for the readability of the code, and the possibility of the generated code being inefficient.
This is certainly doable in C++; but I lack both the skills to write the classes, and the trust that anyone else would do it right.
Optimization: Always start any optimization by (re)reading "Programming Pearls" and "More Programming Pearls"
IPC worries me. I like ZMQ in principle, but they do seem to be having their fair share of windows issues, and I think that the zyre chat mechanism was a good first pass at IPC. I think I am searching for a "more tightly coupled" mechanism -- it is too easy for nodes to drop in and out. When the CPU is running, it needs to know that it is connected to a particular IOM, and that its dropping out and back in is not acceptable behavior. ZMQ does have other libraries built on it; one of them may have a good approach to IPC.
Also, an automatic launch mechanism might be nice; when the main process sends its first message to CPU-B, if the process is not running, it should be launch and connected automagically. I am uncertain about this; it may be that the
main process should explicitly launch everything; but then you get into issues of child management. I need to think a look more about this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to migrate dps8m towards a model where the CPUs and I/O devices run as independent processes. This will allow true asynchronous I/O and CPU execution.
The DPS8M h/w features a main memory architecture that allows multiple CPUs and I/O devices direct access to main memory. This suggests that a model where the DPS8M main memory would be implemented as shared memory would be a natural component of the emulator.
DPS8M memory accesses
The main memory resides in the SCUs (System Control Units); four megawords per SCU, with a maximum configuration of four SCUs.
(The SCUs are simple; they hold memory, and route connect and interrupt signals among the CPUs and IOMs. I suspect that the correct architecture is that the SCUs live in the "main process".)
Features needed:
I like your ideas. After producing a more-or-less stable release we may want to also ponder .....
Do we want to stick with SIMH? or roll our own? Perhaps we would want to extend SIMH to add process management, IPC, SHM, etc? (all in a platform agnostic manner.) Not that the SIMH folks would want to accept our contributions, but we could come up with a SIMH extention library that has the missing bits and pieces we need and make that available for others.
Do we want to stay with C? C++ is wonderful for encapsulation, but alas, SIMH is in C, but we could work around that. Other languages?
Other playforms -- 32-bit? Android? IOS? Windows (Native and/or Cygwin.)?
And there's always optimizing what we have. Surely our 5,000 MIP / core CPUs can emulate a 1.8MIP machine, shall we say, a tad faster than what were getting?
Also don't forget about FNP <=> FNP for Multics internetworking.
What libraries to we want to keep or abandon?
Thoughts?
Caution: these are my personal opinions and thoughts, and are not necessarily
representative of the project members, or for that matter, reality.
What does simh offer?
I am of the belief that simh is of decreasing importance to the emulator, and
should be allowed to wither on the vine.
I am contemplating that for the CPU process, shedding simh entirely. The cable and configuration management would be done with simh in the main process, with the data communicated to the CPU processes through shared memory.
Language:
I am contemplating the value of http://ooc-lang.org/
I have an rather strong dislike for C++; I think they have lost the narrative thread. (Also, I have philosophical issues with languages that generate more efficient code for "++p" then "p++").
The language feature that I think would help the most is a strictly enforced way of doing 15/18/36/72 signed unsigned math -- specifically no automatic
up-casting.
This is probably doable in C by making the subtypes opaque structure, and defining math functions across the structures, but I fear for the readability of the code, and the possibility of the generated code being inefficient.
This is certainly doable in C++; but I lack both the skills to write the classes, and the trust that anyone else would do it right.
Optimization: Always start any optimization by (re)reading "Programming Pearls" and "More Programming Pearls"
IPC worries me. I like ZMQ in principle, but they do seem to be having their fair share of windows issues, and I think that the zyre chat mechanism was a good first pass at IPC. I think I am searching for a "more tightly coupled" mechanism -- it is too easy for nodes to drop in and out. When the CPU is running, it needs to know that it is connected to a particular IOM, and that its dropping out and back in is not acceptable behavior. ZMQ does have other libraries built on it; one of them may have a good approach to IPC.
Also, an automatic launch mechanism might be nice; when the main process sends its first message to CPU-B, if the process is not running, it should be launch and connected automagically. I am uncertain about this; it may be that the
main process should explicitly launch everything; but then you get into issues of child management. I need to think a look more about this.