public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* Level sensitive ARM interrupts
@ 2004-07-02 18:37 Robert Shideleff
  2004-07-02 18:39 ` Robert Shideleff
       [not found] ` <200407141850.05451.bigbob@shideleff.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Shideleff @ 2004-07-02 18:37 UTC (permalink / raw)
  To: sid

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch makes arm interrupts level sensitive, as they are in hardware. The 
nirq and nfiq pins are no longer callbacks, but rather simple input pins. 
They are 'pulled' to high at processor invocation and reset. Their level is 
'sense()-ed' at the beginning of each step.

The patch file was taken from within the sid/component/cgen-cpu/arm7t 
directory.

This is necessary for proper operation of eCos, and for the ability to model 
interrupts as they occur in actual hardware.

Bob
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA5atv8XjOGQDr37YRAte8AKCYZ9EYpSH0lusoyA38/KaCT81rfwCcCglg
Kp6FvMyVsWcJYymMa9uHwqw=
=qqdg
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Level sensitive ARM interrupts
  2004-07-02 18:37 Level sensitive ARM interrupts Robert Shideleff
@ 2004-07-02 18:39 ` Robert Shideleff
  2004-07-05  0:27   ` Ben Elliston
       [not found] ` <200407141850.05451.bigbob@shideleff.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Shideleff @ 2004-07-02 18:39 UTC (permalink / raw)
  To: sid

[-- Attachment #1: Type: Text/Plain, Size: 831 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Forgot the attachment. (as usual)

On Friday 02 July 2004 02:37 pm, Robert Shideleff wrote:
> This patch makes arm interrupts level sensitive, as they are in hardware.
> The nirq and nfiq pins are no longer callbacks, but rather simple input
> pins. They are 'pulled' to high at processor invocation and reset. Their
> level is 'sense()-ed' at the beginning of each step.
>
> The patch file was taken from within the sid/component/cgen-cpu/arm7t
> directory.
>
> This is necessary for proper operation of eCos, and for the ability to
> model interrupts as they occur in actual hardware.
>
> Bob
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA5avL8XjOGQDr37YRAjdcAKCBC6DmWAQ3ImhwCbFvc+Aj/vPAdgCfe19r
TTOx2egnP+V7AyeCGB90/U0=
=SlWB
-----END PGP SIGNATURE-----

[-- Attachment #2: sid-arm7t.diff --]
[-- Type: text/x-diff, Size: 5193 bytes --]

Index: arm7f.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/arm7t/arm7f.cxx,v
retrieving revision 1.3
diff -u -r1.3 arm7f.cxx
--- arm7f.cxx	28 Jun 2001 21:52:56 -0000	1.3
+++ arm7f.cxx	2 Jul 2004 18:34:26 -0000
@@ -17,8 +17,6 @@
 arm7f_cpu::arm7f_cpu ():
   arm_engine (32768),   // XXX: tune size
   thumb_engine (32768), // XXX: tune size
-  nfiq_pin (this, & arm7f_cpu::do_nfiq_pin),
-  nirq_pin (this, & arm7f_cpu::do_nirq_pin),
   initialized_p (false)
 {
   // ??? One might want to quibble over the case of these pins (nFIQ?).
@@ -87,6 +85,10 @@
 
   // Add register access for debugger
   this->create_gdb_register_attrs (26, "7;11;13;14;15;25", & this->hardware.h_pc);
+
+  // These need to be 'pulled' high if they are not connected.
+  nirq_pin.driven(1);
+  nfiq_pin.driven(1);
 }
 
 string
@@ -168,6 +170,10 @@
   this->initialized_p = true;
 
   this->triggerpoint_manager.check_and_dispatch ();
+
+  // These need to be 'pulled' high if they are not connected.
+  nirq_pin.driven(1);
+  nfiq_pin.driven(1);
 }
 
 
@@ -182,6 +188,18 @@
       return;
     }
 
+  // Check for currently asserted interrupt pins. Interrupts are only checked for at each
+  // step size block of instructions.
+  if(!this->h_fbit_get() && !nfiq_pin.sense())
+    queue_eit (EIT_FIQ);
+ 
+  if(!this->h_ibit_get() && !nirq_pin.sense())
+    queue_eit (EIT_IRQ);
+
+  // If an eit is queued, process it now.
+  if (this->pending_eit != EIT_NONE)
+    this->process_eit (this->pending_eit);
+
   if (this->engine_type == ENGINE_PBB)
     {
       if (this->h_tbit_get ())
@@ -412,10 +430,6 @@
 {
   assert (! this->h_tbit_get ());
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   while (true)
     {
       // Fetch/decode the instruction  ------------------------------
@@ -482,10 +496,6 @@
 {
   assert (this->h_tbit_get ());
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   while (true)
     {
       // Fetch/decode the instruction  ------------------------------
@@ -553,10 +563,6 @@
       || this->enable_step_trap_p)
     return this->step_arm ();
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   try
     {
       // This function takes care of step_insn_count.
@@ -583,10 +589,6 @@
       || this->enable_step_trap_p)
     return this->step_thumb ();
 
-  // If an eit is queued, process it now.
-  if (this->pending_eit != EIT_NONE)
-    this->process_eit (this->pending_eit);
-
   try
     {
       // This function takes care of step_insn_count.
@@ -961,46 +963,6 @@
 \f
 // EIT (exception, interrupt, and trap) pins.
 
-void
-arm7f_cpu::do_nfiq_pin (host_int_4 value)
-{
-  // FIXME: Should be able to catch high-low transition but can't do
-  // that with callback_pin.
-  //if (nfiq_pin.sense () == value)
-  //  return;
-  if (value)
-    return;
-
-  // nFIQ has been driven low.
-
-  // Are FIQ interrupts disabled?
-  if (this->h_fbit_get ())
-    return;
-
-  // Queue the interrupt.
-  this->queue_eit (EIT_FIQ);
-}
-
-void
-arm7f_cpu::do_nirq_pin (host_int_4 value)
-{
-  // FIXME: Should be able to catch high-low transition but can't do
-  // that with callback_pin.
-  //if (nirq_pin.sense () == value)
-  //  return;
-  if (value)
-    return;
-
-  // nIRQ has been driven low.
-
-  // Are IRQ interrupts disabled?
-  if (this->h_ibit_get ())
-    return;
-
-  // Queue the interrupt.
-  this->queue_eit (EIT_IRQ);
-}
-
 \f
 // Miscellaneous pins.
 
Index: arm7f.h
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/arm7t/arm7f.h,v
retrieving revision 1.3
diff -u -r1.3 arm7f.h
--- arm7f.h	8 Jan 2003 03:17:27 -0000	1.3
+++ arm7f.h	2 Jul 2004 18:34:26 -0000
@@ -158,10 +158,8 @@
   // FIQ/IRQ are generated by driving these pins (low).
   // It is synchronous if ISYNC is high, asynchronous if ISYNC is low.
   // If asynchronous, a cycle delay for synchronization is incurred.
-  callback_pin<arm7f_cpu> nfiq_pin;
-  void do_nfiq_pin (host_int_4 value);
-  callback_pin<arm7f_cpu> nirq_pin;
-  void do_nirq_pin (host_int_4 value);
+  input_pin nfiq_pin;
+  input_pin nirq_pin;
 
   // cpu is reset by driving this pin low
 #if 0
Index: hw-cpu-arm7t.xml
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/arm7t/hw-cpu-arm7t.xml,v
retrieving revision 1.1
diff -u -r1.1 hw-cpu-arm7t.xml
--- hw-cpu-arm7t.xml	3 Aug 2001 01:47:52 -0000	1.1
+++ hw-cpu-arm7t.xml	2 Jul 2004 18:34:26 -0000
@@ -56,7 +56,9 @@
       <pin>step!</pin> pin is next invoked.  Note that this may not be
       the next instruction if the
       <attribute>step-insn-count</attribute> attribute is greater than
-      one.</p>
+      one. Also note that these pins are level sensitive, so interrupts
+      will occur repeatedly until the pin is driven non-zero. They are
+      'pulled' to one (high) at processor invocation and reset.</p>
     </behavior>
 
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Level sensitive ARM interrupts
  2004-07-02 18:39 ` Robert Shideleff
