exxos wrote: 05 Apr 2021 13:33
Idea being that ram_delay3 will hold off ram_access until the bus is all high.. then its allowed to run.. but it then has to remain in that state until the cycle is completed..
Obviously AS30 will set the FF to high when AS30 = 1.. When CPU accesses the bus the FF is allowed to run, and will latch BUS_FREE when its sees all datalines high..
Code: Select all
assign BUS_FREE = ~&D[31:16];
FDCP ff_dtack3r( .D( BUS_FREE ), .C( CLK100M ), .PRE( AS30 ), .CLR( 1'b0 ), .Q( ram_delay3 ) );
wire ram_access = ram_decode | ram_delay3;
I can't see how this does what you're describing. To me it looks like ram_delay3 is held at 1 whenever the bus is inactive. Fine.
But when the bus *is* active, ram_delay3 would seem to me to reflect whatever BUS_FREE was at the last positive 100MHz clock edge. Which doesn't seem like a latch.
I'd have probably tried something like:
Code: Select all
FDCP ff_dtack3r( .D( 1'b0 ), .C( ~(AS30|BUS_FREE) ), .PRE( AS30 ), .CLR( 1'b0 ), .Q( ram_delay3 ) );
So ram_delay is held high whenever AS30 is high, otherwise it goes low on the falling edge of (AS30|BUS_FREE) and stays there until AS30 goes high and resets it.
Hmm... I suppose, actually, the AS30 dependency in the clock is irrelevant as the clock only matters when AS30 is low already.
So a further simplified version might be:
Code: Select all
FDCP ff_dtack3r( .D( 1'b0 ), .C( ~BUS_FREE ), .PRE( AS30 ), .CLR( 1'b0 ), .Q( ram_delay3 ) );
What do you think?
BW