aboutsummaryrefslogtreecommitdiffstats
path: root/dot_product/dot_product/dot_product.v10/scverify/mc_testbench.h
blob: 4a5c6eef48b2aa0979b3b6186895a73af8178c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// ----------------------------------------------------------------------------
// SystemC Testbench Header
//
//    HLS version: 2011a.126 Production Release
//       HLS date: Wed Aug  8 00:52:07 PDT 2012
//  Flow Packages: HDL_Tcl 2008a.1, SCVerify 2009a.1
//
//   Generated by: mg3115@EEWS104A-015
// Generated date: Tue Mar 01 15:39:35 +0000 2016
//
// ----------------------------------------------------------------------------
#ifdef CCS_SCVERIFY

// 
// -------------------------------------
// testbench
// User supplied testbench
// -------------------------------------
// 
#ifndef INCLUDED_TESTBENCH_H
#define INCLUDED_TESTBENCH_H

extern void mc_testbench_input_a_skip(bool v);
extern void mc_testbench_input_b_skip(bool v);
extern void mc_testbench_output_skip(bool v);

#ifndef SC_USE_STD_STRING
#define SC_USE_STD_STRING
#endif

#include "../../../student_files_2015/student_files_2015/prj1/dot_product_source/dot_product.h"
#include <systemc.h>
#include <tlm.h>
#include <ac_int.h>
#include <mc_container_types.h>
#include <mc_typeconv.h>
#include <mc_transactors.h>
#include <mc_comparator.h>
#include <mc_end_of_testbench.h>
#include <vector>


class testbench : public sc_module
{
public:
   // Interface Ports
   sc_in< bool > clk;
   sc_port< tlm::tlm_fifo_put_if< ac_int<8, true > > > ccs_input_a;
   sc_port< tlm::tlm_fifo_put_if< mc_wait_ctrl > > ccs_wait_ctrl_input_a;
   sc_port< tlm::tlm_fifo_put_if< ac_int<8, true > > > ccs_input_b;
   sc_port< tlm::tlm_fifo_put_if< mc_wait_ctrl > > ccs_wait_ctrl_input_b;
   sc_port< tlm::tlm_fifo_get_if< ac_int<8, true > > > ccs_output;
   sc_port< tlm::tlm_fifo_put_if< mc_wait_ctrl > > ccs_wait_ctrl_output;
   
   // Data objects
   bool testbench_ended;
   int main_exit_code;
   bool atleast_one_active_input;
   sc_time last_event_time;
   sc_time last_event_time2;
   sc_signal< bool >                          cpp_testbench_active;
   sc_event testbench_end_event;
   int argc;
   const char* const *argv;
   bool _checked_results;
   bool _failed;
   static testbench* that;
   static std::vector<mc_end_of_testbench*> _end_of_tb_objs;
   int main();
   static bool input_a_ignore;
   static bool input_a_skip;
   static int input_a_array_comp_first;
   static int input_a_array_comp_last;
   bool _capture_input_a;
   static int input_a_wait_cycles;
   static mc_wait_ctrl input_a_wait_ctrl;
   int input_a_capture_count;
   int input_a_iteration_count;
   static bool input_b_ignore;
   static bool input_b_skip;
   static int input_b_array_comp_first;
   static int input_b_array_comp_last;
   bool _capture_input_b;
   static int input_b_wait_cycles;
   static mc_wait_ctrl input_b_wait_ctrl;
   int input_b_capture_count;
   int input_b_iteration_count;
   static bool output_ignore;
   static bool output_skip;
   static int output_array_comp_first;
   static int output_array_comp_last;
   static bool output_use_mask;
   static ac_int<8, true > output_output_mask;
   tlm::tlm_fifo< mc_golden_info< ac_int<8, true >, ac_int<8, true > > > output_golden;
   bool _capture_output;
   static int output_wait_cycles;
   static mc_wait_ctrl output_wait_ctrl;
   int output_capture_count;
   int output_iteration_count;
   int wait_cnt;
   
   // Named Objects
   
   // Module instance pointers
   mc_comparator< ac_int<8, true > , ac_int<8, true > > *output_comp;
   
   // Declare processes (SC_METHOD and SC_THREAD)
   void wait_for_end();
   void run();
   
   // Constructor
   SC_HAS_PROCESS(testbench);
   testbench(
      const sc_module_name& name
   )
      : clk("clk")
      , ccs_input_a("ccs_input_a")
      , ccs_wait_ctrl_input_a("ccs_wait_ctrl_input_a")
      , ccs_input_b("ccs_input_b")
      , ccs_wait_ctrl_input_b("ccs_wait_ctrl_input_b")
      , ccs_output("ccs_output")
      , ccs_wait_ctrl_output("ccs_wait_ctrl_output")
      , cpp_testbench_active("cpp_testbench_active")
      , output_golden("output_golden",-1)
   {
      // Instantiate other modules
      output_comp = new mc_comparator< ac_int<8, true > , ac_int<8, true > > (
         "output_comp",
         0,
         1
      );
      output_comp->data_in(ccs_output);
      output_comp->data_golden(output_golden);
      
      
      // Register processes
      SC_METHOD(wait_for_end);
      sensitive << clk.pos() << testbench_end_event;
      SC_THREAD(run);
      // Other constructor statements
      set_stack_size(64000000);
      argc = sc_argc();
      argv = sc_argv();
      _checked_results = false;
      that = this;
      testbench_ended = false;
      main_exit_code = 0;
      atleast_one_active_input = true;
      _capture_input_a = true;
      _capture_input_b = true;
      _capture_output = true;
      wait_cnt = 0;
   }
   
   ~testbench()
   {
      delete output_comp;
      output_comp = 0;
   }
   
   // C++ class functions
   public:
      void mc_testbench_process_wait_ctrl(const sc_string &var,int &var_wait_cycles,mc_wait_ctrl &var_wait_ctrl,tlm::tlm_fifo_put_if< mc_wait_ctrl > *ccs_wait_ctrl_fifo_if,const int var_capture_count,const int var_stopat) ;
   public:
      static void register_end_of_testbench_obj(mc_end_of_testbench* obj) ;
   public:
      void capture_input_a( ac_int<8, true > *input_a) ;
   public:
      void capture_input_b( ac_int<8, true > *input_b) ;
   public:
      void capture_output( ac_int<8, true > *output) ;
   protected:
      void wait_on_input_required() ;
   public:
      static void capture_IN( ac_int<8, true > *input_a,  ac_int<8, true > *input_b,  ac_int<8, true > *output) ;
   public:
      static void capture_OUT( ac_int<8, true > *input_a,  ac_int<8, true > *input_b,  ac_int<8, true > *output) ;
   public:
      static void exec_dot_product( ac_int<8, true > *input_a,  ac_int<8, true > *input_b,  ac_int<8, true > *output) ;
   protected:
      void end_of_simulation() ;
   public:
      void check_results() ;
   public:
      bool failed() ;
};
#endif
#endif