OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [cpu/] [alu/] [alu_flags.v] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gdevic
// Copyright (C) 1991-2013 Altera Corporation
2
// Your use of Altera Corporation's design tools, logic functions 
3
// and other software and tools, and its AMPP partner logic 
4
// functions, and any output files from any of the foregoing 
5
// (including device programming or simulation files), and any 
6
// associated documentation or information are expressly subject 
7
// to the terms and conditions of the Altera Program License 
8
// Subscription Agreement, Altera MegaCore Function License 
9
// Agreement, or other applicable license agreement, including, 
10
// without limitation, that your use is for the sole purpose of 
11
// programming logic devices manufactured by Altera and sold by 
12
// Altera or its authorized distributors.  Please refer to the 
13
// applicable agreement for further details.
14
 
15
// PROGRAM              "Quartus II 64-Bit"
16
// VERSION              "Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Web Edition"
17
// CREATED              "Sun Oct 19 14:48:51 2014"
18
 
19
module alu_flags(
20
        ctl_flags_oe,
21
        ctl_flags_bus,
22
        ctl_flags_alu,
23
        alu_sf_out,
24
        alu_yf_out,
25
        alu_xf_out,
26
        ctl_flags_nf_set,
27
        alu_zero,
28
        shift_cf_out,
29
        alu_core_cf_out,
30
        daa_cf_out,
31
        ctl_flags_cf_set,
32
        ctl_flags_cf_cpl,
33
        pf_sel,
34
        ctl_flags_cf_we,
35
        ctl_flags_sz_we,
36
        ctl_flags_xy_we,
37
        ctl_flags_hf_we,
38
        ctl_flags_pf_we,
39
        ctl_flags_nf_we,
40
        ctl_flags_cf2_we,
41
        ctl_flags_hf_cpl,
42
        ctl_flags_use_cf2,
43
        ctl_flags_hf2_we,
44
        ctl_flags_nf_clr,
45
        ctl_alu_zero_16bit,
46
        clk,
47
        ctl_flags_cf2_sel,
48
        flags_sf,
49
        flags_zf,
50
        flags_hf,
51
        flags_pf,
52
        flags_cf,
53
        flags_nf,
54
        flags_cf_latch,
55
        flags_hf2,
56
        db
57
);
58
 
59
 
60
input wire      ctl_flags_oe;
61
input wire      ctl_flags_bus;
62
input wire      ctl_flags_alu;
63
input wire      alu_sf_out;
64
input wire      alu_yf_out;
65
input wire      alu_xf_out;
66
input wire      ctl_flags_nf_set;
67
input wire      alu_zero;
68
input wire      shift_cf_out;
69
input wire      alu_core_cf_out;
70
input wire      daa_cf_out;
71
input wire      ctl_flags_cf_set;
72
input wire      ctl_flags_cf_cpl;
73
input wire      pf_sel;
74
input wire      ctl_flags_cf_we;
75
input wire      ctl_flags_sz_we;
76
input wire      ctl_flags_xy_we;
77
input wire      ctl_flags_hf_we;
78
input wire      ctl_flags_pf_we;
79
input wire      ctl_flags_nf_we;
80
input wire      ctl_flags_cf2_we;
81
input wire      ctl_flags_hf_cpl;
82
input wire      ctl_flags_use_cf2;
83
input wire      ctl_flags_hf2_we;
84
input wire      ctl_flags_nf_clr;
85
input wire      ctl_alu_zero_16bit;
86
input wire      clk;
87
input wire      [1:0] ctl_flags_cf2_sel;
88
output wire     flags_sf;
89
output wire     flags_zf;
90
output wire     flags_hf;
91
output wire     flags_pf;
92
output wire     flags_cf;
93
output wire     flags_nf;
94
output wire     flags_cf_latch;
95
output reg      flags_hf2;
96
inout wire      [7:0] db;
97
 
