diff options
author | Claire Wolf <clifford@clifford.at> | 2020-04-21 18:46:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 18:46:52 +0200 |
commit | 9e1afde7a02e6d3a65c106f74920dcad9e678a04 (patch) | |
tree | e521580ec3e49a3e5ead7c834bc8e9664a950d58 /tests/various/dynamic_part_select/nonblocking.v | |
parent | abc8f1fcb65bb99ef4bf6fc6c6aa3126c333c68f (diff) | |
parent | d32e56a3d1bdb36a77c0c3afad2eb4493292480b (diff) | |
download | yosys-9e1afde7a02e6d3a65c106f74920dcad9e678a04.tar.gz yosys-9e1afde7a02e6d3a65c106f74920dcad9e678a04.tar.bz2 yosys-9e1afde7a02e6d3a65c106f74920dcad9e678a04.zip |
Merge pull request #1851 from YosysHQ/claire/bitselwrite
Improved rewrite code for writing to bit slice
Diffstat (limited to 'tests/various/dynamic_part_select/nonblocking.v')
-rw-r--r-- | tests/various/dynamic_part_select/nonblocking.v | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/various/dynamic_part_select/nonblocking.v b/tests/various/dynamic_part_select/nonblocking.v new file mode 100644 index 000000000..0949b31a9 --- /dev/null +++ b/tests/various/dynamic_part_select/nonblocking.v @@ -0,0 +1,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 |