OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [vhdl/] [plasma.vhd] - Blame information for rev 48

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 rhoads
---------------------------------------------------------------------
2
-- TITLE: Plasma (CPU core with memory)
3
-- AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
-- DATE CREATED: 6/4/02
5
-- FILENAME: plasma.vhd
6
-- PROJECT: Plasma CPU core
7
-- COPYRIGHT: Software placed into the public domain by the author.
8
--    Software 'as is' without warranty.  Author liable for nothing.
9
-- DESCRIPTION:
10
--    This entity combines the CPU core with memory and a UART.
11
---------------------------------------------------------------------
12
library ieee;
13
use ieee.std_logic_1164.all;
14
use work.mlite_pack.all;
15
 
16
entity plasma is
17
   generic(memory_type : string := "ALTERA";
18
           log_file    : string := "UNUSED");
19
   port(clk_in           : in std_logic;
20
        reset_in         : in std_logic;
21
        intr_in          : in std_logic;
22
 
23
        uart_read        : in std_logic;
24
        uart_write       : out std_logic;
25
 
26
        mem_address_out  : out std_logic_vector(31 downto 0);
27
        mem_data         : inout std_logic_vector(31 downto 0);
28
        mem_byte_sel_out : out std_logic_vector(3 downto 0);
29
        mem_write_out    : out std_logic;
30
        mem_pause_in     : in std_logic);
31
end; --entity plasma
32
 
33
architecture logic of plasma is
34
   signal clk            : std_logic;
35
   signal mem_address    : std_logic_vector(31 downto 0);
36
   signal mem_byte_sel   : std_logic_vector(3 downto 0);
37
   signal mem_write      : std_logic;
38
   signal mem_pause      : std_logic;
39
   signal mem_pause_uart : std_logic;
40
   signal uart_sel       : std_logic;
41
begin  --architecture
42
   clk_control1:
43
   if log_file = "UNUSED" generate
44
      --convert 33MHz clock to 16.5MHz clock
45
      clk_div: process(clk_in, reset_in, clk)
46
      begin
47
         if rising_edge(clk_in) then
48
            if reset_in = '1' then
49
               clk <= '0';
50
            else
51
               clk <= not clk;
52
            end if;
53
         end if;
54
      end process; --clk_div
55
   end generate; --clk_control1
56
 
57
   clk_control2:
58
   if log_file /= "UNUSED" generate
59
      clk <= clk_in;
60
   end generate; --clk_control2 
61
 
62
   mem_pause <= mem_pause_in or mem_pause_uart;
63
   uart_sel <= '1' when mem_address(12 downto 0) = ONES(12 downto 0) and mem_byte_sel /= "0000" else
64
               '0';
65
 
66
   u1_cpu: mlite_cpu
67
      generic map (memory_type => memory_type)
68
      PORT MAP (
69
         clk          => clk_in,
70
         reset_in     => reset_in,
71
         intr_in      => intr_in,
72
 
73
         mem_address  => mem_address,
74
         mem_data_w   => mem_data,
75
         mem_data_r   => mem_data,
76
         mem_byte_sel => mem_byte_sel,
77
         mem_write    => mem_write,
78
         mem_pause    => mem_pause);
79
 
80
   u2_ram: ram
81
      generic map (memory_type => memory_type)
82
      PORT MAP (
83
         clk          => clk_in,
84
         mem_byte_sel => mem_byte_sel,
85
         mem_write    => mem_write,
86
         mem_address  => mem_address,
87
         mem_data     => mem_data);
88
 
89
   u3_uart: uart
90
      generic map (log_file => log_file)
91
      port map(
92
         clk        => clk_in,
93
         reset      => reset_in,
94
         uart_sel   => uart_sel,
95
         data       => mem_data(7 downto 0),
96
         uart_write => uart_write,
97
         uart_read  => uart_read,
98
         pause      => mem_pause_uart);
99
 
100
   mem_address_out  <= mem_address;
101
   mem_byte_sel_out <= mem_byte_sel;
102
   mem_write_out    <= mem_write;
103
 
104
end; --architecture logic

powered by: WebSVN 2.1.0

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