98
reg     flags_xf;
99
reg     flags_yf;
100
wire    SYNTHESIZED_WIRE_0;
101
reg     DFFE_inst_latch_hf;
102
wire    SYNTHESIZED_WIRE_1;
103
wire    SYNTHESIZED_WIRE_2;
104
wire    SYNTHESIZED_WIRE_3;
105
wire    SYNTHESIZED_WIRE_4;
106
wire    SYNTHESIZED_WIRE_5;
107
wire    SYNTHESIZED_WIRE_6;
108
wire    SYNTHESIZED_WIRE_7;
109
wire    SYNTHESIZED_WIRE_8;
110
reg     SYNTHESIZED_WIRE_38;
111
wire    SYNTHESIZED_WIRE_9;
112
wire    SYNTHESIZED_WIRE_10;
113
wire    SYNTHESIZED_WIRE_11;
114
wire    SYNTHESIZED_WIRE_12;
115
wire    SYNTHESIZED_WIRE_13;
116
wire    SYNTHESIZED_WIRE_14;
117
wire    SYNTHESIZED_WIRE_15;
118
wire    SYNTHESIZED_WIRE_16;
119
wire    SYNTHESIZED_WIRE_17;
120
wire    SYNTHESIZED_WIRE_18;
121
wire    SYNTHESIZED_WIRE_19;
122
wire    SYNTHESIZED_WIRE_20;
123
wire    SYNTHESIZED_WIRE_21;
124
wire    SYNTHESIZED_WIRE_22;
125
reg     DFFE_inst_latch_sf;
126
wire    SYNTHESIZED_WIRE_23;
127
reg     DFFE_inst_latch_pf;
128
reg     DFFE_inst_latch_nf;
129
wire    SYNTHESIZED_WIRE_24;
130
wire    SYNTHESIZED_WIRE_25;
131
wire    SYNTHESIZED_WIRE_26;
132
wire    SYNTHESIZED_WIRE_27;
133
wire    SYNTHESIZED_WIRE_28;
134
wire    SYNTHESIZED_WIRE_39;
135
wire    SYNTHESIZED_WIRE_31;
136
wire    SYNTHESIZED_WIRE_32;
137
wire    SYNTHESIZED_WIRE_33;
138
wire    SYNTHESIZED_WIRE_34;
139
wire    SYNTHESIZED_WIRE_35;
140
wire    SYNTHESIZED_WIRE_36;
141
reg     DFFE_inst_latch_cf;
142
reg     DFFE_inst_latch_cf2;
143
wire    SYNTHESIZED_WIRE_37;
144
 
145
assign  flags_sf = DFFE_inst_latch_sf;
146
assign  flags_zf = SYNTHESIZED_WIRE_38;
147
assign  flags_hf = SYNTHESIZED_WIRE_23;
148
assign  flags_pf = DFFE_inst_latch_pf;
149
assign  flags_cf = SYNTHESIZED_WIRE_24;
150
assign  flags_nf = DFFE_inst_latch_nf;
151
assign  flags_cf_latch = DFFE_inst_latch_cf;
152
assign  SYNTHESIZED_WIRE_37 = 0;
153
 
154
 
155
 
156
assign  SYNTHESIZED_WIRE_27 = ctl_flags_cf_we & SYNTHESIZED_WIRE_0;
157
 
158
assign  SYNTHESIZED_WIRE_10 = db[7] & ctl_flags_bus;
159
 
160
assign  SYNTHESIZED_WIRE_17 = alu_xf_out & ctl_flags_alu;
161
 
162
assign  SYNTHESIZED_WIRE_20 = db[2] & ctl_flags_bus;
163
 
164
assign  SYNTHESIZED_WIRE_19 = pf_sel & ctl_flags_alu;
165
 
166
assign  SYNTHESIZED_WIRE_3 = db[1] & ctl_flags_bus;
167
 
