stimulus.cpp revision 12855:588919e0e4aa
1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22  stimulus.cpp --
23
24  Original Author: Rocco Jonack, Synopsys, Inc., 1999-08-02
25
26 *****************************************************************************/
27
28/*****************************************************************************
29
30  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
31  changes you are making here.
32
33      Name, Affiliation, Date:
34  Description of Modification:
35
36 *****************************************************************************/
37
38#include "stimulus.h"
39
40void stimulus::entry() {
41  sc_signed       send_value1(4);
42  sc_unsigned     send_value2(4);
43  sc_signed       send_value3(6);
44  sc_unsigned     send_value4(6);
45  sc_signed       send_value5(8);
46  sc_unsigned     send_value6(8);
47
48
49  // sending some reset values
50  reset.write(true);
51  out_valid.write(false);
52  send_value1 = 0;
53  send_value2 = 0;
54  send_value3 = 0;
55  send_value4 = 0;
56  send_value5 = 0;
57  send_value6 = 0;
58  out_stimulus1.write(0);
59  out_stimulus2.write(0);
60  out_stimulus3.write(0);
61  out_stimulus4.write(0);
62  out_stimulus5.write(0);
63  out_stimulus6.write(0);
64  wait(3);
65  reset.write(false);
66  // sending normal mode values
67  while(true){
68    wait(20);
69    out_stimulus1.write( send_value1 );
70    out_stimulus2.write( send_value2 );
71    out_stimulus3.write( send_value3 );
72    out_stimulus4.write( send_value4 );
73    out_stimulus5.write( send_value5 );
74    out_stimulus6.write( send_value6 );
75    out_valid.write( true );
76    cout << "Stimuli : " << send_value1 << " "
77	 << send_value2 << " "
78	 << send_value3 << " "
79	 << send_value4 << " "
80	 << send_value5 << " "
81	 << send_value6 << " " << " at "
82         << sc_time_stamp() << endl;
83    send_value1 = send_value1+2;
84    send_value2 = send_value2+2;
85    send_value3 = send_value3+8;
86    send_value4 = send_value4+8;
87    send_value5 = send_value5+32;
88    send_value6 = send_value6+32;
89    wait();
90    out_valid.write( false );
91  }
92}
93
94// EOF
95