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

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [cpu/] [control/] [decode_state.v] - Blame information for rev 20

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 16 gdevic
// CREATED              "Sat Dec 10 08:55:35 2016"
18 3 gdevic
 
19
module decode_state(
20
        ctl_state_iy_set,
21
        ctl_state_ixiy_clr,
22
        ctl_state_ixiy_we,
23
        ctl_state_halt_set,
24
        ctl_state_tbl_ed_set,
25
        ctl_state_tbl_cb_set,
26
        ctl_state_alu,
27
        clk,
28
        address_is_1,
29
        ctl_repeat_we,
30
        in_intr,
31
        in_nmi,
32
        nreset,
33 13 gdevic
        ctl_state_tbl_we,
34 16 gdevic
        nhold_clk_wait,
35 3 gdevic
        in_halt,
36
        table_cb,
37
        table_ed,
38
        table_xx,
39
        use_ix,
40
        use_ixiy,
41
        in_alu,
42
        repeat_en
43
);
44
 
45
 
46
input wire      ctl_state_iy_set;
47
input wire      ctl_state_ixiy_clr;
48
input wire      ctl_state_ixiy_we;
49
input wire      ctl_state_halt_set;
50
input wire      ctl_state_tbl_ed_set;
51
input wire      ctl_state_tbl_cb_set;
52
input wire      ctl_state_alu;
53
input wire      clk;
54
input wire      address_is_1;
55
input wire      ctl_repeat_we;
56
input wire      in_intr;
57
input wire      in_nmi;
58
input wire      nreset;
59 13 gdevic
input wire      ctl_state_tbl_we;
60 16 gdevic
input wire      nhold_clk_wait;
61 3 gdevic
output reg      in_halt;
62
output wire     table_cb;
63
output wire     table_ed;
64
output wire     table_xx;
65
output wire     use_ix;
66
output wire     use_ixiy;
67
output wire     in_alu;
68
output wire     repeat_en;
69
 
70
reg     DFFE_instNonRep;
71
reg     DFFE_instIY1;
72
reg     DFFE_inst4;
73
reg     DFFE_instED;
74
reg     DFFE_instCB;
75
wire    SYNTHESIZED_WIRE_0;
76
wire    SYNTHESIZED_WIRE_4;
77 16 gdevic
wire    SYNTHESIZED_WIRE_3;
78 3 gdevic
 
79
assign  in_alu = ctl_state_alu;
80
assign  table_cb = DFFE_instCB;
81
assign  table_ed = DFFE_instED;
82
assign  use_ix = DFFE_inst4;
83
 
84
 
85
 
86
assign  repeat_en =  ~DFFE_instNonRep;
87
 
88
assign  use_ixiy = DFFE_instIY1 | DFFE_inst4;
89
 
90
assign  table_xx = ~(DFFE_instED | DFFE_instCB);
91
 
92
 
93
always@(posedge clk or negedge nreset)
94
begin
95
if (!nreset)
96
        begin
97
        DFFE_inst4 <= 0;
98
        end
99
else
100
if (ctl_state_ixiy_we)
101
        begin
102
        DFFE_inst4 <= SYNTHESIZED_WIRE_0;
103
        end
104
end
105
 
106
assign  SYNTHESIZED_WIRE_0 = ~(ctl_state_iy_set | ctl_state_ixiy_clr);
107
 
108 16 gdevic
assign  SYNTHESIZED_WIRE_4 = ctl_state_tbl_we & nhold_clk_wait;
109 3 gdevic
 
110 16 gdevic
assign  SYNTHESIZED_WIRE_3 = in_nmi | in_intr;
111 3 gdevic
 
112 13 gdevic
 
113 3 gdevic
always@(posedge clk or negedge nreset)
114
begin
115
if (!nreset)
116
        begin
117
        DFFE_instCB <= 0;
118
        end
119
else
120 16 gdevic
if (SYNTHESIZED_WIRE_4)
121 3 gdevic
        begin
122
        DFFE_instCB <= ctl_state_tbl_cb_set;
123
        end
124
end
125
 
126
 
127
always@(posedge clk or negedge nreset)
128
begin
129
if (!nreset)
130
        begin
131
        DFFE_instED <= 0;
132
        end
133
else
134 16 gdevic
if (SYNTHESIZED_WIRE_4)
135 3 gdevic
        begin
136
        DFFE_instED <= ctl_state_tbl_ed_set;
137
        end
138
end
139
 
140
 
141
always@(posedge clk or negedge nreset)
142
begin
143
if (!nreset)
144
        begin
145
        in_halt <= 0;
146
        end
147
else
148
        begin
149 16 gdevic
        in_halt <= ~in_halt & ctl_state_halt_set | in_halt & ~SYNTHESIZED_WIRE_3;
150 3 gdevic
        end
151
end
152
 
153
 
154
always@(posedge clk or negedge nreset)
155
begin
156
if (!nreset)
157
        begin
158
        DFFE_instIY1 <= 0;
159
        end
160
else
161
if (ctl_state_ixiy_we)
162
        begin
163
        DFFE_instIY1 <= ctl_state_iy_set;
164
        end
165
end
166
 
167
 
168
always@(posedge clk or negedge nreset)
169
begin
170
if (!nreset)
171
        begin
172
        DFFE_instNonRep <= 0;
173
        end
174
else
175
if (ctl_repeat_we)
176
        begin
177
        DFFE_instNonRep <= address_is_1;
178
        end
179
end
180
 
181
 
182
endmodule

powered by: WebSVN 2.1.0

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