168
assign  SYNTHESIZED_WIRE_23 = DFFE_inst_latch_hf ^ ctl_flags_hf_cpl;
169
 
170
assign  SYNTHESIZED_WIRE_22 = db[0] & ctl_flags_bus;
171
 
172
assign  SYNTHESIZED_WIRE_21 = ctl_flags_alu & alu_core_cf_out;
173
 
174
assign  SYNTHESIZED_WIRE_0 =  ~ctl_flags_cf2_we;
175
 
176
assign  SYNTHESIZED_WIRE_24 = SYNTHESIZED_WIRE_1 ^ ctl_flags_cf_cpl;
177
 
178
assign  SYNTHESIZED_WIRE_2 = alu_sf_out & ctl_flags_alu;
179
 
180
assign  SYNTHESIZED_WIRE_9 = alu_sf_out & ctl_flags_alu;
181
 
182
assign  SYNTHESIZED_WIRE_6 = ctl_flags_nf_set | SYNTHESIZED_WIRE_2 | SYNTHESIZED_WIRE_3;
183
 
184
assign  SYNTHESIZED_WIRE_36 = SYNTHESIZED_WIRE_4 & SYNTHESIZED_WIRE_5;
185
 
186
 
187
assign  SYNTHESIZED_WIRE_31 = SYNTHESIZED_WIRE_6 & SYNTHESIZED_WIRE_7;
188
 
189
assign  SYNTHESIZED_WIRE_7 =  ~ctl_flags_nf_clr;
190
 
191
assign  SYNTHESIZED_WIRE_8 =  ~ctl_alu_zero_16bit;
192
 
193
assign  SYNTHESIZED_WIRE_5 = SYNTHESIZED_WIRE_8 | SYNTHESIZED_WIRE_38;
194
 
195
assign  SYNTHESIZED_WIRE_12 = db[6] & ctl_flags_bus;
196
 
197
assign  SYNTHESIZED_WIRE_33 = SYNTHESIZED_WIRE_9 | SYNTHESIZED_WIRE_10;
198
 
199
assign  SYNTHESIZED_WIRE_4 = SYNTHESIZED_WIRE_11 | SYNTHESIZED_WIRE_12;
200
 
201
assign  SYNTHESIZED_WIRE_35 = SYNTHESIZED_WIRE_13 | SYNTHESIZED_WIRE_14;
202
 
203
assign  SYNTHESIZED_WIRE_39 = SYNTHESIZED_WIRE_15 | SYNTHESIZED_WIRE_16;
204
 
205
assign  SYNTHESIZED_WIRE_34 = SYNTHESIZED_WIRE_17 | SYNTHESIZED_WIRE_18;
206
 
207
assign  SYNTHESIZED_WIRE_32 = SYNTHESIZED_WIRE_19 | SYNTHESIZED_WIRE_20;
208
 
209
assign  SYNTHESIZED_WIRE_11 = alu_zero & ctl_flags_alu;
210
 
211
assign  SYNTHESIZED_WIRE_26 = SYNTHESIZED_WIRE_21 | SYNTHESIZED_WIRE_22;
212
 
213
assign  db[7] = ctl_flags_oe ? DFFE_inst_latch_sf : 1'bz;
214
 
215
assign  SYNTHESIZED_WIRE_14 = db[5] & ctl_flags_bus;
216
 
217
assign  db[6] = ctl_flags_oe ? SYNTHESIZED_WIRE_38 : 1'bz;
218
 
219
assign  db[5] = ctl_flags_oe ? flags_yf : 1'bz;
220
 
221
assign  db[4] = ctl_flags_oe ? SYNTHESIZED_WIRE_23 : 1'bz;
222
 
223
assign  db[3] = ctl_flags_oe ? flags_xf : 1'bz;
224
 
225
assign  db[2] = ctl_flags_oe ? DFFE_inst_latch_pf : 1'bz;
226
 
