w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
pdp11_dspmux.vhd
Go to the documentation of this file.
1-- $Id: pdp11_dspmux.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2015-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: pdp11_dspmux - syn
7-- Description: pdp11: hio dsp mux
8--
9-- Dependencies: -
10-- Test bench: -
11-- Target Devices: generic
12-- Tool versions: ise 14.7; viv 2018.2; ghdl 0.31-0.34
13--
14-- Revision History:
15-- Date Rev Version Comment
16-- 2018-10-07 1054 1.1 use DM_STAT_EXP instead of DM_STAT_DP
17-- 2015-02-22 650 1.0 Initial version
18-- 2015-02-21 649 0.1 First draft
19------------------------------------------------------------------------------
20-- selects display data
21-- 4 Digit Displays
22-- SEL(1:0) 00 ABCLKDIV
23-- 01 DM_STAT_EXP.dp_pc
24-- 10 DISPREG
25-- 11 DM_STAT_EXP.dp_dsrc
26--
27-- 8 Digit Displays
28-- SEL(1) select DSP(7:4)
29-- 0 ABCLKDIV
30-- 1 DM_STAT_EXP.dp_pc
31-- SEL(0) select DSP(7:4)
32-- 0 DISPREG
33-- 1 DM_STAT_EXP.dp_dsrc
34--
35
36library ieee;
37use ieee.std_logic_1164.all;
38use ieee.numeric_std.all;
39
40use work.slvtypes.all;
41use work.pdp11.all;
42
43-- ----------------------------------------------------------------------------
44
45entity pdp11_dspmux is -- hio dsp mux
46 generic (
47 DCWIDTH : positive := 2); -- digit counter width (2 or 3)
48 port (
49 SEL : in slv2; -- select
50 ABCLKDIV : in slv16; -- serport clock divider
51 DM_STAT_EXP : in dm_stat_exp_type; -- debug and monitor - exports
52 DISPREG : in slv16; -- display register
53 DSP_DAT : out slv(4*(2**DCWIDTH)-1 downto 0) -- display data
54 );
55end pdp11_dspmux;
56
57architecture syn of pdp11_dspmux is
58
59 subtype dspdat_msb is integer range 4*(2**DCWIDTH)-1 downto 4*(2**DCWIDTH)-16;
60 subtype dspdat_lsb is integer range 15 downto 0;
61
62begin
63
64 assert DCWIDTH=2 or DCWIDTH=3
65 report "assert(DCWIDTH=2 or DCWIDTH=3): unsupported DCWIDTH"
66 severity failure;
67
68 proc_mux: process (SEL, ABCLKDIV, DM_STAT_EXP, DISPREG)
69 variable idat : slv(4*(2**DCWIDTH)-1 downto 0) := (others=>'0');
70 begin
71 idat := (others=>'0');
72
73 if DCWIDTH = 2 then
74
75 case SEL is
76 when "00" =>
77 idat(dspdat_lsb) := ABCLKDIV;
78 when "01" =>
79 idat(dspdat_lsb) := DM_STAT_EXP.dp_pc;
80 when "10" =>
81 idat(dspdat_lsb) := DISPREG;
82 when "11" =>
83 idat(dspdat_lsb) := DM_STAT_EXP.dp_dsrc;
84 when others => null;
85 end case;
86
87 else
88
89 if SEL(1) = '0' then
90 idat(dspdat_msb) := ABCLKDIV;
91 else
92 idat(dspdat_msb) := DM_STAT_EXP.dp_pc;
93 end if;
94
95 if SEL(0) = '0' then
96 idat(dspdat_lsb) := DISPREG;
97 else
98 idat(dspdat_lsb) := DM_STAT_EXP.dp_dsrc;
99 end if;
100
101 end if;
102
103 DSP_DAT <= idat;
104
105 end process proc_mux;
106
107end syn;
integer range 4*( 2** DCWIDTH)- 1 downto 4*( 2** DCWIDTH)- 16 dspdat_msb
integer range 15 downto 0 dspdat_lsb
in ABCLKDIV slv16
in SEL slv2
DCWIDTH positive := 2
out DSP_DAT slv( 4*( 2** DCWIDTH)- 1 downto 0)
in DISPREG slv16
in DM_STAT_EXP dm_stat_exp_type
Definition: pdp11.vhd:123
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic_vector( 1 downto 0) slv2
Definition: slvtypes.vhd:34
std_logic_vector slv
Definition: slvtypes.vhd:31