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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [nexys2/] [nexys2_types.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 trurl
-------------------------------------------------------------------
2
--!
3
--! PDP-8 Processor
4
--!
5
--! \brief
6
--!      NEXYS2 Wrapper: Type Definitions
7
--!
8
--! \details
9
--!      
10
--!
11
--! \file
12
--!      nexys2_types.vhd
13
--!
14
--! \author
15
--!      Rob Doyle - doyle (at) cox (dot) net
16
--!
17
--------------------------------------------------------------------
18
--
19
--  Copyright (C) 2009, 2010, 2011, 2012 Rob Doyle
20
--
21
-- This source file may be used and distributed without
22
-- restriction provided that this copyright statement is not
23
-- removed from the file and that any derivative work contains
24
-- the original copyright notice and the associated disclaimer.
25
--
26
-- This source file is free software; you can redistribute it
27
-- and/or modify it under the terms of the GNU Lesser General
28
-- Public License as published by the Free Software Foundation;
29
-- version 2.1 of the License.
30
--
31
-- This source is distributed in the hope that it will be
32
-- useful, but WITHOUT ANY WARRANTY; without even the implied
33
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
34
-- PURPOSE. See the GNU Lesser General Public License for more
35
-- details.
36
--
37
-- You should have received a copy of the GNU Lesser General
38
-- Public License along with this source; if not, download it
39
-- from http://www.gnu.org/licenses/lgpl.txt
40
--
41
--------------------------------------------------------------------
42
--
43
-- Comments are formatted for doxygen
44
--
45
 
46
library ieee;
47
use ieee.std_logic_1164.all;
48
use ieee.numeric_std.all;
49
use work.cpu_types.all;
50
 
51
--
52
--! NEXYS2 Type Definition Package
53
--
54
 
55
package nexys2_types is
56
 
57
    subtype  dispSeg_t  is std_logic_vector(0 to  7);           --! Display Segment Driver
58
    subtype  dispDig_t  is std_logic_vector(0 to  3);           --! Display Digit Drivers
59
    subtype  dispDat_t  is std_logic_vector(0 to 15);           --! Display Data type
60
    subtype  iodata_t   is std_logic_vector(0 to 23);           --! IO Bus
61
    subtype  led_t      is std_logic_vector(0 to  7);           --! LEDs
62
    subtype  btn_t      is std_logic_vector(0 to  3);           --! Push Buttons
63
    subtype  sw_t       is std_logic_vector(0 to  7);           --! Switches
64
 
65
    function to_octal(indat : data_t) return dispDat_t;
66
 
67
end nexys2_types;
68
 
69
--
70
--! NEXYS2 Type Definition Package Body
71
--
72
 
73
package body nexys2_types is
74
 
75
    --
76
    -- Function to convert data from octal to dispDat_t
77
    --
78
 
79
    function to_octal(indat : data_t) return dispDat_t is
80
    begin
81
        return '0' & indat(0 to 2) & '0' & indat(3 to 5) &
82
               '0' & indat(6 to 8) & '0' & indat(9 to 11);
83
    end to_octal;
84
 
85
end package body;

powered by: WebSVN 2.1.0

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