2 // Copyright (C) 2008 Tomasz Malesinski <tmal@mimuw.edu.pl>
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 module antic(rst_i
, clk_i
,
52 reg [1:0] dma_pf_width
;
72 parameter [1:0] ADRO_DLPTR
= 2'b00;
73 parameter [1:0] ADRO_MEMSCAN
= 2'b01;
74 parameter [1:0] ADRO_CHAR
= 2'b10;
75 parameter [1:0] ADRO_PM
= 2'b11;
88 always @ (posedge clk_i
)
89 if (we_i
&& adr_i
== 'h0
) begin
90 dma_pf_width
<= dat_i
[1:0];
91 dma_mis_en
<= dat_i
[2];
92 dma_ply_en
<= dat_i
[3];
93 dma_pm_1res
<= dat_i
[4];
94 dma_instr_en
<= dat_i
[5];
98 always @ (posedge clk_i
)
99 if (we_i
&& adr_i
== 'h1
)
100 chactl
<= dat_i
[2:0];
103 always @ (posedge clk_i
)
104 if (we_i
&& adr_i
== 'h2
)
105 dlist_ctr
[7:0] <= dat_i
;
106 else if (we_i
&& adr_i
== 'h3
)
107 dlist_ctr
[15:8] <= dat_i
;
109 dlist_ctr
[9:0] <= dlist_ctr
[9:0] + 1;
112 always @ (posedge clk_i
)
113 if (we_i
&& adr_i
== 'h4
)
114 hscrol
<= dat_i
[3:0];
117 always @ (posedge clk_i
)
118 if (we_i
&& adr_i
== 'h5
)
119 vscrol
<= dat_i
[3:0];
122 always @ (posedge clk_i
)
123 if (we_i
&& adr_i
== 'h7
)
124 pmbase
<= dat_i
[7:2];
127 always @ (posedge clk_i
)
128 if (we_i
&& adr_i
== 'h9
)
129 chbase
<= dat_i
[7:1];
132 always @ (posedge clk_i
)
133 if (we_i
&& adr_i
== 'ha
) begin
137 always @ (posedge clk_i
)
138 if (we_i
&& adr_i
== 'he
) begin
142 always @ (posedge clk_i
)
143 if (we_i
&& adr_i
== 'hf
) begin
147 always @ (posedge clk2_i
)
150 else if (hcount
== 227)
153 hcount
<= hcount
+ 1;
156 always @ (posedge clk2_i
)
159 else if (hcount
== 227)
163 vcount
<= vcount
+ 1;