URL
https://opencores.org/ocsvn/mpmc8/mpmc8/trunk
[/] [mpmc8/] [trunk/] [rtl/] [mpmc10/] [mpmc10_app_en_gen.sv] - Diff between revs 5 and 7
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 5 |
Rev 7 |
Line 36... |
Line 36... |
//
|
//
|
import mpmc10_pkg::*;
|
import mpmc10_pkg::*;
|
|
|
module mpmc10_app_en_gen(clk, state, rdy, strip_cnt, num_strips, en);
|
module mpmc10_app_en_gen(clk, state, rdy, strip_cnt, num_strips, en);
|
input clk;
|
input clk;
|
input [3:0] state;
|
input mpmc10_state_t state;
|
input rdy;
|
input rdy;
|
input [5:0] strip_cnt;
|
input [5:0] strip_cnt;
|
input [5:0] num_strips;
|
input [5:0] num_strips;
|
output reg en;
|
output reg en;
|
|
|
// app_en latches the command and address when app_rdy is active. If app_rdy
|
// app_en latches the command and address when app_rdy is active. If app_rdy
|
// is not true, the command must be retried.
|
// is not true, the command must be retried.
|
always_ff @(posedge clk)
|
always_ff @(posedge clk)
|
begin
|
begin
|
en <= mpmc10_pkg::FALSE;
|
en <= mpmc10_pkg::FALSE;
|
if (state==mpmc10_pkg::WRITE_DATA1)
|
if (state==WRITE_DATA1)
|
en <= mpmc10_pkg::TRUE;
|
en <= TRUE;
|
else if (state==mpmc10_pkg::WRITE_DATA2 && !rdy)
|
else if (state==WRITE_DATA2 && !en)
|
en <= mpmc10_pkg::TRUE;
|
en <= TRUE;
|
else if (state==mpmc10_pkg::READ_DATA0)
|
else if (state==READ_DATA0)
|
en <= mpmc10_pkg::TRUE;
|
en <= TRUE;
|
else if (state==mpmc10_pkg::READ_DATA1 && !(rdy && strip_cnt==num_strips))
|
else if (state==READ_DATA1 && !(rdy && strip_cnt==num_strips))
|
en <= mpmc10_pkg::TRUE;
|
en <= TRUE;
|
end
|
end
|
|
|
endmodule
|
endmodule
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.