On Jul 15, 9:42*pm, rubson <
[email protected]> wrote:
> On Jul 15, 10:37*pm, Chip <[email protected]> wrote:
>
> > Greetings,
>
> > I have a 4-bit chip select bus (1 of 16) that I want to use as an
> > event. *The simplest solution is to simply AND the 4 input lines to
> > produce a single signal called ChipSelect. *As you probably know using
> > this signal in an 'always' block returns the 'Gated clock' warning.
> > Is there a solution to this problem?
>
> > Thanks
>
> if you wanna use it as asynchronous event then yes, is it critical for
> you?
> if not just use it as conditional statement, in other words
>
> always @ (posedge xClk)begin
> if (!CS) begin
> ............
> ............
> ............
>
> end
> end
This is a SPI slave engine. I want to build a state machine that
responds to each bit communicated via SPI. This requires that I know
the count/index of each bit. I want the /CS event to clear the bit
count/index back to 0 BEFORE the SPI clock edges begin to clock in
data.
If CS was a single line it would be easy and I could write something
like (in this example SPCK idle polarity is LO):
always @ (negedge CS or posedge SPCK) begin
if(!SPCK)
BitIndex <= 0;
else
BitIndex <= BitIndex + 1;
end
This process initializes the BitIndex at the beginning of each
transfer.
The problem is that I have a 4-bit (1 of 16) CS bus and the only way I
know of to get the equivalent falling edge is to AND the 4 bits:
wire CS;
and(CS, IN[0], IN[1], IN[2], IN[3]);
In this way I get the Gate Clock warning on signal CS.
Any ideas?
Thanks