-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshifters_TB.h
81 lines (55 loc) · 1.27 KB
/
shifters_TB.h
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
#ifndef __SHIFTER_TB_H__
#define __SHIFTER_TB_H__
#include "arrayShifter.h"
#include "constShifter.h"
SC_MODULE(SHIFTER_TB)
{
sc_signal<sc_logic> clk, rst, startLoading;
sc_signal<sc_lv<8>> outs[3];
// ARRAYSHIFTER<3, 8>* DUT;
CONSTSHIFTER<3,8>* DUT;
SC_CTOR(SHIFTER_TB)
{
// DUT = new ARRAYSHIFTER<3, 8>("DUT");
// (*DUT)(clk, rst, startLoading, outs[0], outs[1], outs[2]);
DUT = new CONSTSHIFTER<3, 8>("DUT");
(*DUT)(clk, rst, startLoading, outs[0], outs[1], outs[2]);
SC_THREAD(clocking);
SC_THREAD(resetting);
SC_THREAD(signalAssignment);
}
void clocking();
void resetting();
void signalAssignment();
};
void SHIFTER_TB::clocking()
{
while (true)
{
wait(5, SC_NS);
clk = SC_LOGIC_0;
wait(5, SC_NS);
clk = SC_LOGIC_1;
}
}
void SHIFTER_TB::resetting()
{
wait(10, SC_NS);
rst = SC_LOGIC_1;
wait(19, SC_NS);
rst = SC_LOGIC_0;
}
void SHIFTER_TB::signalAssignment()
{
while (true)
{
wait(0, SC_NS);
startLoading = SC_LOGIC_0;
wait(95, SC_NS);
startLoading = SC_LOGIC_1;
wait(10, SC_NS);
startLoading = SC_LOGIC_0;
wait();
}
}
#endif