fcs
 All Classes Namespaces Files Functions Variables
tb.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-2021 Robert Newgard
3  *
4  * This file is part of fcs.
5  *
6  * fcs is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * fcs is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with fcs. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef _TB_H_
21  #define _TB_H_
22 
23  #include <systemc>
24  #include <SyscMsg.h>
25  #include <SyscDrv.h>
26  #include <SyscClk.h>
27  #include <SyscFCBus.h>
28  #include <Vuut_16_top.h>
29 
30  namespace tb_16
31  {
32  using namespace std;
33  using namespace sc_core;
34  using namespace sc_dt;
35  using namespace SyscMsg;
36  using namespace SyscDrv;
37  using namespace SyscClk;
38  using namespace SyscFCBus;
39 
40  constexpr unsigned be = 1;
41 
42  class Checker : public sc_module
43  {
44  private:
45  unique_ptr<Msg> msg;
46 
47  public:
48  SC_HAS_PROCESS(Checker);
49  Checker(sc_module_name);
50  ~Checker(void);
51 
52  bool pass;
53 
54  sc_in <uint32_t> res_i;
55  sc_in <uint32_t> exp_i;
56  sc_in <uint32_t> obs_i;
57  sc_in <bool> val_i;
58  sc_in <bool> clk_i;
59 
60  void check(void);
61  };
62 
63  class tb : public sc_module
64  {
65  protected:
66  double clk_freq_hz;
67  string drv_path;
68  string drv_handler;
69  string drv_request;
70  unique_ptr<Msg> msg;
71  DrvClient * drv;
72 
73  public:
74  SC_HAS_PROCESS(tb);
75  tb(sc_module_name);
76  ~tb(void);
77 
78  Vuut_16_top * i_uut;
79  Clk<bool> * i_clk;
80  Bus_src<be> * i_bus;
82  Bus_split<be> * i_lys;
83 
84  sc_signal <bool > tb_clk;
85  sc_signal <bool > tb_rdy;
86 
87  sc_signal <uint32_t> uut_res;
88  sc_signal <uint32_t> uut_exp;
89  sc_signal <uint32_t> uut_obs;
90  sc_signal <bool > uut_val;
91 
92  sc_signal <bool > bus_sav;
93  sc_signal <bool > bus_req;
94  sc_signal <uint32_t> bus_cnt;
95  sc_signal <Bus<be> > bus_bus;
96 
97  sc_signal <uint32_t> lys_usr;
98  sc_signal <bool> lys_err;
99  sc_signal <bool> lys_val;
100  sc_signal <bool> lys_sof;
101  sc_signal <bool> lys_eof;
102  sc_signal <Mod<be>> lys_mod;
103  sc_signal <Dat<be>> lys_dat;
104  };
105  }
106 #endif
sc_signal< uint32_t > uut_obs
Definition: tb.h:89
Bus_src< be > * i_bus
Definition: tb.h:80
sc_signal< Dat< be > > lys_dat
Definition: tb.h:103
sc_signal< bool > tb_clk
Definition: tb.h:84
constexpr unsigned be
Definition: tb.h:40
string drv_request
Definition: tb.h:69
Vuut_16_top * i_uut
Definition: tb.h:78
sc_signal< bool > lys_eof
Definition: tb.h:101
string drv_path
Definition: tb.h:67
sc_signal< bool > lys_sof
Definition: tb.h:100
string drv_handler
Definition: tb.h:68
sc_signal< Mod< be > > lys_mod
Definition: tb.h:102
sc_signal< bool > uut_val
Definition: tb.h:90
sc_signal< uint32_t > lys_usr
Definition: tb.h:97
unique_ptr< Msg > msg
Definition: tb.h:70
sc_signal< uint32_t > uut_exp
Definition: tb.h:88
sc_signal< bool > lys_val
Definition: tb.h:99
Bus_split< be > * i_lys
Definition: tb.h:82
sc_in< bool > val_i
Definition: tb.h:57
sc_signal< bool > bus_req
Definition: tb.h:93
sc_signal< Bus< be > > bus_bus
Definition: tb.h:95
sc_signal< uint32_t > bus_cnt
Definition: tb.h:94
sc_in< uint32_t > exp_i
Definition: tb.h:55
Clk< bool > * i_clk
Definition: tb.h:79
unique_ptr< Msg > msg
Definition: tb.h:45
sc_signal< bool > lys_err
Definition: tb.h:98
Definition: tb.h:42
sc_in< uint32_t > res_i
Definition: tb.h:54
sc_signal< bool > tb_rdy
Definition: tb.h:85
Definition: tb.h:63
sc_signal< uint32_t > uut_res
Definition: tb.h:87
sc_signal< bool > bus_sav
Definition: tb.h:92
sc_in< bool > clk_i
Definition: tb.h:58
bool pass
Definition: tb.h:52
DrvClient * drv
Definition: tb.h:71
Checker * i_chk
Definition: tb.h:81
sc_in< uint32_t > obs_i
Definition: tb.h:56
double clk_freq_hz
Definition: tb.h:66