From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:330e:: with SMTP id t14mr7832356qta.232.1579655304354; Tue, 21 Jan 2020 17:08:24 -0800 (PST) X-Received: by 2002:a9d:24ea:: with SMTP id z97mr5700585ota.345.1579655303826; Tue, 21 Jan 2020 17:08:23 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g89no9057465qtd.0!news-out.google.com!o19ni529qtr.1!nntp.google.com!g89no9057459qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 21 Jan 2020 17:08:23 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=47.136.24.151; posting-account=o_Y23woAAACPYGlDsFV1OivhygPNSoRn NNTP-Posting-Host: 47.136.24.151 References: <4b0649b3-aed2-44fd-822f-d6665b9352dd@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Creating several types from a base type and conversion From: Ken Roberts Injection-Date: Wed, 22 Jan 2020 01:08:24 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:57915 Date: 2020-01-21T17:08:23-08:00 List-Id: On Tuesday, January 21, 2020 at 3:06:55 PM UTC-8, Niklas Holsti wrote: > On 2020-01-21 23:35, Shark8 wrote: > > On Saturday, January 18, 2020 at 5:49:17 AM UTC-7, Ken Roberts wrote: > >> One example: > >> > >> ADD LP : L[Y*(Q)]+(A) -> A > >> > >> Take the logical product of Y and Q register, then add A register, > >> place results in A register. > >> > >> (LP being boolean AND of 2 registers) >=20 > Modular types, including Interfaces.Unsigned_32, have built-in bit-wise= =20 > boolean operators, so there is little advantage in using arrays of=20 > booleans instead of modular types. >=20 > >> I think I tried doing tagged records and subtypes, but kept getting > >> errors like 'Bits already mapped' when trying to extend the BaseWord > >> (30 bit) into a data word ( 2 separate 15-bit fields) and instruction > >> word (5 separate bit-mapped fields) while still being able to easily > >> convert between BaseWord and others (think pulling next instruction > >> from memory array, then pulling data from arbitrary location in > >> memory array). >=20 > Perhaps you (Ken) did not understand that when you extend a tagged=20 > record type, you are *adding* components to the components in the parent= =20 > type. The parent type's components are still there, and still occupy the= =20 > bit ranges specified in the representation clause for the parent type.=20 > This is not a "remapping" or "reinterpretation" of the bits of the=20 > parent type -- that is what the Unchecked_Conversion function is for. > I kinda understood it was not a remapping but adding components, but was ki= nda hoping to be able to have: var.data =3D 30 bits var.upper =3D upper 15 bits of data var.lower =3D lower 15 bits of data =20 > > Hm, you *could* make the programs a stream and use the stream > read/wr= ite attributes. -- Though this *might* be a bit of a > > bear to debug, it does have the advantage that you could "dump > the bi= ts to the stream" and let the Read attribute/function take > > care of interpreting the data. >=20 > That's a bad idea, IMO. The emulated RAM should be randomly accessible,= =20 > word by word, which is cumbersome and slow (if possible) for streams. >=20 Correct - I was planning on using Memory : array (0 .. 32768) of Word; As I noted, with modern computers this size of array would be pretty much a= corner of ram. > >> Functionally, it would be relatively easy to just ignore the hardware > >> aspect of the emulation, but I'm trying to set it up so I can emulate > >> the hardware later as a learning tool to how this old computer > >> actually did things (like 1's complement subtractive addition). The > >> real fun will be programming the timing (1MHz clock split into 4 > >> phases, with interesting interrupt handling). >=20 > It seems to me that emulating the instruction semantics (functional=20 > emulation) is a reasonable goal for someone new to Ada. Emulating the=20 > cycle-by-cycle operation of the HW is much more ambitious, especially=20 > when various HW units are running in parallel, and I do not advise=20 > starting there. Better to start from a functional emulation, and tackle= =20 > the cycle-accurate emulation later. >=20 The original plan was to emulate the software, but by careful planning shou= ld be able to reuse the instruction interpreter functions/procedures when i= t comes time to actually emulate the hardware - note that the main emulatio= n parts are moving data between registers and bit manipulation within the r= egisters. > Your github documents suggest that you intend use network messages to=20 > emulate data transmitted at clock-rate between the different HW units of= =20 > the emulated computer. I suspect that this, together with the=20 > cycle/phase-specific emulation, will not let you reach your target of=20 > running the emulation at the 1 MHz rate of the original computer. >=20 The network emulation is not for messaging between computer sections - it's= for emulating the cabling between the computer and peripheral equipment. The timing is a consideration both in emulating the software as well as emu= lating the timing between the peripheral equipment. The long-term project goal is to emulate the USQ-20 suite - so the message = passing via network would simulate the cabling between the nodes. Node exam= ples: Node 1 : CP642 (unit A) Node 2 : CP642 (unit B) Node 3 : CP642 (unit C) Node 4 : RD231 (Magnetic tape unit) Node 5 : UGC13 (Teletypewriter) Node 6 : SYA4 (PPI display - radar repeaters w/symbology) > --=20 > Niklas Holsti > Tidorum Ltd > niklas holsti tidorum fi > . @ .