1 |
3 |
ultra_embe |
#ifndef ULPI_WRAPPER_VPI_H
|
2 |
|
|
#define ULPI_WRAPPER_VPI_H
|
3 |
|
|
|
4 |
|
|
#include "sc_vpi_module.h"
|
5 |
|
|
|
6 |
|
|
class ulpi_wrapper_vpi: public sc_vpi_module
|
7 |
|
|
{
|
8 |
|
|
public:
|
9 |
|
|
sc_in <bool> ulpi_clk60_i;
|
10 |
|
|
sc_in <bool> ulpi_rst_i;
|
11 |
|
|
sc_in <sc_uint<8> > ulpi_data_i;
|
12 |
|
|
sc_out <sc_uint<8> > ulpi_data_o;
|
13 |
|
|
sc_in <bool> ulpi_dir_i;
|
14 |
|
|
sc_in <bool> ulpi_nxt_i;
|
15 |
|
|
sc_out <bool> ulpi_stp_o;
|
16 |
|
|
sc_in <sc_uint<8> > reg_addr_i;
|
17 |
|
|
sc_in <bool> reg_stb_i;
|
18 |
|
|
sc_in <bool> reg_we_i;
|
19 |
|
|
sc_in <sc_uint<8> > reg_data_i;
|
20 |
|
|
sc_out <sc_uint<8> > reg_data_o;
|
21 |
|
|
sc_out <bool> reg_ack_o;
|
22 |
|
|
sc_in <bool> utmi_txvalid_i;
|
23 |
|
|
sc_out <bool> utmi_txready_o;
|
24 |
|
|
sc_out <bool> utmi_rxvalid_o;
|
25 |
|
|
sc_out <bool> utmi_rxactive_o;
|
26 |
|
|
sc_out <bool> utmi_rxerror_o;
|
27 |
|
|
sc_out <sc_uint<8> > utmi_data_o;
|
28 |
|
|
sc_in <sc_uint<8> > utmi_data_i;
|
29 |
|
|
sc_in <sc_uint<2> > utmi_xcvrselect_i;
|
30 |
|
|
sc_in <bool> utmi_termselect_i;
|
31 |
|
|
sc_in <sc_uint<2> > utmi_opmode_i;
|
32 |
|
|
sc_in <bool> utmi_dppulldown_i;
|
33 |
|
|
sc_in <bool> utmi_dmpulldown_i;
|
34 |
|
|
sc_out <sc_uint<2> > utmi_linestate_o;
|
35 |
|
|
|
36 |
|
|
void read_outputs(void)
|
37 |
|
|
{
|
38 |
|
|
sc_vpi_module_read_output_int(ulpi_data_o, "ulpi_data_o");
|
39 |
|
|
sc_vpi_module_read_output_int(ulpi_stp_o, "ulpi_stp_o");
|
40 |
|
|
sc_vpi_module_read_output_int(reg_data_o, "reg_data_o");
|
41 |
|
|
sc_vpi_module_read_output_int(reg_ack_o, "reg_ack_o");
|
42 |
|
|
sc_vpi_module_read_output_int(utmi_txready_o, "utmi_txready_o");
|
43 |
|
|
sc_vpi_module_read_output_int(utmi_rxvalid_o, "utmi_rxvalid_o");
|
44 |
|
|
sc_vpi_module_read_output_int(utmi_rxactive_o, "utmi_rxactive_o");
|
45 |
|
|
sc_vpi_module_read_output_int(utmi_rxerror_o, "utmi_rxerror_o");
|
46 |
|
|
sc_vpi_module_read_output_int(utmi_data_o, "utmi_data_o");
|
47 |
|
|
sc_vpi_module_read_output_int(utmi_linestate_o, "utmi_linestate_o");
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
void write_inputs(void)
|
51 |
|
|
{
|
52 |
|
|
sc_vpi_module_write_input_int(ulpi_clk60_i, "ulpi_clk60_i");
|
53 |
|
|
sc_vpi_module_write_input_int(ulpi_rst_i, "ulpi_rst_i");
|
54 |
|
|
sc_vpi_module_write_input_int(ulpi_data_i, "ulpi_data_i");
|
55 |
|
|
sc_vpi_module_write_input_int(ulpi_dir_i, "ulpi_dir_i");
|
56 |
|
|
sc_vpi_module_write_input_int(ulpi_nxt_i, "ulpi_nxt_i");
|
57 |
|
|
sc_vpi_module_write_input_int(reg_addr_i, "reg_addr_i");
|
58 |
|
|
sc_vpi_module_write_input_int(reg_stb_i, "reg_stb_i");
|
59 |
|
|
sc_vpi_module_write_input_int(reg_we_i, "reg_we_i");
|
60 |
|
|
sc_vpi_module_write_input_int(reg_data_i, "reg_data_i");
|
61 |
|
|
sc_vpi_module_write_input_int(utmi_txvalid_i, "utmi_txvalid_i");
|
62 |
|
|
sc_vpi_module_write_input_int(utmi_data_i, "utmi_data_i");
|
63 |
|
|
sc_vpi_module_write_input_int(utmi_xcvrselect_i, "utmi_xcvrselect_i");
|
64 |
|
|
sc_vpi_module_write_input_int(utmi_termselect_i, "utmi_termselect_i");
|
65 |
|
|
sc_vpi_module_write_input_int(utmi_opmode_i, "utmi_opmode_i");
|
66 |
|
|
sc_vpi_module_write_input_int(utmi_dppulldown_i, "utmi_dppulldown_i");
|
67 |
|
|
sc_vpi_module_write_input_int(utmi_dmpulldown_i, "utmi_dmpulldown_i");
|
68 |
|
|
}
|
69 |
|
|
|
70 |
|
|
ulpi_wrapper_vpi(sc_module_name name):
|
71 |
|
|
sc_vpi_module(name)
|
72 |
|
|
, ulpi_clk60_i ("ulpi_clk60_i")
|
73 |
|
|
, ulpi_rst_i ("ulpi_rst_i")
|
74 |
|
|
, ulpi_data_i ("ulpi_data_i")
|
75 |
|
|
, ulpi_data_o ("ulpi_data_o")
|
76 |
|
|
, ulpi_dir_i ("ulpi_dir_i")
|
77 |
|
|
, ulpi_nxt_i ("ulpi_nxt_i")
|
78 |
|
|
, ulpi_stp_o ("ulpi_stp_o")
|
79 |
|
|
, reg_addr_i ("reg_addr_i")
|
80 |
|
|
, reg_stb_i ("reg_stb_i")
|
81 |
|
|
, reg_we_i ("reg_we_i")
|
82 |
|
|
, reg_data_i ("reg_data_i")
|
83 |
|
|
, reg_data_o ("reg_data_o")
|
84 |
|
|
, reg_ack_o ("reg_ack_o")
|
85 |
|
|
, utmi_txvalid_i ("utmi_txvalid_i")
|
86 |
|
|
, utmi_txready_o ("utmi_txready_o")
|
87 |
|
|
, utmi_rxvalid_o ("utmi_rxvalid_o")
|
88 |
|
|
, utmi_rxactive_o ("utmi_rxactive_o")
|
89 |
|
|
, utmi_rxerror_o ("utmi_rxerror_o")
|
90 |
|
|
, utmi_data_o ("utmi_data_o")
|
91 |
|
|
, utmi_data_i ("utmi_data_i")
|
92 |
|
|
, utmi_xcvrselect_i ("utmi_xcvrselect_i")
|
93 |
|
|
, utmi_termselect_i ("utmi_termselect_i")
|
94 |
|
|
, utmi_opmode_i ("utmi_opmode_i")
|
95 |
|
|
, utmi_dppulldown_i ("utmi_dppulldown_i")
|
96 |
|
|
, utmi_dmpulldown_i ("utmi_dmpulldown_i")
|
97 |
|
|
, utmi_linestate_o ("utmi_linestate_o")
|
98 |
|
|
{
|
99 |
|
|
register_signal("ulpi_clk60_i");
|
100 |
|
|
register_signal("ulpi_rst_i");
|
101 |
|
|
register_signal("ulpi_data_i");
|
102 |
|
|
register_signal("ulpi_data_o");
|
103 |
|
|
register_signal("ulpi_dir_i");
|
104 |
|
|
register_signal("ulpi_nxt_i");
|
105 |
|
|
register_signal("ulpi_stp_o");
|
106 |
|
|
register_signal("reg_addr_i");
|
107 |
|
|
register_signal("reg_stb_i");
|
108 |
|
|
register_signal("reg_we_i");
|
109 |
|
|
register_signal("reg_data_i");
|
110 |
|
|
register_signal("reg_data_o");
|
111 |
|
|
register_signal("reg_ack_o");
|
112 |
|
|
register_signal("utmi_txvalid_i");
|
113 |
|
|
register_signal("utmi_txready_o");
|
114 |
|
|
register_signal("utmi_rxvalid_o");
|
115 |
|
|
register_signal("utmi_rxactive_o");
|
116 |
|
|
register_signal("utmi_rxerror_o");
|
117 |
|
|
register_signal("utmi_data_o");
|
118 |
|
|
register_signal("utmi_data_i");
|
119 |
|
|
register_signal("utmi_xcvrselect_i");
|
120 |
|
|
register_signal("utmi_termselect_i");
|
121 |
|
|
register_signal("utmi_opmode_i");
|
122 |
|
|
register_signal("utmi_dppulldown_i");
|
123 |
|
|
register_signal("utmi_dmpulldown_i");
|
124 |
|
|
register_signal("utmi_linestate_o");
|
125 |
|
|
}
|
126 |
|
|
};
|
127 |
|
|
|
128 |
|
|
#endif
|