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 8

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 8 gdevic
// CREATED              "Tue Feb 23 22:17:29 2016"
18 3 gdevic
 
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 8 gdevic
        ctl_flags_cf2_sel_shift,
48
        ctl_flags_cf2_sel_daa,
49 3 gdevic
        flags_sf,
50
        flags_zf,
51
        flags_hf,
52
        flags_pf,
53
        flags_cf,
54
        flags_nf,
55
        flags_cf_latch,
56
        flags_hf2,
57
        db
58
);
59
 
60
 
61
input wire      ctl_flags_oe;
62
input wire      ctl_flags_bus;
63
input wire      ctl_flags_alu;
64
input wire      alu_sf_out;
65
input wire      alu_yf_out;
66
input wire      alu_xf_out;
67
input wire      ctl_flags_nf_set;
68
input wire      alu_zero;
69
input wire      shift_cf_out;
70
input wire      alu_core_cf_out;
71
input wire      daa_cf_out;
72
input wire      ctl_flags_cf_set;
73
input wire      ctl_flags_cf_cpl;
74
input wire      pf_sel;
75
input wire      ctl_flags_cf_we;
76
input wire      ctl_flags_sz_we;
77
input wire      ctl_flags_xy_we;
78
input wire      ctl_flags_hf_we;
79
input wire      ctl_flags_pf_we;
80
input wire      ctl_flags_nf_we;
81
input wire      ctl_flags_cf2_we;
82
input wire      ctl_flags_hf_cpl;
83
input wire      ctl_flags_use_cf2;
84
input wire      ctl_flags_hf2_we;
85
input wire      ctl_flags_nf_clr;
86
input wire      ctl_alu_zero_16bit;
87
input wire      clk;
88 8 gdevic
input wire      ctl_flags_cf2_sel_shift;
89
input wire      ctl_flags_cf2_sel_daa;
90 3 gdevic
output wire     flags_sf;
91
output wire     flags_zf;
92
output wire     flags_hf;
93
output wire     flags_pf;
94
output wire     flags_cf;
95
output wire     flags_nf;
96
output wire     flags_cf_latch;
97
output reg      flags_hf2;
98
inout wire      [7:0] db;
99
 
100
reg     flags_xf;
101
reg     flags_yf;
102 8 gdevic
wire    [1:0] sel;
103 3 gdevic
wire    SYNTHESIZED_WIRE_0;
104
reg     DFFE_inst_latch_hf;
105
wire    SYNTHESIZED_WIRE_1;
106
wire    SYNTHESIZED_WIRE_2;
107
wire    SYNTHESIZED_WIRE_3;
108
wire    SYNTHESIZED_WIRE_4;
109
wire    SYNTHESIZED_WIRE_5;
110
wire    SYNTHESIZED_WIRE_6;
111
wire    SYNTHESIZED_WIRE_7;
112
wire    SYNTHESIZED_WIRE_8;
113
reg     SYNTHESIZED_WIRE_38;
114
wire    SYNTHESIZED_WIRE_9;
115
wire    SYNTHESIZED_WIRE_10;
116
wire    SYNTHESIZED_WIRE_11;
117
wire    SYNTHESIZED_WIRE_12;
118
wire    SYNTHESIZED_WIRE_13;
119
wire    SYNTHESIZED_WIRE_14;
120
wire    SYNTHESIZED_WIRE_15;
121
wire    SYNTHESIZED_WIRE_16;
122
wire    SYNTHESIZED_WIRE_17;
123
wire    SYNTHESIZED_WIRE_18;
124
wire    SYNTHESIZED_WIRE_19;
125
wire    SYNTHESIZED_WIRE_20;
126
wire    SYNTHESIZED_WIRE_21;
127
wire    SYNTHESIZED_WIRE_22;
128
reg     DFFE_inst_latch_sf;
129
wire    SYNTHESIZED_WIRE_23;
130
reg     DFFE_inst_latch_pf;
131
reg     DFFE_inst_latch_nf;
132
wire    SYNTHESIZED_WIRE_24;
133
wire    SYNTHESIZED_WIRE_25;
134
wire    SYNTHESIZED_WIRE_26;
135
wire    SYNTHESIZED_WIRE_27;
136
wire    SYNTHESIZED_WIRE_28;
137
wire    SYNTHESIZED_WIRE_39;
138
wire    SYNTHESIZED_WIRE_31;
139
wire    SYNTHESIZED_WIRE_32;
140
wire    SYNTHESIZED_WIRE_33;
141
wire    SYNTHESIZED_WIRE_34;
142
wire    SYNTHESIZED_WIRE_35;
143
wire    SYNTHESIZED_WIRE_36;
144
reg     DFFE_inst_latch_cf;
145
reg     DFFE_inst_latch_cf2;
146
wire    SYNTHESIZED_WIRE_37;
147
 
