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
28 $readmemh("os/atarios.memh", u_atari.u_rom.memory
);
29 $readmemh("tests/antic_test.memh", u_atari.u_rom.memory
, 'h3000
);
31 $monitor("%h %h l%b s%b %b %b v=%h adro=%h ir=%h d=%h dlptr=%h memsc=%h max=%h out=%b",
32 u_atari.u_antic.shift_reg_out
,
33 u_atari.u_antic.u_shift_reg.in
,
34 u_atari.u_antic.u_shift_reg.load
,
35 u_atari.u_antic.u_shift_reg.shift
,
36 u_atari.u_antic.load_char
,
37 u_atari.u_antic.char_block
,
38 u_atari.u_antic.vcount
,
39 u_atari.u_antic.adr_o
,
41 u_atari.u_antic.dcount
,
42 u_atari.u_antic.dlist_ctr
,
43 u_atari.u_antic.memscan_ctr
,
44 u_atari.u_antic.maxline
,
45 u_atari.u_antic.out_reg
);
47 //$monitor("%b %b %b %b",
48 // u_atari.u_antic.dma_instr_en,
49 // u_atari.u_antic.new_block,
50 // u_atari.u_antic.vblank,
51 // u_atari.u_antic.wait_vblank);
60 always @ (posedge clk
) begin
61 if (u_atari.adr
>= 'hd000
&& u_atari.adr
< 'hd800
) begin
63 $display("hardware write %h = %h at %h",
64 u_atari.adr
, u_atari.masterdat_o
, u_atari.u_cpu.pc
);
66 $display("hardware read %h = %h at %h",
67 u_atari.adr
, u_atari.slavedat_o
, u_atari.u_cpu.pc
);
71 always @ (posedge u_atari.vsync
)
74 always @ (posedge u_atari.hsync
)
77 always @ (posedge clk2
or negedge clk2
)
78 $outpixel(u_atari.color
);
80 clkgen
u_clkgen(.
clk_o(clk
), .
clk2_o(clk2
));
81 atari
u_atari(.
clk_i(clk
), .
clk2_i(clk2
), .
rst_i(rst_o
));