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

Subversion Repositories open_free_list

[/] [open_free_list/] [trunk/] [sim/] [alt_scfifo.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 amif2000
// megafunction wizard: %FIFO%
2
// GENERATION: STANDARD
3
// VERSION: WM1.0
4
// MODULE: scfifo
5
 
6
// ============================================================
7
// File Name: sc_fifo.v
8
// Megafunction Name(s):
9
//                      scfifo
10
//
11
// Simulation Library Files(s):
12
//                      altera_mf
13
// ============================================================
14
// ************************************************************
15
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
16
//
17
// 7.2 Build 175 11/20/2007 SP 1 SJ Full Version
18
// ************************************************************
19
 
20
 
21
//Copyright (C) 1991-2007 Altera Corporation
22
//Your use of Altera Corporation's design tools, logic functions
23
//and other software and tools, and its AMPP partner logic
24
//functions, and any output files from any of the foregoing
25
//(including device programming or simulation files), and any
26
//associated documentation or information are expressly subject
27
//to the terms and conditions of the Altera Program License
28
//Subscription Agreement, Altera MegaCore Function License
29
//Agreement, or other applicable license agreement, including,
30
//without limitation, that your use is for the sole purpose of
31
//programming logic devices manufactured by Altera and sold by
32
//Altera or its authorized distributors.  Please refer to the
33
//applicable agreement for further details.
34
 
35
module alt_scfifo (
36
   aclr,
37
   clock,
38
   data,
39
   rdreq,
40
   sclr,
41
   wrreq,
42
   almost_empty,
43
   almost_full,
44
   empty,
45
   full,
46
   q,
47
   usedw,
48
   fifo_ovf,
49
   fifo_unf
50
);
51
 
52
   parameter                 FIFO_WIDTH    = 144;
53
   parameter                 FIFO_DEPTH    = 7;
54
   parameter                 FIFO_TYPE     = "AUTO";
55
   parameter                 FIFO_SHOW     = "OFF";
56
   parameter                 USE_EAB       = "ON";
57
 
58
   parameter                 FIFO_NUMWORDS = 1 << FIFO_DEPTH;
59
   parameter                 FIFO_AEMPTY   = 0;
60
   parameter                 FIFO_AFULL    = FIFO_NUMWORDS;
61
   parameter                 FIFO_UNF      = "TRUE";
62
 
63
   parameter                 TYPE          = FIFO_TYPE == "M4K"   | FIFO_TYPE == "M9K"  ?  "RAM_BLOCK_TYPE=M9K":
64
                                             FIFO_TYPE == "M512"  | FIFO_TYPE == "MLAB" ?  "RAM_BLOCK_TYPE=MLAB":
65
                                             FIFO_TYPE == "M-RAM" | FIFO_TYPE == "M144K"?  "RAM_BLOCK_TYPE=M144K":
66
                                                                                           "RAM_BLOCK_TYPE=AUTO";
67
 
68
   input                     aclr;
69
   input                     clock;
70
   input [FIFO_WIDTH-1:0]    data;
71
   input                     rdreq;
72
   input                     sclr;
73
   input                     wrreq;
74
   output                    almost_empty;
75
   output                    almost_full;
76
   output                    empty;
77
   output                    full;
78
   output [FIFO_WIDTH-1:0]   q;
79
   output [FIFO_DEPTH-1:0]   usedw;
80
   output                    fifo_ovf;
81
   output                    fifo_unf;
82
 
83
   reg                       fifo_ovf;
84
   reg                       fifo_unf;
85
 
86
   always @ (posedge clock or posedge aclr)
87
     if (aclr) begin
88
        fifo_ovf <= 1'b0;
89
        fifo_unf <= 1'b0;
90
     end
91
     else begin
92
        // synthesis translate_off
93
        if (fifo_ovf) begin
94
           $display ("%m: ERROR!!! %m alt_scfifo FIFO overflow, simulation stop");
95
           $stop;
96
        end
97
        if (fifo_unf & (FIFO_UNF == "TRUE")) begin
98
           $display ("%m: ERROR!!! alt_dcfifo FIFO underflow, simulation stop");
99
           $stop;
100
        end
101
        // synthesis translate_on
102
        fifo_ovf <=  (full  & wrreq) | fifo_ovf;
103
        fifo_unf <= ((empty & rdreq) | fifo_unf) & (FIFO_UNF == "TRUE");
104
     end
105
 
106
   scfifo scfifo_component (
107
      .rdreq       (rdreq),
108
      .sclr        (sclr),
109
      .aclr        (aclr),
110
      .clock       (clock),
111
      .wrreq       (wrreq),
112
      .data        (data),
113
      .almost_full (almost_full),
114
      .usedw       (usedw),
115
      .empty       (empty),
116
      .almost_empty(almost_empty),
117
      .q           (q),
118
      .full        (full)
119
      );
120
   defparam
121
           scfifo_component.add_ram_output_register = "ON",
122
           scfifo_component.almost_empty_value = FIFO_AEMPTY,
123
           scfifo_component.almost_full_value = FIFO_AFULL,
124
           scfifo_component.intended_device_family = "Stratix III",
125
           scfifo_component.lpm_hint = TYPE,
126
           scfifo_component.lpm_numwords = FIFO_NUMWORDS,
127
           scfifo_component.lpm_showahead = FIFO_SHOW,
128
           scfifo_component.lpm_type = "scfifo",
129
           scfifo_component.lpm_width = FIFO_WIDTH,
130
           scfifo_component.lpm_widthu = FIFO_DEPTH,
131
           scfifo_component.overflow_checking = "ON",
132
           scfifo_component.underflow_checking = "ON",
133
           scfifo_component.use_eab = USE_EAB;
134
endmodule // alt_scfifo

powered by: WebSVN 2.1.0

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