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

Subversion Repositories alu_with_selectable_inputs_and_outputs

[/] [alu_with_selectable_inputs_and_outputs/] [trunk/] [verif_env/] [collectors/] [output_collector.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dragos_don
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////      This project has been provided to you on behalf of:    ////
4
////                                                             ////
5
////            S.C. ASICArt S.R.L.                              ////
6
////                            www.asicart.com                  ////
7
////                            eli_f@asicart.com                ////
8
////                                                             ////
9
////        Author: Dragos Constantin Doncean                    ////
10
////        Email: doncean@asicart.com                           ////
11
////        Mobile: +40-740-936997                               ////
12
////                                                             ////
13
////      Downloaded from: http://www.opencores.org/             ////
14
////                                                             ////
15
/////////////////////////////////////////////////////////////////////
16
////                                                             ////
17
//// Copyright (C) 2007 Dragos Constantin Doncean                ////
18
////                         www.asicart.com                     ////
19
////                         doncean@asicart.com                 ////
20
////                                                             ////
21
//// This source file may be used and distributed without        ////
22
//// restriction provided that this copyright statement is not   ////
23
//// removed from the file and that any derivative work contains ////
24
//// the original copyright notice and the associated disclaimer.////
25
////                                                             ////
26
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
27
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
28
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
29
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
30
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
31
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
32
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
33
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
34
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
35
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
36
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
37
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
38
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
39
////                                                             ////
40
/////////////////////////////////////////////////////////////////////
41
 
42
 
43
//----------------Collectors----------------
44
 
45
//OUTPUT COLLECTOR
46
 
47
module OUTPUT_COLLECTOR(oc_clk, oc_res,
48
        oc_valid_0, oc_valid_1,
49
        oc_out_0, oc_out_1,
50
        oc_parity_0, oc_parity_1,
51
        oc_data,
52
        oc_parity,
53
        oc_data_collected);
54
 
55
input oc_clk, oc_res;
56
input oc_valid_0, oc_valid_1;
57
input [15:0] oc_out_0, oc_out_1;
58
input oc_parity_0, oc_parity_1;
59
output [15:0] oc_data;
60
output oc_parity;
61
output [0:127] oc_data_collected;
62
 
63
reg [15:0] oc_data;
64
reg oc_parity;
65
reg [0:127] oc_data_collected;
66
 
67
integer i;
68
integer fh;
69
 
70
always @ (posedge oc_clk or posedge oc_res)
71
if(oc_res)
72
begin
73
        i = 0;
74
        oc_data = 0;
75
        oc_parity = 0;
76
        oc_data_collected = 0;
77
end
78
else
79
begin
80
        if(oc_valid_0)
81
        begin
82
                oc_data = oc_out_0;
83
                oc_parity = oc_parity_0;
84
                oc_data_collected[i] = 1;
85
                i = i + 1;
86
        end
87
        if(oc_valid_1)
88
        begin
89
                oc_data = oc_out_1;
90
                oc_parity = oc_parity_1;
91
                oc_data_collected[i] = 1;
92
                i = i + 1;
93
        end
94
end
95
 
96
//Print OUTPUT COLLECTOR buffer contents
97
always @ (i)
98
begin
99
        if(fh === 32'bx)
100
                fh = $fopen("output_collector.out");
101
 
102
        $fdisplay(fh, "%0d INFO: Output Transaction no: %0d", $time, i);
103
        $fdisplay(fh, "%0d INFO: oc_data = %b", $time, oc_data);
104
        $fdisplay(fh, "%0d INFO: oc_parity = %b\n", $time, oc_parity);
105
 
106
        //$fclose(fh);
107
end
108
 
109
endmodule

powered by: WebSVN 2.1.0

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