Top level Atosm chip and its initial firmware
[AtosmChip.git] / atosm_sim.v
blob83825e6e02678dd0ae254b7607d8203367ef7b7d
1 // Atosm Chip
2 // Copyright (C) 2008 Tomasz Malesinski <tmal@mimuw.edu.pl>
3 //
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.
8 //
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 `include "atosm.v"
19 `include "clock.v"
21 module atosm_sim();
22 wire atari_clk;
23 wire atari_clk2;
24 reg clk;
26 reg rst_o;
28 initial begin
29 $readmemh("os/atarios.memh", u_atosm.u_atari.u_rom.memory);
30 $readmemh("fw/fw.memh", u_atosm.u_rom.memory);
32 $monitor("%h %h", u_atosm.u_cpu.pc, u_atosm.u_atari.u_cpu.pc);
34 clk = 0;
35 rst_o = 0;
36 #5 rst_o = 1;
37 #40 rst_o = 0;
38 #2_000_000_0;
39 $finish;
40 end
42 always begin
43 #1 clk = ~clk;
44 end
46 clkgen u_clkgen(.clk_o(atari_clk), .clk2_o(atari_clk2));
47 atosm u_atosm(.rst_i(rst_o), .clk_i(clk),
48 .atari_clk_i(atari_clk), .atari_clk2_i(atari_clk2));
50 endmodule