148
assign  flags_sf = DFFE_inst_latch_sf;
149
assign  flags_zf = SYNTHESIZED_WIRE_38;
150
assign  flags_hf = SYNTHESIZED_WIRE_23;
151
assign  flags_pf = DFFE_inst_latch_pf;
152
assign  flags_cf = SYNTHESIZED_WIRE_24;
153
assign  flags_nf = DFFE_inst_latch_nf;
154
assign  flags_cf_latch = DFFE_inst_latch_cf;
155
assign  SYNTHESIZED_WIRE_37 = 0;
156
 
157
 
158
 
159
assign  SYNTHESIZED_WIRE_27 = ctl_flags_cf_we & SYNTHESIZED_WIRE_0;
160
 
161
assign  SYNTHESIZED_WIRE_10 = db[7] & ctl_flags_bus;
162
 
163
assign  SYNTHESIZED_WIRE_17 = alu_xf_out & ctl_flags_alu;
164
 
165
assign  SYNTHESIZED_WIRE_20 = db[2] & ctl_flags_bus;
166
 
167
assign  SYNTHESIZED_WIRE_19 = pf_sel & ctl_flags_alu;
168
 
169
assign  SYNTHESIZED_WIRE_3 = db[1] & ctl_flags_bus;
170
 
171
assign  SYNTHESIZED_WIRE_23 = DFFE_inst_latch_hf ^ ctl_flags_hf_cpl;
172
 
173
assign  SYNTHESIZED_WIRE_22 = db[0] & ctl_flags_bus;
174
 
175
assign  SYNTHESIZED_WIRE_21 = ctl_flags_alu & alu_core_cf_out;
176
 
177
assign  SYNTHESIZED_WIRE_0 =  ~ctl_flags_cf2_we;
178
 
179
assign  SYNTHESIZED_WIRE_24 = SYNTHESIZED_WIRE_1 ^ ctl_flags_cf_cpl;
180
 
181
assign  SYNTHESIZED_WIRE_2 = alu_sf_out & ctl_flags_alu;
182
 
183
assign  SYNTHESIZED_WIRE_9 = alu_sf_out & ctl_flags_alu;
184
 
185
assign  SYNTHESIZED_WIRE_6 = ctl_flags_nf_set | SYNTHESIZED_WIRE_2 | SYNTHESIZED_WIRE_3;
186
 
187
assign  SYNTHESIZED_WIRE_36 = SYNTHESIZED_WIRE_4 & SYNTHESIZED_WIRE_5;
188
 
189
 
190
assign  SYNTHESIZED_WIRE_31 = SYNTHESIZED_WIRE_6 & SYNTHESIZED_WIRE_7;
191
 
192
assign  SYNTHESIZED_WIRE_7 =  ~ctl_flags_nf_clr;
193
 
194
assign  SYNTHESIZED_WIRE_8 =  ~ctl_alu_zero_16bit;
195
 
196
assign  SYNTHESIZED_WIRE_5 = SYNTHESIZED_WIRE_8 | SYNTHESIZED_WIRE_38;
197
 
198
assign  SYNTHESIZED_WIRE_12 = db[6] & ctl_flags_bus;
199
 
200
assign  SYNTHESIZED_WIRE_33 = SYNTHESIZED_WIRE_9 | SYNTHESIZED_WIRE_10;
201
 
202
assign  SYNTHESIZED_WIRE_4 = SYNTHESIZED_WIRE_11 | SYNTHESIZED_WIRE_12;
203
 
204
assign  SYNTHESIZED_WIRE_35 = SYNTHESIZED_WIRE_13 | SYNTHESIZED_WIRE_14;
205
 
206
assign  SYNTHESIZED_WIRE_39 = SYNTHESIZED_WIRE_15 | SYNTHESIZED_WIRE_16;
207
 
208
assign  SYNTHESIZED_WIRE_34 = SYNTHESIZED_WIRE_17 | SYNTHESIZED_WIRE_18;
209
 
210
assign  SYNTHESIZED_WIRE_32 = SYNTHESIZED_WIRE_19 | SYNTHESIZED_WIRE_20;
211
 
212
assign  SYNTHESIZED_WIRE_11 = alu_zero & ctl_flags_alu;
213
 
214
assign  SYNTHESIZED_WIRE_26 = SYNTHESIZED_WIRE_21 | SYNTHESIZED_WIRE_22;
215
 
216
assign  db[7] = ctl_flags_oe ? DFFE_inst_latch_sf : 1'bz;
217
 
218
assign  SYNTHESIZED_WIRE_14 = db[5] & ctl_flags_bus;
219
 
