URL
https://opencores.org/ocsvn/mpmc8/mpmc8/trunk
[/] [mpmc8/] [trunk/] [rtl/] [mpmc10/] [mpmc10_mask_select.sv] - Diff between revs 5 and 7
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 5 |
Rev 7 |
Line 37... |
Line 37... |
import mpmc10_pkg::*;
|
import mpmc10_pkg::*;
|
|
|
module mpmc10_mask_select(rst, clk, state, wmask, mask, mask2);
|
module mpmc10_mask_select(rst, clk, state, wmask, mask, mask2);
|
input rst;
|
input rst;
|
input clk;
|
input clk;
|
input [3:0] state;
|
input mpmc10_state_t state;
|
input [15:0] wmask;
|
input [15:0] wmask;
|
output reg [15:0] mask;
|
output reg [15:0] mask;
|
output reg [15:0] mask2;
|
output reg [15:0] mask2;
|
|
|
// Setting the data mask. Values are enabled when the data mask is zero.
|
// Setting the data mask. Values are enabled when the data mask is zero.
|
always_ff @(posedge clk)
|
always_ff @(posedge clk)
|
if (rst)
|
if (rst)
|
mask2 <= 16'h0000;
|
mask2 <= 16'h0000;
|
else begin
|
else begin
|
if (state==PRESET1)
|
if (state==PRESET2)
|
mask2 <= wmask;
|
mask2 <= wmask;
|
// For RMW cycle all bytes are writtten.
|
// For RMW cycle all bytes are writtten.
|
else if (state==WRITE_TRAMP1)
|
else if (state==WRITE_TRAMP1)
|
mask2 <= 16'h0000;
|
mask2 <= 16'h0000;
|
end
|
end
|
always_ff @(posedge clk)
|
always_ff @(posedge clk)
|
if (rst)
|
if (rst)
|
mask <= 16'h0000;
|
mask <= 16'h0000;
|
else begin
|
else begin
|
if (state==PRESET2)
|
if (state==PRESET3)
|
mask <= mask2;
|
mask <= mask2;
|
end
|
end
|
|
|
endmodule
|
endmodule
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.