aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/dynamic_part_select/latch_002_gate.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/various/dynamic_part_select/latch_002_gate.v')
-rw-r--r--tests/various/dynamic_part_select/latch_002_gate.v18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/various/dynamic_part_select/latch_002_gate.v b/tests/various/dynamic_part_select/latch_002_gate.v
new file mode 100644
index 000000000..4acf129c6
--- /dev/null
+++ b/tests/various/dynamic_part_select/latch_002_gate.v
@@ -0,0 +1,18 @@
+`default_nettype none
+module latch_002_gate(dword, vect, sel, st);
+ output reg [63:0] dword;
+ input wire [7:0] vect;
+ input wire [7:0] sel;
+ input wire st;
+ reg [63:0] mask;
+ reg [63:0] data;
+ always @*
+ case (|(st))
+ 1'b 1:
+ begin
+ mask = (8'b 11111111)<<((((8)*(sel)))+(0));
+ data = ((8'b 11111111)&(vect[7:0]))<<((((8)*(sel)))+(0));
+ dword <= ((dword)&(~(mask)))|(data);
+ end
+ endcase
+endmodule