@ 2004-07-05  0:27   ` Ben Elliston
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Elliston @ 2004-07-05  0:27 UTC (permalink / raw)
  To: sid

Robert Shideleff <bigbob@shideleff.com> writes:

> This patch makes arm interrupts level sensitive, as they are in hardware.
> The nirq and nfiq pins are no longer callbacks, but rather simple input
> pins. They are 'pulled' to high at processor invocation and reset. Their
> level is 'sense()-ed' at the beginning of each step.
>
> The patch file was taken from within the sid/component/cgen-cpu/arm7t
> directory.
>
> This is necessary for proper operation of eCos, and for the ability to
> model interrupts as they occur in actual hardware.

There are a number of ARM-related interrupt tests which, from
recollection, passed.  Does your patch suggest that the tests are
wrong?  If so, can you update them, too?

Ben


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Level sensitive ARM interrupts
       [not found]     ` <200408041117.50677.bigbob@shideleff.com>
@ 2004-08-04 15:43       ` Frank Ch. Eigler
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Ch. Eigler @ 2004-08-04 15:43 UTC (permalink / raw)
  To: Robert Shideleff; +Cc: sid

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

Hi, Robert -

On Wed, Aug 04, 2004 at 11:17:45AM -0400, Robert Shideleff wrote:
> Oh yeah. Sorry, but I've been pretty busy lately. I've got all of the 
> approvals and here is the updated patch.
> 
> By the way, I've found SID to be extremely useful, even after hardware is 
> available.
> [...]

Thank you very much; your patch is committed to CVS.


- FChE

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-04 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 18:37 Level sensitive ARM interrupts Robert Shideleff
2004-07-02 18:39 ` Robert Shideleff
2004-07-05  0:27   ` Ben Elliston
     [not found] ` <200407141850.05451.bigbob@shideleff.com>
     [not found]   ` <20040804023021.GA16871@redhat.com>
     [not found]     ` <200408041117.50677.bigbob@shideleff.com>
2004-08-04 15:43       ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).