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

Subversion Repositories esoc

[/] [esoc/] [trunk/] [Sources/] [altera/] [esoc_port_mac/] [testbench/] [model/] [timing_adapter_8.vhd] - Blame information for rev 56

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 42 lmaarsen
-- -------------------------------------------------------------------------
2
-- -------------------------------------------------------------------------
3
--
4
-- Revision Control Information
5
--
6
-- $RCSfile: timing_adapter_8.vhd,v $
7
-- $Source: /ipbu/cvs/sio/projects/TriSpeedEthernet/src/testbench/models/vhdl/ethernet_model/gen/timing_adapter_8.vhd,v $
8
--
9
-- $Revision: #1 $
10
-- $Date: 2008/08/09 $
11
-- Check in by : $Author: sc-build $
12
-- Author      : SKNg
13
--
14
-- Project     : Triple Speed Ethernet - 10/100/1000 MAC
15
--
16
-- Description : Simulation Only
17
--
18
-- AVALON STREAMING TIMING ADAPTER FOR 8BIT IMPLEMENTATION
19
 
20
-- 
21
-- ALTERA Confidential and Proprietary
22
-- Copyright 2006 (c) Altera Corporation
23
-- All rights reserved
24
--
25
-- -------------------------------------------------------------------------
26
 
27
library ieee ;
28
use ieee.std_logic_1164.all ;
29
use ieee.std_logic_arith.all ;
30
use ieee.std_logic_unsigned.all ;
31
 
32
 
33
 
34
 
35
entity timing_adapter_8 is
36
port (
37
 
38
  -- Interface: clk                     
39
  clk                  : in std_logic;
40
  reset                : in std_logic;
41
  -- Interface: in
42
  in_ready              : out std_logic;
43
  in_valid              : in  std_logic;
44
  in_data               : in  std_logic_vector (7 downto 0);
45
  in_startofpacket      : in  std_logic;
46
  in_endofpacket        : in  std_logic;
47
  in_error              : in  std_logic;
48
  -- Interface: out
49
  out_ready             : in std_logic;
50
  out_valid             : out std_logic;
51
  out_data              : out std_logic_vector (7 downto 0);
52
  out_startofpacket     : out std_logic;
53
  out_endofpacket       : out std_logic;
54
  out_error             : out std_logic
55
);
56
end timing_adapter_8;
57
 
58
 
59
architecture Behav of timing_adapter_8 is
60
 
61
   -- Component instantiated by Turbo autoplace on 20/02/2008 at 23:58:54
62
   COMPONENT timing_adapter_fifo_8
63
 
64
        generic (
65
          DEPTH      : integer := 64;
66
          DATA_WIDTH : integer := 11;
67
          ADDR_WIDTH : integer := 6
68
        );
69
         PORT
70
         (
71
                 clk            :       IN  STD_LOGIC;
72
                 reset          :       IN  STD_LOGIC;
73
                 in_valid   :   in  std_logic;
74
                 in_data    :   in  std_logic_vector(10 downto 0);
75
                 out_ready      :       IN  STD_LOGIC;
76
 
77
                 in_ready       :       out  STD_LOGIC;
78
                 out_valid  :   out  std_logic;
79
                 out_data   :   out  std_logic_vector(10 downto 0);
80
                 fill_level :   out  std_logic_vector(6 downto 0)
81
         );
82
   END COMPONENT;
83
 
84
   -- ---------------------------------------------------------------------
85
   --| Signal Declarations
86
   -- ---------------------------------------------------------------------
87
 
88
   signal in_payload    : std_logic_vector(10 downto 0);
89
   signal out_payload   : std_logic_vector(10 downto 0);
90
   signal in_ready_wire : std_logic;
91
   signal out_valid_wire: std_logic;
92
   signal fifo_fill     : std_logic_vector(6 downto 0);
93
   signal ready         : std_logic;
94
 
95
begin
96
 
97
 
98
   -- ---------------------------------------------------------------------
99
   --| Payload Mapping
100
   -- ---------------------------------------------------------------------
101
   process (in_data,in_startofpacket,in_endofpacket,in_error,out_payload)
102
   begin
103
     in_payload <= in_data & in_startofpacket & in_endofpacket & in_error;
104
 
105
     out_data           <= out_payload(10 downto 3);
106
     out_startofpacket  <= out_payload(2);
107
     out_endofpacket    <= out_payload(1);
108
     out_error          <= out_payload(0);
109
 
110
   end process;
111
 
112
   -- ---------------------------------------------------------------------
113
   --| FIFO
114
   -- ---------------------------------------------------------------------
115
   u_timing_adapter_fifo_8: timing_adapter_fifo_8
116
   port map
117
     (
118
       clk       => clk,
119
       reset     => reset,
120
       in_ready  => open,
121
       in_valid  => in_valid,
122
       in_data   => in_payload,
123
       out_ready => ready,
124
       out_valid => out_valid_wire,
125
       out_data  => out_payload,
126
       fill_level=> fifo_fill
127
       );
128
 
129
   -- ---------------------------------------------------------------------
130
   --| Ready & valid signals.
131
   -- ---------------------------------------------------------------------
132
   process (fifo_fill, out_valid_wire, out_ready)
133
    begin
134
      if (fifo_fill < 48) then
135
        in_ready <= '1';
136
      else
137
        in_ready <= '0';
138
      end if;
139
 
140
      out_valid <= out_valid_wire;
141
      ready <= out_ready;
142
   end process;
143
 
144
 
145
end behav;
146
 

powered by: WebSVN 2.1.0

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