comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: implementation approach
Date: 01 Aug 2002 15:18:25 -0400
Date: 2002-08-01T19:26:59+00:00	[thread overview]
Message-ID: <uado68k1q.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: a5ae824.0207301854.3295f3a2@posting.google.com

ma740988@pegasus.cc.ucf.edu (Mark) writes:

> I'm in a quandry here and could certainly use some help.  That said,
> some background information.
> 
> I've got code spread across two processors.  We'll call processors A
> and B respectively.  Of interest is a device I'm communicating with
> (serial).  The code for communicating with said device resides on
> processor A.
> While communicating with the device during a 'certain' mode, the
> communication is as follows:
>  - I send a command.
>  - Device sends an interrupt 
>  - I synchronize with interrupt and send said command again 
>  -- and so on ..
> 
> Trouble is.  The interrupt gets routed through and FPGA and 'goes'
> through processor B.

Hmm. Have you tried saying "Either the serial port needs to be
commanded from processor B, or the interrupt needs to be handled by
processor A".

Why can't processor B command the serial port?

Why can't the hardware design be changed so processor A handles the
interrupt?

Always try to do it right, first!

> On B i've got an interrupt handler .. "pragma Attach_Handler .."
> that'll check if the interrupt happened. When it does I could
> perhaps set a flag, then pass the message via a Send_Message routine
> to processor A and the routine for commanding the device on A will
> again command device.

This makes sense. 

> After 8 months of ADA I'm startign to catch on, however, my ADA is
> still 'limited'. In any event, I'm thinking a semaphore might might
> be the most elegant approach or ... I'm open for ideas. If semaphore
> could someone provide me with an example on how to do this?

You'll have to look in your operating system manuals to see what is
provided. (the "non-Ada", but probably simpler, way).

Or, look in the Distributed Systems Annex to see what is available
there. (the "Ada way").

-- 
-- Stephe



      parent reply	other threads:[~2002-08-01 19:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-31  2:54 implementation approach Mark
2002-07-31 13:59 ` SteveD
2002-08-01 19:18 ` Stephen Leake [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox