aboutsummaryrefslogtreecommitdiffstats
path: root/tests/arch/common/dynamic_part_select/nonblocking.v
blob: 89c399522431f6e554edb0254e10b4f1b245c82c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module nonblocking #(parameter WIDTH=256, SELW=2)
   (input 	           clk ,
    input [9:0] 	   ctrl ,
    input [15: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