stimulus.cpp revision 12855
16782SN/A/***************************************************************************** 28683SN/A 310973Sdavid.hashe@amd.com Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 46782SN/A more contributor license agreements. See the NOTICE file distributed 56782SN/A with this work for additional information regarding copyright ownership. 66782SN/A Accellera licenses this file to you under the Apache License, Version 2.0 76782SN/A (the "License"); you may not use this file except in compliance with the 86782SN/A License. You may obtain a copy of the License at 96782SN/A 106782SN/A http://www.apache.org/licenses/LICENSE-2.0 116782SN/A 126782SN/A Unless required by applicable law or agreed to in writing, software 136782SN/A distributed under the License is distributed on an "AS IS" BASIS, 146782SN/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 156782SN/A implied. See the License for the specific language governing 166782SN/A permissions and limitations under the License. 176782SN/A 186782SN/A *****************************************************************************/ 196782SN/A 206782SN/A/***************************************************************************** 216782SN/A 226782SN/A stimulus.cpp -- 236782SN/A 246782SN/A Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-30 256782SN/A 266782SN/A *****************************************************************************/ 276782SN/A 286782SN/A/***************************************************************************** 296782SN/A 307056SN/A MODIFICATION LOG - modifiers, enter your name, affiliation, date and 318232SN/A changes you are making here. 328937SN/A 339105SN/A Name, Affiliation, Date: 349104SN/A Description of Modification: 358683SN/A 3610301Snilay@cs.wisc.edu *****************************************************************************/ 378683SN/A 386782SN/A 397055SN/A#include "stimulus.h" 407055SN/A 417039SN/Avoid stimulus::entry() { 427039SN/A signed int send_value1 = 1; 436782SN/A unsigned int send_value2 = 1; 447039SN/A sc_lv<8> send_value3; 457039SN/A sc_signed send_value4(8); 467039SN/A sc_unsigned send_value5(8); 476782SN/A 486782SN/A 496876SN/A // sending some reset values 506876SN/A reset.write(true); 516782SN/A out_valid.write(false); 526876SN/A send_value3 = 1; 536782SN/A send_value4 = 1; 546782SN/A send_value5 = 1; 556876SN/A out_stimulus1.write(0); 569105SN/A out_stimulus2.write(0); 5710919Sbrandon.potter@amd.com out_stimulus3.write(0); 5810919Sbrandon.potter@amd.com out_stimulus4.write(0); 5910919Sbrandon.potter@amd.com out_stimulus5.write(0); 6010919Sbrandon.potter@amd.com wait(3); 616782SN/A reset.write(false); 626882SN/A // sending normal mode values 636876SN/A while(true){ 646876SN/A wait(10); 6510970Sdavid.hashe@amd.com out_stimulus1.write( send_value1 ); 667564SN/A out_stimulus2.write( send_value2 ); 678653SN/A out_stimulus3.write( send_value3 ); 689105SN/A out_stimulus4.write( send_value4 ); 696876SN/A out_stimulus5.write( send_value5 ); 706876SN/A out_valid.write( true ); 717039SN/A cout << "Stimuli : " << send_value1 << " " 727039SN/A << send_value2 << " " 736876SN/A << send_value3 << " " 747039SN/A << send_value4 << " " 757039SN/A << send_value5 << " " << " at " 766882SN/A << sc_time_stamp() << endl; 777056SN/A send_value1 = send_value1+11; 786882SN/A send_value2 = send_value2+11; 797039SN/A send_value3 = send_value3.to_int()+11; 807454SN/A send_value4 = send_value4+11; 817039SN/A send_value5 = send_value5+11; 827454SN/A wait(); 837039SN/A out_valid.write( false ); 847039SN/A } 857039SN/A} 866782SN/A 876782SN/A// EOF 886782SN/A