Line 80... |
Line 80... |
reg a_prio, nxt_a_prio;
|
reg a_prio, nxt_a_prio;
|
reg a_rip, nxt_a_rip; // read in progress by A
|
reg a_rip, nxt_a_rip; // read in progress by A
|
reg a_wip, nxt_a_wip; // write (read-cache-fill) in progress by A
|
reg a_wip, nxt_a_wip; // write (read-cache-fill) in progress by A
|
reg b_rip, nxt_b_rip; // read in progress by B
|
reg b_rip, nxt_b_rip; // read in progress by B
|
wire c_rip = cfgi_trdy;
|
wire c_rip = cfgi_trdy;
|
wire c_rip = cfgi_trdy;
|
|
wire a_cache_hit, b_cache_hit;
|
wire a_cache_hit, b_cache_hit;
|
|
|
/*AUTOWIRE*/
|
/*AUTOWIRE*/
|
|
|
/* -----\/----- EXCLUDED -----\/-----
|
|
assign #1 t_ram_nwrt = ram_nwrt;
|
|
assign #1 t_ram_nce = ram_nce;
|
|
assign #1 t_ram_addr = ram_addr;
|
|
assign #1 t_ram_din = ram_din;
|
|
-----/\----- EXCLUDED -----/\----- */
|
|
|
|
assign cfgi_rd_data = dout;
|
assign cfgi_rd_data = dout;
|
assign b_rdata = dout;
|
assign b_rdata = dout;
|
|
|
assign a_cache_hit = cvld & (ca_addr == a_addr[mem_asz+1:2]);
|
assign a_cache_hit = cvld & (ca_addr == a_addr[mem_asz+1:2]);
|
assign b_cache_hit = wcvld & (wc_addr == a_addr[mem_asz+1:2]);
|
assign b_cache_hit = wcvld & (wc_addr == a_addr[mem_asz+1:2]);
|
Line 329... |
Line 321... |
end
|
end
|
end // if (!b_mreq_n)
|
end // if (!b_mreq_n)
|
|
|
if (cfgi_irdy)
|
if (cfgi_irdy)
|
begin
|
begin
|
if ((!a_mreq_n | !b_mreq_n) & !c_rip)
|
if ((a_mreq_n & b_mreq_n) & !c_rip & !a_wip)
|
begin
|
|
// access by A or B ports, stall until memory is free
|
|
end
|
|
else
|
|
begin
|
begin
|
if (cfgi_write & !cfgi_trdy)
|
if (cfgi_write & !cfgi_trdy)
|
begin
|
begin
|
nxt_cfgi_trdy = 1;
|
nxt_cfgi_trdy = 1;
|
ram_nce = 0;
|
ram_nce = 0;
|
Line 362... |
Line 350... |
always @(posedge clk or negedge reset_n)
|
always @(posedge clk or negedge reset_n)
|
begin
|
begin
|
if (~reset_n)
|
if (~reset_n)
|
begin
|
begin
|
ca_addr <= 13'h0;
|
ca_addr <= 13'h0;
|
cvld <= #1 0;
|
cvld <= 0;
|
/*AUTORESET*/
|
/*AUTORESET*/
|
// Beginning of autoreset for uninitialized flops
|
// Beginning of autoreset for uninitialized flops
|
a_prio <= 1'h0;
|
a_prio <= 1'h0;
|
a_rip <= 1'h0;
|
a_rip <= 1'h0;
|
a_wip <= 1'h0;
|
a_wip <= 1'h0;
|
Line 378... |
Line 366... |
wcvld <= 1'h0;
|
wcvld <= 1'h0;
|
// End of automatics
|
// End of automatics
|
end
|
end
|
else
|
else
|
begin
|
begin
|
cvld <= #1 nxt_cvld;
|
cvld <= nxt_cvld;
|
ca_addr <= #1 nxt_ca_addr;
|
ca_addr <= nxt_ca_addr;
|
ca_data <= #1 nxt_ca_data;
|
ca_data <= nxt_ca_data;
|
wcvld <= #1 nxt_wcvld;
|
wcvld <= nxt_wcvld;
|
wc_addr <= #1 nxt_wc_addr;
|
wc_addr <= nxt_wc_addr;
|
wc_data <= #1 nxt_wc_data;
|
wc_data <= nxt_wc_data;
|
a_prio <= #1 nxt_a_prio;
|
a_prio <= nxt_a_prio;
|
a_rip <= #1 nxt_a_rip;
|
a_rip <= nxt_a_rip;
|
b_rip <= #1 nxt_b_rip;
|
b_rip <= nxt_b_rip;
|
a_wip <= #1 nxt_a_wip;
|
a_wip <= nxt_a_wip;
|
cfgi_trdy <= #1 nxt_cfgi_trdy;
|
cfgi_trdy <= nxt_cfgi_trdy;
|
end
|
end
|
end
|
end
|
|
|
endmodule // memcontrol
|
endmodule // memcontrol
|
|
|