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

Subversion Repositories wisbone_2_ahb

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

powered by: WebSVN 2.1.0

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