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

Subversion Repositories systemc_cordic

[/] [systemc_cordic/] [trunk/] [cordic_ip/] [testbench.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wwcheng
// testbench.h: header file
2
/********************************************************************
3
//
4
// Module:
5
//   Testbench
6
//
7
// Interface:
8
//   This module generates random input vectors to test the CORDIC
9
//   core and checks the result with C math library functions.
10
//
11
//
12
// Authors:     Winnie Cheng <wwcheng@stanford.edu>,
13
//              Peter Wu <peter5@stanford.edu>
14
//
15
 *********************************************************************/
16
#include "systemc.h"
17
#include "opcode.h"
18
 
19
SC_MODULE(testbench) {
20
 
21
    // Clock Declaration
22
    sc_in_clk clk;
23
 
24
    // Input ports Declaration
25
    sc_in<bool> start;
26
    sc_in<bool> reset;
27
    sc_in<bool> compute_done;
28
    sc_in<short> result1;
29
    sc_in<short> result2;
30
    sc_in<bool> monitor_idle;
31
 
32
    // Output ports Declaration
33
    sc_out<bool> instructions_valid;
34
    sc_out<bool> done;
35
    sc_out<bool> start_monitor;
36
 
37
    // Output data
38
    sc_out<sc_uint<UNIT_SEL_WIDTH> > engine_select;
39
    sc_out<short> operand1;
40
    sc_out<short> operand2;
41
    sc_out<short> operand3;
42
 
43
    // Declare implementation functions
44
    void testbench_process();
45
 
46
    // Constructor
47
    SC_CTOR(testbench)
48
    {
49
        // Register processes and define active clock edge
50
        SC_CTHREAD(testbench_process, clk.pos());
51
 
52
        // Watching for global reset
53
        watching(reset.delayed()==true);
54
    }
55
 
56
}; // end module testbench 

powered by: WebSVN 2.1.0

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