227
assign  db[1] = ctl_flags_oe ? DFFE_inst_latch_nf : 1'bz;
228
 
229
assign  db[0] = ctl_flags_oe ? SYNTHESIZED_WIRE_24 : 1'bz;
230
 
231
assign  SYNTHESIZED_WIRE_13 = alu_yf_out & ctl_flags_alu;
232
 
233
assign  SYNTHESIZED_WIRE_1 = ctl_flags_cf_set | SYNTHESIZED_WIRE_25;
234
 
235
assign  SYNTHESIZED_WIRE_16 = db[4] & ctl_flags_bus;
236
 
237
assign  SYNTHESIZED_WIRE_15 = alu_core_cf_out & ctl_flags_alu;
238
 
239
assign  SYNTHESIZED_WIRE_18 = db[3] & ctl_flags_bus;
240
 
241
 
242
always@(posedge clk)
243
begin
244
if (SYNTHESIZED_WIRE_27)
245
        begin
246
        DFFE_inst_latch_cf <= SYNTHESIZED_WIRE_26;
247
        end
248
end
249
 
250
 
251
always@(posedge clk)
252
begin
253
if (ctl_flags_cf2_we)
254
        begin
255
        DFFE_inst_latch_cf2 <= SYNTHESIZED_WIRE_28;
256
        end
257
end
258
 
259
 
260
always@(posedge clk)
261
begin
262
if (ctl_flags_hf_we)
263
        begin
264
        DFFE_inst_latch_hf <= SYNTHESIZED_WIRE_39;
265
        end
266
end
267
 
268
 
269
always@(posedge clk)
270
begin
271
if (ctl_flags_hf2_we)
272
        begin
273
        flags_hf2 <= SYNTHESIZED_WIRE_39;
274
        end
275
end
276
 
277
 
278
always@(posedge clk)
279
begin
280
if (ctl_flags_nf_we)
281
        begin
282
        DFFE_inst_latch_nf <= SYNTHESIZED_WIRE_31;
283
        end
284
end
285
 
286
 
287
always@(posedge clk)
288
begin
289
if (ctl_flags_pf_we)
290
        begin
291
        DFFE_inst_latch_pf <= SYNTHESIZED_WIRE_32;
292
        end
293
end
294
 
295
 
296
always@(posedge clk)
297
begin
298
if (ctl_flags_sz_we)
299
        begin
300
        DFFE_inst_latch_sf <= SYNTHESIZED_WIRE_33;
301
        end
302
end
303
 
304
 
305
always@(posedge clk)
306
begin
307
if (ctl_flags_xy_we)
308
        begin
309
        flags_xf <= SYNTHESIZED_WIRE_34;
310
        end
311
end
312
 
313
 
314
always@(posedge clk)
315
begin
316
if (ctl_flags_xy_we)
317
        begin
318
        flags_yf <= SYNTHESIZED_WIRE_35;
319
        end
320
end
321
 
322
 
323
always@(posedge clk)
324
begin
325
if (ctl_flags_sz_we)
326
        begin
327
        SYNTHESIZED_WIRE_38 <= SYNTHESIZED_WIRE_36;
328
        end
329
end
330
 
331
 
332
alu_mux_2       b2v_inst_mux_cf(
333
        .in0(DFFE_inst_latch_cf),
334
        .in1(DFFE_inst_latch_cf2),
335
        .sel1(ctl_flags_use_cf2),
336
        .out(SYNTHESIZED_WIRE_25));
337
 
338
 
339
alu_mux_4       b2v_inst_mux_cf2(
340
        .in0(alu_core_cf_out),
341
        .in1(shift_cf_out),
342
        .in2(daa_cf_out),
343
        .in3(SYNTHESIZED_WIRE_37),
344
        .sel(ctl_flags_cf2_sel),
345
        .out(SYNTHESIZED_WIRE_28));
346
 
347
 
348
endmodule

powered by: WebSVN 2.1.0

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