P
Paul Marciano
Guest
Hello. I'm a bit of a beginner at Verilog, so please be gentle.
I'm trying to build a model for an asynchronous SRAM, and I'm stuck on
how to model the data_out whilst its invalid. Specifically, the
datasheet says the data is valid 70ns after ~nCS & nWE, or any change
in ADDR.
My first try was:
always @(negedge nCS)
if (nWE) begin
data_out = 16'hxxxx;
data_out = #70 ram[ADDR];
end
end
But this has many problems. It only reacts to the edge of CS, so
multiple transactions with CS held low don't work and it doesn't
restart the 70ns access timer if any parameters change.
What I think I need is an FSM, but without a clock I don't know how to
model time (i.e the 70ns access timeout) as an event.
This is purely a learning exercise. I hope someone can clue me in.
Thanks,
Paul.
I'm trying to build a model for an asynchronous SRAM, and I'm stuck on
how to model the data_out whilst its invalid. Specifically, the
datasheet says the data is valid 70ns after ~nCS & nWE, or any change
in ADDR.
My first try was:
always @(negedge nCS)
if (nWE) begin
data_out = 16'hxxxx;
data_out = #70 ram[ADDR];
end
end
But this has many problems. It only reacts to the edge of CS, so
multiple transactions with CS held low don't work and it doesn't
restart the 70ns access timer if any parameters change.
What I think I need is an FSM, but without a clock I don't know how to
model time (i.e the 70ns access timeout) as an event.
This is purely a learning exercise. I hope someone can clue me in.
Thanks,
Paul.