OpenCores
URL https://opencores.org/ocsvn/ao486/ao486/trunk

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [pipeline/] [read_commands.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
/*
2
 * Copyright (c) 2014, Aleksander Osman
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * * Redistributions of source code must retain the above copyright notice, this
9
 *   list of conditions and the following disclaimer.
10
 *
11
 * * Redistributions in binary form must reproduce the above copyright notice,
12
 *   this list of conditions and the following disclaimer in the documentation
13
 *   and/or other materials provided with the distribution.
14
 *
15
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
 
27
`include "defines.v"
28
 
29
//PARSED_COMMENTS: this file contains parsed script comments
30
 
31
module read_commands(
32
    input               clk,
33
    input               rst_n,
34
 
35
    //general input
36
    input       [63:0]  glob_descriptor,
37
    input       [31:0]  glob_param_1,
38
    input       [31:0]  glob_param_2,
39
    input       [31:0]  glob_param_3,
40
 
41
    input       [31:0]  glob_desc_base,
42
    input       [31:0]  glob_desc_limit,
43
 
44
    input       [15:0]  tr,
45
    input       [31:0]  tr_base,
46
    input       [63:0]  tr_cache,
47
    input               tr_cache_valid,
48
    input       [31:0]  tr_limit,
49
 
50
    input       [31:0]  gdtr_base,
51
    input       [31:0]  idtr_base,
52
 
53
    input       [31:0]  ecx,
54
    input       [31:0]  edx,
55
 
56
    input       [1:0]   iopl,
57
 
58
    input       [7:0]   exc_vector,
59
 
60
    input               io_allow_check_needed,
61
 
62
    input       [1:0]   cpl,
63
    input               cr0_pg,
64
 
65
    input               real_mode,
66
    input               v8086_mode,
67
    input               protected_mode,
68
 
69
    input       [10:0]  exe_mutex,
70
 
71
    //rd input
72
    input       [87:0]  rd_decoder,
73
    input       [6:0]   rd_cmd,
74
    input       [3:0]   rd_cmdex,
75
    input       [1:0]   rd_modregrm_mod,
76
    input               rd_operand_16bit,
77
    input               rd_operand_32bit,
78
    input       [31:0]  rd_memory_last,
79
    input       [1:0]   rd_prefix_group_1_rep,
80
    input               rd_address_16bit,
81
    input               rd_address_32bit,
82
    input               rd_ready,
83
 
84
    input       [31:0]  dst_wire,
85
 
86
    input               rd_descriptor_not_in_limits,
87
    input       [3:0]   rd_consumed,
88
 
89
    //rd mutex busy
90
    input               rd_mutex_busy_active,
91
    input               rd_mutex_busy_memory,
92
    input               rd_mutex_busy_eflags,
93
    input               rd_mutex_busy_ebp,
94
    input               rd_mutex_busy_esp,
95
    input               rd_mutex_busy_edx,
96
    input               rd_mutex_busy_ecx,
97
    input               rd_mutex_busy_eax,
98
    input               rd_mutex_busy_modregrm_reg,
99
    input               rd_mutex_busy_modregrm_rm,
100
    input               rd_mutex_busy_implicit_reg,
101
 
102
    //rd output
103
    output      [31:0]  rd_extra_wire,
104
    output      [31:0]  rd_system_linear,
105
 
106
    output      [15:0]  rd_error_code,
107
 
108
    output              rd_ss_esp_from_tss_fault,
109
 
110
    output              rd_waiting,
111
 
112
    //mutex req
113
    output              rd_req_memory,
114
    output              rd_req_eflags,
115
    output              rd_req_all,
116
    output              rd_req_reg,
117
    output              rd_req_rm,
118
    output              rd_req_implicit_reg,
119
    output              rd_req_reg_not_8bit,
120
    output              rd_req_edi,
121
    output              rd_req_esi,
122
    output              rd_req_ebp,
123
    output              rd_req_esp,
124
    output              rd_req_ebx,
125
    output              rd_req_edx_eax,
126
    output              rd_req_edx,
127
    output              rd_req_ecx,
128
    output              rd_req_eax,
129
 
130
    //address control
131
    output              address_enter_init,
132
    output              address_enter,
133
    output              address_enter_last,
134
    output              address_leave,
135
    output              address_esi,
136
    output              address_edi,
137
    output              address_xlat_transform,
138
    output              address_bits_transform,
139
 
140
    output              address_stack_pop,
141
    output              address_stack_pop_speedup,
142
 
143
    output              address_stack_pop_next,
144
    output              address_stack_pop_esp_prev,
145
    output              address_stack_pop_for_call,
146
    output              address_stack_save,
147
    output              address_stack_add_4_to_saved,
148
 
149
    output              address_stack_for_ret_first,
150
    output              address_stack_for_ret_second,
151
    output              address_stack_for_iret_first,
152
    output              address_stack_for_iret_second,
153
    output              address_stack_for_iret_third,
154
    output              address_stack_for_iret_last,
155
    output              address_stack_for_iret_to_v86,
156
    output              address_stack_for_call_param_first,
157
 
158
    output              address_ea_buffer,
159
    output              address_ea_buffer_plus_2,
160
 
161
    output              address_memoffset,
162
 
163
    //read control
164
    output              read_virtual,
165
    output              read_rmw_virtual,
166
    output              write_virtual_check,
167
 
168
    output              read_system_descriptor,
169
    output              read_system_word,
170
    output              read_system_dword,
171
    output              read_system_qword,
172
    output              read_rmw_system_dword,
173
 
174
    output              read_length_word,
175
    output              read_length_dword,
176
 
177
    input               read_for_rd_ready,
178
    input               write_virtual_check_ready,
179
 
180
    input               rd_address_effective_ready,
181
 
182
    input       [31:0]  read_4,
183
    input       [63:0]  read_8,
184
 
185
    //read signals
186
    output              rd_src_is_memory,
187
    output              rd_src_is_io,
188
    output              rd_src_is_modregrm_imm,
189
    output              rd_src_is_modregrm_imm_se,
190
    output              rd_src_is_imm,
191
    output              rd_src_is_imm_se,
192
    output              rd_src_is_1,
193
    output              rd_src_is_eax,
194
    output              rd_src_is_ecx,
195
    output              rd_src_is_cmdex,
196
    output              rd_src_is_implicit_reg,
197
    output              rd_src_is_rm,
198
    output              rd_src_is_reg,
199
 
200
    output              rd_dst_is_0,
201
    output              rd_dst_is_modregrm_imm_se,
202
    output              rd_dst_is_modregrm_imm,
203
    output              rd_dst_is_memory,
204
    output              rd_dst_is_memory_last,
205
    output              rd_dst_is_eip,
206
    output              rd_dst_is_eax,
207
    output              rd_dst_is_edx_eax,
208
    output              rd_dst_is_implicit_reg,
209
    output              rd_dst_is_rm,
210
    output              rd_dst_is_reg,
211
 
212
    //global set
213
    output              rd_glob_descriptor_set,
214
    output      [63:0]  rd_glob_descriptor_value,
215
 
216
    output              rd_glob_descriptor_2_set,
217
    output      [63:0]  rd_glob_descriptor_2_value,
218
 
219
    output              rd_glob_param_1_set,
220
    output      [31:0]  rd_glob_param_1_value,
221
 
222
    output              rd_glob_param_2_set,
223
    output      [31:0]  rd_glob_param_2_value,
224
 
225
    output              rd_glob_param_3_set,
226
    output      [31:0]  rd_glob_param_3_value,
227
 
228
    output              rd_glob_param_4_set,
229
    output      [31:0]  rd_glob_param_4_value,
230
 
231
    output              rd_glob_param_5_set,
232
    output      [31:0]  rd_glob_param_5_value,
233
 
234
    //io
235
    output              io_read,
236
    output      [15:0]  io_read_address,
237
    input               rd_io_ready,
238
 
239
    output              rd_io_allow_fault
240
);
241
 
242
//------------------------------------------------------------------------------ string
243
 
244
wire rd_string_ignore;
245
 
246
assign rd_string_ignore = rd_prefix_group_1_rep != 2'd0 &&
247
    ((rd_address_16bit && ecx[15:0] == 16'd0) || (rd_address_32bit && ecx == 32'd0));
248
 
249
//------------------------------------------------------------------------------
250
 
251
// synthesis translate_off
252
wire _unused_ok = &{ 1'b0, glob_param_2[31:6], glob_param_3[31:25], tr[1:0], tr_cache[63:44], tr_cache[39:0],
253
    edx[31:16], exe_mutex[9:0], rd_decoder[87:56], rd_decoder[23:16], rd_decoder[7], rd_memory_last[31:16], dst_wire[31:16], 1'b0 };
254
// synthesis translate_on
255
 
256
//------------------------------------------------------------------------------
257
 
258
`include "autogen/read_commands.v"
259
 
260
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.