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

Subversion Repositories sgmii

[/] [sgmii/] [trunk/] [sim/] [BFMs/] [SGMII_altera/] [testbench/] [model/] [loopback_adapter.v] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jefflieu
// -------------------------------------------------------------------------
2
// -------------------------------------------------------------------------
3
//
4
// Revision Control Information
5
//
6
// $RCSfile: altera_tse_timing_adapter8.v,v $
7
// $Source: /ipbu/cvs/sio/projects/TriSpeedEthernet/src/RTL/MAC/mac/timing_adapter/altera_tse_timing_adapter8.v,v $
8
//
9
// $Revision: #1 $
10 20 jefflieu
// $Date: 2012/06/21 $
11
// Check in by : $Author: swbranch $
12 9 jefflieu
// 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
 
28
module loopback_adapter (
29
 
30
  // Interface: clk                     
31
  input              clk,
32
  input              reset,
33
  // Interface: in
34
  output reg         in_ready,
35
  input              in_valid,
36
  input      [7: 0]  in_data,
37
  input              in_startofpacket,
38
  input              in_endofpacket,
39
  input      [4:0]   in_error,
40
  // Interface: out
41
  input              out_ready,
42
  output reg         out_valid,
43
  output reg [7: 0]  out_data,
44
  output reg         out_startofpacket,
45
  output reg         out_endofpacket,
46
  output reg         out_error
47
);
48
 
49
 
50
 
51
 
52
 
53
   // ---------------------------------------------------------------------
54
   //| Signal Declarations
55
   // ---------------------------------------------------------------------
56
 
57
   reg  [10: 0] in_payload;
58
   wire [10: 0] out_payload;
59
   wire         in_ready_wire;
60
   wire         out_valid_wire;
61
   wire [ 6: 0] fifo_fill;
62
   reg          ready;
63
   wire in_err;
64
 
65
   assign in_err = in_error[0]|in_error[1]|in_error[2]|in_error[3]|in_error[4];
66
   // ---------------------------------------------------------------------
67
   //| Payload Mapping
68
   // ---------------------------------------------------------------------
69
   always @ (in_data or in_startofpacket or in_endofpacket or in_err or out_payload)
70
   begin
71
     in_payload = {in_data,in_startofpacket,in_endofpacket,in_err};
72
     {out_data,out_startofpacket,out_endofpacket,out_error} = out_payload;
73
   end
74
 
75
   // ---------------------------------------------------------------------
76
   //| FIFO
77
   // ---------------------------------------------------------------------
78
   loopback_adapter_fifo u_loopback_adapter_fifo
79
     (
80
       .clk        (clk),
81
       .reset      (reset),
82
       .in_ready   (),
83
       .in_valid   (in_valid),
84
       .in_data    (in_payload),
85
       .out_ready  (ready),
86
       .out_valid  (out_valid_wire),
87
       .out_data   (out_payload),
88
       .fill_level (fifo_fill)
89
       );
90
 
91
   // ---------------------------------------------------------------------
92
   //| Ready & valid signals.
93
   // ---------------------------------------------------------------------
94
   always @ (fifo_fill or out_valid_wire or out_ready)
95
    begin
96
      in_ready <= (fifo_fill < 48);       //was 40
97
      out_valid <= out_valid_wire;
98
      ready = out_ready;
99
   end
100
 
101
 
102
endmodule
103
 

powered by: WebSVN 2.1.0

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