w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tbd_serport_autobaud.vhd
Go to the documentation of this file.
1-- $Id: tbd_serport_autobaud.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2007-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tbd_serport_autobaud - syn
7-- Description: Wrapper for serport_uart_autobaud and serport_uart_rxtx to
8-- avoid records. It has a port interface which will not be
9-- modified by xst synthesis (no records, no generic port).
10--
11-- Dependencies: clkdivce
12-- serport_uart_autobaud
13-- serport_uart_rxtx
14-- serport_uart_rx
15--
16-- To test: serport_uart_autobaud
17-- serport_uart_rxtx
18--
19-- Target Devices: generic
20--
21-- Synthesized (xst):
22-- Date Rev ise Target flop lutl lutm slic t peri
23-- 2007-10-27 92 9.2.02 J39 xc3s1000-4 151 291 0 - t 9.23
24-- 2007-10-27 92 9.1 J30 xc3s1000-4 151 291 0 - t 9.23
25-- 2007-10-27 92 8.2.03 I34 xc3s1000-4 153 338 0 178 s 9.45
26-- 2007-10-27 92 8.1.03 I27 xc3s1000-4 152 293 0 - s 9.40
27--
28-- Tool versions: xst 8.2-14.7; ghdl 0.18-0.31
29-- Revision History:
30-- Date Rev Version Comment
31-- 2008-01-20 112 1.0.1 rename clkgen->clkdivce
32-- 2007-06-24 60 1.0 Initial version
33------------------------------------------------------------------------------
34
35library ieee;
36use ieee.std_logic_1164.all;
37use ieee.numeric_std.all;
38
39use work.slvtypes.all;
40use work.genlib.all;
41use work.serportlib.all;
42
43entity tbd_serport_autobaud is -- serial port autobaud [tb design]
44 port (
45 CLK : in slbit; -- clock
46 RESET : in slbit; -- reset
47 RXSD : in slbit; -- receive serial data (uart view)
48 CE_USEC : out slbit; -- usec pulse (here every 4 clocks)
49 CE_MSEC : out slbit; -- msec pulse (here every 20 clocks)
50 CLKDIV : out slv13; -- clock divider setting
51 ABACT : out slbit; -- autobaud active
52 ABDONE : out slbit; -- autobaud done
53 RXDATA : out slv8; -- receiver data out (1st rx)
54 RXVAL : out slbit; -- receiver data valid (1st rx)
55 RXERR : out slbit; -- receiver data error (1st rx)
56 RXACT : out slbit; -- receiver active (1st rx)
57 TXSD2 : out slbit; -- transmit serial data (2nd tx)
58 RXDATA3 : out slv8; -- receiver data out (3rd rx)
59 RXVAL3 : out slbit; -- receiver data valid (3rd rx)
60 RXERR3 : out slbit; -- receiver data error (3rd rx)
61 RXACT3 : out slbit -- receiver active (3rd rx)
62 );
64
65
66architecture syn of tbd_serport_autobaud is
67
68 constant cdwidth : positive := 13;
69
70 signal LCE_MSEC : slbit := '0';
71 signal LCLKDIV : slv13 := (others=>'0');
72 signal LRXDATA : slv8 := (others=>'0');
73 signal LRXVAL : slbit := '0';
74 signal LTXSD2 : slbit := '0';
75 signal LABACT : slbit := '0';
76
77begin
78
79 CKLDIV : clkdivce
80 generic map (
81 CDUWIDTH => 6,
82 USECDIV => 4,
83 MSECDIV => 5)
84 port map (
85 CLK => CLK,
88 );
89
90 AUTOBAUD : serport_uart_autobaud
91 generic map (
93 CDINIT => 15)
94 port map (
95 CLK => CLK,
97 RESET => RESET,
98 RXSD => RXSD,
99 CLKDIV => LCLKDIV,
100 ACT => LABACT,
101 DONE => ABDONE
102 );
103
104 UART1 : serport_uart_rxtx
105 generic map (
106 CDWIDTH => cdwidth)
107 port map (
108 CLK => CLK,
109 RESET => LABACT,
110 CLKDIV => LCLKDIV,
111 RXSD => RXSD,
112 RXDATA => LRXDATA,
113 RXVAL => LRXVAL,
114 RXERR => RXERR,
115 RXACT => RXACT,
116 TXSD => LTXSD2,
117 TXDATA => LRXDATA,
118 TXENA => LRXVAL,
119 TXBUSY => open
120 );
121
122 UART2 : serport_uart_rx
123 generic map (
124 CDWIDTH => cdwidth)
125 port map (
126 CLK => CLK,
127 RESET => LABACT,
128 CLKDIV => LCLKDIV,
129 RXSD => LTXSD2,
130 RXDATA => RXDATA3,
131 RXVAL => RXVAL3,
132 RXERR => RXERR3,
133 RXACT => RXACT3
134 );
135
136 CE_MSEC <= LCE_MSEC;
137 CLKDIV <= LCLKDIV;
138 ABACT <= LABACT;
139 RXDATA <= LRXDATA;
140 RXVAL <= LRXVAL;
141 TXSD2 <= LTXSD2;
142
143end syn;
out CE_MSEC slbit
Definition: clkdivce.vhd:39
USECDIV positive := 50
Definition: clkdivce.vhd:33
CDUWIDTH positive := 6
Definition: clkdivce.vhd:32
out CE_USEC slbit
Definition: clkdivce.vhd:37
MSECDIV positive := 1000
Definition: clkdivce.vhd:34
in CLK slbit
Definition: clkdivce.vhd:36
out CLKDIV slv( CDWIDTH- 1 downto 0)
CDWIDTH positive := 13
in CLKDIV slv( CDWIDTH- 1 downto 0)
CDWIDTH positive := 13
in CLKDIV slv( CDWIDTH- 1 downto 0)
std_logic_vector( 12 downto 0) slv13
Definition: slvtypes.vhd:45
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
slv13 :=( others => '0') LCLKDIV
slv8 :=( others => '0') LRXDATA