-
Notifications
You must be signed in to change notification settings - Fork 1
/
myproject_mux_164_16_1_1_x0.v
100 lines (90 loc) · 2.86 KB
/
myproject_mux_164_16_1_1_x0.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// ==============================================================
// Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2019.2 (64-bit)
// Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.
// ==============================================================
`timescale 1ns/1ps
module myproject_mux_164_16_1_1_x0 #(
parameter
ID = 0,
NUM_STAGE = 1,
din0_WIDTH = 32,
din1_WIDTH = 32,
din2_WIDTH = 32,
din3_WIDTH = 32,
din4_WIDTH = 32,
din5_WIDTH = 32,
din6_WIDTH = 32,
din7_WIDTH = 32,
din8_WIDTH = 32,
din9_WIDTH = 32,
din10_WIDTH = 32,
din11_WIDTH = 32,
din12_WIDTH = 32,
din13_WIDTH = 32,
din14_WIDTH = 32,
din15_WIDTH = 32,
din16_WIDTH = 32,
dout_WIDTH = 32
)(
input [15 : 0] din0,
input [15 : 0] din1,
input [15 : 0] din2,
input [15 : 0] din3,
input [15 : 0] din4,
input [15 : 0] din5,
input [15 : 0] din6,
input [15 : 0] din7,
input [15 : 0] din8,
input [15 : 0] din9,
input [15 : 0] din10,
input [15 : 0] din11,
input [15 : 0] din12,
input [15 : 0] din13,
input [15 : 0] din14,
input [15 : 0] din15,
input [3 : 0] din16,
output [15 : 0] dout);
// puts internal signals
wire [3 : 0] sel;
// level 1 signals
wire [15 : 0] mux_1_0;
wire [15 : 0] mux_1_1;
wire [15 : 0] mux_1_2;
wire [15 : 0] mux_1_3;
wire [15 : 0] mux_1_4;
wire [15 : 0] mux_1_5;
wire [15 : 0] mux_1_6;
wire [15 : 0] mux_1_7;
// level 2 signals
wire [15 : 0] mux_2_0;
wire [15 : 0] mux_2_1;
wire [15 : 0] mux_2_2;
wire [15 : 0] mux_2_3;
// level 3 signals
wire [15 : 0] mux_3_0;
wire [15 : 0] mux_3_1;
// level 4 signals
wire [15 : 0] mux_4_0;
assign sel = din16;
// Generate level 1 logic
assign mux_1_0 = (sel[0] == 0)? din0 : din1;
assign mux_1_1 = (sel[0] == 0)? din2 : din3;
assign mux_1_2 = (sel[0] == 0)? din4 : din5;
assign mux_1_3 = (sel[0] == 0)? din6 : din7;
assign mux_1_4 = (sel[0] == 0)? din8 : din9;
assign mux_1_5 = (sel[0] == 0)? din10 : din11;
assign mux_1_6 = (sel[0] == 0)? din12 : din13;
assign mux_1_7 = (sel[0] == 0)? din14 : din15;
// Generate level 2 logic
assign mux_2_0 = (sel[1] == 0)? mux_1_0 : mux_1_1;
assign mux_2_1 = (sel[1] == 0)? mux_1_2 : mux_1_3;
assign mux_2_2 = (sel[1] == 0)? mux_1_4 : mux_1_5;
assign mux_2_3 = (sel[1] == 0)? mux_1_6 : mux_1_7;
// Generate level 3 logic
assign mux_3_0 = (sel[2] == 0)? mux_2_0 : mux_2_1;
assign mux_3_1 = (sel[2] == 0)? mux_2_2 : mux_2_3;
// Generate level 4 logic
assign mux_4_0 = (sel[3] == 0)? mux_3_0 : mux_3_1;
// output logic
assign dout = mux_4_0;
endmodule