forked from Endrico/CS701Proj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpc_tb.cpp
73 lines (62 loc) · 1019 Bytes
/
pc_tb.cpp
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
#include "pc_tb.h"
#ifdef MTI_SYSTEMC
void assignment_test_bench::clock_generator()
{
while(1)
{
t_clock.write(false);
wait(10, SC_NS);
t_clock.write(true);
wait(10, SC_NS);
t_clock.write(false);
}
}
void assignment_test_bench::mux_sel_gen()
{
t_pc_in_mux = 0 ;
wait(100, SC_NS);
t_pc_in_mux = 1 ;
wait(100, SC_NS);
t_pc_in_mux = 2 ;
wait(100, SC_NS);
t_pc_in_mux = 3 ;
wait(100, SC_NS);
}
void assignment_test_bench::operand_gen()
{
while(1)
{
t_operand = 0x06;
wait(100, SC_NS);
t_operand = 0x07;
wait(100, SC_NS);
}
}
void assignment_test_bench::rx_gen()
{
while(1)
{
t_rx_out = 0x02;
wait(100, SC_NS);
t_rx_out = 0x04;
wait(100, SC_NS);
}
}
void assignment_test_bench::data_out_gen()
{
while(1)
{
t_data_out = 0x01;
wait(100, SC_NS);
t_data_out = 0x03;
wait(100, SC_NS);
}
}
void assignment_test_bench::PC_ld_gen()
{
t_pc_reg_ld.write(true);
}
SC_MODULE_EXPORT(assignment_test_bench);
#else
// OSCI sc_main code
#endif