From: Ken Roberts <alisonken1@gmail.com>
Subject: Re: Creating several types from a base type and conversion
Date: Tue, 21 Jan 2020 17:08:23 -0800 (PST)
Date: 2020-01-21T17:08:23-08:00 [thread overview]
Message-ID: <b248d6d7-011d-4c42-83d5-2e5bb8e34162@googlegroups.com> (raw)
In-Reply-To: <h8pegdF8u13U1@mid.individual.net>
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:
<snip>
> >> 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)
>
> Modular types, including Interfaces.Unsigned_32, have built-in bit-wise
> boolean operators, so there is little advantage in using arrays of
> booleans instead of modular types.
>
> >> 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).
>
> Perhaps you (Ken) did not understand that when you extend a tagged
> record type, you are *adding* components to the components in the parent
> type. The parent type's components are still there, and still occupy the
> bit ranges specified in the representation clause for the parent type.
> This is not a "remapping" or "reinterpretation" of the bits of the
> parent type -- that is what the Unchecked_Conversion function is for.
>
I kinda understood it was not a remapping but adding components, but was kinda hoping to be able to have:
var.data = 30 bits
var.upper = upper 15 bits of data
var.lower = lower 15 bits of data
> > Hm, you *could* make the programs a stream and use the stream > read/write attributes. -- Though this *might* be a bit of a
> > bear to debug, it does have the advantage that you could "dump > the bits to the stream" and let the Read attribute/function take
> > care of interpreting the data.
>
> That's a bad idea, IMO. The emulated RAM should be randomly accessible,
> word by word, which is cumbersome and slow (if possible) for streams.
>
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).
>
> It seems to me that emulating the instruction semantics (functional
> emulation) is a reasonable goal for someone new to Ada. Emulating the
> cycle-by-cycle operation of the HW is much more ambitious, especially
> when various HW units are running in parallel, and I do not advise
> starting there. Better to start from a functional emulation, and tackle
> the cycle-accurate emulation later.
>
The original plan was to emulate the software, but by careful planning should be able to reuse the instruction interpreter functions/procedures when it comes time to actually emulate the hardware - note that the main emulation parts are moving data between registers and bit manipulation within the registers.
> Your github documents suggest that you intend use network messages to
> emulate data transmitted at clock-rate between the different HW units of
> the emulated computer. I suspect that this, together with the
> cycle/phase-specific emulation, will not let you reach your target of
> running the emulation at the 1 MHz rate of the original computer.
>
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 emulating 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 examples:
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)
> --
> Niklas Holsti
> Tidorum Ltd
> niklas holsti tidorum fi
> . @ .
next prev parent reply other threads:[~2020-01-22 1:08 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-18 7:32 Creating several types from a base type and conversion Ken Roberts
2020-01-18 12:16 ` Simon Wright
2020-01-18 12:49 ` Ken Roberts
2020-01-18 14:56 ` Bill Findlay
2020-01-18 16:13 ` Jeffrey R. Carter
2020-01-18 18:20 ` Bill Findlay
2020-01-18 18:32 ` Jeffrey R. Carter
2020-01-18 20:34 ` Simon Wright
2020-01-20 16:38 ` Bill Findlay
2020-01-18 22:20 ` Ken Roberts
2020-01-18 15:09 ` Simon Wright
2020-01-18 22:16 ` Ken Roberts
2020-01-18 22:35 ` Simon Wright
2020-01-18 23:03 ` Ken Roberts
2020-01-18 23:38 ` Simon Wright
2020-01-19 0:12 ` Ken Roberts
2020-01-19 9:37 ` Simon Wright
2020-01-19 11:48 ` AdaMagica
2020-01-19 14:51 ` Simon Wright
2020-01-19 15:24 ` Niklas Holsti
2020-01-19 16:11 ` Optikos
2020-01-19 0:33 ` Ken Roberts
2020-01-19 0:07 ` Niklas Holsti
2020-01-18 15:47 ` Simon Wright
2020-01-21 21:35 ` Shark8
2020-01-21 23:06 ` Niklas Holsti
2020-01-22 1:08 ` Ken Roberts [this message]
2020-01-22 14:18 ` Ken Roberts
2020-01-22 8:37 ` Simon Wright
2020-01-22 14:32 ` Shark8
2020-01-22 15:40 ` Simon Wright
2020-01-18 14:17 ` Optikos
2020-01-18 17:57 ` Niklas Holsti
2020-01-18 22:59 ` Ken Roberts
2020-01-19 0:30 ` Niklas Holsti
2020-01-19 1:07 ` Ken Roberts
2020-01-19 3:37 ` Ken Roberts
2020-01-23 21:39 ` Optikos
2020-01-24 9:35 ` Ken Roberts
2020-01-24 10:04 ` AdaMagica
2020-01-24 12:38 ` Optikos
2020-01-24 15:01 ` Ken Roberts
2020-01-24 15:22 ` Simon Wright
2020-01-24 15:40 ` Ken Roberts
2020-01-24 15:54 ` Simon Wright
2020-01-25 10:37 ` Ken Roberts
2020-01-25 10:44 ` Ken Roberts
2020-01-25 20:26 ` Shark8
2020-01-27 14:10 ` Ken Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox