diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-20 15:34:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 15:34:31 -0700 |
commit | d32e56a3d1bdb36a77c0c3afad2eb4493292480b (patch) | |
tree | 08ee0263f698739cfeb19476413d5411aa512ab7 /tests/various/dynamic_part_select/multiple_blocking.v | |
parent | e86ba3b94d7285ded20b4280ad52821cbca504fc (diff) | |
parent | caf4071c8bd4494d2c86d3ef9ea7b17fc74bafca (diff) | |
download | yosys-d32e56a3d1bdb36a77c0c3afad2eb4493292480b.tar.gz yosys-d32e56a3d1bdb36a77c0c3afad2eb4493292480b.tar.bz2 yosys-d32e56a3d1bdb36a77c0c3afad2eb4493292480b.zip |
Merge pull request #1975 from dh73/claire/bitselwrite
Adding tests to Claire/bitselwrite branch
Diffstat (limited to 'tests/various/dynamic_part_select/multiple_blocking.v')
-rw-r--r-- | tests/various/dynamic_part_select/multiple_blocking.v | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/various/dynamic_part_select/multiple_blocking.v b/tests/various/dynamic_part_select/multiple_blocking.v new file mode 100644 index 000000000..2858f7741 --- /dev/null +++ b/tests/various/dynamic_part_select/multiple_blocking.v @@ -0,0 +1,19 @@ +module multiple_blocking #(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); + reg [CTRLW:0] a; + reg [SELW-1:0] b; + reg [DINW:0] c; + always @(posedge clk) begin + a = ctrl + 1; + b = sel - 1; + c = ~din; + dout = dout + 1; + dout[a*b+:SLICE] = c; + end +endmodule |