This is the mail archive of the
sid@sources.redhat.com
mailing list for the SID project.
Re: [RFA]: hw-glue-bus-mux selection behavior
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Subject: Re: [RFA]: hw-glue-bus-mux selection behavior
- From: Dave Brolley <brolley at redhat dot com>
- Date: Wed, 28 Mar 2001 11:56:55 -0500
- CC: sid at sources dot redhat dot com
- References: <3AC124C3.7060604@redhat.com> <20010327190454.D3092@redhat.com>
Frank Ch. Eigler wrote:
> Hi -
>
> On Tue, Mar 27, 2001 at 06:39:47PM -0500, Dave Brolley wrote:
> : [...]
> : Notes:
> : 1) I actually implemented the selector to choose "downstream1" when the
> : pin value is even and "downstream2" otherwise. [...]
>
> To me, this seems like an unnecessary feature; I'd let the client pick
> exactly 0 or 1.
ok -- just trying to be too clever, I guess. How about 0 vs non-zero? I
think there should be some defined behavior for all values. Updated
patch attached.
> : 2) I left the mux_passthrough_bus::switch_bus function in since it still
> : seems like useful functionality for other subclasses.
>
> Hmm. For what it's worth, I wouldn't have put the mux_passthrough
> thingie into sid/include/ at all. It looks like a specialized enough
> piece of code that I'd have kept it inside the source directory of
> the appropriate glue component.
I didn't move it. It was already there. Feel free to move it if you like.
> : OK to commit?
>
> Sure; up to you if you want to take my mild objections into consideration.
Of course, as always....
Dave
Index: component/glue/glue.cxx
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/component/glue/glue.cxx,v
retrieving revision 1.32
diff -c -p -r1.32 glue.cxx
*** component/glue/glue.cxx 2001/01/12 21:01:31 1.32
--- component/glue/glue.cxx 2001/03/27 23:20:56
*************** public:
*** 540,549 ****
void handle_switch_pin (host_int_4 value)
{
! if (value != 0)
! {
! upstream.switch_bus();
! }
}
};
--- 540,546 ----
void handle_switch_pin (host_int_4 value)
{
! upstream.select_bus (value);
}
};
Index: component/glue/hw-glue-bus-mux.txt
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/component/glue/hw-glue-bus-mux.txt,v
retrieving revision 1.2
diff -c -p -r1.2 hw-glue-bus-mux.txt
*** component/glue/hw-glue-bus-mux.txt 2001/01/12 21:01:31 1.2
--- component/glue/hw-glue-bus-mux.txt 2001/03/27 23:20:56
***************
*** 24,33 ****
to "downstream1".
* Switching
! When the "switch" pin is driven high, the output accessor will
! be switched from the current output accessor to the one not in use.
The "switch" pin can be driven any number of times, each time
! causing the output to be switched.
* Bus traffic
Input to the "upstream" bus is passed on to the current
--- 24,37 ----
to "downstream1".
* Switching
! When the "switch" pin is driven with the value zero, the output accessor
! will be "downstream1". When the "switch" pin is driven with a non-zero
! value, the output accessor will be "downstream2".
The "switch" pin can be driven any number of times, each time
! causing the corresponding output to be selected.
* Bus traffic
Input to the "upstream" bus is passed on to the current
Index: include/sidbusutil.h
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/include/sidbusutil.h,v
retrieving revision 1.46
diff -c -p -r1.46 sidbusutil.h
*** include/sidbusutil.h 2001/03/01 19:18:07 1.46
--- include/sidbusutil.h 2001/03/27 23:20:57
*************** namespace sidutil
*** 269,274 ****
--- 269,275 ----
}
~mux_passthrough_bus() {}
void switch_bus() { index ^= 1; target = t[index]; }
+ void select_bus (int i) { index = (i != 0); target = t[index]; }
// Some macros to make manufacturing of the cartesian-product
// calls simpler.