OSDN Git Service

added main circuit motones_sim.
[motonesfpga/motonesfpga.git] / simulation / motones_sim.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_unsigned.conv_integer;
4
5 --  
6 --   MOTO NES FPGA On GHDL Simulation Environment Virtual Cuicuit Board
7 --   All of the components are assembled and instanciated on this board.
8 --  
9
10 entity motones_sim is 
11     port (  reset_n     : in std_logic
12          );
13 end motones_sim;
14
15 architecture rtl of motones_sim is
16     component clock_divider
17         port (  base_clk    : in std_logic;
18                 reset_n     : in std_logic;
19                 cpu_clk     : out std_logic;
20                 ppu_clk     : out std_logic
21             );
22     end component;
23
24     ---clock frequency = 21,477,270 (21 MHz)
25     constant base_clock_time : time := 46 ns;
26
27     signal base_clk : std_logic;
28     signal cpu_clk, ppu_clk : std_logic;
29
30 begin
31
32     clock_inst : clock_divider port map 
33         (base_clk, reset_n, cpu_clk, ppu_clk);
34
35     --- generate base clock.
36     clock_p: process
37     begin
38         base_clk <= '1';
39         wait for base_clock_time / 2;
40         base_clk <= '0';
41         wait for base_clock_time / 2;
42     end process;
43
44
45 end rtl;
46