| 1 |
192 |
jshamlet |
-- Copyright (c)2020 Jeremy Seth Henry
|
| 2 |
|
|
-- All rights reserved.
|
| 3 |
|
|
--
|
| 4 |
|
|
-- Redistribution and use in source and binary forms, with or without
|
| 5 |
|
|
-- modification, are permitted provided that the following conditions are met:
|
| 6 |
|
|
-- * Redistributions of source code must retain the above copyright
|
| 7 |
|
|
-- notice, this list of conditions and the following disclaimer.
|
| 8 |
|
|
-- * Redistributions in binary form must reproduce the above copyright
|
| 9 |
|
|
-- notice, this list of conditions and the following disclaimer in the
|
| 10 |
|
|
-- documentation and/or other materials provided with the distribution,
|
| 11 |
|
|
-- where applicable (as part of a user interface, debugging port, etc.)
|
| 12 |
|
|
--
|
| 13 |
|
|
-- THIS SOFTWARE IS PROVIDED BY JEREMY SETH HENRY ``AS IS'' AND ANY
|
| 14 |
|
|
-- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
| 15 |
|
|
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 16 |
|
|
-- DISCLAIMED. IN NO EVENT SHALL JEREMY SETH HENRY BE LIABLE FOR ANY
|
| 17 |
|
|
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
| 18 |
|
|
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
| 19 |
|
|
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
| 20 |
|
|
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 21 |
|
|
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 22 |
|
|
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 23 |
|
|
--
|
| 24 |
|
|
-- VHDL Units : o8_sdlc_if
|
| 25 |
|
|
-- Description: Provides a full memory-mapped SDLC stack with automatic CRC16
|
| 26 |
|
|
-- Checksum insertion and integrity checking.
|
| 27 |
|
|
--
|
| 28 |
|
|
-- Transmit Memory Map
|
| 29 |
|
|
-- "0_0000_0000" (0x000) TX Buffer START
|
| 30 |
|
|
-- "0_1111_1101" (0x0FD) TX Buffer END
|
| 31 |
|
|
-- "0_1111_1110" (0x0FE) Clock Status*
|
| 32 |
|
|
-- "0_1111_1111" (0x0FF) TX Length / Status**
|
| 33 |
|
|
--
|
| 34 |
|
|
-- Receive Memory Map
|
| 35 |
|
|
-- "1_0000_0000" (0x100) RX Buffer START
|
| 36 |
196 |
jshamlet |
-- "1_1111_1101" (0x1FD) RX Buffer END
|
| 37 |
201 |
jshamlet |
-- "1_1111_1110" (0x0FE) RX Checksum Status***
|
| 38 |
|
|
-- "1_1111_1111" (0x1FF) RX Length Status****
|
| 39 |
192 |
jshamlet |
--
|
| 40 |
201 |
jshamlet |
-- * Address 0xFE reports the SDLC bit clock status and updates on changes.
|
| 41 |
|
|
-- 1) If BClk_Okay = '0' (Bitclock is NOT present), the field will report
|
| 42 |
|
|
-- 0x00. Otherwise, it will report 0xFF if the bitclock is present.
|
| 43 |
|
|
-- 2) Writing any value to the register will cause the controller to
|
| 44 |
|
|
-- silently reset the clock status without causing an interrupt.
|
| 45 |
199 |
jshamlet |
--
|
| 46 |
201 |
jshamlet |
-- ** This location serves as the control/status register for transmit
|
| 47 |
|
|
-- 1) Writing a value between 1 and 253 will trigger the transmit engine,
|
| 48 |
|
|
-- using the write value as the packet length.
|
| 49 |
|
|
-- 2) Values 0x00, 0xFE, or 0xFF are invalid, and will be ignored.
|
| 50 |
|
|
-- 3) This value will change from the user written value to 0xFF once the
|
| 51 |
|
|
-- packet is transmitted to indicate the transmission is complete.
|
| 52 |
199 |
jshamlet |
--
|
| 53 |
201 |
jshamlet |
-- *** This location serves as the status register for receive checksum test
|
| 54 |
|
|
-- 1) A value of 0x00 indicates the CRC did NOT match, while a value
|
| 55 |
|
|
-- of 0xFF indicates that the recieved CRC matches the calculated CRC.
|
| 56 |
|
|
--
|
| 57 |
|
|
-- **** This location serves as the status register for the receive
|
| 58 |
|
|
-- 1) This value is only updated on reception of a full frame, indicated
|
| 59 |
|
|
-- by a start followed by a stop flag. Incomplete frames are ignored.
|
| 60 |
204 |
jshamlet |
-- 2) If too many bytes are received (buffer overflow), a value of
|
| 61 |
201 |
jshamlet |
-- ERR_LENGTH is written.
|
| 62 |
192 |
jshamlet |
|
| 63 |
|
|
library ieee;
|
| 64 |
|
|
use ieee.std_logic_1164.all;
|
| 65 |
|
|
use ieee.std_logic_unsigned.all;
|
| 66 |
|
|
use ieee.std_logic_arith.all;
|
| 67 |
|
|
|
| 68 |
|
|
library work;
|
| 69 |
|
|
use work.open8_pkg.all;
|
| 70 |
|
|
|
| 71 |
|
|
library work;
|
| 72 |
|
|
use work.sdlc_serial_pkg.all;
|
| 73 |
|
|
|
| 74 |
|
|
entity o8_sdlc_if is
|
| 75 |
|
|
generic(
|
| 76 |
202 |
jshamlet |
Monitor_Enable : boolean := false;
|
| 77 |
199 |
jshamlet |
Attach_Monitor_to_CPU_Side : boolean := false;
|
| 78 |
192 |
jshamlet |
Poly_Init : std_logic_vector(15 downto 0) := x"0000";
|
| 79 |
|
|
Set_As_Master : boolean := true;
|
| 80 |
|
|
Clock_Offset : integer := 6;
|
| 81 |
|
|
BitClock_Freq : real := 500000.0;
|
| 82 |
|
|
Sys_Freq : real := 100000000.0;
|
| 83 |
|
|
Reset_Level : std_logic := '1';
|
| 84 |
|
|
Address : ADDRESS_TYPE
|
| 85 |
|
|
);
|
| 86 |
|
|
port(
|
| 87 |
|
|
Clock : in std_logic;
|
| 88 |
|
|
Reset : in std_logic;
|
| 89 |
|
|
--
|
| 90 |
223 |
jshamlet |
Open8_Bus : in OPEN8_BUS_TYPE;
|
| 91 |
192 |
jshamlet |
Rd_Data : out DATA_TYPE;
|
| 92 |
|
|
Interrupt : out std_logic;
|
| 93 |
|
|
-- Serial IO
|
| 94 |
|
|
SDLC_In : in std_logic;
|
| 95 |
|
|
SDLC_SClk : in std_logic;
|
| 96 |
|
|
SDLC_MClk : out std_logic;
|
| 97 |
|
|
SDLC_Out : out std_logic
|
| 98 |
|
|
);
|
| 99 |
|
|
end entity;
|
| 100 |
|
|
|
| 101 |
|
|
architecture behave of o8_sdlc_if is
|
| 102 |
|
|
|
| 103 |
|
|
constant Base_Addr : std_logic_vector(15 downto 9)
|
| 104 |
|
|
:= Address(15 downto 9);
|
| 105 |
|
|
|
| 106 |
223 |
jshamlet |
alias CPU_Upper_Addr is Open8_Bus.Address(15 downto 9);
|
| 107 |
205 |
jshamlet |
signal Base_Addr_Match : std_logic := '0';
|
| 108 |
192 |
jshamlet |
|
| 109 |
223 |
jshamlet |
alias DP_A_Addr is Open8_Bus.Address(8 downto 0);
|
| 110 |
205 |
jshamlet |
signal DP_A_Wr_En : std_logic := '0';
|
| 111 |
223 |
jshamlet |
alias DP_A_Wr_Data is Open8_Bus.Wr_Data;
|
| 112 |
205 |
jshamlet |
signal DP_A_Rd_En : std_logic := '0';
|
| 113 |
|
|
signal DP_A_Rd_Data : DATA_TYPE := OPEN8_NULLBUS;
|
| 114 |
192 |
jshamlet |
|
| 115 |
196 |
jshamlet |
constant Reg_Sub_Addr : std_logic_vector(8 downto 1) := x"7F";
|
| 116 |
223 |
jshamlet |
alias Reg_Upper_Addr is Open8_Bus.Address(8 downto 1);
|
| 117 |
|
|
alias Reg_Lower_Addr is Open8_Bus.Address(0);
|
| 118 |
196 |
jshamlet |
|
| 119 |
|
|
signal Reg_Addr : std_logic_vector(8 downto 1) := (others => '0');
|
| 120 |
205 |
jshamlet |
signal Reg_Sel : std_logic := '0';
|
| 121 |
|
|
signal Reg_Wr_En : std_logic := '0';
|
| 122 |
|
|
signal Reg_Clk_Sel : std_logic := '0';
|
| 123 |
|
|
signal Reg_TxS_Sel : std_logic := '0';
|
| 124 |
196 |
jshamlet |
|
| 125 |
205 |
jshamlet |
signal DP_B_Addr : std_logic_vector(8 downto 0) := (others => '0');
|
| 126 |
|
|
signal DP_B_Wr_Data : DATA_IN_TYPE := x"00";
|
| 127 |
|
|
signal DP_B_Wr_En : std_logic := '0';
|
| 128 |
|
|
signal DP_B_Rd_Data : DATA_IN_TYPE := x"00";
|
| 129 |
192 |
jshamlet |
|
| 130 |
202 |
jshamlet |
signal DP_Port0_Addr : DATA_IN_TYPE := x"00";
|
| 131 |
|
|
signal DP_Port0_RWn : std_logic := '0';
|
| 132 |
|
|
signal DP_Port0_WrData : DATA_IN_TYPE := x"00";
|
| 133 |
|
|
signal DP_Port0_RdData : DATA_IN_TYPE := x"00";
|
| 134 |
|
|
signal DP_Port0_Req : std_logic := '0';
|
| 135 |
|
|
signal DP_Port0_Ack : std_logic := '0';
|
| 136 |
|
|
|
| 137 |
|
|
signal DP_Port1_Addr : DATA_IN_TYPE := x"00";
|
| 138 |
|
|
signal DP_Port1_RWn : std_logic := '0';
|
| 139 |
|
|
signal DP_Port1_WrData : DATA_IN_TYPE := x"00";
|
| 140 |
|
|
signal DP_Port1_RdData : DATA_IN_TYPE := x"00";
|
| 141 |
|
|
signal DP_Port1_Req : std_logic := '0';
|
| 142 |
|
|
signal DP_Port1_Ack : std_logic := '0';
|
| 143 |
|
|
|
| 144 |
205 |
jshamlet |
signal BClk_RE : std_logic := '0';
|
| 145 |
|
|
signal BClk_FE : std_logic := '0';
|
| 146 |
202 |
jshamlet |
signal BClk_Okay : std_logic := '0';
|
| 147 |
192 |
jshamlet |
|
| 148 |
202 |
jshamlet |
signal TX_Wr_En : std_logic := '0';
|
| 149 |
|
|
signal TX_Wr_Flag : std_logic := '0';
|
| 150 |
|
|
signal TX_Wr_Data : DATA_IN_TYPE := x"00";
|
| 151 |
|
|
signal TX_Req_Next : std_logic := '0';
|
| 152 |
192 |
jshamlet |
|
| 153 |
202 |
jshamlet |
signal TX_CRC_Clr : std_logic := '0';
|
| 154 |
|
|
signal TX_CRC_En : std_logic := '0';
|
| 155 |
|
|
signal TX_CRC_Data : CRC_OUT_TYPE := x"0000";
|
| 156 |
|
|
signal TX_CRC_Valid : std_logic := '0';
|
| 157 |
192 |
jshamlet |
|
| 158 |
202 |
jshamlet |
signal TX_Interrupt : std_logic := '0';
|
| 159 |
192 |
jshamlet |
|
| 160 |
202 |
jshamlet |
signal RX_Valid : std_logic := '0';
|
| 161 |
|
|
signal RX_Flag : std_logic := '0';
|
| 162 |
|
|
signal RX_Data : DATA_IN_TYPE;
|
| 163 |
|
|
signal RX_Idle : std_logic := '0';
|
| 164 |
192 |
jshamlet |
|
| 165 |
202 |
jshamlet |
signal RX_Frame_Start : std_logic := '0';
|
| 166 |
|
|
signal RX_Frame_Stop : std_logic := '0';
|
| 167 |
|
|
signal RX_Frame_Valid : std_logic := '0';
|
| 168 |
|
|
signal RX_Frame_Data : DATA_IN_TYPE := x"00";
|
| 169 |
192 |
jshamlet |
|
| 170 |
202 |
jshamlet |
signal RX_CRC_Valid : std_logic := '0';
|
| 171 |
|
|
signal RX_CRC_Data : CRC_OUT_TYPE := x"0000";
|
| 172 |
|
|
|
| 173 |
|
|
signal RX_Interrupt : std_logic := '0';
|
| 174 |
|
|
|
| 175 |
192 |
jshamlet |
begin
|
| 176 |
|
|
|
| 177 |
202 |
jshamlet |
-- ***************************************************************************
|
| 178 |
|
|
-- * Open8 Bus Interface and Control Register Detection *
|
| 179 |
|
|
-- ***************************************************************************
|
| 180 |
|
|
|
| 181 |
192 |
jshamlet |
-- This decode needs to happen immediately, to give the RAM a chance to
|
| 182 |
|
|
-- do the lookup before we have to set Rd_Data
|
| 183 |
205 |
jshamlet |
Base_Addr_Match <= '1' when Base_Addr = CPU_Upper_Addr else '0';
|
| 184 |
223 |
jshamlet |
DP_A_Wr_En <= Base_Addr_Match and Open8_Bus.Wr_En;
|
| 185 |
192 |
jshamlet |
|
| 186 |
206 |
jshamlet |
CPU_IF_proc: process( Reset, Clock )
|
| 187 |
192 |
jshamlet |
begin
|
| 188 |
|
|
if( Reset = Reset_Level )then
|
| 189 |
|
|
Reg_Addr <= (others => '0');
|
| 190 |
|
|
Reg_Wr_En <= '0';
|
| 191 |
196 |
jshamlet |
Reg_Clk_Sel <= '0';
|
| 192 |
|
|
Reg_TxS_Sel <= '0';
|
| 193 |
205 |
jshamlet |
DP_A_Rd_En <= '0';
|
| 194 |
192 |
jshamlet |
Rd_Data <= OPEN8_NULLBUS;
|
| 195 |
206 |
jshamlet |
Interrupt <= '0';
|
| 196 |
192 |
jshamlet |
elsif( rising_edge(Clock) )then
|
| 197 |
196 |
jshamlet |
Reg_Addr <= Reg_Upper_Addr;
|
| 198 |
|
|
Reg_Sel <= Reg_Lower_Addr;
|
| 199 |
223 |
jshamlet |
Reg_Wr_En <= Base_Addr_Match and Open8_Bus.Wr_En;
|
| 200 |
192 |
jshamlet |
|
| 201 |
196 |
jshamlet |
Reg_Clk_Sel <= '0';
|
| 202 |
|
|
Reg_TxS_Sel <= '0';
|
| 203 |
192 |
jshamlet |
if( Reg_Addr = Reg_Sub_Addr )then
|
| 204 |
196 |
jshamlet |
Reg_Clk_Sel <= Reg_Wr_En and not Reg_Sel;
|
| 205 |
|
|
Reg_TxS_Sel <= Reg_Wr_En and Reg_Sel;
|
| 206 |
192 |
jshamlet |
end if;
|
| 207 |
|
|
|
| 208 |
223 |
jshamlet |
DP_A_Rd_En <= Base_Addr_Match and Open8_Bus.Rd_En;
|
| 209 |
192 |
jshamlet |
Rd_Data <= OPEN8_NULLBUS;
|
| 210 |
205 |
jshamlet |
if( DP_A_Rd_En = '1' )then
|
| 211 |
|
|
Rd_Data <= DP_A_Rd_Data;
|
| 212 |
192 |
jshamlet |
end if;
|
| 213 |
206 |
jshamlet |
|
| 214 |
|
|
Interrupt <= RX_Interrupt or TX_Interrupt;
|
| 215 |
192 |
jshamlet |
end if;
|
| 216 |
|
|
end process;
|
| 217 |
|
|
|
| 218 |
202 |
jshamlet |
-- ***************************************************************************
|
| 219 |
|
|
-- * Shared Dual-Port Memory *
|
| 220 |
|
|
-- ***************************************************************************
|
| 221 |
|
|
|
| 222 |
200 |
jshamlet |
U_RAM : entity work.sdlc_dp512b_ram
|
| 223 |
192 |
jshamlet |
port map(
|
| 224 |
|
|
clock => Clock,
|
| 225 |
205 |
jshamlet |
address_a => DP_A_Addr,
|
| 226 |
|
|
address_b => DP_B_Addr,
|
| 227 |
|
|
data_a => DP_A_Wr_Data,
|
| 228 |
|
|
data_b => DP_B_Wr_Data,
|
| 229 |
|
|
wren_a => DP_A_Wr_En,
|
| 230 |
|
|
wren_b => DP_B_Wr_En,
|
| 231 |
|
|
q_a => DP_A_Rd_Data,
|
| 232 |
|
|
q_b => DP_B_Rd_Data
|
| 233 |
192 |
jshamlet |
);
|
| 234 |
|
|
|
| 235 |
199 |
jshamlet |
Attach_to_CPU_side: if( Monitor_Enable and Attach_Monitor_to_CPU_Side )generate
|
| 236 |
|
|
|
| 237 |
|
|
U_MON: entity work.sdlc_monitor
|
| 238 |
|
|
port map(
|
| 239 |
|
|
clock => Clock,
|
| 240 |
205 |
jshamlet |
address => DP_A_Addr,
|
| 241 |
|
|
data => DP_A_Wr_Data,
|
| 242 |
|
|
wren => DP_A_Wr_En,
|
| 243 |
199 |
jshamlet |
q => open
|
| 244 |
|
|
);
|
| 245 |
|
|
end generate;
|
| 246 |
|
|
|
| 247 |
|
|
Attach_to_Int_side: if( Monitor_Enable and not Attach_Monitor_to_CPU_Side )generate
|
| 248 |
|
|
|
| 249 |
|
|
U_MON: entity work.sdlc_monitor
|
| 250 |
|
|
port map(
|
| 251 |
|
|
clock => Clock,
|
| 252 |
205 |
jshamlet |
address => DP_B_Addr,
|
| 253 |
|
|
data => DP_B_Wr_Data,
|
| 254 |
|
|
wren => DP_B_Wr_En,
|
| 255 |
199 |
jshamlet |
q => open
|
| 256 |
|
|
);
|
| 257 |
|
|
|
| 258 |
|
|
end generate;
|
| 259 |
|
|
|
| 260 |
202 |
jshamlet |
-- ***************************************************************************
|
| 261 |
|
|
-- * Memory Arbitration *
|
| 262 |
|
|
-- ***************************************************************************
|
| 263 |
|
|
|
| 264 |
|
|
U_ARB : entity work.sdlc_serial_arbfsm
|
| 265 |
|
|
generic map(
|
| 266 |
|
|
Reset_Level => Reset_Level
|
| 267 |
|
|
)
|
| 268 |
|
|
port map(
|
| 269 |
|
|
Clock => Clock,
|
| 270 |
|
|
Reset => Reset,
|
| 271 |
|
|
--
|
| 272 |
205 |
jshamlet |
DP_Addr => DP_B_Addr,
|
| 273 |
|
|
DP_Wr_Data => DP_B_Wr_Data,
|
| 274 |
|
|
DP_Wr_En => DP_B_Wr_En,
|
| 275 |
|
|
DP_Rd_Data => DP_B_Rd_Data,
|
| 276 |
|
|
--
|
| 277 |
202 |
jshamlet |
DP_Port0_Addr => DP_Port0_Addr,
|
| 278 |
|
|
DP_Port0_RWn => DP_Port0_RWn,
|
| 279 |
|
|
DP_Port0_WrData => DP_Port0_WrData,
|
| 280 |
|
|
DP_Port0_RdData => DP_Port0_RdData,
|
| 281 |
|
|
DP_Port0_Req => DP_Port0_Req,
|
| 282 |
|
|
DP_Port0_Ack => DP_Port0_Ack,
|
| 283 |
|
|
--
|
| 284 |
|
|
DP_Port1_Addr => DP_Port1_Addr,
|
| 285 |
|
|
DP_Port1_RWn => DP_Port1_RWn,
|
| 286 |
|
|
DP_Port1_WrData => DP_Port1_WrData,
|
| 287 |
|
|
DP_Port1_RdData => DP_Port1_RdData,
|
| 288 |
|
|
DP_Port1_Req => DP_Port1_Req,
|
| 289 |
205 |
jshamlet |
DP_Port1_Ack => DP_Port1_Ack
|
| 290 |
202 |
jshamlet |
);
|
| 291 |
|
|
|
| 292 |
|
|
-- ***************************************************************************
|
| 293 |
|
|
-- * Serial BitClock *
|
| 294 |
|
|
-- ***************************************************************************
|
| 295 |
|
|
|
| 296 |
192 |
jshamlet |
U_BCLK : entity work.sdlc_serial_clk
|
| 297 |
|
|
generic map(
|
| 298 |
|
|
Set_As_Master => Set_As_Master,
|
| 299 |
|
|
BitClock_Freq => BitClock_Freq,
|
| 300 |
|
|
Reset_Level => Reset_Level,
|
| 301 |
|
|
Sys_Freq => Sys_Freq
|
| 302 |
|
|
)
|
| 303 |
|
|
port map(
|
| 304 |
|
|
Clock => Clock,
|
| 305 |
|
|
Reset => Reset,
|
| 306 |
|
|
--
|
| 307 |
|
|
BClk_In => SDLC_SClk,
|
| 308 |
|
|
BClk_Out => SDLC_MClk,
|
| 309 |
|
|
BClk_FE => BClk_FE,
|
| 310 |
|
|
BClk_RE => BClk_RE,
|
| 311 |
|
|
BClk_Okay => BClk_Okay
|
| 312 |
|
|
);
|
| 313 |
|
|
|
| 314 |
202 |
jshamlet |
-- ***************************************************************************
|
| 315 |
|
|
-- * Serial Transmit Path *
|
| 316 |
|
|
-- ***************************************************************************
|
| 317 |
|
|
|
| 318 |
|
|
U_TXFSM: entity work.sdlc_serial_txfsm
|
| 319 |
192 |
jshamlet |
generic map(
|
| 320 |
|
|
Reset_Level => Reset_Level
|
| 321 |
|
|
)
|
| 322 |
|
|
port map(
|
| 323 |
|
|
Clock => Clock,
|
| 324 |
|
|
Reset => Reset,
|
| 325 |
|
|
--
|
| 326 |
|
|
BClk_Okay => BClk_Okay,
|
| 327 |
|
|
--
|
| 328 |
196 |
jshamlet |
Reg_Clk_Sel => Reg_Clk_Sel,
|
| 329 |
|
|
Reg_TxS_Sel => Reg_TxS_Sel,
|
| 330 |
192 |
jshamlet |
--
|
| 331 |
202 |
jshamlet |
DP_Port0_Addr => DP_Port0_Addr,
|
| 332 |
|
|
DP_Port0_RWn => DP_Port0_RWn,
|
| 333 |
|
|
DP_Port0_WrData => DP_Port0_WrData,
|
| 334 |
|
|
DP_Port0_RdData => DP_Port0_RdData,
|
| 335 |
|
|
DP_Port0_Req => DP_Port0_Req,
|
| 336 |
|
|
DP_Port0_Ack => DP_Port0_Ack,
|
| 337 |
192 |
jshamlet |
--
|
| 338 |
|
|
TX_Wr_En => TX_Wr_En,
|
| 339 |
|
|
TX_Wr_Flag => TX_Wr_Flag,
|
| 340 |
|
|
TX_Wr_Data => TX_Wr_Data,
|
| 341 |
|
|
TX_Req_Next => TX_Req_Next,
|
| 342 |
|
|
--
|
| 343 |
|
|
TX_CRC_Clr => TX_CRC_Clr,
|
| 344 |
|
|
TX_CRC_En => TX_CRC_En,
|
| 345 |
|
|
TX_CRC_Data => TX_CRC_Data,
|
| 346 |
|
|
TX_CRC_Valid => TX_CRC_Valid,
|
| 347 |
|
|
--
|
| 348 |
202 |
jshamlet |
TX_Interrupt => TX_Interrupt
|
| 349 |
|
|
);
|
| 350 |
|
|
|
| 351 |
|
|
U_TX_CRC : entity work.sdlc_crc16_ccitt
|
| 352 |
|
|
generic map(
|
| 353 |
|
|
Poly_Init => Poly_Init,
|
| 354 |
|
|
Reset_Level => Reset_Level
|
| 355 |
|
|
)
|
| 356 |
|
|
port map(
|
| 357 |
|
|
Clock => Clock,
|
| 358 |
|
|
Reset => Reset,
|
| 359 |
192 |
jshamlet |
--
|
| 360 |
202 |
jshamlet |
Clear => TX_CRC_Clr,
|
| 361 |
|
|
Wr_En => TX_CRC_En,
|
| 362 |
|
|
Wr_Data => TX_Wr_Data,
|
| 363 |
192 |
jshamlet |
--
|
| 364 |
202 |
jshamlet |
CRC16_Valid => TX_CRC_Valid,
|
| 365 |
|
|
CRC16_Out => TX_CRC_Data
|
| 366 |
192 |
jshamlet |
);
|
| 367 |
|
|
|
| 368 |
|
|
U_TX_SER : entity work.sdlc_serial_tx
|
| 369 |
|
|
generic map(
|
| 370 |
|
|
Reset_Level => Reset_Level
|
| 371 |
|
|
)
|
| 372 |
|
|
port map(
|
| 373 |
|
|
Clock => Clock,
|
| 374 |
|
|
Reset => Reset,
|
| 375 |
|
|
--
|
| 376 |
|
|
BClk_FE => BClk_FE,
|
| 377 |
|
|
BClk_RE => BClk_RE,
|
| 378 |
|
|
BClk_Okay => BClk_Okay,
|
| 379 |
|
|
--
|
| 380 |
|
|
TX_En => TX_Wr_En,
|
| 381 |
|
|
TX_FSS_Flag => TX_Wr_Flag,
|
| 382 |
|
|
TX_Data => TX_Wr_Data,
|
| 383 |
|
|
TX_Req_Next => TX_Req_Next,
|
| 384 |
|
|
--
|
| 385 |
|
|
Serial_Out => SDLC_Out
|
| 386 |
|
|
);
|
| 387 |
|
|
|
| 388 |
202 |
jshamlet |
-- ***************************************************************************
|
| 389 |
|
|
-- * Serial Receive Path *
|
| 390 |
|
|
-- ***************************************************************************
|
| 391 |
192 |
jshamlet |
|
| 392 |
|
|
U_RX_SER : entity work.sdlc_serial_rx
|
| 393 |
|
|
generic map(
|
| 394 |
|
|
Set_As_Master => Set_As_Master,
|
| 395 |
|
|
Clock_Offset => Clock_Offset,
|
| 396 |
|
|
Reset_Level => Reset_Level
|
| 397 |
|
|
)
|
| 398 |
|
|
port map(
|
| 399 |
|
|
Clock => Clock,
|
| 400 |
|
|
Reset => Reset,
|
| 401 |
|
|
--
|
| 402 |
|
|
BClk_RE => BClk_RE,
|
| 403 |
|
|
BClk_Okay => BClk_Okay,
|
| 404 |
|
|
--
|
| 405 |
|
|
Serial_In => SDLC_In,
|
| 406 |
|
|
--
|
| 407 |
|
|
RX_Valid => RX_Valid,
|
| 408 |
|
|
RX_Flag => RX_Flag,
|
| 409 |
|
|
RX_Data => RX_Data,
|
| 410 |
|
|
RX_Idle => RX_Idle
|
| 411 |
|
|
);
|
| 412 |
|
|
|
| 413 |
202 |
jshamlet |
U_RX_PKT : entity work.sdlc_serial_frame
|
| 414 |
|
|
generic map(
|
| 415 |
|
|
Reset_Level => Reset_Level
|
| 416 |
|
|
)
|
| 417 |
|
|
port map(
|
| 418 |
|
|
Clock => Clock,
|
| 419 |
|
|
Reset => Reset,
|
| 420 |
|
|
--
|
| 421 |
|
|
RX_Valid => RX_Valid,
|
| 422 |
|
|
RX_Flag => RX_Flag,
|
| 423 |
|
|
RX_Data => RX_Data,
|
| 424 |
|
|
RX_Idle => RX_Idle,
|
| 425 |
|
|
--
|
| 426 |
|
|
RX_Frame_Start => RX_Frame_Start,
|
| 427 |
|
|
RX_Frame_Stop => RX_Frame_Stop,
|
| 428 |
|
|
RX_Frame_Valid => RX_Frame_Valid,
|
| 429 |
|
|
RX_Frame_Data => RX_Frame_Data
|
| 430 |
|
|
);
|
| 431 |
|
|
|
| 432 |
192 |
jshamlet |
U_RX_CRC : entity work.sdlc_crc16_ccitt
|
| 433 |
|
|
generic map(
|
| 434 |
|
|
Poly_Init => Poly_Init,
|
| 435 |
|
|
Reset_Level => Reset_Level
|
| 436 |
|
|
)
|
| 437 |
|
|
port map(
|
| 438 |
|
|
Clock => Clock,
|
| 439 |
|
|
Reset => Reset,
|
| 440 |
|
|
--
|
| 441 |
202 |
jshamlet |
Clear => RX_Frame_Start,
|
| 442 |
|
|
Wr_En => RX_Frame_Valid,
|
| 443 |
|
|
Wr_Data => RX_Frame_Data,
|
| 444 |
192 |
jshamlet |
--
|
| 445 |
202 |
jshamlet |
CRC16_Valid => RX_CRC_Valid,
|
| 446 |
|
|
CRC16_Out => RX_CRC_Data
|
| 447 |
192 |
jshamlet |
);
|
| 448 |
|
|
|
| 449 |
202 |
jshamlet |
U_RX_FSM : entity work.sdlc_serial_rxfsm
|
| 450 |
|
|
generic map(
|
| 451 |
|
|
Reset_Level => Reset_Level
|
| 452 |
|
|
)
|
| 453 |
|
|
port map(
|
| 454 |
|
|
Clock => Clock,
|
| 455 |
|
|
Reset => Reset,
|
| 456 |
|
|
--
|
| 457 |
|
|
BClk_Okay => BClk_Okay,
|
| 458 |
|
|
--
|
| 459 |
|
|
DP_Port1_Addr => DP_Port1_Addr,
|
| 460 |
|
|
DP_Port1_RWn => DP_Port1_RWn,
|
| 461 |
|
|
DP_Port1_WrData => DP_Port1_WrData,
|
| 462 |
|
|
DP_Port1_RdData => DP_Port1_RdData,
|
| 463 |
|
|
DP_Port1_Req => DP_Port1_Req,
|
| 464 |
|
|
DP_Port1_Ack => DP_Port1_Ack,
|
| 465 |
|
|
--
|
| 466 |
|
|
RX_CRC_Valid => RX_CRC_Valid,
|
| 467 |
|
|
RX_CRC_Data => RX_CRC_Data,
|
| 468 |
|
|
--
|
| 469 |
|
|
RX_Frame_Start => RX_Frame_Start,
|
| 470 |
|
|
RX_Frame_Stop => RX_Frame_Stop,
|
| 471 |
|
|
RX_Frame_Valid => RX_Frame_Valid,
|
| 472 |
|
|
RX_Frame_Data => RX_Frame_Data,
|
| 473 |
|
|
--
|
| 474 |
|
|
RX_Interrupt => RX_Interrupt
|
| 475 |
|
|
);
|
| 476 |
|
|
|
| 477 |
192 |
jshamlet |
end architecture;
|