blob: 0949b31a965ec22d0638ec122e8ef6f4dc40b984 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
module nonblocking #(parameter WIDTH=32, SELW=1, CTRLW=$clog2(WIDTH), DINW=2**SELW)
(input clk,
input [CTRLW-1:0] ctrl,
input [DINW-1:0] din,
input [SELW-1:0] sel,
output reg [WIDTH-1:0] dout);
localparam SLICE = WIDTH/(SELW**2);
always @(posedge clk) begin
dout <= dout + 1;
dout[ctrl*sel+:SLICE] <= din ;
end
endmodule
|