220
assign  db[6] = ctl_flags_oe ? SYNTHESIZED_WIRE_38 : 1'bz;
221
 
222
assign  db[5] = ctl_flags_oe ? flags_yf : 1'bz;
223
 
224
assign  db[4] = ctl_flags_oe ? SYNTHESIZED_WIRE_23 : 1'bz;
225
 
226
assign  db[3] = ctl_flags_oe ? flags_xf : 1'bz;
227
 
228
assign  db[2] = ctl_flags_oe ? DFFE_inst_latch_pf : 1'bz;
229
 
230
assign  db[1] = ctl_flags_oe ? DFFE_inst_latch_nf : 1'bz;
231
 
232
assign  db[0] = ctl_flags_oe ? SYNTHESIZED_WIRE_24 : 1'bz;
233
 
234
assign  SYNTHESIZED_WIRE_13 = alu_yf_out & ctl_flags_alu;
235
 
236
assign  SYNTHESIZED_WIRE_1 = ctl_flags_cf_set | SYNTHESIZED_WIRE_25;
237
 
238
assign  SYNTHESIZED_WIRE_16 = db[4] & ctl_flags_bus;
239
 
240
assign  SYNTHESIZED_WIRE_15 = alu_core_cf_out & ctl_flags_alu;
241
 
242
assign  SYNTHESIZED_WIRE_18 = db[3] & ctl_flags_bus;
243
 
244
 
245
always@(posedge clk)
246
begin
247
if (SYNTHESIZED_WIRE_27)
248
        begin
249
        DFFE_inst_latch_cf <= SYNTHESIZED_WIRE_26;
250
        end
251
end
252
 
253
 
254
always@(posedge clk)
255
begin
256
if (ctl_flags_cf2_we)
257
        begin
258
        DFFE_inst_latch_cf2 <= SYNTHESIZED_WIRE_28;
259
        end
260
end
261
 
262
 
263
always@(posedge clk)
264
begin
265
if (ctl_flags_hf_we)
266
        begin
267
        DFFE_inst_latch_hf <= SYNTHESIZED_WIRE_39;
268
        end
269
end
270
 
271
 
272
always@(posedge clk)
273
begin
274
if (ctl_flags_hf2_we)
275
        begin
276
        flags_hf2 <= SYNTHESIZED_WIRE_39;
277
        end
278
end
279
 
280
 
281
always@(posedge clk)
282
begin
283
if (ctl_flags_nf_we)
284
        begin
285
        DFFE_inst_latch_nf <= SYNTHESIZED_WIRE_31;
286
        end
287
end
288
 
289
 
290
always@(posedge clk)
291
begin
292
if (ctl_flags_pf_we)
293
        begin
294
        DFFE_inst_latch_pf <= SYNTHESIZED_WIRE_32;
295
        end
296
end
297
 
298
 
299
always@(posedge clk)
300
begin
301
if (ctl_flags_sz_we)
302
        begin
303
        DFFE_inst_latch_sf <= SYNTHESIZED_WIRE_33;
304
        end
305
end
306
 
307
 
308
always@(posedge clk)
309
begin
310
if (ctl_flags_xy_we)
311
        begin
312
        flags_xf <= SYNTHESIZED_WIRE_34;
313
        end
314
end
315
 
316
 
317
always@(posedge clk)
318
begin
319
if (ctl_flags_xy_we)
320
        begin
321
        flags_yf <= SYNTHESIZED_WIRE_35;
322
        end
323
end
324
 
325
 
326
always@(posedge clk)
327
begin
328
if (ctl_flags_sz_we)
329
        begin
330
        SYNTHESIZED_WIRE_38 <= SYNTHESIZED_WIRE_36;
331
        end
332
end
333
 
334
 
335
alu_mux_2       b2v_inst_mux_cf(
336
        .in0(DFFE_inst_latch_cf),
337
        .in1(DFFE_inst_latch_cf2),
338
        .sel1(ctl_flags_use_cf2),
339
        .out(SYNTHESIZED_WIRE_25));
340
 
341
 
342
alu_mux_4       b2v_inst_mux_cf2(
343
        .in0(alu_core_cf_out),
344
        .in1(shift_cf_out),
345
        .in2(daa_cf_out),
346
        .in3(SYNTHESIZED_WIRE_37),
347 8 gdevic
        .sel(sel),
348 3 gdevic
        .out(SYNTHESIZED_WIRE_28));
349
 
350 8 gdevic
assign  sel[0] = ctl_flags_cf2_sel_shift;
351
assign  sel[1] = ctl_flags_cf2_sel_daa;
352 3 gdevic
 
353
endmodule

powered by: WebSVN 2.1.0

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