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/] [monitors/] [parity_monitor.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
//----------------Monitors----------------
44
 
45
//PARITY MONITOR
46
 
47
module PARITY_MONITOR(m_clk, m_res, m_parity_0, m_parity_1);
48
input m_clk, m_res;
49
input m_parity_0, m_parity_1;
50
 
51
reg res_was_active;
52
 
53
integer fh0, fh1;
54
 
55
always @ (posedge m_clk)
56
if(m_res)
57
        res_was_active = 1;
58
else
59
        if(res_was_active)
60
        begin
61
                if(fh0 === 32'bx)
62
                        fh0 = $fopen("parity_0_monitor.out");
63
                if(fh1 === 32'bx)
64
                        fh1 = $fopen("parity_1_monitor.out");
65
 
66
                if ((m_parity_0 === 1'bx) || (m_parity_0 === 1'bz))
67
                        $fdisplay(fh0, "%0d ERROR: PARITY_0 doesn't have a valid value (%b)", $time, m_parity_0);
68
                if ((m_parity_1 === 1'bx) || (m_parity_1 === 1'bz))
69
                        $fdisplay(fh1, " ERROR: PARITY_1 doesn't have a valid value (%b)", $time, m_parity_1);
70
 
71
                //$fclose(fh0);
72
                //$fclose(fh1);
73
        end
74
 
75
endmodule

powered by: WebSVN 2.1.0

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