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

Subversion Repositories plasma

[/] [plasma/] [tags/] [V2_1/] [vhdl/] [plasma_if.vhd] - Blame information for rev 402

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

Line No. Rev Author Line
1 57 rhoads
---------------------------------------------------------------------
2
-- TITLE: Plamsa Interface (clock divider and interface to FPGA board)
3
-- AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
-- DATE CREATED: 6/6/02
5
-- FILENAME: plasma_if.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 divides the clock by two and interfaces to the 
11
--    Altera EP20K200EFC484-2X FPGA board.
12
---------------------------------------------------------------------
13
library ieee;
14
use ieee.std_logic_1164.all;
15
use work.mlite_pack.all;
16
 
17
entity plasma_if is
18
   generic(memory_type : string := "ALTERA";
19
           log_file    : string := "UNUSED");
20
   port(clk_in     : in std_logic;
21
        reset_n    : in std_logic;
22
        uart_read  : in std_logic;
23
        uart_write : out std_logic;
24
 
25
        address    : out std_logic_vector(31 downto 0);
26
        data       : out std_logic_vector(31 downto 0);
27
        we_n       : out std_logic;
28
        oe_n       : out std_logic;
29
        be_n       : out std_logic_vector(3 downto 0);
30
        sram0_cs_n : out std_logic;
31
        sram1_cs_n : out std_logic);
32
end; --entity plasma_if
33
 
34
architecture logic of plasma_if is
35
   signal clk_reg      : std_logic;
36
   signal reset_in     : std_logic;
37
   signal intr_in      : std_logic;
38
   signal mem_address  : std_logic_vector(31 downto 0);
39
   signal mem_pause_in : std_logic;
40
   signal write_enable : std_logic;
41
   signal mem_byte_sel : std_logic_vector(3 downto 0);
42
begin  --architecture
43
   reset_in <= not reset_n;
44
   intr_in <= '0';
45
   mem_pause_in <= '0';
46
 
47
   address <= mem_address;
48
   we_n <= not write_enable;
49
   oe_n <= write_enable;
50
   be_n <= not mem_byte_sel;
51
   sram0_cs_n <= not mem_address(16);
52
   sram1_cs_n <= not mem_address(16);
53
 
54
   --convert 33MHz clock to 16.5MHz clock
55
   clk_div: process(clk_in, reset_in, clk_reg)
56
   begin
57
      if reset_in = '1' then
58
         clk_reg <= '0';
59
      elsif rising_edge(clk_in) then
60
         clk_reg <= not clk_reg;
61
      end if;
62
   end process; --clk_div
63
 
64
   u1_plama: plasma
65
      generic map (memory_type => memory_type,
66
                   log_file    => log_file)
67
      PORT MAP (
68
         clk_in           => clk_reg,
69
         reset_in         => reset_in,
70
         intr_in          => intr_in,
71
 
72
         uart_read        => uart_read,
73
         uart_write       => uart_write,
74
 
75
         mem_address_out  => mem_address,
76
         mem_data         => data,
77
         mem_byte_sel_out => mem_byte_sel,
78
         mem_write_out    => write_enable,
79
         mem_pause_in     => mem_pause_in);
80
 
81
end; --architecture logic
82
 

powered by: WebSVN 2.1.0

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