This is the mail archive of the sid@sourceware.org mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][commit] Enhancements to Bus Arbitration Modelling


Hi,

I've committed this patch which adds the capability to implement passthrough for each upstream interface of a bus arbitrator independently. Previously, the passthrough could only be enabled for the arbitrator as a whole. This is useful when one or more components upstream of the arbitrator need access to components downstream of the arbitrator without arbitration while still requiring arbitration for other upstream components.

The implementation is achieved by passing the index of the upstream accessor to the virtual check_passthough method. The default implementation supports no explicit upstream passthough and checks only for passthrough required by the system state.

This patch also adds a virtual method which defines the latency of accessing the bus arbitrator itself. The default latency is 0 cycles.

Dave
2005-08-02  Dave Brolley  <brolley@redhat.com>

	* sidbusutil.h (bus_arbitrator): Remove passthrough_pin.
	(check_passthrough): Now takes 'upstream' argument. Correct all calls.
	Don't check passthrough_pin here.
	(access_latency): New virtual method of bus_arbitrator.
Index: sid/include/sidbusutil.h
===================================================================
RCS file: /cvs/src/src/sid/include/sidbusutil.h,v
retrieving revision 1.15
diff -c -p -r1.15 sidbusutil.h
*** sid/include/sidbusutil.h	10 May 2005 15:48:22 -0000	1.15
--- sid/include/sidbusutil.h	2 Aug 2005 18:19:15 -0000
***************
*** 1,6 ****
  // sidbusutil.h -*- C++ -*- Different types and sizes of buses.
  
! // Copyright (C) 1999, 2000, 2001, 2002, 2004 Red Hat.
  // This file is part of SID and is licensed under the GPL.
  // See the file COPYING.SID for conditions for redistribution.
  
--- 1,6 ----
  // sidbusutil.h -*- C++ -*- Different types and sizes of buses.
  
! // Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Red Hat.
  // This file is part of SID and is licensed under the GPL.
  // See the file COPYING.SID for conditions for redistribution.
  
*************** namespace sidutil
*** 1213,1220 ****
  	running_pin.set_active_high ();
  	add_pin ("active", & active_pin);
  	active_pin.set_active_high ();
- 	add_pin ("passthrough", & passthrough_pin);
- 	passthrough_pin.set_active_high ();
        }
      ~bus_arbitrator () throw () { }
  
--- 1213,1218 ----
*************** namespace sidutil
*** 1289,1295 ****
      sid::bus::status
      write(int upstream, sid::host_int_4 addr, DataType data)
        {
! 	if (ulog_level >= 8 || ! check_passthrough ())
  	  log (5, "%s: received write request from %s interface at 0x%x\n",
  	       name.c_str (), up2str(upstream), addr);
  	return arbitrate_write (upstream, downstream_for_address (addr), addr, data);
--- 1287,1293 ----
      sid::bus::status
      write(int upstream, sid::host_int_4 addr, DataType data)
        {
! 	if (ulog_level >= 8 || ! check_passthrough (upstream))
  	  log (5, "%s: received write request from %s interface at 0x%x\n",
  	       name.c_str (), up2str(upstream), addr);
  	return arbitrate_write (upstream, downstream_for_address (addr), addr, data);
*************** namespace sidutil
*** 1299,1305 ****
      sid::bus::status
      read(int upstream, sid::host_int_4 addr, DataType& data)
        {
! 	if (ulog_level >= 8 || ! check_passthrough ())
  	  log (5, "%s: received read request from %s interface at 0x%x\n",
  	       name.c_str (), up2str(upstream), addr);
  	return arbitrate_read (upstream, downstream_for_address (addr), addr, data);
--- 1297,1303 ----
      sid::bus::status
      read(int upstream, sid::host_int_4 addr, DataType& data)
        {
! 	if (ulog_level >= 8 || ! check_passthrough (upstream))
  	  log (5, "%s: received read request from %s interface at 0x%x\n",
  	       name.c_str (), up2str(upstream), addr);
  	return arbitrate_read (upstream, downstream_for_address (addr), addr, data);
*************** namespace sidutil
*** 1335,1341 ****
  				     DataType& data)
        {
  	// Check for direct passthrough
! 	if (check_passthrough ())
  	  return downstream_bus (downstream)->read (addr, data);
  
  	// Prioritize the request
--- 1333,1339 ----
  				     DataType& data)
        {
  	// Check for direct passthrough
! 	if (check_passthrough (upstream))
  	  return downstream_bus (downstream)->read (addr, data);
  
  	// Prioritize the request
*************** namespace sidutil
*** 1354,1360 ****
  				      DataType data)
        {
  	// Check for direct passthrough
! 	if (check_passthrough ())
  	  return downstream_bus (downstream)->write(addr, data);
  
  	// Prioritize the request
--- 1352,1358 ----
  				      DataType data)
        {
  	// Check for direct passthrough
! 	if (check_passthrough (upstream))
  	  return downstream_bus (downstream)->write(addr, data);
  
  	// Prioritize the request
*************** namespace sidutil
*** 1410,1431 ****
  	return s;
        }
  
!     bool check_passthrough ()
        {
- 	if (passthrough_pin.state () == binary_pin_active)
- 	  {
- 	    log (8, "%s: passthrough enabled\n", name.c_str ());
- 	    return true;
- 	  }
- 
  	if (running_pin.state () != binary_pin_active
  	    || active_pin.state () != binary_pin_active)
  	  {
  	    log (8, "%s: system is idle -- passthrough\n", name.c_str ());
  	    return true;
  	  }
!       return false;
!     }
  
    protected:
      // Route locking
--- 1408,1429 ----
  	return s;
        }
  
!     virtual bool check_passthrough (int = 0)
        {
  	if (running_pin.state () != binary_pin_active
  	    || active_pin.state () != binary_pin_active)
  	  {
  	    log (8, "%s: system is idle -- passthrough\n", name.c_str ());
  	    return true;
  	  }
! 	return false;
!       }
! 
!   protected:
!     // Methods for timing
!     //
!     // Default to no latency
!     virtual sid::host_int_2 access_latency (bus_request &r) { return 0; }
  
    protected:
      // Route locking
*************** namespace sidutil
*** 1457,1463 ****
      //
      binary_input_pin running_pin;
      binary_input_pin active_pin;
-     binary_input_pin passthrough_pin;
    };
  }
  
--- 1455,1460 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]