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

Subversion Repositories mlite

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

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 55 rhoads
        mem_data         : out std_logic_vector(31 downto 0);
28 48 rhoads
        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 mem_address    : std_logic_vector(31 downto 0);
35 55 rhoads
   signal mem_data_r     : std_logic_vector(31 downto 0);
36
   signal mem_data_w     : std_logic_vector(31 downto 0);
37 48 rhoads
   signal mem_byte_sel   : std_logic_vector(3 downto 0);
38
   signal mem_write      : std_logic;
39
   signal mem_pause      : std_logic;
40
   signal mem_pause_uart : std_logic;
41
   signal uart_sel       : std_logic;
42
begin  --architecture
43 105 rhoads
   uart_sel <= '1' when mem_address(12 downto 0) = ONES(12 downto 0) and
44
               mem_byte_sel /= "0000" else '0';
45 55 rhoads
   mem_data <= mem_data_r;
46 105 rhoads
   mem_pause <= (mem_pause_in and not uart_sel) or mem_pause_uart;
47 48 rhoads
 
48
   u1_cpu: mlite_cpu
49
      generic map (memory_type => memory_type)
50
      PORT MAP (
51
         clk          => clk_in,
52
         reset_in     => reset_in,
53
         intr_in      => intr_in,
54
 
55
         mem_address  => mem_address,
56 55 rhoads
         mem_data_w   => mem_data_w,
57
         mem_data_r   => mem_data_r,
58 48 rhoads
         mem_byte_sel => mem_byte_sel,
59
         mem_write    => mem_write,
60
         mem_pause    => mem_pause);
61
 
62
   u2_ram: ram
63
      generic map (memory_type => memory_type)
64
      PORT MAP (
65
         clk          => clk_in,
66
         mem_byte_sel => mem_byte_sel,
67
         mem_write    => mem_write,
68
         mem_address  => mem_address,
69 55 rhoads
         mem_data_w   => mem_data_w,
70
         mem_data_r   => mem_data_r);
71 48 rhoads
 
72
   u3_uart: uart
73
      generic map (log_file => log_file)
74
      port map(
75
         clk        => clk_in,
76
         reset      => reset_in,
77
         uart_sel   => uart_sel,
78 55 rhoads
         data       => mem_data_w(7 downto 0),
79 48 rhoads
         uart_write => uart_write,
80
         uart_read  => uart_read,
81
         pause      => mem_pause_uart);
82
 
83
   mem_address_out  <= mem_address;
84
   mem_byte_sel_out <= mem_byte_sel;
85
   mem_write_out    <= mem_write;
86
 
87
end; --architecture logic

powered by: WebSVN 2.1.0

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