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

Subversion Repositories wisbone_2_ahb

[/] [wisbone_2_ahb/] [tags/] [t2/] [svtb/] [avm_svtb/] [wb_ahb_stim_gen.svh] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 toomuch
//******************************************************************************************************
2
// Copyright (c) 2007 TooMuch Semiconductor Solutions Pvt Ltd.
3
 
4
 
5
//File name             :       wb_ahb_stim_gen.svh
6
//Date                  :        Aug, 2007
7
//Description           :       Stimulus Generation for WISHBONE_AHB Bridge
8
//Revision              :       1.0
9
 
10
//******************************************************************************************************
11
 
12
// class to generate write and read packet
13
import avm_pkg::*;
14
import global::*;
15
class wb_ahb_stim_gen extends avm_named_component;
16
 
17
 
18
avm_blocking_put_port#( wb_req_pkt) initiator_port;
19
tlm_fifo#(wb_req_pkt) fifo;
20
 
21
        function new(string name ,avm_named_component parent);
22
                super.new(name,parent);
23
                initiator_port=new("initiatot_port",this);
24
                fifo =new("fifo",this);
25
        endfunction
26
 
27
task stimulus(input int count = 41);
28
 
29
        wb_req_pkt p;
30
//*****************************************
31
//Write operations with no wait states
32
//*****************************************
33
                for(int i=0; i<8 ;i++)
34
                begin
35
                                p.wr='b1;
36
                                p.adr=i+1;
37
                                p.dat=i;
38
                                p.stb='b1;
39
                                write_to_pipe(p);
40
                end
41
 
42
//************************************************
43
//Write operations with wait states from AHB Slave
44
//************************************************
45
                for(int i=8;i<10;i++)
46
                begin
47
                                p.wr='b1;//Wait state from AHB SLAVE
48
                                p.stb='b1;
49
                                write_to_pipe(p);
50
                end
51
 
52
//*****************************************
53
//Write operations with no wait states
54
//*****************************************
55
                for(int i=10; i<14 ;i++)
56
                begin
57
                                p.wr='b1;
58
                                p.adr=i+1;
59
                                p.dat=i;
60
                                p.stb='b1;
61
                                write_to_pipe(p);
62
                end
63
 
64
//***********************************************
65
//Write operations with wait states from WB Master
66
//***********************************************
67
                for(int i=14;i<16;i++)
68
                begin
69
                                p.stb='b0;
70
                                p.wr='b1;//Wait state from AHB SLAVE
71
                write_to_pipe(p);
72
                end
73
 
74
//*****************************************
75
//Write operations with no wait states
76
//*****************************************
77
                for(int i=15; i<19 ;i++)
78
                begin
79
                                p.wr='b1;
80
                                p.adr=i+1;
81
                                p.dat=i;
82
                                p.stb='b1;
83
                                write_to_pipe(p);
84
                end
85
 
86
//*************************************
87
//Read operations without wait states
88
//*************************************
89
                for(int i=19; i<25 ;i++)
90
                begin
91
                                p.wr='b0;
92
                                p.adr=i+1;
93
                                p.stb='b1;
94
                                write_to_pipe(p);
95
                end
96
 
97
//**********************************************
98
//Read operations with wait states from AHB Slave
99
//**********************************************
100
                for(int i=25; i<27 ;i++)
101
                begin
102
                                p.wr='b0;
103
                write_to_pipe(p);
104
                end
105
//*************************************
106
//Read operations without wait states
107
//*************************************
108
                for(int i=27; i<31 ;i++)
109
                begin
110
                                p.wr='b0;
111
                                p.adr=$random;
112
                                $display("%0d, %0d", p.wr, p.adr );
113
                write_to_pipe(p);
114
                end
115
//**********************************************
116
//Read operations with wait states from WB Master
117
//**********************************************
118
                for(int i=31; i<33 ;i++)
119
                begin
120
                                p.wr='b0;
121
                write_to_pipe(p);
122
                end
123
//*************************************
124
//Read operations without wait states
125
//*************************************
126
                for(int i=33; i<38 ;i++)
127
                begin
128
                                p.wr='b0;
129
                                p.adr=$random;
130
                                $display("%0d, %0d",p.wr, p.adr );
131
                write_to_pipe(p);
132
                end
133
//*****************************************
134
//Write operations with no wait states
135
//*****************************************
136
                for(int i=38; i<41 ;i++)
137
                begin
138
                                p.wr='b1;
139
                                p.adr=$random;
140
                                p.dat=$random;
141
                                $display("%0d, %0d", p.adr , p.dat );
142
                write_to_pipe(p);
143
                end
144
 
145
endtask
146
 
147
// task to push transaction in the fifo
148
task write_to_pipe(wb_req_pkt p);
149
                initiator_port.put(p);
150
endtask
151
 
152
endclass

powered by: WebSVN 2.1.0

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