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

Subversion Repositories bitserial

[/] [bitserial/] [trunk/] [top.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 howe.r.j.8
-- File:        top.vhd
2
-- Author:      Richard James Howe
3
-- Repository:  https://github.com/howerj/bit-serial
4
-- License:     MIT
5
-- Description: Top level entity; Bit Serial CPU
6
 
7
library ieee, work, std;
8
use ieee.std_logic_1164.all;
9
use ieee.numeric_std.all;
10
use work.util.all;
11
 
12
entity top is
13
        generic (
14
                g:               common_generics := default_settings;
15
                file_name:       string          := "bit.hex";
16
                N:               positive        := 16;
17
                baud:            positive        := 115200;
18
                debug:           natural         := 0; -- will not synthesize if greater than zero (debug off)
19
                uart_use_cfg:   boolean          := false;
20
                uart_fifo_depth: natural         := 0
21
        );
22
        port (
23
                clk:         in std_ulogic;
24
                -- synthesis translate_off
25
--              rst:         in std_ulogic;
26
                halt:       out std_ulogic;
27
                -- synthesis translate_on
28
                tx:         out std_ulogic;
29
                rx:          in std_ulogic;
30
                sw:          in std_ulogic_vector(7 downto 0);
31
                ld:         out std_ulogic_vector(7 downto 0));
32
end entity;
33
 
34
architecture rtl of top is
35
        constant W:              positive   := N - 3;
36
        signal rst:              std_ulogic := '0';
37
        signal i:                std_ulogic := 'X';
38
        signal o, a, oe, ie, ae: std_ulogic := 'X';
39
begin
40
        peripheral: entity work.peripherals
41
                generic map(
42
                        g               => g,
43
                        file_name       => file_name,
44
                        W               => W,
45
                        N               => N,
46
                        baud            => baud,
47
                        uart_fifo_depth => uart_fifo_depth,
48
                        uart_use_cfg    => uart_use_cfg)
49
                port map (
50
                        clk => clk, rst => rst,
51
                        tx => tx, rx => rx, ld => ld, sw => sw,
52
                        i => o,
53
                        o => i,
54
                        a => a, oe => ie, ie => oe, ae => ae);
55
 
56
        cpu: entity work.bcpu
57
                generic map (
58
                        asynchronous_reset => g.asynchronous_reset,
59
                        delay              => g.delay,
60
                        N                  => N,
61
                        debug              => debug)
62
                port map (
63
                        clk => clk, rst => rst,
64
                        -- synthesis translate_off
65
                        stop => halt,
66
                        -- synthesis translate_on
67
                        i => i,
68
                        o => o, a => a, oe => oe, ie => ie, ae => ae);
69
end architecture;

powered by: WebSVN 2.1.0

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