-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathpcileech_header.svh
More file actions
184 lines (160 loc) · 7.85 KB
/
pcileech_header.svh
File metadata and controls
184 lines (160 loc) · 7.85 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
//
// PCILeech FPGA.
//
// SystemVerilog Header File for PCILeech FPGA projects.
//
// (c) Ulf Frisk, 2019
// Author: Ulf Frisk, pcileech@frizk.net
//
`ifndef _pcileech_header_svh_
`define _pcileech_header_svh_
// ------------------------------------------------------------------------
// Interface connecting PCIe to PCIe CFG module.
// ------------------------------------------------------------------------
interface IfPCIeSignals;
// ------------------------------------------------------------------------
// VALUES FROM PCIe TO module.
// ------------------------------------------------------------------------
wire [7:0] cfg_bus_number;
wire [4:0] cfg_device_number;
wire [2:0] cfg_function_number;
wire [15:0] cfg_command;
wire [31:0] cfg_mgmt_do;
wire cfg_mgmt_rd_wr_done;
wire [2:0] pl_initial_link_width;
wire pl_phy_lnk_up;
wire [1:0] pl_lane_reversal_mode;
wire pl_link_gen2_cap;
wire pl_link_partner_gen2_supported;
wire pl_link_upcfg_cap;
wire pl_sel_lnk_rate;
wire [1:0] pl_sel_lnk_width;
wire [5:0] pl_ltssm_state;
wire [1:0] pl_rx_pm_state;
wire [2:0] pl_tx_pm_state;
wire pl_directed_change_done;
wire pl_received_hot_rst;
wire cfg_aer_rooterr_corr_err_received;
wire cfg_aer_rooterr_corr_err_reporting_en;
wire cfg_aer_rooterr_fatal_err_received;
wire cfg_aer_rooterr_fatal_err_reporting_en;
wire cfg_aer_rooterr_non_fatal_err_received;
wire cfg_aer_rooterr_non_fatal_err_reporting_en;
wire cfg_bridge_serr_en;
wire [15:0] cfg_dcommand;
wire [15:0] cfg_dcommand2;
wire [15:0] cfg_dstatus;
wire [15:0] cfg_lcommand;
wire [15:0] cfg_lstatus;
wire [2:0] cfg_pcie_link_state;
wire cfg_pmcsr_pme_en;
wire cfg_pmcsr_pme_status;
wire [1:0] cfg_pmcsr_powerstate;
wire cfg_received_func_lvl_rst;
wire cfg_root_control_pme_int_en;
wire cfg_root_control_syserr_corr_err_en;
wire cfg_root_control_syserr_fatal_err_en;
wire cfg_root_control_syserr_non_fatal_err_en;
wire cfg_slot_control_electromech_il_ctl_pulse;
wire [15:0] cfg_status;
wire cfg_to_turnoff;
wire [5:0] tx_buf_av;
wire tx_cfg_req;
wire tx_err_drop;
wire [6:0] cfg_vc_tcvc_map;
wire [2:0] cfg_interrupt_mmenable;
wire cfg_interrupt_msienable;
wire cfg_interrupt_msixenable;
wire cfg_interrupt_msixfm;
wire cfg_interrupt_rdy;
wire [7:0] cfg_interrupt_do;
// ------------------------------------------------------------------------
// VALUES FROM module TO PCIe.
// ------------------------------------------------------------------------
wire cfg_mgmt_rd_en;
wire cfg_mgmt_wr_en;
wire [63:0] cfg_dsn;
wire [31:0] cfg_mgmt_di;
wire [9:0] cfg_mgmt_dwaddr;
wire [3:0] cfg_mgmt_byte_en;
wire [1:0] pl_directed_link_change;
wire [1:0] pl_directed_link_width;
wire pl_directed_link_auton;
wire pl_directed_link_speed;
wire pl_upstream_prefer_deemph;
wire pl_transmit_hot_rst;
wire pl_downstream_deemph_source;
wire [7:0] cfg_interrupt_di;
wire [4:0] cfg_pciecap_interrupt_msgnum;
wire cfg_interrupt_assert;
wire cfg_interrupt;
wire cfg_interrupt_stat;
wire [1:0] cfg_pm_force_state;
wire cfg_pm_force_state_en;
wire cfg_pm_halt_aspm_l0s;
wire cfg_pm_halt_aspm_l1;
wire cfg_pm_send_pme_to;
wire cfg_pm_wake;
wire cfg_trn_pending;
wire cfg_turnoff_ok;
wire rx_np_ok;
wire rx_np_req;
wire tx_cfg_gnt;
modport mpm (
input cfg_bus_number, cfg_device_number, cfg_function_number, cfg_command, cfg_mgmt_do, cfg_mgmt_rd_wr_done,
pl_initial_link_width, pl_phy_lnk_up, pl_lane_reversal_mode, pl_link_gen2_cap, pl_link_partner_gen2_supported,
pl_link_upcfg_cap, pl_sel_lnk_rate, pl_sel_lnk_width, pl_ltssm_state, pl_rx_pm_state,
pl_tx_pm_state, pl_directed_change_done, pl_received_hot_rst,
cfg_aer_rooterr_corr_err_received, cfg_aer_rooterr_corr_err_reporting_en, cfg_aer_rooterr_fatal_err_received, cfg_aer_rooterr_fatal_err_reporting_en,
cfg_aer_rooterr_non_fatal_err_received, cfg_aer_rooterr_non_fatal_err_reporting_en, cfg_bridge_serr_en, cfg_dcommand, cfg_dcommand2, cfg_dstatus,
cfg_lcommand, cfg_lstatus, cfg_pcie_link_state, cfg_pmcsr_pme_en, cfg_pmcsr_pme_status, cfg_pmcsr_powerstate, cfg_received_func_lvl_rst, cfg_root_control_pme_int_en,
cfg_root_control_syserr_corr_err_en, cfg_root_control_syserr_fatal_err_en, cfg_root_control_syserr_non_fatal_err_en, cfg_slot_control_electromech_il_ctl_pulse,
cfg_status, cfg_to_turnoff, tx_buf_av, tx_cfg_req, tx_err_drop, cfg_vc_tcvc_map,
cfg_interrupt_mmenable, cfg_interrupt_msienable, cfg_interrupt_msixenable, cfg_interrupt_msixfm, cfg_interrupt_rdy, cfg_interrupt_do,
output cfg_mgmt_rd_en, cfg_mgmt_wr_en, cfg_dsn, cfg_mgmt_di, cfg_mgmt_dwaddr, cfg_mgmt_byte_en, pl_directed_link_change, pl_directed_link_width, pl_directed_link_auton,
pl_directed_link_speed, pl_upstream_prefer_deemph, pl_transmit_hot_rst, pl_downstream_deemph_source,
cfg_interrupt_di, cfg_pciecap_interrupt_msgnum, cfg_interrupt_assert, cfg_interrupt, cfg_interrupt_stat, cfg_pm_force_state, cfg_pm_force_state_en, cfg_pm_halt_aspm_l0s,
cfg_pm_halt_aspm_l1, cfg_pm_send_pme_to, cfg_pm_wake, cfg_trn_pending, cfg_turnoff_ok, rx_np_ok, rx_np_req, tx_cfg_gnt
);
endinterface
// ------------------------------------------------------------------------
// Interface connecting PCIe CFG to FIFO
// ------------------------------------------------------------------------
interface IfPCIeCfgFifo;
wire [63:0] tx_data;
wire tx_valid;
wire [31:0] rx_data;
wire rx_valid;
wire rx_empty;
wire rx_rd_en;
modport mp_fifo (
output tx_data, tx_valid, rx_rd_en,
input rx_data, rx_valid, rx_empty
);
modport mp_pcie (
input tx_data, tx_valid, rx_rd_en,
output rx_data, rx_valid, rx_empty
);
endinterface
// ------------------------------------------------------------------------
// Interface connecting PCIe TLP to FIFO
// ------------------------------------------------------------------------
interface IfPCIeTlpFifo;
wire [31:0] tx_data;
wire tx_last;
wire tx_valid;
wire [31:0] rx_data;
wire rx_last;
wire rx_valid;
wire rx_empty;
wire rx_rd_en;
modport mp_fifo (
output tx_data, tx_last, tx_valid, rx_rd_en,
input rx_data, rx_last, rx_valid, rx_empty
);
modport mp_pcie (
input tx_data, tx_last, tx_valid, rx_rd_en,
output rx_data, rx_last, rx_valid, rx_empty
);
endinterface
`endif